@egen-civitas/esm-app-shell 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/0e44e729978549df.js +1 -0
- package/dist/0e44e729978549df.js.map +1 -0
- package/dist/100e7c99afd2869a.js +1 -0
- package/dist/100e7c99afd2869a.js.map +1 -0
- package/dist/104a9d544f2d1bee.js +1 -0
- package/dist/104a9d544f2d1bee.js.map +1 -0
- package/dist/165cd7c9a57e9fd4.js +1 -0
- package/dist/165cd7c9a57e9fd4.js.map +1 -0
- package/dist/20c375935cdfd472.js +1 -0
- package/dist/20c375935cdfd472.js.map +1 -0
- package/dist/2387ac2d7d438c25.js +1 -0
- package/dist/2387ac2d7d438c25.js.map +1 -0
- package/dist/28213ad7c964ca67.js +1 -0
- package/dist/28213ad7c964ca67.js.map +1 -0
- package/dist/28ee358f798f3afc.js +1 -0
- package/dist/28ee358f798f3afc.js.map +1 -0
- package/dist/2a6578b999e69afa.js +1 -0
- package/dist/2a6578b999e69afa.js.map +1 -0
- package/dist/2e996b9d664c67d5.js +1 -0
- package/dist/2e996b9d664c67d5.js.map +1 -0
- package/dist/2f3c2b970b4f3f2a.js +1 -0
- package/dist/2f3c2b970b4f3f2a.js.map +1 -0
- package/dist/301f10a4f624d74f.js +1 -0
- package/dist/301f10a4f624d74f.js.map +1 -0
- package/dist/3421840c2ad1831a.js +1 -0
- package/dist/3421840c2ad1831a.js.map +1 -0
- package/dist/35750147bebf81e6.js +1 -0
- package/dist/35750147bebf81e6.js.map +1 -0
- package/dist/38e195234254e1ed.js +1 -0
- package/dist/38e195234254e1ed.js.map +1 -0
- package/dist/392ff79c3df465de.js +1 -0
- package/dist/392ff79c3df465de.js.map +1 -0
- package/dist/39e4bad4d556fdf0.js +1 -0
- package/dist/39e4bad4d556fdf0.js.map +1 -0
- package/dist/3f0bf1710c0f5c33.js +1 -0
- package/dist/3f0bf1710c0f5c33.js.map +1 -0
- package/dist/40a802fc37195f5f.js +1 -0
- package/dist/40a802fc37195f5f.js.map +1 -0
- package/dist/4726bdbff3230ea5.js +1 -0
- package/dist/4726bdbff3230ea5.js.map +1 -0
- package/dist/4ce174ac213a420d.js +1 -0
- package/dist/4ce174ac213a420d.js.map +1 -0
- package/dist/503f6ee851a6c84c.js +1 -0
- package/dist/503f6ee851a6c84c.js.map +1 -0
- package/dist/5a15fdd1c746d468.js +1 -0
- package/dist/5a15fdd1c746d468.js.map +1 -0
- package/dist/5c94ce2b2b091a81.js +1 -0
- package/dist/5c94ce2b2b091a81.js.map +1 -0
- package/dist/6740948aa3c94b36.js +1 -0
- package/dist/6740948aa3c94b36.js.map +1 -0
- package/dist/6face530dd71d3ab.js +1 -0
- package/dist/6face530dd71d3ab.js.map +1 -0
- package/dist/6ff5fd266c168d37.js +1 -0
- package/dist/6ff5fd266c168d37.js.map +1 -0
- package/dist/7133b1158c1eee9f.js +1 -0
- package/dist/7133b1158c1eee9f.js.map +1 -0
- package/dist/7405a39d009c0cd9.js +1 -0
- package/dist/7405a39d009c0cd9.js.map +1 -0
- package/dist/746d6624966d97cc.js +1 -0
- package/dist/746d6624966d97cc.js.map +1 -0
- package/dist/7486f1056be8aac2.js +1 -0
- package/dist/7486f1056be8aac2.js.map +1 -0
- package/dist/7fe1ae38f4e52228.js +1 -0
- package/dist/7fe1ae38f4e52228.js.map +1 -0
- package/dist/86ca4f4caca86a05.js +20 -0
- package/dist/86ca4f4caca86a05.js.map +1 -0
- package/dist/8a1e9fb14542294e.js +1 -0
- package/dist/8a1e9fb14542294e.js.map +1 -0
- package/dist/996aced69a32fb34.js +1 -0
- package/dist/996aced69a32fb34.js.map +1 -0
- package/dist/99b0e92c982b69e3.wasm +0 -0
- package/dist/99ff6ed3397c063c.js +1 -0
- package/dist/99ff6ed3397c063c.js.map +1 -0
- package/dist/9da38ddd134bbac0.wasm +0 -0
- package/dist/9f95152ca23cbda2.js +1 -0
- package/dist/9f95152ca23cbda2.js.map +1 -0
- package/dist/9fb2e1c5007395e8.js +1 -0
- package/dist/9fb2e1c5007395e8.js.map +1 -0
- package/dist/a2203b7ab1be4fe5.js +1 -0
- package/dist/a2203b7ab1be4fe5.js.map +1 -0
- package/dist/a5299431ca4e1890.js +1 -0
- package/dist/a5299431ca4e1890.js.map +1 -0
- package/dist/{888ab4f4534f9acb.css → a6455eee3c1cdefe.css} +1 -1
- package/dist/{888ab4f4534f9acb.css.map → a6455eee3c1cdefe.css.map} +1 -1
- package/dist/af9d1a058dafb22f.js +1 -0
- package/dist/b4c358eb41ead1a6.js +1 -0
- package/dist/b4c358eb41ead1a6.js.map +1 -0
- package/dist/b97ae94953bb55a1.js +1 -0
- package/dist/b97ae94953bb55a1.js.map +1 -0
- package/dist/bd220d0c8e3bcf3e.js +1 -0
- package/dist/bd220d0c8e3bcf3e.js.map +1 -0
- package/dist/c2c6850fc4d942cc.js +1 -0
- package/dist/c2c6850fc4d942cc.js.map +1 -0
- package/dist/c4bf6419e95bcb10.js +1 -0
- package/dist/c4bf6419e95bcb10.js.map +1 -0
- package/dist/c5be968929b7b675.js +1 -0
- package/dist/c5be968929b7b675.js.map +1 -0
- package/dist/c6231509ea43d4cf.js +1 -0
- package/dist/c6231509ea43d4cf.js.map +1 -0
- package/dist/c8956121db18ddca.js +1 -0
- package/dist/c8956121db18ddca.js.map +1 -0
- package/dist/cabfdf9ddd4121e9.wasm +0 -0
- package/dist/d2cacd093023c7fc.js +1 -0
- package/dist/d2cacd093023c7fc.js.map +1 -0
- package/dist/d427071073895236.js +1 -0
- package/dist/d427071073895236.js.map +1 -0
- package/dist/d63e75be7857458a.wasm +0 -0
- package/dist/d714a019d4dfd0f1.js +1 -0
- package/dist/d714a019d4dfd0f1.js.map +1 -0
- package/dist/db9d140f9cb6fbb6.js +1 -0
- package/dist/db9d140f9cb6fbb6.js.map +1 -0
- package/dist/deb33db385797b5e.js +1 -0
- package/dist/deb33db385797b5e.js.map +1 -0
- package/dist/ea485a963430e479.js +1 -0
- package/dist/ea485a963430e479.js.map +1 -0
- package/dist/eb96cd859ce842b3.js +1 -0
- package/dist/eb96cd859ce842b3.js.map +1 -0
- package/dist/{egen.f35ccbd9a7ae43e2.js → egen.8b9857424e0e5992.js} +4 -4
- package/dist/egen.8b9857424e0e5992.js.map +1 -0
- package/dist/{egen.a395d41c58c43ffb.css → egen.c5e7dd6c93adda21.css} +1 -1
- package/dist/f3f2147432dcd6ef.js +1 -0
- package/dist/f3f2147432dcd6ef.js.map +1 -0
- package/dist/f443206d9f3ee012.js +1 -0
- package/dist/f443206d9f3ee012.js.map +1 -0
- package/dist/f4941e9d6d02713b.js +1 -0
- package/dist/f4941e9d6d02713b.js.map +1 -0
- package/dist/f516f10149ceaf20.js +1 -0
- package/dist/f516f10149ceaf20.js.map +1 -0
- package/dist/f7e95e9103f6bea5.js +1 -0
- package/dist/f7e95e9103f6bea5.js.map +1 -0
- package/dist/f87c9fff5312393d.js +1 -0
- package/dist/f87c9fff5312393d.js.map +1 -0
- package/dist/fdd8e6bc172cc6c8.js +1 -0
- package/dist/fdd8e6bc172cc6c8.js.map +1 -0
- package/dist/icon_128x128.addc1ce9ab1985d5e40ed48c2de69bb5.png +0 -0
- package/dist/icon_144x144.f4cc490c1b5ae9623ea84e233facf32e.png +0 -0
- package/dist/icon_192x192.628002be9ce9c4510018b7d94b94b90e.png +0 -0
- package/dist/icon_256x256.04e54c3231fe1852ee4f14359bf8fc37.png +0 -0
- package/dist/icon_384x384.9bef3ed318d064b36823da2035f62bec.png +0 -0
- package/dist/icon_512x512.bd73077d044266a7cf5f8bd6d7cb3b1b.png +0 -0
- package/dist/icon_96x96.6ec9feb388f20c73eecf14e2e2aea004.png +0 -0
- package/dist/index.html +1 -1
- package/dist/logo-512.png +0 -0
- package/dist/logo.svg +0 -0
- package/dist/{manifest.60265363becdf876d27bddc4588dc7c2.json → manifest.5a7b59c177c6ce166fbd2239a14d5fb8.json} +7 -7
- package/package.json +3 -3
- package/dist/c18393f118f80bc5.js +0 -1
- package/dist/c18393f118f80bc5.js.map +0 -1
- package/dist/eb27d690cf45cd5e.js +0 -20
- package/dist/eb27d690cf45cd5e.js.map +0 -1
- package/dist/egen.f35ccbd9a7ae43e2.js.map +0 -1
- package/dist/icon_128x128.3dde25c6e69b1c010a6a5d6b27b3f436.png +0 -0
- package/dist/icon_144x144.e263e02b838d229b02ff9133e6e0f2ba.png +0 -0
- package/dist/icon_192x192.d3d318638bbe8a10a3c687d3d302d01a.png +0 -0
- package/dist/icon_256x256.c729f6e7e914b58fcea5ce91d7aa9bad.png +0 -0
- package/dist/icon_384x384.c8923df6b6bd08eba5c79b78d7fcecc0.png +0 -0
- package/dist/icon_512x512.7163efb26df832de513bc58d925ea22e.png +0 -0
- package/dist/icon_96x96.682ee334ae19d49894217370b8596f61.png +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_egen_civitas_esm_app_shell=self.webpackChunk_egen_civitas_esm_app_shell||[]).push([["1808"],{339(e,r,n){n.r(r),n.d(r,{default:()=>t9});var i=n(2883),a=n(8783),o=n(5028),s=n(5963),l=n(9423);n(8005);var u=n(9064),c=n(5635);n(6679);var h=n(6282),d=n(8526);n(3227);var f=n(2995),p=n(9657);n(3763);var v=n(5498);function y(e){var r=!1;return e.scene.objects.traverse(function(e,n){("Mesh"===n.type&&"UIGeometry"===n.geometry.type||"Page"===n.type&&void 0!==n.uiFrame)&&(r=!0)}),r}var m=n(2220),g=n(2865);n(2769),n(7295),n(7913);var b=n(1955);n(7173),n(1483),n(5181);var w=n(909),x=n(6259),S=n(7410),k=n(843),M=n(4691),A=n(5222);n(3486);var O=n(461),C=n(3940),_=n(7565),P=n(3027),E=n(2784);function D(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function j(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}function T(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function s(e){j(o,i,a,s,l,"next",e)}function l(e){j(o,i,a,s,l,"throw",e)}s(void 0)})}}function I(e,r,n){return r=F(r),function(e,r){if(r&&("object"===X(r)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,K()?Reflect.construct(r,n||[],F(e).constructor):r.apply(e,n))}function R(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function B(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function z(e,r,n){return r&&B(e.prototype,r),n&&B(e,n),e}function L(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function U(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&H(e,r)}function V(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function N(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){L(e,r,n[r])})}return e}function G(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function W(e,r){if(null==e)return{};var n,i,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}if(o=function(e,r){if(null==e)return{};var n,i,a={},o=Object.getOwnPropertyNames(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,r),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}function H(e,r){return(H=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function q(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||Z(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Z(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function Z(e,r){if(e){if("string"==typeof e)return D(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,r)}}function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(K=function(){return!!e})()}function J(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var Q=(0,E.a)(function(e,r){r.exports=function(e,r){for(var n=e.split("."),i=r.split("."),a=0;a<3;a++){var o=Number(n[a]),s=Number(i[a]);if(o>s)return 1;if(s>o)return -1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return -1}return 0}}),$=Symbol("target"),ee=Symbol("unsubscribe");function et(e){return V(e,Date)||V(e,Set)||V(e,Map)||V(e,WeakSet)||V(e,WeakMap)||ArrayBuffer.isView(e)}var er=Array.isArray;function en(e){return"symbol"==(void 0===e?"undefined":X(e))}var ei={after:function(e,r){return er(e)?e.slice(r.length):""===r?e:e.slice(r.length+1)},concat:function(e,r){return er(e)?(e=Y(e),r&&e.push(r),e):r&&void 0!==r.toString?(""!==e&&(e+="."),en(r)?e+r.toString():e+r):e},initial:function(e){if(er(e))return e.slice(0,-1);if(""===e)return e;var r=e.lastIndexOf(".");return -1===r?"":e.slice(0,r)},last:function(e){if(er(e))return e[e.length-1]||"";if(""===e)return e;var r=e.lastIndexOf(".");return -1===r?e:e.slice(r+1)},walk:function(e,r){var n=!0,i=!1,a=void 0;if(er(e))try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;r(l)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}else if(""!==e){var u=0,c=e.indexOf(".");if(-1===c)r(e);else for(;u<e.length;)-1===c&&(c=e.length),r(e.slice(u,c)),u=c+1,c=e.indexOf(".",u)}},get:function(e,r){return this.walk(r,function(r){e&&(e=e[r])}),e}};function ea(e,r,n){return e.isUnsubscribed||r.ignoreSymbols&&en(n)||r.ignoreUnderscores&&"_"===n.charAt(0)||"ignoreKeys"in r&&r.ignoreKeys.includes(n)}var eo=function(){function e(r){R(this,e),this._equals=r,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}return z(e,[{key:"_getDescriptorCache",value:function(){return void 0===this._descriptorCache&&(this._descriptorCache=new WeakMap),this._descriptorCache}},{key:"_getProperties",value:function(e){var r=this._getDescriptorCache(),n=r.get(e);return void 0===n&&(n={},r.set(e,n)),n}},{key:"_getOwnPropertyDescriptor",value:function(e,r){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,r);var n=this._getProperties(e),i=n[r];return void 0===i&&(i=Reflect.getOwnPropertyDescriptor(e,r),n[r]=i),i}},{key:"getProxy",value:function(e,r,n,i){if(this.isUnsubscribed)return e;var a=e[i],o=a||e;this._pathCache.set(o,r);var s=this._proxyCache.get(o);return void 0===s&&(s=void 0===a?new Proxy(e,n):e,this._proxyCache.set(o,s)),s}},{key:"getPath",value:function(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}},{key:"isDetached",value:function(e,r){return!Object.is(e,ei.get(r,this.getPath(e)))}},{key:"defineProperty",value:function(e,r,n){return!!Reflect.defineProperty(e,r,n)&&(this.isUnsubscribed||(this._getProperties(e)[r]=n),!0)}},{key:"setProperty",value:function(e,r,n,i,a){if(!this._equals(a,n)||!(r in e)){var o=this._getOwnPropertyDescriptor(e,r);return void 0!==o&&"set"in o?Reflect.set(e,r,n,i):Reflect.set(e,r,n)}return!0}},{key:"deleteProperty",value:function(e,r,n){if(Reflect.deleteProperty(e,r)){if(!this.isUnsubscribed){var i=this._getDescriptorCache().get(e);i&&(delete i[r],this._pathCache.delete(n))}return!0}return!1}},{key:"isSameDescriptor",value:function(e,r,n){var i=this._getOwnPropertyDescriptor(r,n);return void 0!==e&&void 0!==i&&Object.is(e.value,i.value)&&(e.writable||!1)===(i.writable||!1)&&(e.enumerable||!1)===(i.enumerable||!1)&&(e.configurable||!1)===(i.configurable||!1)&&e.get===i.get&&e.set===i.set}},{key:"isGetInvariant",value:function(e,r){var n=this._getOwnPropertyDescriptor(e,r);return void 0!==n&&!0!==n.configurable&&!0!==n.writable}},{key:"unsubscribe",value:function(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}}]),e}();function es(e){return"[object Object]"===toString.call(e)}function el(){return!0}function eu(e,r){return e.length!==r.length||e.some(function(e,n){return r[n]!==e})}var ec=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),eh=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),ed={push:el,pop:el,shift:el,unshift:el,copyWithin:eu,reverse:eu,sort:eu,splice:eu,flat:eu,fill:eu},ef=new Set(Y(ec).concat(Y(eh),Y(Object.keys(ed))));function ep(e,r){if(e.size!==r.size)return!0;var n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;if(!r.has(l))return!0}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return!1}var ev=["keys","values","entries"],ey=new Set(["has","toString"]),em={add:ep,clear:ep,delete:ep,forEach:ep},eg=new Set(Y(ey).concat(Y(Object.keys(em)),Y(ev)));function eb(e,r){if(e.size!==r.size)return!0;var n=!0,i=!1,a=void 0;try{for(var o,s,l=e[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=q(s.value,2),c=u[0],h=u[1];if((o=r.get(c))!==h||void 0===o&&!r.has(c))return!0}}catch(e){i=!0,a=e}finally{try{n||null==l.return||l.return()}finally{if(i)throw a}}return!1}var ew=new Set(Y(ey).concat(["get"])),ex={set:eb,clear:eb,delete:eb,forEach:eb},eS=new Set(Y(ew).concat(Y(Object.keys(ex)),Y(ev))),ek=function(){function e(r,n,i,a){R(this,e),this._path=n,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=a,this._changes=a?[]:null,this.clone=void 0===n?r:this._shallowClone(r)}return z(e,[{key:"_shallowClone",value:function(e){var r=this,n=e;if(es(e))n=N({},e);else if(er(e))n=Y(e);else if(V(e,Date))n=new Date(e);else if(V(e,Set))n=new Set(Y(e).map(function(e){return r._shallowClone(e)}));else if(V(e,Map)){n=new Map;var i=!0,a=!1,o=void 0;try{for(var s,l=e.entries()[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=q(s.value,2),c=u[0],h=u[1];n.set(c,this._shallowClone(h))}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}return this._clonedCache.add(n),n}},{key:"preferredThisArg",value:function(e,r,n,i){return e?(er(i)?this._onIsChanged=ed[r]:V(i,Set)?this._onIsChanged=em[r]:V(i,Map)&&(this._onIsChanged=ex[r]),i):n}},{key:"update",value:function(e,r,n){var i=this,a=ei.after(e,this._path);if("length"!==r){var o=this.clone;ei.walk(a,function(e){o&&o[e]&&(i._clonedCache.has(o[e])||(o[e]=i._shallowClone(o[e])),o=o[e])}),this._hasOnValidate&&this._changes.push({path:a,property:r,previous:n}),o&&o[r]&&(o[r]=n)}this._isChanged=!0}},{key:"undo",value:function(e){for(var r,n=this._changes.length-1;-1!==n;n--)r=this._changes[n],ei.get(e,r.path)[r.property]=r.previous}},{key:"isChanged",value:function(e){return void 0===this._onIsChanged?this._isChanged:this._onIsChanged(this.clone,e)}}],[{key:"isHandledMethod",value:function(e){return ec.has(e)}}]),e}(),eM=function(e){function r(){return R(this,r),I(this,r,arguments)}return U(r,e),z(r,null,[{key:"isHandledMethod",value:function(e){return ef.has(e)}}]),r}(ek),eA=function(e){function r(){return R(this,r),I(this,r,arguments)}return U(r,e),z(r,[{key:"undo",value:function(e){e.setTime(this.clone.getTime())}},{key:"isChanged",value:function(e,r){return!r(this.clone.valueOf(),e.valueOf())}}]),r}(ek),eO=function(e){function r(){return R(this,r),I(this,r,arguments)}return U(r,e),z(r,[{key:"undo",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.clone[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;e.add(s)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}var l=!0,u=!1,c=void 0;try{for(var h,d=e[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;this.clone.has(f)||e.delete(f)}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}}],[{key:"isHandledMethod",value:function(e){return eg.has(e)}}]),r}(ek),eC=function(e){function r(){return R(this,r),I(this,r,arguments)}return U(r,e),z(r,[{key:"undo",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.clone.entries()[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=q(a.value,2),l=s[0],u=s[1];e.set(l,u)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}var c=!0,h=!1,d=void 0;try{for(var f,p=e.keys()[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;this.clone.has(v)||e.delete(v)}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}}}],[{key:"isHandledMethod",value:function(e){return eS.has(e)}}]),r}(ek),e_=function(e){function r(e,n,i,a){var o;return R(this,r),(o=I(this,r,[void 0,n,i,a]))._arg1=i[0],o._weakValue=e.has(o._arg1),o}return U(r,e),z(r,[{key:"isChanged",value:function(e){return this._weakValue!==e.has(this._arg1)}},{key:"undo",value:function(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}}]),r}(ek),eP=function(e){function r(e,n,i,a){var o;return R(this,r),(o=I(this,r,[void 0,n,i,a]))._weakKey=i[0],o._weakHas=e.has(o._weakKey),o._weakValue=e.get(o._weakKey),o}return U(r,e),z(r,[{key:"isChanged",value:function(e){return this._weakValue!==e.get(this._weakKey)}},{key:"undo",value:function(e){var r=e.has(this._weakKey);this._weakHas&&!r?e.set(this._weakKey,this._weakValue):!this._weakHas&&r?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}}]),r}(ek),eE=function(){function e(r){R(this,e),this._stack=[],this._hasOnValidate=r}return z(e,[{key:"isCloning",get:function(){return this._stack.length>0}},{key:"start",value:function(e,r,n){var i=ek;er(e)?i=eM:V(e,Date)?i=eA:V(e,Set)?i=eO:V(e,Map)?i=eC:V(e,WeakSet)?i=e_:V(e,WeakMap)&&(i=eP),this._stack.push(new i(e,r,n,this._hasOnValidate))}},{key:"update",value:function(e,r,n){this._stack[this._stack.length-1].update(e,r,n)}},{key:"preferredThisArg",value:function(e,r,n){var i=e.name,a=eE.isHandledMethod(n,i);return this._stack[this._stack.length-1].preferredThisArg(a,i,r,n)}},{key:"isChanged",value:function(e,r,n){return this._stack[this._stack.length-1].isChanged(e,r,n)}},{key:"undo",value:function(e){void 0!==this._previousClone&&this._previousClone.undo(e)}},{key:"stop",value:function(){return this._previousClone=this._stack.pop(),this._previousClone.clone}}],[{key:"isHandledType",value:function(e){return es(e)||er(e)||et(e)}},{key:"isHandledMethod",value:function(e,r){return es(e)?ek.isHandledMethod(r):er(e)?eM.isHandledMethod(r):V(e,Set)?eO.isHandledMethod(r):V(e,Map)?eC.isHandledMethod(r):et(e)}}]),e}(),eD={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},ej=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=N({},eD,n);var i=Symbol("ProxyTarget"),a=n.equals,o=n.isShallow,s=n.ignoreDetached,l=n.details,u=new eo(a),c="function"==typeof n.onValidate,h=new eE(c),d=function(e,r,i,a,o){return!c||h.isCloning||!0===n.onValidate(ei.concat(u.getPath(e),r),i,a,o)},f=function(r,i,a,o){ea(u,n,i)||s&&u.isDetached(r,e)||p(u.getPath(r),i,a,o)},p=function(e,n,i,a,o){h.isCloning?h.update(e,n,a):r(ei.concat(e,n),i,a,o)},v=function(e){return e&&(e[i]||e)},y=function(r,a,l,c){return("object"==(void 0===r?"undefined":X(r))?null===r:"function"!=typeof r)||V(r,RegExp)||"constructor"===l||o&&!eE.isHandledMethod(a,l)||ea(u,n,l)||u.isGetInvariant(a,l)||s&&u.isDetached(a,e)?r:(void 0===c&&(c=u.getPath(a)),u.getProxy(r,ei.concat(c,l),m,i))},m={get:function(e,r,n){if(en(r)){if(r===i||r===$)return e;if(r===ee&&!u.isUnsubscribed&&0===u.getPath(e).length)return u.unsubscribe(),e}return y(et(e)?Reflect.get(e,r):Reflect.get(e,r,n),e,r)},set:function(e,r,n,o){n=v(n);var s=e[i]||e,l=s[r];if(a(l,n)&&r in e)return!0;var c=d(e,r,n,l);return c&&u.setProperty(s,r,n,o,l)?(f(e,r,e[r],l),!0):!c},defineProperty:function(e,r,n){if(!u.isSameDescriptor(n,e,r)){var i=e[r];d(e,r,n.value,i)&&u.defineProperty(e,r,n,i)&&f(e,r,n.value,i)}return!0},deleteProperty:function(e,r){if(!Reflect.has(e,r))return!0;var n=Reflect.get(e,r),i=d(e,r,void 0,n);return i&&u.deleteProperty(e,r,n)?(f(e,r,void 0,n),!0):!i},apply:function(r,n,o){var s=n[i]||n;if(u.isUnsubscribed)return Reflect.apply(r,s,o);if((!1===l||!0!==l&&!l.includes(r.name))&&eE.isHandledType(s)){var c,f=ei.initial(u.getPath(r)),g=eE.isHandledMethod(s,r.name);h.start(s,f,o);var b=Reflect.apply(r,h.preferredThisArg(r,n,s),g?o.map(function(e){return v(e)}):o),w=h.isChanged(s,a),x=h.stop();if(eE.isHandledType(b)&&g&&(V(n,Map)&&"get"===r.name&&(f=ei.concat(f,o[0])),b=u.getProxy(b,f,m)),w){var S={name:r.name,args:o,result:b},k=h.isCloning?ei.initial(f):f,M=h.isCloning?ei.last(f):"";d(ei.get(e,k),M,s,x,S)?p(k,M,s,x,S):h.undo(s)}return(V(n,Map)||V(n,Set))&&"object"==(void 0===(c=b)?"undefined":X(c))&&"function"==typeof c.next?function(e,r,n,i,a){var o=e.next;if("entries"===r.name)e.next=function(){var e=o.call(this);return!1===e.done&&(e.value[0]=a(e.value[0],r,e.value[0],i),e.value[1]=a(e.value[1],r,e.value[0],i)),e};else if("values"===r.name){var s=n[$].keys();e.next=function(){var e=o.call(this);return!1===e.done&&(e.value=a(e.value,r,s.next().value,i)),e}}else e.next=function(){var e=o.call(this);return!1===e.done&&(e.value=a(e.value,r,e.value,i)),e};return e}(b,r,n,f,y):b}return Reflect.apply(r,n,o)}},g=u.getProxy(e,n.pathAsArray?[]:"",m);return r=r.bind(g),c&&(n.onValidate=n.onValidate.bind(g)),g};ej.target=function(e){return e&&e[$]||e},ej.unsubscribe=function(e){return e[ee]||e};var eT="__splineHtmlContent",eI="(function () {\n 'use strict';\n var MARKER = ".concat(JSON.stringify(eT),";\n var callSeq = 1;\n var pending = {};\n var listeners = {};\n var acked = false;\n var readyResolve;\n var readyPromise = new Promise(function (resolve) { readyResolve = resolve; });\n\n function post(msg) {\n msg[MARKER] = true;\n try {\n window.parent.postMessage(msg, '*');\n } catch (e) { /* parent gone — nothing to do */ }\n }\n\n function call(method, args) {\n return new Promise(function (resolve, reject) {\n var id = callSeq++;\n pending[id] = { resolve: resolve, reject: reject };\n post({ kind: 'call', id: id, method: method, args: args });\n });\n }\n\n // ---- the public API ----------------------------------------------------\n var spline = {\n /** Resolves once the editor has acknowledged the frame. */\n ready: readyPromise,\n setVariable: function (name, value) { return call('setVariable', [name, value]); },\n setVariables: function (variables) { return call('setVariables', [variables]); },\n getVariable: function (name) { return call('getVariable', [name]); },\n getVariables: function () { return call('getVariables', []); },\n getAllObjects: function () { return call('getAllObjects', []); },\n findObjectByName: function (name) { return call('findObjectByName', [name]); },\n findObjectById: function (id) { return call('findObjectById', [id]); },\n /** Read a mesh's live geometry ({vertexCount, triangleCount, indexed, bounds, vertices: Float32Array, indices?, normals?, uvs?}); options {space: 'local'|'world'}. Resolves undefined (with a console warning) when unreadable. */\n getGeometry: function (nameOrId, options) { return call('getGeometry', [nameOrId, options || {}]); },\n /** Runtime-only transform/visibility update ({position,rotation,scale,visible}; rotation in degrees). */\n updateObject: function (nameOrId, props) { return call('updateObject', [nameOrId, props]); },\n /** Runtime-only object creation ('Cube', 'Sphere', …, 'Text', 'Group', lights); resolves to the new object's snapshot. */\n createObject: function (type, options) {\n // A three.js material instance or createCustomMaterial factory can't cross\n // the postMessage boundary (textures/callbacks/functions fail\n // structured clone) — fail loud, not with a cryptic DataCloneError.\n if (options && options.material && (\n options.material.isMaterial === true ||\n typeof options.material === 'function'\n )) {\n return Promise.reject(new Error(\n 'createObject: custom three.js materials need the inline ' +\n 'HTML-content mode (the editor Preview/Play frame and web ' +\n 'exports); this embed runs the sandboxed mode, whose transport ' +\n 'cannot carry them. Use a color/PBR bag or shared material ' +\n 'name here instead.'\n ));\n }\n return call('createObject', [type, options || {}]);\n },\n /** Custom three.js/TSL materials — inline HTML-content mode only; the\n * factory function cannot cross this sandboxed transport. */\n createCustomMaterial: function () {\n return Promise.reject(new Error(\n 'createCustomMaterial: custom three.js materials need the inline ' +\n 'HTML-content mode (the editor Preview/Play frame and web ' +\n 'exports); this embed runs the sandboxed mode, whose transport ' +\n 'cannot carry the factory function or the material it returns.'\n ));\n },\n /** The live three texture an object samples — inline HTML-content mode\n * only; a Texture instance cannot cross this sandboxed transport. */\n getTexture: function () {\n return Promise.reject(new Error(\n 'getTexture: a three.js texture instance needs the inline ' +\n 'HTML-content mode (the editor Preview/Play frame and web ' +\n 'exports); this embed runs the sandboxed mode, whose transport ' +\n 'cannot carry it.'\n ));\n },\n /** Replace a mesh's material with a custom three.js material — inline\n * HTML-content mode only; neither factories nor instances can cross\n * this sandboxed transport. */\n setMaterial: function () {\n return Promise.reject(new Error(\n 'setMaterial: custom three.js materials need the inline ' +\n 'HTML-content mode (the editor Preview/Play frame and web ' +\n 'exports); this embed runs the sandboxed mode, whose transport ' +\n 'cannot carry the factory function or the material it returns.'\n ));\n },\n /** Runtime-only deep clone of an existing object; resolves to the clone's snapshot. */\n cloneObject: function (nameOrId, options) { return call('cloneObject', [nameOrId, options || {}]); },\n /** Removes an object (and its subtree); resolves to false when none matched. */\n removeObject: function (nameOrId) { return call('removeObject', [nameOrId]); },\n /** Spawn a runtime-only copy of a template object; resolves to its snapshot ({id,...}) or undefined. */\n spawnObject: function (templateNameOrId, options) { return call('spawnObject', [templateNameOrId, options || {}]); },\n /** Remove a spawned copy by id (or assigned name). Spawned objects only. */\n destroyObject: function (idOrName) { return call('destroyObject', [idOrName]); },\n /** Per-copy transform writes on a cloner ([{position,rotation,scale}|null, ...]; degrees); null clears all. Resolves to the copy count. */\n setInstanceTransforms: function (nameOrId, transforms) { return call('setInstanceTransforms', [nameOrId, transforms === undefined ? null : transforms]); },\n /** Trigger a Spline event on an object (requires Play mode). */\n emitEvent: function (eventName, nameOrUuid) { return call('emitEvent', [eventName, nameOrUuid]); },\n emitEventReverse: function (eventName, nameOrUuid) { return call('emitEventReverse', [eventName, nameOrUuid]); },\n requestRender: function () { return call('requestRender', []); },\n addEventListener: function (eventName, cb) {\n if (typeof cb !== 'function') return;\n if (!listeners[eventName]) {\n listeners[eventName] = [];\n call('listenEvent', [eventName]);\n }\n listeners[eventName].push(cb);\n },\n removeEventListener: function (eventName, cb) {\n var list = listeners[eventName];\n if (!list) return;\n var i = list.indexOf(cb);\n if (i !== -1) list.splice(i, 1);\n if (list.length === 0) {\n delete listeners[eventName];\n call('unlistenEvent', [eventName]);\n }\n },\n };\n window.spline = spline;\n\n // ---- editor -> frame ---------------------------------------------------\n window.addEventListener('message', function (event) {\n if (event.source !== window.parent) return;\n var data = event.data;\n if (!data || data[MARKER] !== true) return;\n if (data.kind === 'ready-ack') {\n acked = true;\n readyResolve();\n } else if (data.kind === 'result') {\n var entry = pending[data.id];\n if (!entry) return;\n delete pending[data.id];\n if (data.ok) entry.resolve(data.value);\n else entry.reject(new Error(data.error || 'spline bridge call failed'));\n } else if (data.kind === 'event') {\n var list = listeners[data.eventName];\n if (!list) return;\n for (var i = 0; i < list.length; i++) {\n try {\n list[i](data.payload);\n } catch (e) {\n reportError(e);\n }\n }\n }\n });\n\n // ---- console + error capture --------------------------------------------\n function stringify(value, depth) {\n try {\n if (typeof value === 'string') return value;\n if (value instanceof Error) return value.stack || String(value);\n if (typeof value === 'function') return '[function ' + (value.name || 'anonymous') + ']';\n if (value === undefined) return 'undefined';\n var seen = [];\n var json = JSON.stringify(value, function (k, v) {\n if (typeof v === 'object' && v !== null) {\n if (seen.indexOf(v) !== -1) return '[circular]';\n seen.push(v);\n }\n if (typeof v === 'function') return '[function]';\n return v;\n });\n return json === undefined ? String(value) : json;\n } catch (e) {\n try { return String(value); } catch (e2) { return '[unserializable]'; }\n }\n }\n\n function sendConsole(level, args) {\n var parts = [];\n for (var i = 0; i < args.length; i++) parts.push(stringify(args[i]));\n var text = parts.join(' ');\n if (text.length > 4000) text = text.slice(0, 4000) + '…';\n post({ kind: 'console', level: level, text: text });\n }\n\n ['log', 'info', 'warn', 'error'].forEach(function (level) {\n var original = console[level];\n console[level] = function () {\n sendConsole(level, arguments);\n if (original) original.apply(console, arguments);\n };\n });\n\n function reportError(error) {\n sendConsole('error', [error instanceof Error ? error : String(error)]);\n }\n window.addEventListener('error', function (event) {\n sendConsole('error', [event.message + (event.filename ? ' (' + event.filename + ':' + event.lineno + ')' : '')]);\n });\n window.addEventListener('unhandledrejection', function (event) {\n sendConsole('error', ['Unhandled promise rejection: ' + stringify(event.reason)]);\n });\n\n // ---- input passthrough ---------------------------------------------------\n // A pointer that goes DOWN on the page background belongs to the 3D scene\n // until it is released; one that goes down on generated UI never forwards.\n var forwardedPointers = {};\n\n function isBackground(target) {\n if (!target || target === document || target === document.documentElement || target === document.body) {\n return true;\n }\n if (target.closest && target.closest('[data-spline-passthrough]')) return true;\n return false;\n }\n\n function baseInput(e, type) {\n return {\n type: type,\n x: e.clientX,\n y: e.clientY,\n button: e.button,\n buttons: e.buttons,\n pointerId: e.pointerId,\n pointerType: e.pointerType,\n isPrimary: e.isPrimary,\n movementX: e.movementX,\n movementY: e.movementY,\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n altKey: e.altKey,\n metaKey: e.metaKey,\n };\n }\n\n document.addEventListener('pointerdown', function (e) {\n if (!isBackground(e.target)) return;\n forwardedPointers[e.pointerId] = true;\n post({ kind: 'input', event: baseInput(e, 'pointerdown') });\n }, true);\n\n document.addEventListener('pointermove', function (e) {\n if (!forwardedPointers[e.pointerId] && !isBackground(e.target)) return;\n post({ kind: 'input', event: baseInput(e, 'pointermove') });\n }, true);\n\n ['pointerup', 'pointercancel'].forEach(function (type) {\n document.addEventListener(type, function (e) {\n var wasForwarded = forwardedPointers[e.pointerId];\n delete forwardedPointers[e.pointerId];\n if (!wasForwarded && !isBackground(e.target)) return;\n post({ kind: 'input', event: baseInput(e, type) });\n }, true);\n });\n\n ['click', 'dblclick'].forEach(function (type) {\n document.addEventListener(type, function (e) {\n if (!isBackground(e.target)) return;\n post({ kind: 'input', event: baseInput(e, type) });\n }, true);\n });\n\n document.addEventListener('wheel', function (e) {\n if (!isBackground(e.target)) return;\n e.preventDefault();\n var msg = baseInput(e, 'wheel');\n msg.deltaX = e.deltaX;\n msg.deltaY = e.deltaY;\n msg.deltaMode = e.deltaMode;\n // The legacy wheelDelta fields carry the trackpad-vs-mouse signature\n // the editor's pan/zoom discrimination reads (wheelDeltaY === -3*dY\n // on trackpads) — a reconstructed WheelEvent loses them, turning\n // two-finger pans into zooms. Forward them verbatim.\n if (typeof e.wheelDeltaX === 'number') msg.wheelDeltaX = e.wheelDeltaX;\n if (typeof e.wheelDeltaY === 'number') msg.wheelDeltaY = e.wheelDeltaY;\n post({ kind: 'input', event: msg });\n }, { capture: true, passive: false });\n\n ['keydown', 'keyup'].forEach(function (type) {\n document.addEventListener(type, function (e) {\n // Never steal keys from the page's own form fields.\n var t = e.target;\n if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;\n post({ kind: 'input', event: {\n type: type,\n key: e.key,\n code: e.code,\n repeat: e.repeat,\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n altKey: e.altKey,\n metaKey: e.metaKey,\n } });\n }, true);\n });\n\n // ---- handshake -----------------------------------------------------------\n // Announce readiness and KEEP announcing until the editor acks. A single\n // 'ready' can race the editor attaching its listener (or land while the\n // editor is busy); code that awaits spline.ready would then hang forever.\n // The editor acks every 'ready' (and posts a proactive ack on attach), so\n // this settles within one round-trip in the normal case.\n post({ kind: 'ready' });\n var readyRetry = setInterval(function () {\n if (acked) {\n clearInterval(readyRetry);\n return;\n }\n post({ kind: 'ready' });\n }, 250);\n})();"),eR=function(){function e(r,n,i){R(this,e),this.deps=r,this.onConsole=n,this.onEvent=i,this.disposed=!1,this.eventUnsubs=new Map,this.variablePollHandle=null,this.lastVariables=null}return z(e,[{key:"dispose",value:function(){this.disposed=!0;var e=!0,r=!1,n=void 0;try{for(var i,a=this.eventUnsubs.values()[Symbol.iterator]();!(e=(i=a.next()).done);e=!0)(0,i.value)()}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}this.eventUnsubs.clear(),this.stopVariablePolling()}},{key:"execute",value:function(e,r){var n=this,i=this.deps;switch(e){case"setVariable":var a=i.setVariable(String(r[0]),r[1]);return a.warning&&this.onConsole("warn",a.warning),a.ok;case"setVariables":var o=null!=(h=r[0])?h:{},s=!0,l=!0,u=!1,c=void 0;try{for(var h,d,f=Object.entries(o)[Symbol.iterator]();!(l=(d=f.next()).done);l=!0){var p=q(d.value,2),v=p[0],y=p[1],m=i.setVariable(v,y);m.warning&&this.onConsole("warn",m.warning),s=s&&m.ok}}catch(e){u=!0,c=e}finally{try{l||null==f.return||f.return()}finally{if(u)throw c}}return s;case"getVariable":return i.getVariable(String(r[0]));case"getVariables":return i.getVariables();case"getAllObjects":return i.getAllObjects();case"findObjectByName":case"findObjectById":return i.findObject(String(r[0]));case"getGeometry":var g,b=i.getGeometry(String(r[0]),null!=(g=r[1])?g:{});return b.warning&&this.onConsole("warn",b.warning),b.data;case"updateObject":return i.updateObject(String(r[0]),null!=(w=r[1])?w:{});case"createObject":return i.createObject(String(r[0]),null!=(x=r[1])?x:{});case"createCustomMaterial":if(void 0===i.createCustomMaterial)throw Error("createCustomMaterial: not available on this surface — custom three.js/TSL materials need the inline HTML-content mode (editor Preview/Play and web exports).");return i.createCustomMaterial(r[0]);case"getTexture":if(void 0===i.getTexture)throw Error("getTexture: not available on this surface — a three.js texture instance needs the inline HTML-content mode (editor Preview/Play and web exports).");return i.getTexture(String(r[0]),null!=(S=r[1])?S:{});case"setMaterial":if(void 0===i.setMaterial)throw Error("setMaterial: not available on this surface — custom three.js/TSL materials need the inline HTML-content mode (editor Preview/Play and web exports).");return i.setMaterial(String(r[0]),r[1]);case"cloneObject":return i.cloneObject(String(r[0]),null!=(k=r[1])?k:{});case"removeObject":return i.removeObject(String(r[0]));case"spawnObject":var w,x,S,k,M,A=i.spawnObject(String(r[0]),null!=(M=r[1])?M:{});return A.warning&&this.onConsole("warn",A.warning),A.object;case"destroyObject":return i.destroyObject(String(r[0]));case"setInstanceTransforms":var O=null===r[1]||void 0===r[1]?null:r[1],C=i.setInstanceTransforms(String(r[0]),O);return C<0&&this.onConsole("warn",'spline.setInstanceTransforms: "'.concat(String(r[0]),'" has no cloner — make the object a cloner first (its copies are what this drives).')),C;case"emitEvent":case"emitEventReverse":var _=i.emitEvent(String(r[0]),String(r[1]),"emitEventReverse"===e);return _.warning&&this.onConsole("warn",_.warning),_.ok;case"requestRender":return i.requestRender(),!0;case"listenEvent":var P=String(r[0]);return"variableChange"===P?this.startVariablePolling():this.eventUnsubs.has(P)||this.eventUnsubs.set(P,i.addSplineEventListener(P,function(e){n.onEvent(P,e)})),!0;case"unlistenEvent":var E,D=String(r[0]);return"variableChange"===D?this.stopVariablePolling():(null==(E=this.eventUnsubs.get(D))||E(),this.eventUnsubs.delete(D)),!0;default:throw Error("Unknown spline bridge method: ".concat(e))}}},{key:"startVariablePolling",value:function(){var e=this;null===this.variablePollHandle&&(this.lastVariables=this.deps.getVariables(),this.variablePollHandle=window.setInterval(function(){if(!e.disposed){var r=e.deps.getVariables(),n=function(e,r){var n=[],i=!0,a=!1,o=void 0;try{for(var s,l=Object.keys(r)[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;e[u]!==r[u]&&n.push({name:u,value:r[u]})}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return n}(null!=(s=e.lastVariables)?s:{},r);e.lastVariables=r;var i=!0,a=!1,o=void 0;try{for(var s,l,u=n[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;e.onEvent("variableChange",c)}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}},100))}},{key:"stopVariablePolling",value:function(){null!==this.variablePollHandle&&(window.clearInterval(this.variablePollHandle),this.variablePollHandle=null),this.lastVariables=null}}]),e}(),eB=function(){function e(r,n,i){var a=this;R(this,e),this.iframe=r,this.deps=n,this.onConsole=i,this.disposed=!1,this.handshakeSeen=!1,this.handshakeTimer=null,this.onMessage=function(e){if(!a.disposed&&e.source===a.iframe.contentWindow){var r=e.data;"object"!=X(r)||null===r||!0!==r[eT]||"string"!=typeof r.kind||a.handleMessage(r)}},this.host=new eR(n,i,function(e,r){a.sendEvent(e,r)})}return z(e,[{key:"attach",value:function(){var e,r=this;window.addEventListener("message",this.onMessage),this.send((L(e={},eT,!0),L(e,"kind","ready-ack"),e)),this.handshakeTimer=window.setTimeout(function(){r.handshakeTimer=null,r.handshakeSeen||r.disposed||r.onConsole("warn","The HTML content frame has not initialized (no signal from its scripts yet) — if the page looks frozen, check for errors in its code.")},6e3)}},{key:"dispose",value:function(){this.disposed=!0,window.removeEventListener("message",this.onMessage),this.host.dispose(),null!==this.handshakeTimer&&(window.clearTimeout(this.handshakeTimer),this.handshakeTimer=null)}},{key:"handleMessage",value:function(e){var r,n,i=this;switch(e.kind){case"ready":this.handshakeSeen=!0,this.send((L(r={},eT,!0),L(r,"kind","ready-ack"),r));break;case"console":this.onConsole(e.level,e.text);break;case"call":try{n=Promise.resolve(this.host.execute(e.method,e.args))}catch(e){n=Promise.reject(e)}n.then(function(r){var n;i.send((L(n={},eT,!0),L(n,"kind","result"),L(n,"id",e.id),L(n,"ok",!0),L(n,"value",r),L(n,"error",void 0),n))},function(r){var n,a=V(r,Error)?r.message:String(r);i.send((L(n={},eT,!0),L(n,"kind","result"),L(n,"id",e.id),L(n,"ok",!1),L(n,"value",void 0),L(n,"error",a),n)),i.onConsole("error",a)});break;case"input":this.dispatchInput(e.event)}}},{key:"send",value:function(e){var r;null==(r=this.iframe.contentWindow)||r.postMessage(e,"*")}},{key:"sendEvent",value:function(e,r){var n;this.send((L(n={},eT,!0),L(n,"kind","event"),L(n,"eventName",e),L(n,"payload",r),n))}},{key:"dispatchInput",value:function(e){var r=this.deps.getCanvas();if(r){var n=this.iframe.getBoundingClientRect(),i={bubbles:!0,cancelable:!0,view:window,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey};switch(e.type){case"pointerdown":case"pointermove":case"pointerup":case"pointercancel":r.dispatchEvent(new PointerEvent(e.type,G(N({},i),{clientX:(null!=(a=e.x)?a:0)+n.left,clientY:(null!=(o=e.y)?o:0)+n.top,button:e.button,buttons:e.buttons,pointerId:e.pointerId,pointerType:e.pointerType,isPrimary:e.isPrimary,movementX:e.movementX,movementY:e.movementY})));break;case"click":case"dblclick":r.dispatchEvent(new MouseEvent(e.type,G(N({},i),{clientX:(null!=(s=e.x)?s:0)+n.left,clientY:(null!=(l=e.y)?l:0)+n.top,button:e.button,buttons:e.buttons})));break;case"wheel":var a,o,s,l,u,c,h=new WheelEvent("wheel",G(N({},i),{clientX:(null!=(u=e.x)?u:0)+n.left,clientY:(null!=(c=e.y)?c:0)+n.top,deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode}));"number"==typeof e.wheelDeltaX&&Object.defineProperty(h,"wheelDeltaX",{value:e.wheelDeltaX}),"number"==typeof e.wheelDeltaY&&Object.defineProperty(h,"wheelDeltaY",{value:e.wheelDeltaY}),r.dispatchEvent(h);break;case"keydown":case"keyup":r.dispatchEvent(new KeyboardEvent(e.type,G(N({},i),{key:e.key,code:e.code,repeat:e.repeat})))}}}}]),e}();function ez(e){var r=e.userData,n=(e.uuid,W(e,["userData","uuid"]));if(void 0===r||"NonParametricGeometry"===r.type)return u=e.userData,h=null==(c=e.data)?void 0:c.groups,d=null!=(o=null==c?void 0:c.attributes)?o:{},f=null!=(s=null==c?void 0:c.morphAttributes)?s:{},p=null==c?void 0:c.interleavedBuffers,v=null==c?void 0:c.arrayBuffers,y=null==c?void 0:c.index,void 0!==d.position&&Array.isArray(d.position.array)&&(l=function(e){for(var r=1/0,n=1/0,i=1/0,a=-1/0,o=-1/0,s=-1/0,l=0;l<e.length;l+=3){var u=e[l],c=e[l+1],h=e[l+2];r=Math.min(r,u),n=Math.min(n,c),i=Math.min(i,h),a=Math.max(a,u),o=Math.max(o,c),s=Math.max(s,h)}return{width:a-r,height:o-n,depth:s-i}}(d.position.array)),m=G(N(G(N({},void 0===u?{}:u.parameters),{data:{attributes:d,morphAttributes:f,interleavedBuffers:p,arrayBuffers:v}}),void 0===l?{}:l),{type:"NonParametricGeometry"}),void 0!==y&&Object.assign(m.data,{index:y}),void 0!==h&&Object.assign(m.data,{groups:h.map(function(e){var r;return G(N({},e),{materialIndex:null!=(r=e.materialIndex)?r:0})})}),m;if("SubdivGeometry"===r.type){var i,a=null==(b=n.data)?void 0:b.attributes;if(void 0===(null==a?void 0:a.positionWASM)){var o,s,l,u,c,h,d,f,p,v,y,m,g,b,x=new P.dd;if(void 0===(null==a?void 0:a.position)||void 0===(null==a?void 0:a.faceMap))return null;var S=a.position.array,k=a.faceMap.array,M=n.data.index.array;x.setAttribute("position",new P.bd(S,3)),x.setIndex(new P.$c(M,1));for(var A=(0,w.b)(x),O=[],_=Array(k[k.length-1]+1).fill(3),E=A.getIndex().array,D=0,j=k.length;D<j;)k[D]===k[D+1]?(_[k[D]]++,O.push.apply(O,Y(new Set(E.slice(3*D,3*D+6)))),D+=2):(O.push.apply(O,Y(E.slice(3*D,3*D+3))),D++);a.indexWASM={array:O},a.positionWASM=A.attributes.position,a.verticesPerFaceWASM={array:_}}if(void 0===(null==a?void 0:a.positionWASM)||0===(null==a?void 0:a.positionWASM.length)||void 0===(null==a?void 0:a.indexWASM)||0===(null==a?void 0:a.indexWASM.length)||void 0===(null==a?void 0:a.verticesPerFaceWASM)||0===(null==a?void 0:a.verticesPerFaceWASM.length))return null;var T=N({type:"SubdivGeometry"},(i=a.positionWASM.array,eL.setFromArray(i),eL.getSize(eF),{width:eF.x,height:eF.y,depth:eF.z}));for(var I in T.subdivisions=r.parameters.subdivisions,a)"positionWASM"===I?T[I]=new Float32Array(a[I].array):"indexWASM"===I?T[I]=new Int32Array(a[I].array):"verticesPerFaceWASM"===I&&(T[I]=new Int8Array(a[I].array));return T.scaleBaked=[1,1,1],T}var R=r.type,B=r.parameters;return"VectorGeometry"===R?(B.extrudeDepth&&(B.depth=B.extrudeDepth),G(N({},B),{width:100,height:100,shape:function e(r){for(var n,i,a=r.points.length/7,o=new C.f,s=0;s<a;s++){var l=7*s,u=r.points[l+0],c=r.points[l+1],h=r.points[l+2],d=r.points[l+3],f=r.points[l+4],p=r.points[l+5],v=r.points[l+6];o.push({fi:s,id:P.Cc.generateUUID(),data:{roundness:v,position:[u,c],areControlsDirectionsMirrored:!0,controlPrevious:{position:[h,d]},controlNext:{position:[f,p]}}})}return{points:o,isClosed:r.isClosed,roundness:r.roundness,shapeHoles:null!=(n=null==(i=r.shapeHoles)?void 0:i.map(function(r){return e(r)}))?n:[]}}(r.shape),type:R})):"LatheGeometry"===R?G(N({},r.parameters),{type:R,points:(null!=(g=null==r?void 0:r.parameters.points)?g:[]).map(function(e){return[e.x,e.y]})}):(B.extrudeDepth&&(B.depth=B.extrudeDepth),G(N({},B),{type:R}))}new P.Oc,new P.Ec,new P.Pc,new P.Fc,new P.Fc;var eL=new P.Xc,eF=new P.Fc,eU=function(){function e(r,n,i,a,o,s){if(R(this,e),this.id=r,this.data=n,this.object=i,this.entered=!1,("KeyDown"===n.type||"KeyUp"===n.type||"KeyPress"===n.type)&&!n.key)throw Error("Missing property");this.actions=(0,S.f)(n,n.actions,a,o,s,i)}return z(e,[{key:"disconnect",value:function(){(0,S.g)(this.actions)}},{key:"dispatchHeld",value:function(e){this.actions.Create.forEach(function(r){e&&r.dispatchThrottled.cancel(),r.dispatchThrottled()})}},{key:"dispatch",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.actions.Transition.forEach(function(r){r.object.currentTransitionEvent!==e&&(r.object.currentTransitionEvent=e,r.init())}),"MousePress"===this.data.type||"KeyPress"===this.data.type?this.entered||(this.entered=!0,this.actions.Transition.forEach(function(e){return e.playFromCurrent()}),this.actions.Animation.forEach(function(e){return e.playFromCurrent()}),this.actions.TimelineAnimation.forEach(function(e){return e.playFromCurrent()}),this.actions.SwitchCamera.forEach(function(e){return e.playFromCurrent()}),this.actions.Create.forEach(function(e){return e.dispatchStart()})):(this.actions.Transition.some(function(e){return e.playing&&"Toggle"!==e.data.runMode})||this.actions.Transition.forEach(function(e){return e.play()}),this.actions.SwitchCamera.some(function(e){return e.playing&&"Toggle"!==e.data.runMode})||this.actions.SwitchCamera.forEach(function(e){"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.Animation.forEach(function(e){"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.TimelineAnimation.forEach(function(e){"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()})),this.actions.Link.forEach(function(e){e.dispatch()}),this.actions.SceneTransition.forEach(function(e){e.dispatch()}),!1===r&&this.actions.Create.forEach(function(e){e.dispatch()}),this.actions.Destroy.forEach(function(e){e.dispatch()}),this.actions.Reset.forEach(function(e){e.dispatch()}),this.actions.Audio.forEach(function(e){e.dispatchBasic()}),this.actions.Video.forEach(function(e){e.dispatchBasic()}),this.actions.Particles.forEach(function(e){e.dispatchBasic()}),this.actions.SetVariable.forEach(function(e){return e.checkConditions()}),this.actions.SetVariable.forEach(function(e){return e.dispatch()}),this.actions.DynamicVariablePlay.forEach(function(e){return e.dispatch()}),this.actions.ClearLocalStorage.forEach(function(e){return e.dispatch()}),this.actions.UserAPI.forEach(function(e){return e.dispatch()})}},{key:"dispatchRelease",value:function(){this.entered&&(this.entered=!1,this.actions.Transition.forEach(function(e){return e.reverseFromCurrent()}),this.actions.Particles.forEach(function(e){return e.reverseFromCurrent()}),this.actions.Animation.forEach(function(e){return e.reverseFromCurrent()}),this.actions.SwitchCamera.forEach(function(e){return e.reverseFromCurrent()}),this.actions.Create.forEach(function(e){return e.dispatchStop()}))}},{key:"dispatchUserEvent",value:function(e){var r=this;this.actions.Transition.forEach(function(e){e.object.currentTransitionEvent!==r&&(e.object.currentTransitionEvent=r,e.init())}),e?(this.actions.Transition.forEach(function(e){return e.reverseFromCurrent()}),this.actions.Animation.forEach(function(e){return e.reverseFromCurrent()}),this.actions.TimelineAnimation.forEach(function(e){return e.reverseFromCurrent()}),this.actions.SwitchCamera.forEach(function(e){return e.reverseFromCurrent()})):(this.actions.Transition.forEach(function(e){return e.playFromCurrent()}),this.actions.Animation.forEach(function(e){return e.playFromCurrent()}),this.actions.TimelineAnimation.forEach(function(e){return e.playFromCurrent()}),this.actions.SwitchCamera.forEach(function(e){return e.playFromCurrent()})),this.actions.Link.forEach(function(e){e.dispatch()}),this.actions.SceneTransition.forEach(function(e){e.dispatch()}),this.actions.Create.forEach(function(e){e.dispatch()}),this.actions.Destroy.forEach(function(e){e.dispatch()}),this.actions.Reset.forEach(function(e){e.dispatch()}),this.actions.Audio.forEach(function(e){e.dispatchBasic()}),this.actions.Video.forEach(function(e){e.dispatchBasic()}),this.actions.Particles.forEach(function(e){e.dispatchBasic()}),this.actions.SetVariable.forEach(function(e){return e.checkConditions()}),this.actions.SetVariable.forEach(function(e){return e.dispatch()}),this.actions.DynamicVariablePlay.forEach(function(e){return e.dispatch()}),this.actions.ClearLocalStorage.forEach(function(e){return e.dispatch()}),this.actions.UserAPI.forEach(function(e){return e.dispatch()})}}]),e}(),eV=function(e){function r(e,n,i){var a;return R(this,r),(a=I(this,r,[e])).eventManager=n,a.useForRaycastProperty=i,a.objectsPerTypes={MouseDown:[],MouseUp:[],MousePress:[],KeyDown:[],KeyUp:[],KeyPress:[]},a.canvasMouseEvents=[],a.eventsPerObjects={MouseDown:{},MouseUp:{},MousePress:{},KeyDown:{},KeyUp:{},KeyPress:{}},a.heldKeys={},a.heldKeysPress={},a._prevObjects=[],a.sceneInterects=null,a.onCanvasRaycast=function(e){if(!0===a.useForRaycastProperty&&null===a.sceneInterects){a.eventContext.updateRaycaster(e);var r=a.eventContext,n=r.raycaster,i=r.page,o=(0,u.a)(n,i,[],!0);a.sceneInterects=o,o.length&&(a.eventContext.sharedAssets.raycastProperty={x:o[0].point.x,y:o[0].point.y,z:o[0].point.z,objX:o[0].object.matrixWorld.elements[12],objY:o[0].object.matrixWorld.elements[13],objZ:o[0].object.matrixWorld.elements[14]})}},a.onCanvasMouseDown=function(e){(e.target===a.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&a.canvasMouseEvents.forEach(function(r){("MouseDown"===r.data.type||"MousePress"===r.data.type)&&(a.onCanvasRaycast(e),r.dispatch())})},a.onCanvasMouseUp=function(e){(e.target===a.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&a.canvasMouseEvents.forEach(function(r){"MouseUp"===r.data.type?(a.onCanvasRaycast(e),r.dispatch()):"MousePress"===r.data.type&&r.dispatchRelease()})},a.onMouseDown=function(e){g.a.length>1||(a.eventContext.updateRaycaster(e),a.handleMouseEvent("MouseDown"))},a.onMouseUp=function(e){g.a.length>1||(a.eventContext.updateRaycaster(e),a.handleMouseEvent("MouseUp"))},a.onMousePressDown=function(e){g.a.length>1||(a.eventContext.updateRaycaster(e),a.handleMousePressEvent())},a.onMousePressRelease=function(e){g.a.length>1||(a.eventContext.updateRaycaster(e),a.handleMousePressEvent(!0))},a.onKeyDown=function(e){a.heldKeys[e.key]||(a.handleKeyEvent(e,"KeyDown"),a.handleKeyEventHeld(e,"KeyDown",!0)),a.heldKeys[e.key]=!0},a.onKeyUp=function(e){a.handleKeyEvent(e,"KeyUp"),a.handleKeyEventHeld(e,"KeyUp",!0)},a.onKeyPressDown=function(e){a.heldKeysPress[e.key]?a.handleKeyEventHeld(e,"KeyPress"):(a.handleKeyEvent(e,"KeyPress"),a.handleKeyEventHeld(e,"KeyPress",!0)),a.heldKeysPress[e.key]=!0},a.onKeyPressUp=function(e){a.handleKeyEvent(e,"KeyPress",!0)},a.releaseHeldKey=function(e){delete a.heldKeys[e.key]},a.releaseHeldKeyPress=function(e){delete a.heldKeysPress[e.key]},a._onUserEvent=function(e){var r,n,i,o,s=e.eventName,l=e.target,u=e.reverse;if(s&&l){var c=(0,h.a)(s);c&&("MouseDown"===c||"MouseUp"===c||"MousePress"===c?(l.dispatchEvent({type:"beginEvent",eventName:c}),null==(n=a.eventsPerObjects[c])||null==(r=n[l.uuid])||r.forEach(function(e){e.dispatchUserEvent(u)}),a.canvasMouseEvents.forEach(function(e){e.dispatchUserEvent(u)})):("KeyDown"===c||"KeyUp"===c||"KeyPress"===c)&&(l.dispatchEvent({type:"beginEvent",eventName:c}),null==(o=a.eventsPerObjects[c])||null==(i=o[l.uuid])||i.forEach(function(e){e.dispatchUserEvent()})))}},a}return U(r,e),z(r,[{key:"connect",value:function(){var e,r,n,i,a,o,s=this,l=this.eventContext,u=l.page,c=l.sharedAssets,h=l.domElement,f=function(e,r){if(null==(o=e.data)?void 0:o.events.length){var n=!0,i=!1,a=void 0;try{for(var o,l,h=["MouseDown","MouseUp","MousePress","KeyDown","KeyUp","KeyPress"][Symbol.iterator]();!(n=(l=h.next()).done);n=!0)!function(){var n,i=l.value,a=s.eventsPerObjects[i];if(e.data.events.filter(function(e){var r=e.data;return r.type===i&&!0!==r.disabled}).forEach(function(r){var n=r.id,i=r.data;try{var o=new eU(n,i,e,u,c,s.eventManager);o.actions.Video.length&&(s.hasVideoAction=!0),"MouseDown"!==i.type&&"MouseUp"!==i.type&&"MousePress"!==i.type||"Canvas"!==i.mode&&"Window"!==i.mode?(a[e.uuid]?a[e.uuid].some(function(e){return e.id===o.id})||a[e.uuid].push(o):a[e.uuid]=[o],(0,A.c)(e)&&e.traverseChildren(function(e){var r;if(!e.visible)return!0;V(e,w.ia)&&"shapeBlendNode"in e.data.geometry&&2!==(null==(r=e.data.geometry.shapeBlendNode)?void 0:r.operation)&&(a[e.uuid]?a[e.uuid].push(o):a[e.uuid]=[o])})):s.canvasMouseEvents.push(o)}catch(e){}}),(null==(n=a[e.uuid])?void 0:n.length)&&(s.objectsPerTypes[i].push((0,A.e)(e)&&("MouseDown"===i||"MouseUp"===i||"MousePress"===i)?r:e),(0,A.c)(e))){var o=s.objectsPerTypes[i];e.traverseChildren(function(e){if(!e.visible)return!0;V(e,w.ia)&&-1===o.indexOf(e)&&o.push(e)})}}()}catch(e){i=!0,a=e}finally{try{n||null==h.return||h.return()}finally{if(i)throw a}}}};u.traverseEntity(function(e){var r;((0,A.f)(e)||V(e,d.h))&&(null==(r=e.frame)||r.traverse(function(r){f(r,e)})),f(e)}),this.heldKeys={},this.heldKeysPress={},this.domEventsNeeded.clear(),h.addEventListener("pointerdown",this.onCanvasMouseDown),h.addEventListener("pointerup",this.onCanvasMouseUp),((null==(e=this.objectsPerTypes.MouseDown)?void 0:e.length)||this.useForRaycastProperty)&&(this.domEventsNeeded.add("pointerdown"),h.addEventListener("pointerdown",this.onMouseDown)),(null==(r=this.objectsPerTypes.MouseUp)?void 0:r.length)&&(this.domEventsNeeded.add("pointerup"),h.addEventListener("pointerup",this.onMouseUp)),(null==(n=this.objectsPerTypes.MousePress)?void 0:n.length)&&(this.domEventsNeeded.add("pointerdown"),h.addEventListener("pointerdown",this.onMousePressDown),this.domEventsNeeded.add("pointerup"),h.addEventListener("pointerup",this.onMousePressRelease)),(null==(i=this.objectsPerTypes.KeyDown)?void 0:i.length)&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.releaseHeldKey)),(null==(a=this.objectsPerTypes.KeyUp)?void 0:a.length)&&(this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyUp)),(null==(o=this.objectsPerTypes.KeyPress)?void 0:o.length)&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyPressDown),document.addEventListener("keyup",this.releaseHeldKeyPress),this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyPressUp)),Object.entries(this.objectsPerTypes).forEach(function(e){var r=q(e,2);(r[0],r[1]).forEach(function(e){e.addEventListener("userEvent",s._onUserEvent)})}),this.canvasMouseEvents.forEach(function(e){e.object.addEventListener("userEvent",s._onUserEvent)})}},{key:"disconnect",value:function(){var e=this,r=this.eventContext.domElement;this.domEventsNeeded.clear(),this.heldKeys={},this.heldKeysPress={},r.removeEventListener("pointerdown",this.onCanvasMouseDown),r.removeEventListener("pointerup",this.onCanvasMouseUp),r.removeEventListener("pointerdown",this.onMouseDown),r.removeEventListener("pointerdown",this.onMousePressDown),r.removeEventListener("pointerup",this.onMouseUp),r.removeEventListener("pointerup",this.onMousePressRelease),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("keydown",this.onKeyPressDown),document.removeEventListener("keyup",this.onKeyPressUp),document.removeEventListener("keyup",this.releaseHeldKey),Object.values(this.eventsPerObjects).forEach(function(e){Object.values(e).forEach(function(e){e.forEach(function(e){e.disconnect()})})}),this.canvasMouseEvents.forEach(function(e){e.disconnect()}),Object.entries(this.objectsPerTypes).forEach(function(r){var n=q(r,2);(n[0],n[1]).forEach(function(r){r.removeEventListener("userEvent",e._onUserEvent)})}),this.canvasMouseEvents.forEach(function(r){r.object.removeEventListener("userEvent",e._onUserEvent)})}},{key:"handleMouseEvent",value:function(e){var r=this,n=this.eventContext,i=n.stopRaycast,a=n.raycaster,o=n.page,s=n.pointerScreen,l=this.objectsPerTypes[e],c=l.filter(function(e){return!(0,A.e)(e)});if((l.length||this.useForRaycastProperty)&&(!o.uiCanvas||!(0,u.c)(o,[s.x,s.y],Object.keys(this.eventsPerObjects[e]),function(n){r.handleObjectMouseEventDispatch(n,e)}))){if((i||this.useForRaycastProperty)&&(null===this.sceneInterects?h=(0,u.a)(a,o,c,this.useForRaycastProperty):(h=this.sceneInterects,this.sceneInterects=null),this.useForRaycastProperty&&h.length&&(this.eventContext.sharedAssets.raycastProperty={x:h[0].point.x,y:h[0].point.y,z:h[0].point.z,objX:h[0].object.matrixWorld.elements[12],objY:h[0].object.matrixWorld.elements[13],objZ:h[0].object.matrixWorld.elements[14]}),i)){var h,d,f,p,v,y,m,g=[null!=(d=null==(v=h[0])||null==(p=v.uv)?void 0:p.x)?d:0,null!=(f=null==(m=h[0])||null==(y=m.uv)?void 0:y.y)?f:0];(0,u.b)(h).forEach(function(n){(0,A.f)(n)&&(0,u.c)(n,g,Object.keys(r.eventsPerObjects[e]),function(n){r.handleObjectMouseEventDispatch(n,e)}),r.eventsPerObjects[e][n.uuid]&&r.handleObjectMouseEventDispatch(n,e)})}i||c.forEach(function(n){var i,o,s,l,c=(0,u.d)(a,n);c&&(r.handleObjectMouseEventDispatch(n,e),(0,A.f)(n)&&(0,u.c)(n,[null!=(i=null==c||null==(s=c.uv)?void 0:s.x)?i:0,null!=(o=null==c||null==(l=c.uv)?void 0:l.y)?o:0],Object.keys(r.eventsPerObjects[e]),function(n){r.handleObjectMouseEventDispatch(n,e)}))})}}},{key:"handleMousePressEvent",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n="MousePress",i=this.objectsPerTypes[n],a=i.filter(function(e){return!(0,A.e)(e)}),o=[];if(i.length){if(!r){var s=this.eventContext,l=s.stopRaycast,c=s.raycaster,h=s.page,d=s.pointerScreen,f=!1;if(h.uiCanvas&&(f=(0,u.c)(h,[d.x,d.y],Object.keys(this.eventsPerObjects[n]),function(e){o.push(e)})),l&&!f){var p=(0,u.a)(c,h,a);o=(0,u.b)(p),p.forEach(function(r){var i,a,s,l;(0,A.f)(r.object)&&(0,u.c)(r.object,[null!=(i=null==r||null==(s=r.uv)?void 0:s.x)?i:0,null!=(a=null==r||null==(l=r.uv)?void 0:l.y)?a:0],Object.keys(e.eventsPerObjects[n]),function(e){o.push(e)})})}else a.forEach(function(r){var i,a,s,l,h=(0,u.d)(c,r);h&&(o.push(r),(0,A.f)(r)&&(0,u.c)(r,[null!=(i=null==h||null==(s=h.uv)?void 0:s.x)?i:0,null!=(a=null==h||null==(l=h.uv)?void 0:l.y)?a:0],Object.keys(e.eventsPerObjects[n]),function(e){o.push(e)}))})}this._prevObjects.length&&this._prevObjects.forEach(function(r){o.includes(r)||e.handleObjectMouseEventDispatchRelease(r,n)}),o.length&&o.forEach(function(r){e.handleObjectMouseEventDispatch(r,n)}),this._prevObjects=o}}},{key:"handleObjectMouseEventDispatch",value:function(e,r){var n,i;e.dispatchEvent({type:"beginEvent",eventName:r}),null==(i=this.eventsPerObjects[r])||null==(n=i[e.uuid])||n.forEach(function(e){e.dispatch()})}},{key:"handleObjectMouseEventDispatchRelease",value:function(e,r){var n,i;e.dispatchEvent({type:"beginEvent",eventName:r}),null==(i=this.eventsPerObjects[r])||null==(n=i[e.uuid])||n.forEach(function(e){e.dispatchRelease()})}},{key:"handleKeyEvent",value:function(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.objectsPerTypes[r].forEach(function(a){var o=n.eventsPerObjects[r][a.uuid];o.some(function(r){var n=r.data;return"key"in n&&n.key===e.key})&&a.dispatchEvent({type:"beginEvent",eventName:r}),o.forEach(function(r){"key"in r.data&&r.data.key===e.key&&(i?r.dispatchRelease():r.dispatch(!0))})})}},{key:"handleKeyEventHeld",value:function(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.objectsPerTypes[r].forEach(function(a){n.eventsPerObjects[r][a.uuid].forEach(function(r){"key"in r.data&&r.data.key===e.key&&r.dispatchHeld(i)})})}}]),r}(p.a),eN=function(e){return!0===(null==e?void 0:e.isPlayAudioAction)},eG=function(e){return!0===(null==e?void 0:e.isPauseAudioAction)},eW=function(e){return!0===(null==e?void 0:e.isPlayVideoAction)},eH=function(e){return!0===(null==e?void 0:e.isPauseVideoAction)},eq=function(){function e(r,n,i,a,o,s){R(this,e),this.id=r,this.data=n,this.object=i,this.actions=(0,S.f)(n,n.actions,a,o,s,i)}return z(e,[{key:"disconnect",value:function(){(0,S.g)(this.actions)}},{key:"dispatch",value:function(){this.actions.Transition.forEach(function(e){e.play()}),this.actions.Animation.forEach(function(e){e.play()}),this.actions.TimelineAnimation.forEach(function(e){e.play()}),this.actions.SwitchCamera.forEach(function(e){e.play()}),this.actions.SceneTransition.forEach(function(e){e.dispatch()}),this.actions.Reset.forEach(function(e){return e.dispatch()}),this.actions.SetVariable.forEach(function(e){return e.checkConditions()}),this.actions.SetVariable.forEach(function(e){return e.dispatch()}),this.actions.DynamicVariablePlay.forEach(function(e){return e.dispatch()}),this.actions.ClearLocalStorage.forEach(function(e){return e.dispatch()}),this.actions.UserAPI.forEach(function(e){return e.dispatch()}),this.actions.Create.forEach(function(e){e.dispatchFromStart()}),this.actions.Destroy.forEach(function(e){e.dispatchFromStart()})}},{key:"dispatchAfter",value:function(e){this.actions.Audio.forEach(function(r){var n,i;(null!=(n=r.interaction.data.triggerAfter)?n:"any")===e&&(eN(r.interaction)?null==(i=r.interaction.audioPlayer)||i.play():eG(r.interaction)&&r.interaction.dispatch())}),this.actions.Video.forEach(function(r){var n,i=null!=(n=r.interaction.data.triggerAfter)?n:"autoplay";i===e&&(eW(r.interaction)?r.interaction.play("autoplay"===i):eH(r.interaction)&&r.interaction.dispatch())}),this.actions.Particles.forEach(function(r){var n;(null!=(n=r.data.triggerAfter)?n:"any")===e&&r.dispatchBasic()})}},{key:"seekVideos",value:function(e){return T(function(){var r;return J(this,function(n){switch(n.label){case 0:return r=[],this.actions.Video.forEach(function(n){var i;"autoplay"===(null!=(i=n.interaction.data.triggerAfter)?i:"autoplay")&&eW(n.interaction)&&r.push(n.interaction.seek(e))}),[4,Promise.all(r)];case 1:return n.sent(),[2]}})}).call(this)}},{key:"pauseVideos",value:function(){this.actions.Video.forEach(function(e){eW(e.interaction)&&e.interaction.pause()})}},{key:"dispatchUserEvent",value:function(e){var r=this;this.actions.Transition.forEach(function(e){e.object.currentTransitionEvent!==r&&(e.object.currentTransitionEvent=r,e.init())}),e?(this.actions.Transition.forEach(function(e){return e.reverseFromCurrent()}),this.actions.Animation.forEach(function(e){return e.reverseFromCurrent()}),this.actions.TimelineAnimation.forEach(function(e){return e.reverseFromCurrent()}),this.actions.SwitchCamera.forEach(function(e){return e.reverseFromCurrent()})):(this.actions.Transition.forEach(function(e){return e.playFromCurrent()}),this.actions.Animation.forEach(function(e){return e.playFromCurrent()}),this.actions.TimelineAnimation.forEach(function(e){return e.playFromCurrent()}),this.actions.SwitchCamera.forEach(function(e){return e.playFromCurrent()})),this.actions.SceneTransition.forEach(function(e){return e.dispatch()}),this.actions.Reset.forEach(function(e){return e.dispatch()}),this.actions.SetVariable.forEach(function(e){return e.checkConditions()}),this.actions.SetVariable.forEach(function(e){return e.dispatch()}),this.actions.DynamicVariablePlay.forEach(function(e){return e.dispatch()}),this.actions.ClearLocalStorage.forEach(function(e){return e.dispatch()}),this.actions.UserAPI.forEach(function(e){return e.dispatch()}),this.actions.Create.forEach(function(e){e.dispatch()}),this.actions.Destroy.forEach(function(e){e.dispatch()}),this.actions.Audio.forEach(function(e){var r;eN(e.interaction)?null==(r=e.interaction.audioPlayer)||r.play():eG(e.interaction)&&e.interaction.dispatch()}),this.actions.Video.forEach(function(e){eW(e.interaction)?e.interaction.play():eH(e.interaction)&&e.interaction.dispatch()}),this.actions.Particles.forEach(function(e){e.dispatchBasic()})}}]),e}(),eY=function(e){function r(e,n){var i;return R(this,r),(i=I(this,r,[e])).eventManager=n,i.eventsPerObject=new Map,i.eventsAfterPerObject=new Map,i.onMouseDown=function(){Y(i.eventsAfterPerObject.entries()).forEach(function(e){var r=q(e,2),n=r[0],i=r[1];n.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach(function(e){e.dispatchAfter("mouseDown")})})},i.onKeyDown=function(){Y(i.eventsAfterPerObject.entries()).forEach(function(e){var r=q(e,2),n=r[0],i=r[1];n.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach(function(e){e.dispatchAfter("keyDown")})})},i.onAny=function(){var e=i.eventContext,r=e.domElement,n=e.isExport?document:r;n.removeEventListener("pointerdown",i.onAny),n.removeEventListener("mousedown",i.onAny),document.removeEventListener("keydown",i.onAny),Y(i.eventsAfterPerObject.entries()).forEach(function(e){var r=q(e,2),n=r[0],i=r[1];n.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach(function(e){e.dispatchAfter("any")})})},i.onSceneTransitionAudioVideoPlay=function(){Y(i.eventsAfterPerObject.entries()).forEach(function(e){var r=q(e,2),n=r[0],i=r[1];n.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach(function(e){e.actions.Audio.forEach(function(e){var r;eN(e.interaction)&&(null==(r=e.interaction.audioPlayer)||r.play())}),e.actions.Video.forEach(function(e){var r,n=null!=(r=e.interaction.data.triggerAfter)?r:"autoplay";eW(e.interaction)&&e.interaction.play("autoplay"===n)}),e.actions.Particles.forEach(function(e){e.dispatchBasic()})})})},i.onPlay=function(){Y(i.eventsAfterPerObject.entries()).forEach(function(e){var r=q(e,2),n=r[0],i=r[1];n.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach(function(e){e.dispatchAfter("autoplay")})})},i.seekVideos=function(e){return T(function(){var r;return J(this,function(n){switch(n.label){case 0:return r=[],Y(i.eventsAfterPerObject.entries()).forEach(function(n){var i=q(n,2),a=i[0],o=i[1];a.data.visible&&o.forEach(function(n){r.push(n.seekVideos(e))})}),[4,Promise.all(r)];case 1:return n.sent(),[2]}})})()},i.pauseVideos=function(){Y(i.eventsAfterPerObject.entries()).forEach(function(e){var r=q(e,2);(r[0],r[1]).forEach(function(e){e.pauseVideos()})})},i.onUserEvent=function(e){var r,n,a=e.eventName,o=e.target,s=e.reverse;if(a&&o){var l=(0,h.a)(a);l&&"Start"===l&&((0,A.e)(o)||o.dispatchEvent({type:"beginEvent",eventName:"Start"}),null==(r=i.eventsPerObject.get(o))||r.forEach(function(e){e.dispatchUserEvent(s)}),null==(n=i.eventsAfterPerObject.get(o))||n.forEach(function(e){e.dispatchUserEvent(s)}))}},i}return U(r,e),z(r,[{key:"connect",value:function(){var e=this,r=this.eventContext,n=r.sharedAssets,i=r.page,a=function(r){var a=!0,o=!1,s=void 0;if(null==(l=r.data)?void 0:l.events.length)try{for(var l,u,c=r.data.events[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var h,d,f,p,v=u.value,y=v.id,m=v.data;if(!m.disabled&&"Start"===m.type){var g=new eq(y,m,r,i,n,e.eventManager);(g.actions.Transition.length||g.actions.TimelineAnimation.length||g.actions.Animation.length||g.actions.SwitchCamera.length||g.actions.Create.length||g.actions.Destroy.length||g.actions.SceneTransition.length||g.actions.Reset.length||g.actions.SetVariable.length||g.actions.DynamicVariablePlay.length||g.actions.ClearLocalStorage.length||g.actions.UserAPI.length)&&(e.eventsPerObject.has(r)?null==(h=e.eventsPerObject.get(r))||h.push(g):e.eventsPerObject.set(r,[g])),g.actions.Audio.length&&(e.eventsAfterPerObject.has(r)?null==(d=e.eventsAfterPerObject.get(r))||d.push(g):e.eventsAfterPerObject.set(r,[g])),g.actions.Video.length&&(e.hasVideoAction=!0,e.eventsAfterPerObject.has(r)?null==(f=e.eventsAfterPerObject.get(r))||f.push(g):e.eventsAfterPerObject.set(r,[g])),g.actions.Particles.length&&(e.eventsAfterPerObject.has(r)?null==(p=e.eventsAfterPerObject.get(r))||p.push(g):e.eventsAfterPerObject.set(r,[g]))}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}};if(i.traverseEntity(function(e){var r;((0,A.f)(e)||V(e,d.h))&&(null==(r=e.frame)||r.traverse(function(e){a(e)})),a(e)}),Y(this.eventsAfterPerObject.values()).some(function(e){return e.length})){if(0===this.eventManager.activateCount){var o=this.eventContext,s=o.domElement,l=o.isExport?document:s;l.addEventListener("pointerdown",this.onMouseDown,{once:!0}),l.addEventListener("mousedown",this.onMouseDown,{once:!0}),document.addEventListener("keydown",this.onKeyDown,{once:!0}),l.addEventListener("pointerdown",this.onAny),l.addEventListener("mousedown",this.onAny),document.addEventListener("keydown",this.onAny),Y(this.eventsAfterPerObject.entries()).forEach(function(r){var n=q(r,2),i=n[0];n[1],i.addEventListener("userEvent",e.onUserEvent)})}else this.onSceneTransitionAudioVideoPlay();this.onPlay()}Y(this.eventsPerObject.entries()).forEach(function(r){var n=q(r,2),i=n[0],a=n[1];i.dispatchEvent({type:"beginEvent",eventName:"Start"}),a.forEach(function(e){return e.dispatch()}),i.addEventListener("userEvent",e.onUserEvent)})}},{key:"disconnect",value:function(){var e=this;if(Y(this.eventsAfterPerObject.values()).some(function(e){return e.length})){var r=this.eventContext,n=r.domElement,i=r.isExport?document:n;i.removeEventListener("pointerdown",this.onMouseDown),i.removeEventListener("mousedown",this.onMouseDown),document.removeEventListener("keydown",this.onKeyDown),i.removeEventListener("pointerdown",this.onAny),i.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),Y(this.eventsAfterPerObject.entries()).forEach(function(r){var n=q(r,2),i=n[0],a=n[1];i.removeEventListener("userEvent",e.onUserEvent),a.forEach(function(e){return e.disconnect()})})}Y(this.eventsPerObject.entries()).forEach(function(r){var n=q(r,2),i=n[0],a=n[1];i.removeEventListener("userEvent",e.onUserEvent),a.forEach(function(e){return e.disconnect()})}),this.eventsPerObject.clear(),this.eventsAfterPerObject.clear()}}]),r}(p.a),eX=function(){function e(r,n,i,a,o){var s=this;R(this,e),this.publish=r,this.controlsManager=n,this.animationControls=i,this.eventContext=a,this.sharedVariables=o,this.isEnabled=!1,this.activateCount=0,this.needsMouse=!1,this.needsRaycast=!1,this.onTouchMovePreventScroll=function(e){var r=window.parent!==window,n=document.documentElement.scrollHeight>document.documentElement.clientHeight||document.documentElement.scrollWidth>document.documentElement.clientWidth;(e.touches.length>1||s.preventTouchScroll||!1===r&&!1===n)&&e.preventDefault()},this.onMouseWheelPreventScroll=function(e){s.preventScroll&&e.preventDefault()},this.onMouseMove=function(e){s.eventContext.sharedAssets.mouseProperty=G(N({},s.getMousePosition(e)),{pressed:e.buttons>0})},this.onMouseDown=function(e){s.eventContext.sharedAssets.mouseProperty=G(N({},s.getMousePosition(e)),{pressed:!0})},this.onMouseUp=function(e){s.eventContext.sharedAssets.mouseProperty=G(N({},s.getMousePosition(e)),{pressed:!1})},this.getMousePosition=function(e){var r,n=s.eventContext.domRect,i=(null==(r=e.touches)?void 0:r.length)>0?e.touches[0]:e,a=i.pageX,o=i.pageY;return{x:a-(n.left+window.scrollX),y:o-(n.top+window.scrollY)}},this.stopRaycast=r.stopRaycast,this.preventScroll=r.preventScroll,this.preventTouchScroll=r.preventTouchScroll,this.hideCursor=r.hideCursor,this.requestRender=a.requestRender}return z(e,[{key:"warnMissingEventFeatures",value:function(){var e=this;this.eventContext.page.traverseEntity(function(r){var n=!0,i=!1,a=void 0;try{for(var o,s=r.dataPatched.events[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;if(!0!==l.data.disabled){var u=l.data.type;if(void 0===e.handlers[u]){var c=S.c[u];void 0!==c&&(0,O.c)(c,'a "'.concat(u,'" event'))}}}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}})}},{key:"activate",value:function(){var e,r=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isEnabled){this.isEnabled=!0,this.initializeActionsDependentStates(),this.needsMouse&&(this.eventContext.domElement.addEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.addEventListener("pointerdown",this.onMouseDown));var i={eventContext:this.eventContext,eventManager:this,sharedVariables:this.sharedVariables,needsMouse:this.needsMouse,needsRaycast:this.needsRaycast};this.handlers={};var a=function(e,n){var a=(0,p.c)(e);void 0!==a?r.handlers[e]=a(i):void 0!==n&&(r.handlers[e]=n())};a("Spline",function(){return new h.b(r.eventContext)}),a("VariableChange"),a("API"),a("WEBHOOK"),a("AIAssistantListener"),a("AIAssistantTrigger"),a("Conditional"),a("Start",function(){return new eY(r.eventContext,r)}),a("Basic",function(){return new eV(r.eventContext,r,r.needsRaycast)}),a("MouseHover"),a("Scroll"),a("Follow"),a("DragDrop"),a("LookAt"),a("Resize"),a("Textfields"),this.warnMissingEventFeatures();var o=this.eventContext,s=o.page,l=o.domElement;this.hideCursor&&(l.style.cursor="none"),s.traverseEntity(function(e){e.addEventListener("requestRender",r.requestRender)}),Object.values(this.handlers).forEach(function(e){return e.connect()}),l.addEventListener("wheel",this.onMouseWheelPreventScroll),l.addEventListener("touchmove",this.onTouchMovePreventScroll),this.activateCount++,n||null==(e=this.eventContext.sharedAssets.openAIRealtime)||e.connect()}}},{key:"deactivate",value:function(){var e,r,n=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEnabled){this.isEnabled=!1,this.eventContext.domElement.removeEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.removeEventListener("pointerdown",this.onMouseDown),this.eventContext.domElement.removeEventListener("pointerup",this.onMouseUp),this.eventContext.sharedAssets.mouseProperty=null,this.eventContext.sharedAssets.raycastProperty=null;var a=this.eventContext,o=a.page,s=a.domElement;s.style.cursor="",Object.values(this.handlers).forEach(function(e){return e.disconnect()}),null==(e=this.controlsManager.gameControl)||e.disposeActions(),this.controlsManager.disconnectEvents(),o.traverseEntity(function(e){e.removeEventListener("requestRender",n.requestRender),e.destroyedInAction=!1}),s.removeEventListener("touchmove",this.onTouchMovePreventScroll),s.removeEventListener("wheel",this.onMouseWheelPreventScroll),this.animationControls.onExitPlayMode(),i||null==(r=this.eventContext.sharedAssets.openAIRealtime)||r.disconnect()}}},{key:"dispose",value:function(){this.deactivate(),Object.values(this.handlers).forEach(function(e){return e.dispose()})}},{key:"isPaused",get:function(){return this.isEnabled}},{key:"pause",value:function(){this.deactivate()}},{key:"resume",value:function(){this.activate()}},{key:"reset",value:function(){this.deactivate(!0),this.activate(!0),this.controlsManager.deactivate(),this.controlsManager.activate(this),this.controlsManager.page.updateMatrixWorld(!0),this.controlsManager.rebuildBVH()}},{key:"updateUseWindowEvents",value:function(e){var r=this.isEnabled;r&&this.deactivate(),this.eventContext.useWindowEvents=e,r&&this.activate()}},{key:"initializeActionsDependentStates",value:function(){var e=this,r=this.eventContext.sharedAssets;r.resetDynamicVariablePlayState();var n=function(i){var a=!0,o=!1,s=void 0;if("Conditional"===i.data.type&&(i.data.ifActions.forEach(n),i.data.elseActions.forEach(n)),"Conditional"===i.data.type||"SetVariable"===i.data.type)try{for(var l,u=("Conditional"===i.data.type?i.data.condition:i.data.expression)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;"id"in c&&Array.isArray(c.id)&&("mouse"===c.id[0]&&(e.needsMouse=!0),"raycast"===c.id[0]&&(e.needsRaycast=!0))}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}"DynamicVariablePlay"===i.data.type&&""!==i.data.variableId&&("Play"===i.data.mode||"PlayPause"===i.data.mode||"Toggle"===i.data.mode)&&r.setDynamicVariablePlayState(i.data.variableId,"Stopped")};this.eventContext.page.traverseEntity(function(r){var i=!0,a=!1,o=void 0,s=!0,l=!1,u=void 0;if(null==(c=r.data)?void 0:c.events.length)try{for(var c,h,d=r.data.events[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var f=h.value;if("VariableChange"===f.data.type&&("mouseProperty"===f.data.variableId&&(e.needsMouse=!0),"raycastProperty"===f.data.variableId&&(e.needsRaycast=!0)),"Conditional"===f.data.type)for(var p=0,v=["inActions","outActions"];p<v.length;p++){var y=v[p];f.data[y].forEach(n)}else if("DragDrop"===f.data.type)for(var m=0,g=["drag","drop"];m<g.length;m++){var b=g[m];f.data.dragDropActions[b].forEach(n)}else if("GameControl"===f.data.type)for(var w=0,x=["idle","move","jump","run"];w<x.length;w++){var S=x[w];f.data.gameActions[S].forEach(n)}else if("Resize"===f.data.type)try{for(var k,M=f.data.breakpoints[Symbol.iterator]();!(i=(k=M.next()).done);i=!0)k.value.data.actions.forEach(n)}catch(e){a=!0,o=e}finally{try{i||null==M.return||M.return()}finally{if(a)throw o}}else"LookAt"===f.data.type||"API"===f.data.type||f.data.actions.forEach(n)}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}})}}]),e}(),eZ=function(){function e(r,n,i,a){R(this,e),this.enableResponsive=!1,this._renderer=r,this._camera=n,this._frameSize=(new P.Dc).copy(i),this._fov=null!=a?a:n.fov}return z(e,[{key:"frameSize",set:function(e){this._frameSize.copy(e)}},{key:"setRenderSize",value:function(e,r){this._renderSize=void 0===e||void 0===r?void 0:new P.Dc(e,r)}},{key:"updateRenderer",value:function(){if(this._renderer){var e,r=null!=(e=this._renderSize)?e:this._frameSize;this._renderer.setSize(r.x,r.y)}}},{key:"updateViewport",value:function(){if(this._renderer&&this._camera&&"PerspectiveCamera"===this._camera.cameraType){var e,r=null!=(e=this._renderSize)?e:this._frameSize;this._renderer.setViewport(0,0,r.x,r.y)}}},{key:"updateCamera",value:function(){this._camera&&("PerspectiveCamera"===this._camera.cameraType?(this._camera.aspect=this._frameSize.x/this._frameSize.y,this._camera.updateProjectionMatrix()):this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y,this.enableResponsive))}},{key:"setCamera",value:function(e){this._camera=e,this._fov=e.fov}},{key:"revert",value:function(){var e=window.innerWidth,r=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,r),this._renderer.setSize(e,r)),this._camera&&(this._camera.aspect=e/r,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,r,this.enableResponsive),this._camera.updateProjectionMatrix())}}]),e}(),eK=["particles","hair","shape-blends","vector-shapes","3d-paths","cloners","components","text","ui-2d","game-controls","collision-bvh","transitions"];function eJ(e,r){if("Page"===e.type){var n=e.timelines;(void 0===n||Object.keys(n).length>0)&&r.add("timeline")}switch(e.type){case"Particle":case"ParticleCollider":r.add("particles");break;case"Hair":r.add("hair");break;case"Page":null!=(null==(a=e.publish)?void 0:a.gameControlObject)&&r.add("game-controls"),(null!=e.uiScene||void 0!==e.uiFrame)&&r.add("ui-2d");var i,a,o,s=null==(o=e.uiScene)?void 0:o.objects;if(void 0!==s){if("function"!=typeof s.traverse)throw Error("unrecognized uiScene shape");s.traverse(function(e,n){eJ(n,r)})}}switch(null==(i=e.geometry)?void 0:i.type){case"ShapeBlendGeometry":r.add("shape-blends");break;case"VectorGeometry":r.add("vector-shapes");break;case"PathGeometry":r.add("3d-paths");break;case"UIGeometry":r.add("ui-2d");break;case"TextGeometry":case"InputGeometry":r.add("text")}("Component"===e.type||"Instance"===e.type)&&r.add("components"),null!=e.cloner&&r.add("cloners");var l=e.states;if(null!=l)if(Array.isArray(l))l.length>0&&r.add("transitions");else{if("object"!=(void 0===l?"undefined":X(l)))throw Error("unrecognized states shape");Object.keys(l).length>0&&r.add("transitions")}}var eQ,e$,e0=function(){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];R(this,e),this.shared=new w.fa(r.shared,n,!0,i),this.scene=new s.f(r.scene,this.sharedAssets),this.shared.setEntityOpContext({scene:this.scene,shared:this.shared})}return z(e,[{key:"sharedAssets",get:function(){return this.shared}},{key:"reset",value:function(e,r){this.scene.clearScene(),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}},{key:"resetPersonalCameraFromDocumentData",value:function(){var e=!0,r=!1,n=void 0;try{for(var i,a=this.scene.children[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;V(o,d.h)&&!o.uiScene&&o.personalCamera.updateState(o.data.camera,{scene:this.scene,shared:this.shared})}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"dispose",value:function(){this.scene.dispose(),this.shared.dispose()}},{key:"gc",value:function(){var e=this;this.scene.releaseInstanceGroups(),this.shared.geometryCache.startGc(),this.shared.geometryCache2.startGc(),this.scene.traverseEntity(function(r){V(r,w.ia)&&r.markGeometryAsReachable(e.shared)}),this.shared.geometryCache.endGc(),this.shared.geometryCache2.endGc()}}]),e}();function e1(e){return e$||(e$=n.e("9636").then(n.bind(n,1967)).then(function(r){return(eQ=new r.DRACOLoader).setDecoderPath(void 0!==e?"".concat(e,"/"):"https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload(),eQ.decoderPending})),e$}function e2(e){return T(function(){var r,n,i,a,o,s,l;return J(this,function(u){switch(u.label){case 0:r=!0,n=!1,i=void 0,u.label=1;case 1:u.trys.push([1,6,7,8]),a=function(){var e,r,n,i;return J(this,function(a){switch(a.label){case 0:var o;return[4,(o=(e=s.value).geometry.data.draco,T(function(){var e,r;return J(this,function(n){switch(n.label){case 0:if(!eQ)return[3,5];r={attributeIDs:eQ.defaultAttributeIDs,attributeTypes:eQ.defaultAttributeTypes,useUniqueIDs:!1},n.label=1;case 1:return n.trys.push([1,3,,4]),[4,eQ.decodeGeometry(new Int8Array(o).buffer,r)];case 2:return e=n.sent(),[3,4];case 3:return console.error(n.sent()),[3,4];case 4:if(e)return[2,{index:e.index?{array:e.index.array}:void 0,attributes:Object.entries(e.attributes).map(function(e){var r=q(e,2),n=r[0],i=r[1];return{name:n,itemSize:i.itemSize,array:i.array}})}];n.label=5;case 5:return[2,null]}})})())];case 1:return(r=a.sent())&&(n=e.geometry.data,r.index&&(n.index={array:r.index.array,itemSize:1,normalized:!1,type:"Uint32Array"}),i={},r.attributes.forEach(function(e){var r=e.name,n=e.array,a=e.itemSize;i[r]={array:n,itemSize:a,type:"Float32Array",normalized:!1}}),n.attributes=i,n.draco=void 0),[2]}})},o=e[Symbol.iterator](),u.label=2;case 2:if(r=(s=o.next()).done)return[3,5];return[5,function(e){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&e[r],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}(a())];case 3:u.sent(),u.label=4;case 4:return r=!0,[3,2];case 5:return[3,8];case 6:return l=u.sent(),n=!0,i=l,[3,8];case 7:try{r||null==o.return||o.return()}finally{if(n)throw i}return[7];case 8:return[2]}})})()}function e3(e){var r,n=this._clip.duration,i=null!=(r=this._clip.start)?r:0,a=this.loop,o=this.time+e,s=this._loopCount,l=a===P.Cb;if(0===e)return -1===s||!l||1&~s?o:n-(o-i);if(a===P.Ab){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(o>=n)o=n;else{if(!(o<0)){this.time=o;break e}o=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=o,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===s&&(e>=0?(s=0,this._setEndings(!0,0===this.repetitions,l)):this._setEndings(0===this.repetitions,!0,l)),o>=n||o<i){var u=Math.floor((o-i)/(n-i));o-=(n-i)*u,s+=Math.abs(u);var c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,l||(o=e>0?n:i,1===this.repetitions&&(o=n)),this.time=o,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===c){var h=e<0;this._setEndings(h,!h,l)}else this._setEndings(!1,!1,l);this._loopCount=s,this.time=o,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u})}}else this.time=o;if(l&&!(1&~s))return n-(o-i)}return o}var e5=!1,e4=function(){function e(r,n,i,a){var o=this;R(this,e),this.scene=r,this.requestRender=n,this.updateDisplayProgress=i,this.animationInspectorState=a,this.clipIdToAction={},this.activeClip=null,this.needsUpdate=!1,this.addClip=function(e){"Empty"===e.data.type&&Array.isArray(e.data.animations)&&e.data.animations.forEach(function(r,n){var i=r[0]+"/";if(Array.isArray(e.identity)?i+=e.identity[0]:i+=e.uuid,!o.clipIdToAction[i]){var a=P.oe.parse(JSON.parse(r[2]));e.animations[n]=a;var s=o.mixer.clipAction(a,e);!1===e5&&(Object.getPrototypeOf(s)._updateTime=e3,e5=!0),s.clampWhenFinished=!0,o.clipIdToAction[i]=s}})},this.mixer=new P.Ke(r),this.scene.traverseEntity(this.addClip)}return z(e,[{key:"rebindClips",value:function(){this.mixer.stopAllAction(),this.mixer=new P.Ke(this.scene),this.clipIdToAction={},this.activeClip=null,this.scene.traverseEntity(this.addClip)}},{key:"deleteClip",value:function(e,r){var n=this.scene.find(r);if(n){var i=n.animations.find(function(r){return r.uuid===e});if(i){var a=this.clipIdToAction[e];a&&(a.stop(),this.mixer.uncacheClip(i),delete this.clipIdToAction[e],n.animations=n.animations.filter(function(r){return r.uuid!==e}))}}}},{key:"isPlaying",get:function(){return Object.values(this.clipIdToAction).some(function(e){return e.isRunning()})}},{key:"playFromInspector",value:function(e){this.mixer.stopAllAction();var r=this.clipIdToAction[e];r&&(r.play(),this.activeClip=r.getClip(),this.scene.markShadowsDirty(),this.requestRender())}},{key:"onExitPlayMode",value:function(){Object.values(this.clipIdToAction).forEach(function(e){e.repetitions=1/0,e.loop=P.Bb}),this.mixer.stopAllAction(),this.scene.markShadowsDirty(),this.requestRender()}},{key:"play",value:function(e){var r=e.clipId+"/"+e.object,n=this.clipIdToAction[r];if(n)return n.repetitions=e.repeat>=0?e.repeat+1:1/0,n.loop="pingpong"!==e.direction&&"pingpong-rewind"!==e.direction||0===e.repeat?P.Bb:P.Cb,n.play(),n.paused=!1,this.requestRender(),n}},{key:"resumeFromInspector",value:function(e){var r=this.clipIdToAction[e];r&&(r.play(),r.paused=!1,this.scene.markShadowsDirty(),this.requestRender())}},{key:"pauseFromInspector",value:function(e){var r=this.clipIdToAction[e];r&&(r.paused=!0)}},{key:"stop",value:function(){this.mixer.stopAllAction(),this.scene.markShadowsDirty(),this.requestRender()}},{key:"update",value:function(e){var r;if(this.needsUpdate)this.needsUpdate=!1;else if(!1===this.isPlaying||(null==(r=this.animationInspectorState)?void 0:r.isScrubbing))return;this.mixer.update(e/1e3),this.activeClip&&this.updateDisplayProgress(Math.round(this.mixer.time/this.activeClip.duration*(this.maxFrames-1)%(this.maxFrames-1))),this.requestRender()}},{key:"maxFrames",get:function(){var e;return(0,o.a)(null!=(e=this.activeClip)?e:void 0)}},{key:"setProgressFromInspector",value:function(e,r){if(this.clipIdToAction[r]){this.activeClip!==this.clipIdToAction[r].getClip()&&this.playFromInspector(r);var n=this.clipIdToAction[r].paused;this.clipIdToAction[r].paused=!1,this.mixer.setTime(Math.min(e/(this.maxFrames-1),.9999)*this.activeClip.duration),this.scene.markShadowsDirty(),this.requestRender(),n&&(this.clipIdToAction[r].paused=!0)}}}]),e}(),e6={bloom:function(){return Promise.all([n.e("3182"),n.e("5215")]).then(n.bind(n,8978))},chromaticAberration:function(){return Promise.all([n.e("3182"),n.e("3142")]).then(n.bind(n,3893))},vignette:function(){return Promise.all([n.e("3182"),n.e("7016")]).then(n.bind(n,2651))},noise:function(){return Promise.all([n.e("3182"),n.e("336")]).then(n.bind(n,2419))},hueSaturation:function(){return Promise.all([n.e("3182"),n.e("7943")]).then(n.bind(n,5946))},brightnessContrast:function(){return Promise.all([n.e("3182"),n.e("8756")]).then(n.bind(n,1164))},depthOfField:function(){return Promise.all([n.e("3182"),n.e("9899")]).then(n.bind(n,6518))},pixelation:function(){return Promise.all([n.e("3182"),n.e("1951")]).then(n.bind(n,9570))}},e8={bloom:function(){return Promise.all([n.e("1581"),n.e("7214")]).then(n.bind(n,4029))},depthOfField:function(){return Promise.all([n.e("1581"),n.e("4565")]).then(n.bind(n,244))}};function e9(e,r,n){return Promise.all(e.map(function(e){var i;return null==(i=r[e])?void 0:i.call(r).catch(function(r){console.warn("[spline] Failed to load the ".concat(e," postprocessing effect (").concat(n,"); the effect will be skipped."),r)})})).then(function(){})}var e7=(0,E.b)(Q(),1);function te(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!V(e,DataView)}function tt(e){var r;return{id:e.uuid,name:e.name,type:null!=(r=e.type)?r:"Object",visible:e.visible,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x*P.Cc.RAD2DEG,y:e.rotation.y*P.Cc.RAD2DEG,z:e.rotation.z*P.Cc.RAD2DEG},scale:{x:e.scale.x,y:e.scale.y,z:e.scale.z}}}function tr(e,r,n){var i=function(r){var n;return null!=(n=e.findObjectById(r))?n:e.findObjectByName(r)},a=new Map,o=function(e){var r=a.get(e);if(r)return r;var n=!0,i=!1,o=void 0;try{for(var s,l=a.values()[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=s.value;if(u.name===e)return u}}catch(e){i=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(i)throw o}}};return{setVariable:function(r,n){return r in e.getVariables()?(e.setVariable(r,n),{ok:!0}):{ok:!1,warning:'spline.setVariable: no variable named "'.concat(r,'" in this scene.')}},getVariable:function(r){return e.getVariable(r)},getVariables:function(){return e.getVariables()},getAllObjects:function(){return e.getAllObjects().map(tt)},findObject:function(e){var r=i(e);return r?tt(r):void 0},getGeometry:function(e,r){if(!n)return{warning:"spline.getGeometry: not available in this runtime integration."};var a=o(e),s=a?a.object:(l=i(e))?n.findEntity(l.uuid):void 0;if(!s)return{warning:'spline.getGeometry: no object named "'.concat(e,'" (names/ids come from getAllObjects).')};var l,u,c,h,d,f,p=null!=a?a:s;"world"===r.space&&(null==(u=p.updateWorldMatrix)||u.call(p,!0,!1),f=null==(c=p.matrixWorld)?void 0:c.elements);var v=function(e,r){var n=null==e?void 0:e.getAttribute("position");if(!n||!n.count)return null;for(var i=n.count,a=null!=r?r:null,o=null!=(b=null==(w=e.getIndex)?void 0:w.call(e))?b:null,s=Math.floor((o?o.count:i)/3),l=1/0,u=1/0,c=1/0,h=-1/0,d=-1/0,f=-1/0,p=new Float32Array(3*i),v=0;v<i;v++){var y,m,g,b,w,x,S=n.getX(v),k=n.getY(v),M=n.getZ(v);a&&(S=(x=q((y=S,m=k,g=M,[a[0]*y+a[4]*m+a[8]*g+a[12],a[1]*y+a[5]*m+a[9]*g+a[13],a[2]*y+a[6]*m+a[10]*g+a[14]]),3))[0],k=x[1],M=x[2]),S<l&&(l=S),k<u&&(u=k),M<c&&(c=M),S>h&&(h=S),k>d&&(d=k),M>f&&(f=M),p[3*v]=S,p[3*v+1]=k,p[3*v+2]=M}var A={space:a?"world":"local",vertexCount:i,triangleCount:s,indexed:null!==o,bounds:{min:[l,u,c],max:[h,d,f],size:[h-l,d-u,f-c]},vertices:p};if(o){for(var O=new Uint32Array(o.count),C=0;C<o.count;C++)O[C]=o.getX(C);A.indices=O}var _=e.getAttribute("normal");if(_&&_.count===i){var P=a?function(e){var r=e[0],n=e[4],i=e[8],a=e[1],o=e[5],s=e[9],l=e[2],u=e[6],c=e[10],h=r*(o*c-s*u)-n*(a*c-s*l)+i*(a*u-o*l);if(!isFinite(h)||1e-12>Math.abs(h))return null;var d=1/h,f=[(o*c-s*u)*d,(i*u-n*c)*d,(n*s-i*o)*d,(s*l-a*c)*d,(r*c-i*l)*d,(i*a-r*s)*d,(a*u-o*l)*d,(n*l-r*u)*d,(r*o-n*a)*d];return[f[0],f[3],f[6],f[1],f[4],f[7],f[2],f[5],f[8]]}(a):void 0;if(!a||P){for(var E=new Float32Array(3*i),D=0;D<i;D++){var j=_.getX(D),T=_.getY(D),I=_.getZ(D);if(P){var R=P[0]*j+P[1]*T+P[2]*I,B=P[3]*j+P[4]*T+P[5]*I,z=P[6]*j+P[7]*T+P[8]*I,L=Math.hypot(R,B,z);L>1e-12?(j=R/L,T=B/L,I=z/L):(j=R,T=B,I=z)}E[3*D]=j,E[3*D+1]=T,E[3*D+2]=I}A.normals=E}}var F=e.getAttribute("uv");if(F&&F.count===i){for(var U=new Float32Array(2*i),V=0;V<i;V++)U[2*V]=F.getX(V),U[2*V+1]=F.getY(V);A.uvs=U}return A}(s.geometry,f);return v?{data:N({id:p.uuid,name:p.name,geometry:null==(d=s.data)||null==(h=d.geometry)?void 0:h.type},v)}:{warning:'spline.getGeometry: "'.concat(p.name,"\" has no readable geometry — only meshes do (lights, cameras and groups have none; read a group's child meshes instead).")}},updateObject:function(r,a){var s=o(r);if(s){var l=a.position,u=a.rotation,c=a.scale,h=a.visible;return l&&("number"==typeof l.x&&(s.position.x=l.x),"number"==typeof l.y&&(s.position.y=l.y),"number"==typeof l.z&&(s.position.z=l.z)),u&&("number"==typeof u.x&&(s.rotation.x=u.x*P.Cc.DEG2RAD),"number"==typeof u.y&&(s.rotation.y=u.y*P.Cc.DEG2RAD),"number"==typeof u.z&&(s.rotation.z=u.z*P.Cc.DEG2RAD)),c&&("number"==typeof c.x&&(s.scale.x=c.x),"number"==typeof c.y&&(s.scale.y=c.y),"number"==typeof c.z&&(s.scale.z=c.z)),"boolean"==typeof h&&(s.playModeVisible=h),s.updateMatrix(),e.requestRender(),!0}var d=i(r);if(!d)return!1;var f=a.position,p=a.rotation,v=a.scale,y=a.visible,m=a.geometry,g=a.material;if(m&&"object"==(void 0===m?"undefined":X(m))&&n){var b=n.findEntity(d.uuid);if(b){var w=m.vertices,x=m.normals,S=m.uvs,k=m.indices,M=W(m,["vertices","normals","uvs","indices"]);te(w)&&n.shared.updateEntityGeometryVertices(b,{vertices:w,normals:te(x)?x:void 0,uvs:te(S)?S:void 0,indices:te(k)?k:void 0}),Object.keys(M).length>0&&n.shared.updateEntityGeometryParams(b,M)}}if(g&&"object"==(void 0===g?"undefined":X(g))&&n){var A=n.findEntity(d.uuid);A&&n.shared.updateEntityMaterialParams(A,g)}return f&&("number"==typeof f.x&&(d.position.x=f.x),"number"==typeof f.y&&(d.position.y=f.y),"number"==typeof f.z&&(d.position.z=f.z)),p&&("number"==typeof p.x&&(d.rotation.x=p.x*P.Cc.DEG2RAD),"number"==typeof p.y&&(d.rotation.y=p.y*P.Cc.DEG2RAD),"number"==typeof p.z&&(d.rotation.z=p.z*P.Cc.DEG2RAD)),v&&("number"==typeof v.x&&(d.scale.x=v.x),"number"==typeof v.y&&(d.scale.y=v.y),"number"==typeof v.z&&(d.scale.z=v.z)),"boolean"==typeof y&&(d.visible=y),e.requestRender(),!0},createObject:function(r,n){return T(function(){return J(this,function(i){switch(i.label){case 0:return[4,e.createObject(r,n)];case 1:return[2,tt.apply(void 0,[i.sent()])]}})})()},createCustomMaterial:function(r){return e.createCustomMaterial(r)},getTexture:function(e,r){if(!n)return null;var a=i(e),o=a?n.findEntity(a.uuid):void 0;if(!o)return null;var s=n.shared.getEntityTexture(o,null!=r?r:{});return s?{texture:s.texture,width:s.width,height:s.height,layer:s.layerType}:null},setMaterial:function(r,n){return e.setMaterial(r,n)},cloneObject:function(r,n){return tt(e.cloneObject(r,n))},removeObject:function(r){return e.removeObject(r)},spawnObject:function(r,o){if(!n)return{warning:"spline.spawnObject: not available in this runtime integration."};var s,l,u=i(r),c=u?n.findEntity(u.uuid):void 0;if(!c)return{warning:'spline.spawnObject: no object named "'.concat(r,'" to use as a template.')};if(a.size>=500)return{warning:"spline.spawnObject: spawn budget reached (500 live copies) — destroyObject old copies (or reuse them) instead of spawning more."};var h=n.shared.spawnRuntimeClone(c,null!=o?o:{});return h?(a.set(h.uuid,h),e.requestRender(),{object:{id:h.uuid,name:h.name,type:null!=(s=null==(l=h.object.data)?void 0:l.type)?s:h.object.type,visible:!1!==h.playModeVisible,position:{x:h.position.x,y:h.position.y,z:h.position.z},rotation:{x:h.rotation.x*P.Cc.RAD2DEG,y:h.rotation.y*P.Cc.RAD2DEG,z:h.rotation.z*P.Cc.RAD2DEG},scale:{x:h.scale.x,y:h.scale.y,z:h.scale.z},spawned:!0}}):{warning:'spline.spawnObject: "'.concat(r,'" cannot be spawned from.')}},destroyObject:function(r){var i=o(r);return!(!n||!i||(a.delete(i.uuid),n.shared.destroyRuntimeClone(i),e.requestRender(),0))},setInstanceTransforms:function(r,a){if(!n)return -1;var o=i(r),s=o?n.findEntity(o.uuid):void 0;if(!s)return -1;var l=n.shared.setEntityInstanceTransforms(s,a);return l>=0&&e.requestRender(),l},emitEvent:function(e,r,n){var a=i(r);return a?(n?a.emitEventReverse(e):a.emitEvent(e),{ok:!0}):{ok:!1,warning:'spline.emitEvent: no object named "'.concat(r,'".')}},requestRender:function(){return e.requestRender()},addSplineEventListener:function(r,n){var i=function(e){var r,i,a,o;n({target:{id:null!=(r=null==(a=e.target)?void 0:a.id)?r:"",name:null!=(i=null==(o=e.target)?void 0:o.name)?i:""}})};return e.addEventListener(r,i),function(){return e.removeEventListener(r,i)}},getCanvas:function(){return r}}}var tn=function(){function e(r,n,i){R(this,e),this.iframe=r,this.bridge=n,this.observer=i}return z(e,[{key:"dispose",value:function(){this.bridge.dispose(),this.observer.disconnect(),this.iframe.remove()}}],[{key:"mount",value:function(e,r,n,i){if(("u"<typeof document?"undefined":X(document))>"u")return null;var a=r.parentElement;if(!a)return null;"static"===getComputedStyle(a).position&&(a.style.position="relative");var o=document.createElement("iframe");o.setAttribute("sandbox","allow-scripts allow-forms allow-pointer-lock"),o.title="Spline HTML content";var s=o.style;s.position="absolute",s.border="0",s.background="transparent",s.pointerEvents="auto",s.colorScheme="normal";var l=function(){s.left="".concat(r.offsetLeft,"px"),s.top="".concat(r.offsetTop,"px"),s.width="".concat(r.offsetWidth,"px"),s.height="".concat(r.offsetHeight,"px")};l();var u=new ResizeObserver(l);u.observe(r),u.observe(a),o.srcdoc=function(e){var r="<script>".concat(eI,"<\/script>"),n=/<head(\s[^>]*)?>/i.exec(e);if(n){var i=n.index+n[0].length;return e.slice(0,i)+r+e.slice(i)}var a=/<html(\s[^>]*)?>/i.exec(e);if(a){var o=a.index+a[0].length;return e.slice(0,o)+"<head>".concat(r,"</head>")+e.slice(o)}return r+e}(n),a.insertBefore(o,r.nextSibling);var c=new eB(o,tr(e,r,i),function(e,r){"warn"===e?console.warn("[spline html] ".concat(r)):"error"===e&&console.error("[spline html] ".concat(r))});return c.attach(),new tn(o,c,u)}}]),e}(),ti="data-spline-html-content",ta="\n[".concat(ti,"] { pointer-events: none; }\n[").concat(ti,"] > * { pointer-events: auto; }\n[").concat(ti,"] [data-spline-passthrough] { pointer-events: none; }\n"),to=function(){function e(r,n,i,a,o,s){R(this,e),this.container=r,this.host=n,this.observer=i,this.spline=a,this.previousSplineGlobal=o,this.removeLateLifecycleShim=s}return z(e,[{key:"dispose",value:function(){this.removeLateLifecycleShim(),this.host.dispose(),this.observer.disconnect(),this.container.remove(),window.spline===this.spline&&(window.spline=this.previousSplineGlobal)}}],[{key:"mount",value:function(e,r,n,i){if(("u"<typeof document?"undefined":X(document))>"u")return null;var a=r.parentElement;if(!a)return null;"static"===getComputedStyle(a).position&&(a.style.position="relative");var o=document.createElement("div");o.setAttribute(ti,"");var s=o.style;s.position="absolute",s.overflow="hidden";var l=function(){s.left="".concat(r.offsetLeft,"px"),s.top="".concat(r.offsetTop,"px"),s.width="".concat(r.offsetWidth,"px"),s.height="".concat(r.offsetHeight,"px")};l();var u=new ResizeObserver(l);u.observe(r),u.observe(a);var c=document.createElement("style");c.textContent=ta,o.appendChild(c);var h=(new DOMParser).parseFromString(n,"text/html"),d=Array.from(h.querySelectorAll("script")),f=!0,p=!1,v=void 0;try{for(var y,m=d[Symbol.iterator]();!(f=(y=m.next()).done);f=!0)y.value.remove()}catch(e){p=!0,v=e}finally{try{f||null==m.return||m.return()}finally{if(p)throw v}}var g=!0,b=!1,w=void 0;try{for(var x,S=Array.from(h.head.children)[Symbol.iterator]();!(g=(x=S.next()).done);g=!0){var k=x.value;("STYLE"===k.tagName||"LINK"===k.tagName&&"stylesheet"===k.rel)&&o.appendChild(k)}}catch(e){b=!0,w=e}finally{try{g||null==S.return||S.return()}finally{if(b)throw w}}for(;h.body.firstChild;)o.appendChild(h.body.firstChild);a.insertBefore(o,r.nextSibling);var M=new Map,A=new eR(tr(e,r,i),function(e,r){"warn"===e?console.warn("[spline html] ".concat(r)):"error"===e&&console.error("[spline html] ".concat(r))},function(e,r){var n=M.get(e),i=!0,a=!1,o=void 0;if(n)try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;try{u(r)}catch(e){console.error(e)}}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}),O=function(e,r){try{return Promise.resolve(A.execute(e,r))}catch(e){return Promise.reject(e)}},C={ready:Promise.resolve(),setVariable:function(e,r){return O("setVariable",[e,r])},setVariables:function(e){return O("setVariables",[e])},getVariable:function(e){return O("getVariable",[e])},getVariables:function(){return O("getVariables",[])},getAllObjects:function(){return O("getAllObjects",[])},findObjectByName:function(e){return O("findObjectByName",[e])},findObjectById:function(e){return O("findObjectById",[e])},getGeometry:function(e,r){return O("getGeometry",[e,null!=r?r:{}])},updateObject:function(e,r){return O("updateObject",[e,r])},createObject:function(e,r){return O("createObject",[e,null!=r?r:{}])},createCustomMaterial:function(e){return O("createCustomMaterial",[e])},getTexture:function(e,r){return O("getTexture",[e,null!=r?r:{}])},setMaterial:function(e,r){return O("setMaterial",[e,r])},cloneObject:function(e,r){return O("cloneObject",[e,null!=r?r:{}])},removeObject:function(e){return O("removeObject",[e])},spawnObject:function(e,r){return O("spawnObject",[e,null!=r?r:{}])},destroyObject:function(e){return O("destroyObject",[e])},setInstanceTransforms:function(e,r){return O("setInstanceTransforms",[e,null!=r?r:null])},emitEvent:function(e,r){return O("emitEvent",[e,r])},emitEventReverse:function(e,r){return O("emitEventReverse",[e,r])},requestRender:function(){return O("requestRender",[])},addEventListener:function(e,r){if("function"==typeof r){var n=M.get(e);n||(n=new Set,M.set(e,n),O("listenEvent",[e])),n.add(r)}},removeEventListener:function(e,r){var n=M.get(e);n&&(n.delete(r),0===n.size&&(M.delete(e),O("unlistenEvent",[e])))}},_=window.spline;window.spline=C;var P=function(){if(("u"<typeof document?"undefined":X(document))>"u"||"loading"===document.readyState)return function(){};var e=[],r=function(r,n){var i=new Set,a=r.addEventListener.bind(r),o=r.removeEventListener.bind(r);Object.defineProperty(r,"addEventListener",{configurable:!0,writable:!0,value:function(e,o,s){if(a(e,o,s),n.includes(e)&&null!=o){var l={type:e,listener:o};i.add(l),queueMicrotask(function(){i.delete(l)&&function(e,r,n){var i,a=new Event(n);try{"function"==typeof r?r.call(e,a):null==(i=r.handleEvent)||i.call(r,a)}catch(e){console.error(e)}}(r,l.listener,l.type)})}}}),Object.defineProperty(r,"removeEventListener",{configurable:!0,writable:!0,value:function(e,r,n){o(e,r,n);var a=!0,s=!1,l=void 0;try{for(var u,c=i[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var h=u.value;h.type===e&&h.listener===r&&i.delete(h)}}catch(e){s=!0,l=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}}}),e.push(function(){delete r.addEventListener,delete r.removeEventListener,i.clear()})};r(document,["DOMContentLoaded"]),r(window,["load"]);var n=Object.getOwnPropertyDescriptor(window,"onload");return Object.defineProperty(window,"onload",{configurable:!0,get:function(){return null},set:function(e){"function"==typeof e&&queueMicrotask(function(){try{e.call(window,new Event("load"))}catch(e){console.error(e)}})}}),e.push(function(){n?Object.defineProperty(window,"onload",n):delete window.onload}),function(){var r=!0,n=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done);r=!0)(0,a.value)()}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}}(),E=!0,D=!1,j=void 0;try{for(var T,I=d[Symbol.iterator]();!(E=(T=I.next()).done);E=!0){var R=T.value,B=document.createElement("script"),z=!0,L=!1,F=void 0;try{for(var U,V=Array.from(R.attributes)[Symbol.iterator]();!(z=(U=V.next()).done);z=!0){var N=U.value;B.setAttribute(N.name,N.value)}}catch(e){L=!0,F=e}finally{try{z||null==V.return||V.return()}finally{if(L)throw F}}R.src?B.async=!1:B.textContent=R.textContent,o.appendChild(B)}}catch(e){D=!0,j=e}finally{try{E||null==I.return||I.return()}finally{if(D)throw j}}return new to(o,A,u,C,_,P)}}]),e}();function ts(e){return"object"==(void 0===e?"undefined":X(e))&&null!==e&&!0===e.isMaterial}function tl(e){if("function"==typeof e.material)throw Error("createObject: a (three) => material factory must be resolved to a material instance before object creation — this entry point does not support it.");if(!ts(e.material))return{options:e};var r=e.material;if(!0===r.isNodeMaterial){var n,i=null==(n=(0,w.V)())?void 0:n.NodeMaterial;if(void 0!==i&&V(r,i))return{options:G(N({},e),{material:void 0}),material:r};throw Error("createObject: this TSL NodeMaterial comes from your own three/webgpu module instance, which cannot compile in the runtime's bundled three. Build it with app.createCustomMaterial((three) => …) instead, or use a built-in material (MeshStandardMaterial, MeshBasicMaterial, …).")}if(!0===r.isShaderMaterial)throw Error("createObject: a GLSL ShaderMaterial cannot compile on the WebGPU backend — port the shader to TSL with app.createCustomMaterial((three) => …), or use a built-in material (MeshStandardMaterial, …).");return{options:G(N({},e),{material:void 0}),material:r}}var tu=new Set(["name","parent","position","rotation","scale","visible","castShadow","receiveShadow","color","material"]),tc="'Cube', 'Sphere', 'Plane', 'Rectangle', 'Ellipse', 'Triangle', 'Polygon', 'Star', 'Cone', 'Cylinder', 'Pyramid', 'Torus', 'TorusKnot', 'Dodecahedron', 'Icosahedron', 'Helix', 'Backdrop', 'Lathe', 'Text', 'CustomMesh', 'Group', 'PointLight', 'SpotLight', 'DirectionalLight'",th={cube:"CubeGeometry",box:"CubeGeometry",sphere:"SphereGeometry",plane:"PlaneGeometry",rectangle:"RectangleGeometry",ellipse:"EllipseGeometry",circle:"EllipseGeometry",triangle:"TriangleGeometry",polygon:"PolygonGeometry",star:"StarGeometry",cone:"ConeGeometry",cylinder:"CylinderGeometry",pyramid:"PyramidGeometry",torus:"TorusGeometry",torusknot:"TorusKnotGeometry",dodecahedron:"DodecahedronGeometry",icosahedron:"IcosahedronGeometry",helix:"HelixGeometry",backdrop:"BackdropGeometry",lathe:"LatheGeometry",text:"TextGeometry",custommesh:"NonParametricGeometry",nonparametric:"NonParametricGeometry"},td={group:"Empty",empty:"Empty",pointlight:"PointLight",spotlight:"SpotLight",directionallight:"DirectionalLight"},tf={shapeblend:"Shape Blends are built from member meshes in the editor and cannot be created empty.",path:"Path shapes need authored path data — clone an existing one with cloneObject() instead.",vector:"Vector shapes need authored shape data — clone an existing one with cloneObject() instead.",shape:"Vector shapes need authored shape data — clone an existing one with cloneObject() instead.",boolean:"Boolean operations are not creatable at runtime — clone an existing Boolean object with cloneObject() instead.",decal:"Decals need a surface to project onto — clone an existing Decal with cloneObject() instead.",ui:"UI objects need a 2D frame — clone an existing one with cloneObject() instead.",input:"Text inputs are not creatable at runtime — clone an existing one with cloneObject() instead.",particle:"Particle emitters are not creatable at runtime — clone an existing one with cloneObject() instead.",particlecollider:"Particle forces are not creatable at runtime — clone an existing one with cloneObject() instead.",hair:"Hair systems are not creatable at runtime — clone an existing one with cloneObject() instead.",camera:"Cameras are not creatable at runtime.",perspectivecamera:"Cameras are not creatable at runtime.",orthographiccamera:"Cameras are not creatable at runtime.",hemispherelight:"Hemisphere lights are not creatable at runtime.",splat:"Splats are not creatable at runtime.",page:"Pages are not creatable at runtime.",component:"Components are authored in the editor.",instance:"Instances are authored in the editor — clone an existing one with cloneObject() instead.",bone:"Bones are not creatable at runtime.",mesh:"pass the shape name directly, e.g. createObject('Cube')."},tp={CubeGeometry:"Cube",SphereGeometry:"Sphere",PlaneGeometry:"Plane",RectangleGeometry:"Rectangle",EllipseGeometry:"Ellipse",TriangleGeometry:"Triangle",PolygonGeometry:"Pentagon",StarGeometry:"Star",ConeGeometry:"Cone",CylinderGeometry:"Cylinder",PyramidGeometry:"Pyramid",TorusGeometry:"Torus",TorusKnotGeometry:"Torus Knot",DodecahedronGeometry:"Dodecahedron",IcosahedronGeometry:"Icosahedron",HelixGeometry:"Helix",BackdropGeometry:"Backdrop",LatheGeometry:"Lathe",TextGeometry:"Text",NonParametricGeometry:"Custom Mesh"},tv={Empty:"Group",PointLight:"Point Light",SpotLight:"Spot Light",DirectionalLight:"Directional Light"};function ty(e,r){var n,i,a,o,s,l;return void 0===e?[r[0],r[1],r[2]]:Array.isArray(e)?[null!=(n=e[0])?n:r[0],null!=(i=e[1])?i:r[1],null!=(a=e[2])?a:r[2]]:[null!=(o=e.x)?o:r[0],null!=(s=e.y)?s:r[1],null!=(l=e.z)?l:r[2]]}function tm(e){return"number"==typeof e?[e,e,e]:ty(e,[1,1,1])}function tg(e){var r=new w.i(0,0,0,1);return r.setStyle(e),{r:r.r,g:r.g,b:r.b}}function tb(e,r){var n=null!=(u=e.material)?u:void 0!==e.color?{color:e.color}:void 0;if(void 0===n)return C.ea.defaultColorMaterial(tw(C.x),"physical","layer1","layer2");if("string"==typeof n){var i,a,o=!0,s=!1,l=void 0;try{for(var u,c,h=Object.entries(r.shared.materials)[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=q(c.value,2),f=d[0],p=d[1];if(f===n||p.name===n)return f}}catch(e){s=!0,l=e}finally{try{o||null==h.return||h.return()}finally{if(s)throw l}}if(i=n.trim().toLowerCase(),/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(i)||/^(rgb|hsl)a?\(/.test(i)||void 0!==P.Tc.NAMES[i])return C.ea.defaultColorMaterial(tg(n),"physical","layer1","layer2");throw Error("createObject: material '".concat(n,"' matches no shared material in this document (available: ").concat((a=Object.entries(r.shared.materials).map(function(e){var r=q(e,2)[1];return"'".concat(r.name,"'")}).filter(function(e){return"'undefined'"!==e})).length?a.join(", "):"(none)",") and is not a valid CSS color."))}if("function"==typeof n)throw Error("createObject: a (three) => material factory must be resolved to a material instance before object creation — this entry point does not support it.");if(ts(n))throw Error("createObject: a three.js material instance cannot be stored in the document — this entry point does not support it.");var v=void 0!==n.color?tg(n.color):tw(C.x),y=C.ea.defaultColorMaterial(v,"physical","layer1","layer2"),m=y.layers.find(function(e){return"light"===e.data.type});if(m){var g={};void 0!==n.roughness&&(g.roughness=n.roughness),void 0!==n.metalness&&(g.metalness=n.metalness),void 0!==n.reflectivity&&(g.reflectivity=n.reflectivity),Object.assign(m.data,g)}if(void 0!==n.alpha){var b=y.layers.find(function(e){return"color"===e.data.type});b&&Object.assign(b.data,{alpha:n.alpha})}return y}function tw(e){return{r:(e>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255}}function tx(e){return Array.isArray(e)?e:!ArrayBuffer.isView(e)||V(e,DataView)?null:Array.from(e)}function tS(e,r){var n=new Set;if(r.traverse(function(e,r){var i;n.add(null!=(i=r.name)?i:"")}),!n.has(e))return e;for(var i=2;n.has("".concat(e," ").concat(i));)i++;return"".concat(e," ").concat(i)}function tk(e){return"texture"===e.type||"video"===e.type||"matcap"===e.type?G(N({},e.data),{updateTexture:function(r){return e.color.texture.image.updateSrc(r)}}):N({},e.data)}var tM=new w.i(0,0,0,1),tA={color:["color"],cavity:[],dust:["color"],fresnel:["color"],normal:[],gradient:["colors"],depth:["colors"],texture:[],video:[],noise:["colorA","colorB","colorC","colorD"],toon:["colors","shadowColor"],outline:["outlineColor","contourColor"],transmission:["attenuationColor"],reflection:[],matcap:[],pattern:["colorA","colorB"],vertexColor:[],light:[],displace:[],rainbow:[],particle:[]},tO=new P.Dc;function tC(e){var r=new w.i(0,0,0,1);try{r.setStyle(e)}catch(e){console.error(e)}return r}var t_=function(){function e(r){var i=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.renderOnDemand,s=a.renderMode,l=a.wasmPath,u=a.renderer,c=a.htmlContentMode;if(R(this,e),this._rendererBackend="webgl",this._rendererAuto=!1,this._rendererConfigured=!1,this._viewportMode=1,this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._proxyObjectCache=new Map,this._htmlContentMode="sandbox",this._variablesCache=new Map,this._isPaused=!1,this._renderRequested=!1,this._skipRender=!1,this.time=performance.now(),this.dt=0,this.currentTAAFrame=0,this.disposed=!1,this._requestRenderAutoMode=function(){i._skipRender=!1},this.requestRender=function(){i._renderRequested=!0},this.render=function(e){var r,n,a;if(i.time=e,i._lastTime&&(i.dt=i.time-i._lastTime),i._lastTime=i.time,null==(r=i._perfs)||r.start(),i._renderer)if(i._isPaused||!("manual"===i.renderMode&&!i._renderRequested||"auto"===i.renderMode&&i._skipRender)){if(i._renderRequested=!1,i._skipRender=!0,i._controls&&(i._skipRender=null!=(o=i._controls.update(i.dt))&&o),i._eventManager&&((null==(l=i._eventManager.handlers)||null==(s=l.Start)?void 0:s.hasVideoAction)||(null==(c=i._eventManager.handlers)||null==(u=c.Basic)?void 0:u.hasVideoAction)||(null==(d=i._eventManager.handlers)||null==(h=d.Conditional)?void 0:h.hasVideoAction))&&(i._skipRender=!1),null==(f=i._animationControls)||f.update(i.dt),i._skipRender?(i.currentTAAFrame++,i.currentTAAFrame<w.f?i._skipRender=!1:i.currentTAAFrame=0):i.currentTAAFrame=0,null==(p=i._scene)||p.traverseVisibleEntity(function(e){var r;"ParticleSystem"===e.type&&(e.update(i.dt),i._skipRender=!1),(0,A.b)(e)&&(!0!==(null==(r=i._renderer)?void 0:r.isWebGPUSplineRenderer)&&e.warnClassicFallbackOnce(),e.isSimulating&&(e.update(i.dt),i._skipRender=!1))}),i._scene&&i._scene.activeCamera!==i._camera&&(i._camera=i._scene.activeCamera),(null==(v=i._eventManager)?void 0:v.isEnabled)&&(null==(m=i._eventManager.handlers)||null==(y=m.Follow)||y.onAnimationFrameDamping(),null==(b=i._eventManager.handlers)||null==(g=b.LookAt)||g.onAnimationFrameDamping(),null==(S=i._eventManager.handlers)||null==(x=S.DragDrop)||x.onAnimationFrameDamping()),i._scene&&i._camera){if(i._scene.pathConstraints.applyConstraints(i._scene),i._renderer.sceneTransitionTimeRemaining>0){i._renderer.sceneTransitionTimeRemaining-=i.dt;var o,s,l,u,c,h,d,f,p,v,y,m,g,b,x,S,k,M=Math.min(1,1-i._renderer.sceneTransitionTimeRemaining/i._renderer.sceneTransitionDuration);i._renderer.pipeline.sceneTransitionPass.uniforms.mixRatio.value=M,i._skipRender=!1}else i._renderer.pipeline.sceneTransitionFromTexture=null;i._renderer.renderSplineScene(i._scene,i._camera),!0===i._renderer.lastFrameIncomplete&&(i._skipRender=!1),!0===i._renderer.skyAnimationActive&&(i._skipRender=!1)}i.canvas.dispatchEvent(i._renderedEvent),null==(k=i._perfs)||k.end()}else null==(n=i._perfs)||n.end();else null==(a=i._perfs)||a.end()},this._resize=function(e){if(i._renderer){if(1===i._viewportMode&&i._frameView&&(i._frameView.frameSize=tO.set(i._viewportWidth,i._viewportHeight)),e){var r,n,a,o,s,l,u,c,h,d,f,p,v=i._viewportWidth,y=i._viewportHeight;i._renderer.setSize(v-1,y-1,!1),i._renderer.setSize(v,y,!1)}else i._renderer.setSize(i._viewportWidth,i._viewportHeight,!1);i._camera=null==(o=i._scene)?void 0:o.activeCamera,null==(d=i._scene)||d.updateViewPlaneSize(null!=(r=null==(l=i._frameView)||null==(s=l.frameSize)?void 0:s.x)?r:i._viewportWidth,null!=(n=null==(c=i._frameView)||null==(u=c.frameSize)?void 0:u.y)?n:i._viewportHeight,null!=(a=null==(h=i._frameView)?void 0:h.enableResponsive)&&a),i._camera&&(null==(f=i._frameView)||f.setCamera(i._camera),null==(p=i._frameView)||p.updateCamera(),"PerspectiveCamera"===i._camera.cameraType&&(i._camera.aspect=i._viewportWidth/i._viewportHeight),i._camera.updateProjectionMatrix()),i.eventManager&&(i.eventManager.eventContext.domRect=i.canvas.getBoundingClientRect()),i._requestRenderAutoMode()}},this._debouncedResize=(0,M.a)(this._resize,10),this._onScroll=function(e){i.eventManager&&(i.eventManager.eventContext.domRect=i.canvas.getBoundingClientRect())},this.canvas=r,this._htmlContentMode=void 0===c?"sandbox":c,this.renderMode=o||void 0===s?"auto":s,void 0!==l&&(this._wasmPath=(0,M.h)(l,"/")),this._rendererBackend=null!=u?u:"webgl",void 0===u){var h=null;try{h=new URLSearchParams(window.location.search).get("renderer")}catch(e){}"webgpu"===h||"webgl"===h||"webgl2"===h?this._rendererBackend="webgl2"===h?"webgl":h:(this._rendererAuto=!0,this._rendererBackend=("u"<typeof navigator?"undefined":X(navigator))<"u"&&"gpu"in navigator?"webgpu":"webgl")}this._renderedEvent=new CustomEvent("rendered",{bubbles:!0}),Object.defineProperty(this._renderedEvent,"target",{writable:!1,value:this}),window.location.search.includes("perfs")&&n.e("3571").then(n.bind(n,4878)).then(function(e){i._perfs=new e.Perfs({x:10,y:10})}),(0,g.d)(r)}return z(e,[{key:"_createRenderer",value:function(){return T(function(){var e,r,i,a,o,s,l,u,c,h,d,f,p,v,y,m;return J(this,function(g){switch(g.label){case 0:if(e=this,!("webgpu"===this._rendererBackend&&this._rendererAuto))return[3,4];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,null==(r=navigator.gpu)?void 0:r.requestAdapter()];case 2:return g.sent()||(this._rendererBackend="webgl"),[3,4];case 3:return g.sent(),this._rendererBackend="webgl",[3,4];case 4:if("webgpu"!==this._rendererBackend)return[3,9];g.label=5;case 5:return g.trys.push([5,8,,9]),[4,Promise.all([n.e("2258"),n.e("1581"),n.e("1416"),n.e("4582"),n.e("9021")]).then(n.bind(n,3756))];case 6:s=(o=g.sent()).createWebGPUSplineRenderer,(0,o.isWebGPUSupported)(),l=!0,u=!1,c=!1!==(null==(a=this._data)||null==(i=a.scene.publish)?void 0:i.asyncShaderCompilation);try{d=(h=new URLSearchParams(window.location.search)).get("bundles"),"rerecord"===d?l="rerecord":("off"===d||"0"===d||"false"===d||"no"===d)&&(l=!1),u="1"===h.get("forcegl"),f=h.get("asynccomp"),"off"===f||"0"===f||"false"===f||"no"===f?c=!1:("on"===f||"1"===f||"true"===f||"always"===f)&&(c=!0)}catch(e){}return[4,s({canvas:this.canvas,antialias:!1,alpha:!0,powerPreference:"high-performance",sceneBundles:!u&&l,forceWebGL:u,asyncCompilation:!u&&c})];case 7:return[2,((p=g.sent()).onBackgroundWorkReady=function(){e._skipRender=!1,e._renderRequested=!0},p.skyAnimationAllowed=!0,p)];case 8:return console.error("[spline] Failed to initialize the WebGPU renderer, falling back to WebGL:",g.sent()),this._rendererBackend="webgl",[3,9];case 9:return[4,Promise.all([n.e("3182"),n.e("5704")]).then(n.bind(n,8283))];case 10:y=(v=g.sent()).SplineRenderer,m=v.rendererGlobals;try{"off"===new URLSearchParams(window.location.search).get("taa")&&(m.taaEnabled.value=!1)}catch(e){}return[2,new y({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"})]}})}).call(this)}},{key:"_failWebGPURequired",value:function(){console.error('[spline] This scene was exported for WebGPU only and this browser does not provide a WebGPU adapter. Re-export with renderer "Both" or "WebGL 2" to support this browser.');try{var e=window.devicePixelRatio||1,r=this.canvas.clientWidth||300,n=this.canvas.clientHeight||150;this.canvas.width=r*e,this.canvas.height=n*e;var i=this.canvas.getContext("2d");i&&(i.scale(e,e),i.fillStyle="rgba(127, 127, 127, 0.85)",i.font="13px system-ui, -apple-system, Segoe UI, Roboto, sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText("This scene requires a WebGPU-capable browser.",r/2,n/2))}catch(e){}this.canvas.dispatchEvent(new CustomEvent("splineerror",{bubbles:!0,detail:{reason:"webgpu-required"}}))}},{key:"load",value:function(e,r,n){return T(function(){var i;return J(this,function(a){switch(a.label){case 0:var o;return o="The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.",e.endsWith(".spline")?console.warn(o+" The .spline files are only meant to be used by the Editor."):e.endsWith(".splinecode")||console.warn(o),this.disposed=!1,[4,fetch(e,n)];case 1:return[4,a.sent().arrayBuffer()];case 2:return i=a.sent(),[4,this.start(i,{variables:r})];case 3:return a.sent(),[2]}})}).call(this)}},{key:"start",value:function(e){return T(function(e){var r,i,a,o,h,p,g,M,E,D,j,I,R,B,z,L,F,U,N,G,W,H,Z,K,Q,$,ee,et,er,en,ei,ea,eo,es,el=arguments;return J(this,function(eu){var ec,eh,ed,ef;switch(eu.label){case 0:if(r=this,o=void 0===(a=(i=el.length>1&&void 0!==el[1]?el[1]:{}).interactive)||a,h=i.variables,this.disposed)return[2];return c.a.init(),[4,T(function(){var r,i,a,o;return J(this,function(s){switch(s.label){case 0:if(a=(i=q((0,C.l)(C.o.deserialize(new Uint8Array(e))),2))[0],o=i[1],131===(null!=(r=a.schema)?r:0))return[3,2];return[4,n.e("8330").then(n.bind(n,7985))];case 1:(0,s.sent().updateDocumentSchema)(a),s.label=2;case 2:return[2,o.result().data]}})})()];case 1:return R=eu.sent(),this._data=R,ec=[],R.scene.objects.traverse(function(e,r){"Mesh"===r.type&&"NonParametricGeometry"===r.geometry.type&&void 0!==r.geometry.data.draco&&ec.push(r)}),B=ec,R.version&&(0,e7.default)(R.version,"2.0.60")>0&&console.warn("Your .splinecode file is more recent than the library. Please upgrade @splinetool/runtime to the latest version."),void 0!==this._wasmPath&&(this.setUIWasmUrl("".concat(this._wasmPath,"/hana-ui.wasm")),(0,_.a)(this._wasmPath)),eh=R,[4,Promise.all([z=T(function(){var e,r;return J(this,function(i){switch(i.label){case 0:return e={particles:function(){return n.e("6803").then(n.bind(n,46))},hair:function(){return Promise.all([n.e("4582"),n.e("6592")]).then(n.bind(n,9155))},"shape-blends":function(){return Promise.all([n.e("2258"),n.e("1416"),n.e("1693")]).then(n.bind(n,1356))},"vector-shapes":function(){return n.e("2968").then(n.bind(n,6539))},"3d-paths":function(){return n.e("5714").then(n.bind(n,7414))},cloners:function(){return Promise.all([n.e("2258"),n.e("8138")]).then(n.bind(n,3185))},components:function(){return n.e("9416").then(n.bind(n,5931))},text:function(){return n.e("9872").then(n.bind(n,7171))},"ui-2d":function(){return Promise.all([n.e("3022"),n.e("5135")]).then(n.bind(n,338))},"game-controls":function(){return Promise.all([n.e("2258"),n.e("7357")]).then(n.bind(n,9100))},"collision-bvh":function(){return n.e("9049").then(n.bind(n,9440))},mousehover:function(){return n.e("4428").then(n.bind(n,8247))},scroll:function(){return n.e("1505").then(n.bind(n,4808))},dragdrop:function(){return n.e("2934").then(n.bind(n,4485))},tracking:function(){return n.e("1732").then(n.bind(n,6188))},resize:function(){return n.e("2659").then(n.bind(n,7230))},conditional:function(){return n.e("1418").then(n.bind(n,8769))},variables:function(){return n.e("3329").then(n.bind(n,8776))},"api-services":function(){return n.e("6248").then(n.bind(n,7483))},"ai-assistant":function(){return n.e("319").then(n.bind(n,1314))},textinputs:function(){return n.e("6309").then(n.bind(n,2260))},audio:function(){return n.e("431").then(n.bind(n,9874))},video:function(){return n.e("6181").then(n.bind(n,7860))},"create-destroy":function(){return Promise.all([n.e("2258"),n.e("2983")]).then(n.bind(n,8378))},"scene-transition":function(){return n.e("175").then(n.bind(n,1698))},timeline:function(){return Promise.all([n.e("3022"),n.e("5521"),n.e("8672")]).then(n.bind(n,8371))},transitions:function(){return Promise.all([n.e("3022"),n.e("5521"),n.e("2324")]).then(n.bind(n,9791))},"misc-actions":function(){return Promise.all([n.e("3022"),n.e("5521"),n.e("8898")]).then(n.bind(n,6649))}},r=function(e){var r=new Set,n=!1,i=!1,a=!0,o=!1,s=void 0;try{for(var l,u=(0,S.d)(e,function(e){"GameControl"===e&&(n=!0),"Trigger"===e&&(i=!0)})[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;r.add(c)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}try{e.scene.objects.traverse(function(e,n){eJ(n,r)});var h=null==(y=e.shared.lib)?void 0:y.components;if(h){var d=Object.keys(h);d.length>0&&r.add("components");var f=!0,p=!1,v=void 0;try{for(var y,m,g,b=d[Symbol.iterator]();!(f=(g=b.next()).done);f=!0){var w=g.value;!function e(r,n){var i=!0,a=!1,o=void 0;if(r&&(r.data&&eJ(r.data,n),r.children))try{for(var s,l=r.children[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;e(u,n)}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}(null==(m=h[w])?void 0:m.asset,r)}}catch(e){p=!0,v=e}finally{try{f||null==b.return||b.return()}finally{if(p)throw v}}}}catch(e){var x=!0,k=!1,M=void 0;try{for(var A,O=eK[Symbol.iterator]();!(x=(A=O.next()).done);x=!0){var C=A.value;r.add(C)}}catch(e){k=!0,M=e}finally{try{x||null==O.return||O.return()}finally{if(k)throw M}}}return n&&r.add("game-controls"),(i||r.has("game-controls"))&&r.add("collision-bvh"),r}(eh),[4,Promise.all(Y(r).map(function(r){return e[r]()}))];case 1:return i.sent(),[2]}})})(),B.length&&e1(this._wasmPath),(0,f.a)(R)&&(0,k.n)(this._wasmPath),(0,w.y)(R)&&(0,w.x)(this._wasmPath),(0,b.a)(R)&&(0,w.H)(this._wasmPath),C.Ea.physicsEnabled(R.scene.objects)&&(0,m.b)(this._wasmPath),(0,w.p)(R)&&(0,v.c)(),(0,s.c)(R)&&(0,s.d)(),(0,x.b)(R)&&(0,x.a)(),y(R)&&z.then(function(){var e;return null==(e=(0,O.l)())?void 0:e.loadHanaUIRUNTIME()}),(0,m.e)(R)&&(0,m.m)(this._wasmPath)].filter(Boolean))];case 2:if(eu.sent(),!B.length)return[3,4];return[4,e2(B)];case 3:eu.sent(),eu.label=4;case 4:if(null==(g=this._eventManager)||g.deactivate(),null==(M=this._controls)||M.deactivate(),null==(E=this._scene)||E.dispose(),L=R.scene.publish.renderer,!(this._rendererAuto&&"webgl"===L))return[3,5];return this._rendererBackend="webgl",[3,8];case 5:if(!(this._rendererAuto&&"webgpu"===L))return[3,8];if(U="webgpu"!==this._rendererBackend)return[3,7];return[4,null==(F=navigator.gpu)?void 0:F.requestAdapter().catch(function(){return null})];case 6:U=!eu.sent(),eu.label=7;case 7:if(U)return[2,void this._failWebGPURequired()];this._rendererAuto=!1,eu.label=8;case 8:if(ed=R,ef=new Set,ed.scene.objects.traverse(function(e,r){if("Page"===r.type){var n=r.postprocessing,i=!0,a=!1,o=void 0;if(n&&"object"==(void 0===n?"undefined":X(n))&&!0===n.enabled)try{for(var s,l=Object.entries(n)[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=q(s.value,2),c=u[0],h=u[1];"enabled"!==c&&h&&"object"==(void 0===h?"undefined":X(h))&&!0===h.enabled&&ef.add(c)}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}}),N=Y(ef),"webgpu"!==this._rendererBackend)return[3,14];eu.label=9;case 9:return eu.trys.push([9,13,,14]),[4,Promise.all([Promise.all([n.e("2258"),n.e("1581"),n.e("1416"),n.e("4582"),n.e("9021")]).then(n.bind(n,3756)),e9(N,e8,"webgpu")])];case 10:if(eu.sent(),this._renderer)return[3,12];return G=this,[4,this._createRenderer()];case 11:G._renderer=eu.sent(),eu.label=12;case 12:return[3,14];case 13:return console.error("[spline] Failed to load the WebGPU material backend, using WebGL:",eu.sent()),this._rendererBackend="webgl",[3,14];case 14:if("webgpu"===this._rendererBackend)return[3,16];return[4,Promise.all([Promise.all([n.e("3182"),n.e("5704")]).then(n.bind(n,8283)),e9(N,e6,"webgl")])];case 15:eu.sent(),eu.label=16;case 16:if((0,w.N)("webgpu"===this._rendererBackend?"webgpu":"webgl"),(W=new e0(R)).resetPersonalCameraFromDocumentData(),this._scene=W.scene,this._sharedAssetsManager=W.sharedAssets,this._camera=this._scene.activeCamera,!window.location.search.includes("merge-geometries"))return[3,18];return[4,n.e("8061").then(n.bind(n,9932))];case 17:H=eu.sent().mergeStaticGeometries,Z=performance.now(),H(R,W.scene),console.log("Merged geometries in ",performance.now()-Z," ms"),eu.label=18;case 18:if((0,f.a)(R)&&this._scene.traverse(function(e){(0,f.f)(e)&&e.recomputeBoolean()}),this._sharedAssetsManager.setRequestRender(function(){var e;r._requestRenderAutoMode(),null==(e=r._scene)||e.traverse(function(e){(0,A.h)(e)&&e.pendingMediaLoad&&e.update({scene:r._scene,shared:r._sharedAssetsManager})})}),null==(D=this._scene)||D.traverse(function(e){"ParticleSystem"===e.type&&(e.wakeUp(),e.data.autoPlay?e.start():e.stop()),(0,A.b)(e)&&e.setPlayMode(!0)}),Promise.all(K=Object.keys(R.shared.fonts).flatMap(function(e){var n=r._sharedAssetsManager.getFont(e);return n?[n.loadingPromise]:[]})).then(function(){r.disposed||(W.scene.markNeedsUpdateRendererDirty(),r._requestRenderAutoMode())}),!((0,w.p)(R)&&(0,m.h)(R)))return[3,20];return[4,Promise.all(K)];case 19:eu.sent(),eu.label=20;case 20:if(!y(R))return[3,22];return Q=[],this._scene.traverseEntity(function(e){((0,A.f)(e)||V(e,d.h))&&e.uiCanvas&&Q.push(e.uiCanvas)}),[4,Promise.all(Q.map(function(e){return e.promise}))];case 21:eu.sent(),eu.label=22;case 22:if(this._scene.rewriteEventsBeforeGoToPlayMode(),(0,l.a)(this._scene.activePage,this._sharedAssetsManager),this._renderer)return[3,24];return $=this,[4,this._createRenderer()];case 23:$._renderer=eu.sent(),eu.label=24;case 24:if(this._rendererConfigured||(this._rendererConfigured=!0,this._renderer.hdTransmission=!0===R.scene.publish.hdTransmission,ee=this._getPixelRatio(/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?R.scene.publish.settings.web.pixelRatioMobile:R.scene.publish.settings.web.pixelRatioDesktop),this._renderer.setPixelRatio(ee),this._renderer.pipeline.enableUIOverlay(),this._renderer.pipeline.addEventListener("smaaloaded",this._requestRenderAutoMode),!R.shared.images.SplineWatermark))return[3,26];return[4,(et=this._sharedAssetsManager.getImage("SplineWatermark")).loadPromise];case 25:eu.sent(),er=et.getTexture(1001),this._renderer.pipeline.setWatermark(er),eu.label=26;case 26:return(0,s.c)(R)&&this._scene.initializeSplatViewer(),void 0!==R.scene.blueNoiseTextureData&&this._renderer.pipeline.updateBlueNoiseTexture(R.scene.blueNoiseTextureData),en=Object.values(R.frames)[0],this._frameView?this._frameView.setCamera(this._camera):("fullscreen"===en.preset?(this._viewportMode=1,this.canvas.style.display="block",this.canvas.parentElement&&(this._viewportWidth=this.canvas.parentElement.clientWidth||300,this.canvas.style.width="100%"),this.canvas.parentElement&&(this._viewportHeight=this.canvas.parentElement.clientHeight||150,this.canvas.style.height="100%")):(this._viewportMode=2,this._viewportWidth=en.size[0],this._viewportHeight=en.size[1],this.canvas.style.width="".concat(this._viewportWidth,"px"),this.canvas.style.height="".concat(this._viewportHeight,"px")),this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1),this._frameView=new eZ(this._renderer,this._camera,new P.Dc(this._viewportWidth,this._viewportHeight)),this._frameView.enableResponsive=null!=(p=en.allowResponsive)&&p&&"fullscreen"===en.preset),o&&(ei=new u.e(this._renderer,this.data.scene.publish,this._scene,function(){return r._scene.activeCamera},this._sharedAssetsManager,this._requestRenderAutoMode,!0,en),this._scene.updateMatrixWorld(!0),this._controls=new m.j(ei),this._animationControls=new e4(this._scene,this._requestRenderAutoMode),this._eventManager=new eX(R.scene.publish,this._controls,this._animationControls,ei,R.shared.variables),this._eventManager.activate(),this._controls.activate(this._eventManager)),this._resize(),this._scene.activePage.data.postprocessing.depthOfField.enabled&&Promise.all(this._sharedAssetsManager.getImageLoadPromises()).then(function(){r.disposed||r._resize(!0)}),void 0!==h&&this.setVariables(h),0===this.dt&&(this.render(performance.now()),setTimeout(function(){var e;null==(e=r._renderer)||e.setAnimationLoop(r.render)},0)),this._resizeObserverTimeout=setTimeout(function(){!r._resizeObserver&&r.canvas.parentElement&&(r._resizeObserver=new ResizeObserver(function(){r._viewportWidth=r.canvas.clientWidth,r._viewportHeight=r.canvas.clientHeight,r._debouncedResize()}),r._resizeObserver.observe(r.canvas.parentElement))},300),document.addEventListener("scroll",this._onScroll),o&&(null==(j=this._htmlContentOverlay)||j.dispose(),this._htmlContentOverlay=void 0),ea=null==(I=R.scene.publish.htmlContent)?void 0:I.html,o&&ea&&"none"!==this._htmlContentMode&&(es={shared:this._sharedAssetsManager,findEntity:function(e){var n,i,a;return null!=(n=null==(i=r._scene)?void 0:i.getObjectByProperty("uuid",e))?n:null==(a=r._scene)?void 0:a.getObjectByName(e)}},this._htmlContentOverlay=null!=(eo="inline"===this._htmlContentMode?to.mount(this,this.canvas,ea,es):tn.mount(this,this.canvas,ea,es))?eo:void 0),[2]}})}).apply(this,arguments)}},{key:"setVariables",value:function(e){if(void 0!==this._data){var r=Object.entries(e),n=!0,i=!1,a=void 0;try{for(var o,s=r[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=q(o.value,2),u=l[0],c=l[1];this.setVariable(u,c)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}}},{key:"setVariable",value:function(e,r){var n=this._getVariableByName(e);if(!n||"dynamicVariableType"in n.data)void 0===n?console.warn("No variable named ".concat(e," was found in your Spline file. Make sure to create it from Spline editor.")):"dynamicVariableType"in n.data&&console.warn("Dynamic variables like ".concat(e," cannot be updated from code."));else{var i,a=r;"number"==typeof n.data.value?a="number"==typeof r?r:"boolean"==typeof r?+(!0===r):parseFloat(r):"boolean"==typeof n.data.value?a="number"==typeof r?!!r:"boolean"==typeof r?r:"false"!==r.toLocaleLowerCase()&&!!r:"string"!=typeof n.data.value&&void 0!==n.data.value.textValue&&(a=r.toString());var o="string"==typeof a?{textValue:a}:a;null==(i=this._sharedAssetsManager)||i.updateVariable(n.id,o),this.requestRender(),this._requestRenderAutoMode()}}},{key:"getVariables",value:function(){var e=this,r={};return this._data&&this._data.shared.variables.forEach(function(n){void 0===r[n.data.name]&&(r[n.data.name]=e._getVariableValue(e._sharedAssetsManager.getVariable(n.id)))}),r}},{key:"getVariable",value:function(e){var r=this._getVariableByName(e);if(r){var n=this._sharedAssetsManager.getVariable(r.id);return this._getVariableValue(n)}}},{key:"_getVariableValue",value:function(e){return"string"!=typeof e&&C.Ga.isTextValue(e)?C.Ga.getDisplayedValue(e):e}},{key:"_getVariableByName",value:function(e){if(this._data){if(this._variablesCache.has(e))return this._variablesCache.get(e);var r=this._data.shared.variables.find(function(r){return r.data.name===e});return r&&this._variablesCache.set(e,r),r}}},{key:"_getPixelRatio",value:function(e){switch(e){case 0:return window.devicePixelRatio;case 1:return 1;case 2:return 2}}},{key:"findObjectById",value:function(e){var r,n=null==(r=this._scene)?void 0:r.getObjectByProperty("uuid",e);return this._createProxyObject(n)}},{key:"findObjectByName",value:function(e){var r,n=null==(r=this._scene)?void 0:r.getObjectByName(e);return this._createProxyObject(n)}},{key:"getAllObjects",value:function(){var e,r=this,n=[];return null==(e=this._scene)||e.traverseEntity(function(e){if(!(e.uuid===C.w||r._scene.isInvisibleObjects(e)||V(e,d.h))){var i=r._createProxyObject(e);i&&n.push(i)}}),n}},{key:"getSplineEvents",value:function(){var e,r;return(null==(r=this._eventManager)||null==(e=r.handlers)?void 0:e.Spline).splineEvents}},{key:"emitEvent",value:function(e,r){var n;null==(n=this.findObjectById(r)||this.findObjectByName(r))||n.emitEvent(e)}},{key:"emitEventReverse",value:function(e,r){var n;null==(n=this.findObjectById(r)||this.findObjectByName(r))||n.emitEventReverse(e)}},{key:"addEventListener",value:function(e,r){this.canvas.addEventListener(e,r)}},{key:"removeEventListener",value:function(e,r){this.canvas.removeEventListener(e,r)}},{key:"setZoom",value:function(e){var r,n;V(null==(r=this._controls)?void 0:r.orbitControls,m.a)&&(null==(n=this._controls)||n.orbitControls.setZoom(e))}},{key:"eventManager",get:function(){return this._eventManager}},{key:"controls",get:function(){return this._controls}},{key:"setSize",value:function(e,r){this._viewportWidth=e,this._viewportHeight=r,this._viewportMode=2,this._resize()}},{key:"setBackgroundColor",value:function(e){var r,n=tC(e);null==(r=this._scene)||r.activePage.setBackgroundColor(n),this._requestRenderAutoMode()}},{key:"dispose",value:function(){var e,r,n,i,a,o,s,l,u,h;this.disposed=!0,null==(e=this._htmlContentOverlay)||e.dispose(),this._htmlContentOverlay=void 0,null==(r=this._eventManager)||r.dispose(),null==(n=this._scene)||n.dispose(),this._scene=void 0,this._camera=void 0,(0,w.k)(),null==(i=this._sharedAssetsManager)||i.setRequestRender(function(){}),null==(a=this._sharedAssetsManager)||a.dispose(),this._sharedAssetsManager=void 0,this._proxyObjectCache.forEach(function(e){ej.unsubscribe(e)}),this._proxyObjectCache.clear(),this._variablesCache.clear(),null==(o=this._renderer)||o.pipeline.removeEventListener("smaaloaded",this._requestRenderAutoMode),null==(s=this._renderer)||s.setAnimationLoop(null),null==(l=this._renderer)||l.dispose(),this._renderer=void 0,this._debouncedResize.cancel(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),void 0!==this._resizeObserverTimeout&&(clearTimeout(this._resizeObserverTimeout),this._resizeObserverTimeout=void 0),this.canvas.style.width="",this.canvas.style.height="",this.canvas.removeAttribute("width"),this.canvas.removeAttribute("height"),this._frameView=void 0,null==(u=this._controls)||u.deactivate(),this._controls=void 0,this._animationControls=void 0,null==(h=this._eventManager)||h.eventContext.dispose(),this._eventManager=void 0,this._splatViewer=void 0,this._data=void 0,this._perfs=void 0,this.dt=0,this._lastTime=void 0,(0,g.e)(this.canvas),document.removeEventListener("scroll",this._onScroll),c.a.dispose()}},{key:"isStopped",get:function(){return this._isPaused}},{key:"stop",value:function(){var e,r,n;this._isPaused||(null==(e=this._renderer)||e.setAnimationLoop(null),this._isPaused=!0,null==(r=this._eventManager)||r.pause(),(null==(n=this._controls)?void 0:n.orbitControls)&&(this._controls.orbitControls.enabled=!1))}},{key:"play",value:function(){var e,r,n;this._isPaused&&(this._isPaused=!1,null==(e=this._eventManager)||e.resume(),(null==(r=this._controls)?void 0:r.orbitControls)&&(this._controls.orbitControls.enabled=!0),null==(n=this._renderer)||n.setAnimationLoop(this.render))}},{key:"setGlobalEvents",value:function(e){var r;null==(r=this._eventManager)||r.updateUseWindowEvents(e)}},{key:"data",get:function(){return this._data}},{key:"_createProxyObject",value:function(e){var r=this;if(this._scene){var n,i,a=this._scene;if(null!=e){if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);e.traverseAncestors(function(e){V(e,d.h)&&(i=e.name)});var l,u,h,p,v,y,m,g=this._sharedAssetsManager,b={shared:g,scene:this._scene},x=function(r){if(null===r||"Base State"===r)return null;if(r&&e.data.states){var n=e.data.states.find(function(e){return e.data.name===r});return n?n.id:void 0}},S="material"in e?e.material:void 0,k=e.materialOverride,M={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,type:e.data.type,page:i,material:null!=k?k:S?{layers:null!=(l=null==(h=(y=Array.isArray(S)?S[0]:S).layers)?void 0:h.map(tk))?l:[],alpha:null!=(u=null==(m=null==(p=y.layers)?void 0:p.find(function(e){return"light"===e.type}))||null==(v=m.node.alphaOverride)?void 0:v.value)?u:1}:void 0,parentUuid:V(e.parent,d.h)||V(e,s.f)||null==(n=e.parent)?void 0:n.uuid,emitEvent:function(r){e.dispatchEvent({type:"userEvent",eventName:r})},emitEventReverse:function(r){e.dispatchEvent({type:"userEvent",eventName:r,reverse:!0})},hide:function(){e.visible&&(e.visible=!1,b.shared.requestRender())},show:function(){e.visible||(e.visible=!0,b.shared.requestRender())},get state(){var A,_=e.stateSelection;if(null!==_)return null==(A=e.data.states.find(function(e){return e.id===_}))?void 0:A.data.name},set state(t){var E;if(void 0!==t){var D="string"==typeof t?e.data.states.find(function(e){return e.id===t}):e.data.states[t];if(D)E=D.id;else{var j="string"==typeof t?x(t):void 0;j&&(E=j)}}e.changeSelectedState(null!=E?E:null,b),e.currentState=null!=E?E:null,e.dispatchEvent({type:"completeState",state:null!=E?E:null}),b.shared.requestRender()},transition:function(r){var n=(0,o.c)();if(null===n)return(0,O.c)("transitions","obj.transition()"),{transition:function(e){return this},play:function(){return this},pause:function(){return this},reset:function(){return this},seek:function(e){return this}};var i,s,l,u=this,h=[],d=!1,f=function(){l=new o.d({delay:0,delayDirection:"start-once",direction:"normal",repeat:0,runMode:"Repeat"},h.map(function(e){return e.runner}))},p={update:function(e){null==l||l.update(e),!0!==(null==l?void 0:l.isPlaying)&&c.a.remove(p)}},v={transition:function(r){var i=r.from,o=r.to,l=r.duration,c=r.delay,d=W(r,["from","to","duration","delay"]),p=x(i);void 0===p&&(p=s);var v=x(o);return s=v,h.push(new n(e,p,v,N({state:v,repeat:0,delay:null!=c?c:0,delayDirection:"start-once",direction:"normal",duration:null!=l?l:1e3},d,6===d.easing?C.G.defaultData:5===d.easing?C.H.defaultData:{}),g,!1,a.activePage,{onBegin:function(){(i&&p||"Base State"===i&&!p)&&(u.state=null!=p?p:void 0)},onComplete:function(){u.state=null!=v?v:void 0}})),f(),this},play:function(){return l&&(d=!0,l.play(c.a.time),l.isPlaying&&c.a.add(p)),this},pause:function(){return null==l||l.stop(),c.a.remove(p),this},reset:function(){return this.pause(),d=!1,f(),null==l||l.seek(0),this},seek:function(e){var r=h.reduce(function(e,r){return e+r.runner.duration},0);return r>0&&(null==l||l.seek(e/1e3/r)),this}};return v.transition(r),(null==(i=r.autoPlay)||i)&&queueMicrotask(function(){d||v.play()}),v},set color(t){var T=tC(t);if(f.c.is(e))return void(e.color=T);if(!("Mesh"===e.type&&"material"in e&&V(e,w.ha)))return;var I={r:T.r,g:T.g,b:T.b,a:T.a},R=e.materialOverride;if(void 0!==R){var B=R.color;return void(!0===(null==B?void 0:B.isColor)&&"function"==typeof B.setStyle&&(B.setStyle(t),b.shared.requestRender()))}var z=Array.isArray(e.material)?e.material[0]:e.material,F=null==(U=z.data.layers.find(function(e){return"color"===e.data.type}))?void 0:U.id;if(F)z.updateByOp({type:0,path:["layers",F],props:{color:N({},I)}},z.data,b);else{var U,H,q=z.data,Y=q.layers.find(function(e){return"light"===e.data.type});if(!Y)return;var Z=0===q.layers.indexOf(Y)?Y:null,K=q.layers.at(Z?q.layers.indexOf(Z)+1:0),J={type:4,fi:Z?Z.fi+(K?(K.fi-Z.fi)/2:1):K?K.fi/2:1,id:P.Cc.generateUUID(),data:G(N({},C.da.defaultData("color")),{color:I}),localIndex:0},Q=q.layers.insertAfterHelper(null!=(H=null==Z?void 0:Z.id)?H:null,1),$=q.layers.runOp(G(N({},J),{fi:Q[0]})).data;Object.assign(z.data,{layers:$}),z.updateByOp(G(N({},J),{path:["layers"]}),z.data,b)}}},ee=ej(M,function(n,i){var a,o=e[n],s=n.split(".");"material"===s[0]&&S&&void 0===k&&function(e,r,n){var i=Array.isArray(n)?n[0]:n;if("layers"===e[0]){var a=parseInt(e[1]),o=i.layers[a],s=e[2];o&&s&&function(e,r,n){var i=e[0];try{if(a=n.type,e.slice(1),null==(o=tA[a])?void 0:o.includes(i))if("colors"===i){if(e.length<2)throw Error("You cannot mutate the colors array, only its items");var a,o,s,l,u=parseInt(e[1]),c=null==(l=n.getValue(i))?void 0:l[u];if(!c)throw Error("Color index out of range");tM.setStyle(r),c.set(tM.r,tM.g,tM.b,tM.a)}else null==(s=n.getValue(i))||s.setStyle(r);else if("texture"===i||"video"===i){var h=n.color;!function(e,r,n,i){var a=e[0];if("repeat"===a||"offset"===a||"rotation"===a){var o=i.getNode("mat"),s=o&&"function"==typeof o.updateMatrix?o:i.getValue("mat");if(!s)return;if("rotation"===a)s.rotation=parseFloat(r);else{var l=e[1];if(void 0===l)V(r,Array)&&2===r.length&&Object.assign(s,L({},a,r));else{var u=s[a],c=0===parseInt(l)?[parseFloat(r),u[1]]:[u[0],parseFloat(r)];Object.assign(s,L({},a,c))}}s.updateMatrix()}else"wrapping"===a||"minFilter"===a||"magFilter"===a?"wrapping"===a?n.texture.wrap=r:n.texture[a]=r:"image"===a&&"data"===e[1]&&n.texture.image.updateSrc(r)}(e.slice(1),r,h,n)}else{var d=e[1],f=n.getValue(i);(null==f?void 0:f.isVector3)&&void 0!==d||(null==f?void 0:f.isVector2)&&void 0!==d?f.setComponent(parseInt(d),r):n.setValue(i,r)}}catch(e){console.error("Error setting material value",e)}}(e.slice(2),r,o)}else"alpha"===e[0]&&i.layers.forEach(function(e){"light"===e.type&&void 0!==e.node.alphaOverride&&(e.node.alphaOverride.value=r,r<1&&(i.transparent=!0))})}(s.slice(1),i,S),"object"!=(void 0===o?"undefined":X(o))&&(null==(a=Object.getOwnPropertyDescriptor(e,n))?void 0:a.writable)&&(e[n]=i),r._requestRenderAutoMode(),e.updateMatrix()});return this._proxyObjectCache.set(e.uuid,ee),ee}}}},{key:"setUIWasmUrl",value:function(e){(0,O.k)(e)}},{key:"pauseGameControls",value:function(){var e,r;null==(r=this._eventManager)||null==(e=r.controlsManager.gameControl)||e.pause()}},{key:"resumeGameControls",value:function(){var e,r;null==(r=this._eventManager)||null==(e=r.controlsManager.gameControl)||e.resume()}},{key:"swapGeometry",value:function(e,r){return T(function(){var n,i,a,o,s,l,u,c,h,d,f,p,v,y,m,g;return J(this,function(b){switch(b.label){case 0:if("string"!=typeof r)return[3,3];if(!r.endsWith(".splinegeometry"))throw Error("Only .splinegeometry format is supported");return[4,fetch(r)];case 1:return[4,b.sent().arrayBuffer()];case 2:return o=new Uint8Array(b.sent()),[3,4];case 3:o=r,b.label=4;case 4:if(!(l="data"in(s=C.o.deserialize(o))&&void 0!==s.data.draco))return[3,6];return[4,e1(this._wasmPath)];case 5:b.sent(),b.label=6;case 6:if(!(u=null!=(n=null==(i=this._scene)?void 0:i.getObjectByProperty("uuid",e))?n:null==(a=this._scene)?void 0:a.getObjectByName(e)))return[2,void console.warn("Object ".concat(e," not found"))];if("Mesh"!==u.data.type||!V(u,w.ha))return[2,void console.warn("Object ".concat(e," is not a mesh"))];if(h=G(N({},(c=u).data),{geometry:s}),!l)return[3,8];return[4,e2([h])];case 7:b.sent(),b.label=8;case 8:c.updateByOp({type:0,path:[],props:{geometry:h.geometry}},h,{shared:this._sharedAssetsManager,scene:this._scene},!1),d=!0,f=!1,p=void 0;try{for(v=c.data.states[Symbol.iterator]();!(d=(y=v.next()).done);d=!0)m=y.value,g=N({},m.data),c.states||(c.states={}),c.states[m.id]=C.Da.patch(h,g)}catch(e){f=!0,p=e}finally{try{d||null==v.return||v.return()}finally{if(f)throw p}}return[2,o]}})}).call(this)}},{key:"_applyDocumentTransaction",value:function(e){this._data=e.data,this._scene&&(this._scene.data=this._data.scene),this._sharedAssetsManager&&(this._sharedAssetsManager.data=this._data.shared);var r=!0,n=!1,i=void 0;try{for(var a,o=e.actual[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s,l=a.value,u=l.path;Array.isArray(u)&&2===u.length&&"scene"===u[0]&&"objects"===u[1]&&(null==(s=this._scene)||s.updateTreeByOp(G(N({},l),{path:[]}),this._sharedAssetsManager))}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"_findEntity",value:function(e){var r,n,i;return null!=(r=null==(n=this._scene)?void 0:n.getObjectByProperty("uuid",e))?r:null==(i=this._scene)?void 0:i.getObjectByName(e)}},{key:"_resolveParentId",value:function(e){if(void 0===e)return this._scene.activePage.uuid;var r="string"==typeof e?e:e.uuid,n=this._findEntity(r);if(!n)throw Error("parent '".concat(r,"' — no object with that name or uuid in the scene."));return n.uuid}},{key:"createCustomMaterial",value:function(e){return T(function(){var r,i,a;return J(this,function(o){switch(o.label){case 0:if(this.disposed)throw Error("createCustomMaterial: this Application was disposed.");if("function"!=typeof e)throw Error("createCustomMaterial: expected a factory function — createCustomMaterial((three) => new three.MeshStandardNodeMaterial()).");if(!(i=void 0===(r=(0,w.V)())))return[3,3];if("webgpu"!==this._rendererBackend)return[3,2];return[4,Promise.all([n.e("2258"),n.e("1581"),n.e("1416"),n.e("4582"),n.e("9021")]).then(n.bind(n,3756))];case 1:o.sent(),r=(0,w.V)(),o.label=2;case 2:i=void 0===r,o.label=3;case 3:if(i)throw Error("createCustomMaterial: requires the webgpu backend (the runtime default where WebGPU is available). This Application is on the classic WebGL pipeline — pass { renderer: 'webgpu' } or drop any ?renderer=webgl2 override.");if("object"!=(void 0===(a=e(r))?"undefined":X(a))||null===a||!0!==a.isMaterial)throw Error("createCustomMaterial: the factory must return a three.js material built from the namespace it receives — e.g. (three) => new three.MeshStandardNodeMaterial().");return[2,a]}})}).call(this)}},{key:"setMaterial",value:function(e,r){return T(function(){var n,i,a,o,s,l;return J(this,function(u){switch(u.label){case 0:if(this.disposed)throw Error("setMaterial: this Application was disposed.");if(!(n=this._scene))throw Error("setMaterial: no scene loaded — call load() or start() first.");if(i="string"==typeof e?e:e.uuid,!(a=this._findEntity(i)))throw Error("setMaterial: '".concat(i,"' — no object with that name or uuid in the scene."));if(!V(a,w.ha))throw Error("setMaterial: '".concat(i,"' is not a mesh — lights, groups, and cameras have no material."));if("function"!=typeof r)return[3,2];return[4,this.createCustomMaterial(r)];case 1:return s=u.sent(),[3,3];case 2:s=r,u.label=3;case 3:if(o=s,"webgpu"!==(0,w.O)())throw Error("setMaterial: custom three.js materials require the webgpu backend (the runtime default where WebGPU is available). This scene is running the classic WebGL pipeline — pass { renderer: 'webgpu' } or drop any ?renderer=webgl2 override.");if(void 0===(l=tl({material:o})).material)throw Error("setMaterial: expected a three.js material instance or a (three) => material factory.");return[2,(a.setMaterialOverride(l.material,{scene:n,shared:this._sharedAssetsManager}),this._proxyObjectCache.delete(a.uuid),this._requestRenderAutoMode(),l.material)]}})}).call(this)}},{key:"createObject",value:function(e){return T(function(e){var r,i,a,o,s,l,u,c,h,d,f,p,y,m,g,b,x,S,k,M,A,_,E=arguments;return J(this,function(D){switch(D.label){case 0:if(r=E.length>1&&void 0!==E[1]?E[1]:{},this.disposed)throw Error("createObject: this Application was disposed.");if(i=this._scene,a=this._data,!i||!a)throw Error("createObject: no scene loaded — call load() or start() first.");if(o=function(e){if("string"!=typeof e||0===e.length)throw Error("createObject: expected a type name string — one of ".concat(tc,"."));var r=e.replace(/Geometry$/i,"").replace(/[\s_-]/g,"").toLowerCase(),n=td[r];if(n)return{objectType:n};var i=th[r];if(i)return{objectType:"Mesh",geometryType:i};var a=tf[r];throw a?Error("createObject: '".concat(e,"' is not supported — ").concat(a)):Error("createObject: '".concat(e,"' is not a creatable Spline type — use one of ").concat(tc,", e.g. createObject('Cube', { width: 200 })."))}(e),"function"!=typeof r.material)return[3,2];return s=[N({},r)],l={},[4,this.createCustomMaterial(r.material)];case 1:r=G.apply(void 0,s.concat([(l.material=D.sent(),l)])),D.label=2;case 2:if(d=(h=tl(r)).options,void 0!==(f=h.material)){if("Mesh"!==o.objectType)throw Error("createObject: a three.js material instance only applies to mesh types — lights and groups have no material.");if("webgpu"!==(0,w.O)())throw Error("createObject: three.js material instances require the webgpu backend (the runtime default where WebGPU is available). This scene is running the classic WebGL pipeline — pass { renderer: 'webgpu' } to the Application, or drop any ?renderer=webgl2 override.")}if("TextGeometry"!==o.geometryType)return[3,5];return[4,n.e("9872").then(n.bind(n,7171))];case 3:if(D.sent(),!(0,O.b)("text"))throw Error("createObject: this runtime build was compiled without the 'text' feature — re-export the scene with a Text object present, or load the full runtime build.");return[4,(0,v.c)()];case 4:if(D.sent(),c=null!=(p=r.font)?p:C.fa,void 0===a.shared.fonts[c]){if(c!==C.fa)throw y=Object.keys(a.shared.fonts).join(", "),Error("createObject: font '".concat(c,"' is not in this document — available fonts: ").concat(y||"(none)","."));u={name:C.fa,url:C.ga}}D.label=5;case 5:if(m=this._resolveParentId(r.parent),g=function(e,r,n){var i,a,o,s,l=e.objectType,u=e.geometryType,c=function(e){var r={},n=!0,i=!1,a=void 0;try{for(var o,s=Object.entries(e)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=q(o.value,2),u=l[0],c=l[1];tu.has(u)||void 0===c||(r[u]=c)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(r),h={states:new C.f,events:new C.f};if("Mesh"===l&&u){if("NonParametricGeometry"===u){var d,f,p,v,y=function(e){var r=tx(e.vertices);if(!r||r.length<9||r.length%3!=0)throw Error("createObject('CustomMesh'): `vertices` must be a flat number[] of x,y,z triples (length a multiple of 3, at least one triangle).");var n=r.length/3;if(n>6e4)throw Error("createObject('CustomMesh'): too many vertices (".concat(n,"); keep it under 60000."));var i=tx(e.indices);if(i&&i.length){var a=i.find(function(e){return!Number.isInteger(e)||e<0||e>=n});if(void 0!==a)throw Error("createObject('CustomMesh'): index ".concat(a," is out of range (mesh has ").concat(n," vertices)."))}else i=null;var o=new P.dd;o.setAttribute("position",new P.bd(r,3));var s=tx(e.normals),l=null!==s&&s.length===r.length;l&&o.setAttribute("normal",new P.bd(s,3));var u=tx(e.uvs);u&&u.length===2*n&&o.setAttribute("uv",new P.bd(u,2));var c=!1;if(!l){var h=null!=i?i:Array.from({length:n},function(e,r){return r}),d=function(e,r){for(var n=e.length/3,i=new Map,a=Array(n),o=0;o<n;o++){var s="".concat(Math.round(1e4*e[3*o]),",").concat(Math.round(1e4*e[3*o+1]),",").concat(Math.round(1e4*e[3*o+2])),l=i.get(s);void 0===l?(i.set(s,o),a[o]=o):a[o]=l}for(var u=new Map,c=0;c+2<r.length;c+=3)for(var h=a[r[c]],d=a[r[c+1]],f=a[r[c+2]],p=0,v=[[h,d],[d,f],[f,h]];p<v.length;p++){var y,m=q(v[p],2),g=m[0],b=m[1];if(g!==b){var w=g<b?g+"_"+b:b+"_"+g;u.set(w,(null!=(y=u.get(w))?y:0)+1)}}var x=u.size>0,S=!0,k=!1,M=void 0;try{for(var A,O=u.values()[Symbol.iterator]();!(S=(A=O.next()).done);S=!0){var C=A.value;if(2!==C){x=!1;break}}}catch(e){k=!0,M=e}finally{try{S||null==O.return||O.return()}finally{if(k)throw M}}if(!x)return{closed:!1,inverted:!1};for(var _=0,P=0;P+2<r.length;P+=3){var E=3*r[P],D=3*r[P+1],j=3*r[P+2],T=e[E],I=e[E+1],R=e[E+2],B=e[D],z=e[D+1],L=e[D+2],F=e[j],U=e[j+1],V=e[j+2];_+=T*(z*V-L*U)+I*(L*F-B*V)+R*(B*U-z*F)}return{closed:!0,inverted:_<0}}(r,h),f=d.closed,p=d.inverted;if(f&&p){for(var v=0;v+2<h.length;v+=3){var y=h[v+1];h[v+1]=h[v+2],h[v+2]=y}i=h}else f||(c=!0)}return i&&o.setIndex(i),l||o.computeVertexNormals(),{geometry:ez({userData:{type:"NonParametricGeometry",parameters:{subdivisions:0}},data:o.toJSON().data}),doubleSide:c}}(c),m=y.geometry,g=y.doubleSide;Object.assign(h,C.xa.defaultData,{geometry:m,materials:[tb(r,n)]}),g&&(h.side=2)}else Object.assign(h,C.xa.defaultData,{geometry:"TextGeometry"===u?(d=C.na.defaultData("TextGeometry"),f=c.text,void 0!==(v=(p=W(c,["text"])).fontSize)&&void 0===p.width&&(p.width=350*v/16),void 0!==v&&void 0===p.height&&(p.height=50*v/16),Object.assign(d,p),void 0!==f&&Object.assign(d,{text:{textValue:String(f)}}),d):ez({userData:N({type:u},w.L[u].normalizeInputs({parameters:c}))}),material:tb(r,n)});void 0!==r.castShadow&&(h.castShadow=r.castShadow),void 0!==r.receiveShadow&&(h.receiveShadow=r.receiveShadow)}else"Empty"===l?Object.assign(h,C.wa.defaultData):(Object.assign(h,C.za.defaultData(l),c),void 0!==r.color&&(h.color=tg(r.color)));h.visible=null==(i=r.visible)||i,h.position=ty(r.position,[0,0,0]),h.rotation=ty(r.rotation,[0,0,0]),h.scale=tm(r.scale);var b=null!=(a=null!=(o=u&&tp[u])?o:tv[l])?a:l;return h.name=null!=(s=r.name)?s:tS(b,n.scene.objects),h}(o,d,a),b=P.Cc.generateUUID(),S=(x=q((0,C.l)(a),2))[0],k=x[1],u&&(S.shared.fonts[C.fa]=u),S.scene.objects.insertAfter(m,null,[{id:b,data:g,children:[]}]),M=k.result(),u&&this._sharedAssetsManager.addFont(C.fa,u),void 0===c)return[3,8];if(!(A=this._sharedAssetsManager.getFont(c)))return[3,7];return[4,A.loadingPromise];case 6:D.sent(),D.label=7;case 7:D.label=8;case 8:return this._applyDocumentTransaction(M),_=i.find(b),[2,(void 0!==f&&_.setMaterialOverride(f,{scene:i,shared:this._sharedAssetsManager}),this._requestRenderAutoMode(),this._createProxyObject(_))]}})}).apply(this,arguments)}},{key:"cloneObject",value:function(e){var r,n,i,a,o,s,l,u,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.disposed)throw Error("cloneObject: this Application was disposed.");var h=this._scene,f=this._data;if(!h||!f)throw Error("cloneObject: no scene loaded — call load() or start() first.");var p="string"==typeof e?e:null==e?void 0:e.uuid,v=p?this._findEntity(p):void 0;if(!v)throw Error("cloneObject: '".concat(p,"' — no object with that name or uuid in the scene."));if(V(v,d.h))throw Error("cloneObject: pages cannot be cloned.");var y=f.scene.objects.get(v.uuid);if(!y)throw Error("cloneObject: '".concat(p,"' is not part of the document tree (expanded clones and instanced children cannot be cloned — clone their source object instead)."));var m=(n=function e(r,n){var i,a=P.Cc.generateUUID();if("Component"===r.data.type)return{data:G(N({},C.Ba.fromComponentData(r)),{name:r.data.name+" Instance"}),id:a,fi:r.fi,children:[]};n[r.id]=a;var o=r.data;return"Empty"===o.type&&(null==(i=o.animations)?void 0:i.length)&&(o=G(N({},o),{animations:o.animations.map(function(e){var r=q(e,3),n=r[0],i=r[1],a=r[2],o=P.Cc.generateUUID(),s=a.indexOf(n);return[o,i,-1!==s?a.slice(0,s)+o+a.slice(s+n.length):a]})})),G(N({},r),{id:a,data:o,children:r.children.map(function(r){return e(r,n)})})}(y,r={}),i=(0,C.g)(n,r),a=f.scene.objects,l=N({},i.data),void 0!==c.position&&(l.position=ty(c.position,[0,0,0])),void 0!==c.rotation&&(l.rotation=ty(c.rotation,[0,0,0])),void 0!==c.scale&&(l.scale=tm(c.scale)),void 0!==c.visible&&(l.visible=c.visible),l.name=null!=(o=c.name)?o:tS("".concat(null!=(s=i.data.name)?s:"Object"," Copy"),a),G(N({},i),{data:l})),g=void 0!==c.parent?this._resolveParentId(c.parent):null!=(u=f.scene.objects.parent(v.uuid))?u:null,b=void 0!==c.parent?null:v.uuid,w=q((0,C.l)(f),2),x=w[0],S=w[1];x.scene.objects.insertAfter(g,b,[m]),this._applyDocumentTransaction(S.result());var k=h.find(m.id);return this._requestRenderAutoMode(),this._createProxyObject(k)}},{key:"removeObject",value:function(e){var r=this._scene,n=this._data;if(this.disposed||!r||!n)return!1;var i="string"==typeof e?e:null==e?void 0:e.uuid,a=i?this._findEntity(i):void 0;if(!a)return!1;if(V(a,d.h))throw Error("removeObject: pages cannot be removed.");if("PerspectiveCamera"===a.data.type||"OrthographicCamera"===a.data.type)throw Error("removeObject: cameras cannot be removed.");if(void 0===n.scene.objects.get(a.uuid))throw Error("removeObject: '".concat(i,"' is not part of the document tree (expanded clones and instanced children cannot be removed individually)."));var o=[];a.traverseEntity(function(e){o.push(e.uuid)});var s=q((0,C.l)(n),2),l=s[0],u=s[1];l.scene.objects.delete(a.uuid),this._applyDocumentTransaction(u.result());var c=!0,h=!1,f=void 0;try{for(var p,v=o[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value,m=this._proxyObjectCache.get(y);m&&(ej.unsubscribe(m),this._proxyObjectCache.delete(y))}}catch(e){h=!0,f=e}finally{try{c||null==v.return||v.return()}finally{if(h)throw f}}return this._requestRenderAutoMode(),!0}}]),e}(),tP=n(8836),tE=n(1190);let tD=function(){return tE.A.Date.now()};var tj=/\s/;let tT=function(e){for(var r=e.length;r--&&tj.test(e.charAt(r)););return r};var tI=/^\s+/,tR=n(1787),tB=0/0,tz=/^[-+]0x[0-9a-f]+$/i,tL=/^0b[01]+$/i,tF=/^0o[0-7]+$/i,tU=parseInt;let tV=function(e){if("number"==typeof e)return e;if((0,tR.A)(e))return tB;if((0,tP.A)(e)){var r,n="function"==typeof e.valueOf?e.valueOf():e;e=(0,tP.A)(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=(r=e)?r.slice(0,tT(r)+1).replace(tI,""):r;var i=tL.test(e);return i||tF.test(e)?tU(e.slice(2),i?2:8):tz.test(e)?tB:+e};var tN=Math.max,tG=Math.min;let tW=function(e,r,n){var i,a,o,s,l,u,c=0,h=!1,d=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function p(r){var n=i,o=a;return i=a=void 0,c=r,s=e.apply(o,n)}function v(e){var n=e-u,i=e-c;return void 0===u||n>=r||n<0||d&&i>=o}function y(){var e,n,i,a=tD();if(v(a))return m(a);l=setTimeout(y,(e=a-u,n=a-c,i=r-e,d?tG(i,o-n):i))}function m(e){return(l=void 0,f&&i)?p(e):(i=a=void 0,s)}function g(){var e,n=tD(),o=v(n);if(i=arguments,a=this,u=n,o){if(void 0===l)return c=e=u,l=setTimeout(y,r),h?p(e):s;if(d)return clearTimeout(l),l=setTimeout(y,r),p(u)}return void 0===l&&(l=setTimeout(y,r)),s}return r=tV(r)||0,(0,tP.A)(n)&&(h=!!n.leading,o=(d="maxWait"in n)?tN(tV(n.maxWait)||0,r):o,f="trailing"in n?!!n.trailing:f),g.cancel=function(){void 0!==l&&clearTimeout(l),c=0,i=u=a=l=void 0},g.flush=function(){return void 0===l?s:m(tD())},g};function tH(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function tq(e){if(Array.isArray(e))return e}function tY(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tX(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function tZ(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function tK(e,r){return tq(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||tJ(e,r)||tY()}function tJ(e,r){if(e){if("string"==typeof e)return tH(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tH(e,r)}}var tQ=[],t$={width:"100%",height:"100%"},t0=(0,a.forwardRef)(function(e,r){var n,o,s=tq(n=[e,r])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||tJ(n)||tY(),l=s[0],u=s.slice(1),c=l.className,h=l.children,d=l.debounceTime,f=void 0===d?300:d,p=l.ignoreDimensions,v=void 0===p?tQ:p,y=l.parentSizeStyles,m=l.enableDebounceLeadingCall,g=void 0===m||m,b=l.resizeObserverPolyfill,w=function(e,r){if(null==e)return{};var n,i,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}if(o=function(e,r){if(null==e)return{};var n,i,a={},o=Object.getOwnPropertyNames(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,r),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}(l,["className","children","debounceTime","ignoreDimensions","parentSizeStyles","enableDebounceLeadingCall","resizeObserverPolyfill"]),x=tK(u,1)[0],S=(0,a.useRef)(null),k=(0,a.useRef)(0),M=tK((0,a.useState)({width:0,height:0,top:0,left:0}),2),A=M[0],O=M[1],C=(0,a.useMemo)(function(){var e=Array.isArray(v)?v:[v];return tW(function(r){O(function(n){return Object.keys(n).filter(function(e){return n[e]!==r[e]}).every(function(r){return e.includes(r)})?n:r})},f,{leading:g})},[f,g,v]);return(0,a.useEffect)(function(){var e=new(b||window.ResizeObserver)(function(e){e.forEach(function(e){var r,n=null!=(r=null==e?void 0:e.contentRect)?r:{},i=n.left,a=n.top,o=n.width,s=n.height;k.current=window.requestAnimationFrame(function(){C({width:o,height:s,top:a,left:i})})})});return S.current&&e.observe(S.current),function(){window.cancelAnimationFrame(k.current),e.disconnect(),C.cancel()}},[C,b]),(0,i.jsx)("div",tZ(tX({style:tX({},t$,y),ref:(o=[x,S],e=>{o.forEach(r=>{"function"==typeof r?r(e):null!=r&&(r.current=e)})}),className:c},w),{children:h(tZ(tX({},A),{ref:S.current,resize:C}))}))});function t1(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function t2(e){if(Array.isArray(e))return e}function t3(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}function t5(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t4(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function t6(e,r){return t2(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||t8(e,r)||t5()}function t8(e,r){if(e){if("string"==typeof e)return t1(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t1(e,r)}}var t9=(0,a.forwardRef)(function(e,r){var n,o,s,l=t2(n=[e,r])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t8(n)||t5(),u=l[0],c=l.slice(1),h=u.scene,d=u.style,f=u.onSplineMouseDown,p=u.onSplineMouseUp,v=u.onSplineMouseHover,y=u.onSplineKeyDown,m=u.onSplineKeyUp,g=u.onSplineStart,b=u.onSplineLookAt,w=u.onSplineFollow,x=u.onSplineScroll,S=u.onLoad,k=u.renderOnDemand,M=void 0===k||k,A=u.wasmPath,O=u.children,C=function(e,r){if(null==e)return{};var n,i,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}if(o=function(e,r){if(null==e)return{};var n,i,a={},o=Object.getOwnPropertyNames(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,r),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}(u,["scene","style","onSplineMouseDown","onSplineMouseUp","onSplineMouseHover","onSplineKeyDown","onSplineKeyUp","onSplineStart","onSplineLookAt","onSplineFollow","onSplineScroll","onLoad","renderOnDemand","wasmPath","children"]),_=t6(c,1)[0],P=(0,a.useRef)(null),E=t6((0,a.useState)(!0),2),D=E[0],j=E[1],T=t6((0,a.useState)(),2),I=T[0],R=T[1];if(I)throw I;return(0,a.useEffect)(function(){j(!0);var e,r,n=[{name:"mouseDown",cb:f},{name:"mouseUp",cb:p},{name:"mouseHover",cb:v},{name:"keyDown",cb:y},{name:"keyUp",cb:m},{name:"start",cb:g},{name:"lookAt",cb:b},{name:"follow",cb:w},{name:"scroll",cb:x}];return P.current&&(r=new t_(P.current,{renderOnDemand:M,wasmPath:A}),(e=function(){var e,i,a,o,s,l;return function(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:return[4,r.load(h)];case 1:u.sent(),e=!0,i=!1,a=void 0;try{for(o=n[Symbol.iterator]();!(e=(s=o.next()).done);e=!0)(l=s.value).cb&&r.addEventListener(l.name,l.cb)}catch(e){i=!0,a=e}finally{try{e||null==o.return||o.return()}finally{if(i)throw a}}return j(!1),null==S||S(r),[2]}})},function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function s(e){t3(o,i,a,s,l,"next",e)}function l(e){t3(o,i,a,s,l,"throw",e)}s(void 0)})})().catch(function(e){R(e)})),function(){var e=!0,i=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(e=(o=s.next()).done);e=!0){var l=o.value;l.cb&&r.removeEventListener(l.name,l.cb)}}catch(e){i=!0,a=e}finally{try{e||null==s.return||s.return()}finally{if(i)throw a}}r.dispose()}},[h]),(0,i.jsx)(t0,(o=t4({ref:_,parentSizeStyles:t4({overflow:"hidden"},d),debounceTime:50},C),s=s={children:function(){return(0,i.jsxs)(i.Fragment,{children:[D&&O,(0,i.jsx)("canvas",{ref:P,style:{display:D?"none":"block"}})]})}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(s)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(s)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(s,e))}),o))})},5222(e,r,n){function i(e){return!0===(null==e?void 0:e.isParticleSystem)}function a(e){return!0===(null==e?void 0:e.isHairSystem)}function o(e){return!0===(null==e?void 0:e.isShapeBlendEntity)}function s(e){return!0===(null==e?void 0:e.isPathObject)}function l(e){return!0===(null==e?void 0:e.isObject2D)}function u(e){return!0===(null==e?void 0:e.isUIObject)}function c(e){return"object"==(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)&&null!==e&&"booleanOp"in e}function h(e){return!0===(null==e?void 0:e.isCloner)}function d(e){return!0===(null==e?void 0:e.isClone)}function f(e){return!0===(null==e?void 0:e.isComponentObject)}n.d(r,{a:()=>i,b:()=>a,c:()=>o,d:()=>s,e:()=>l,f:()=>u,g:()=>c,h:()=>h,i:()=>d,j:()=>f})},3227(e,r,n){n.d(r,{a:()=>g,b:()=>k});var i=n(2995),a=n(5181),o=n(3027);function s(e,r,n){return r=d(r),function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,y()?Reflect.construct(r,n||[],d(e).constructor):r.apply(e,n))}function l(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function u(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function c(e,r,n){return r&&u(e.prototype,r),n&&u(e,n),e}function h(e,r,n){return(h="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=d(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&v(e,r)}function p(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function v(e,r){return(v=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}var m=function(e){function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0x999999;return l(this,r),(n=s(this,r,[e,i,a])).object=e,n.added=!1,n.name="DirectionalLightHelper: ".concat(e.uuid),n}return f(r,e),c(r,[{key:"raycast",value:function(e,r){(0,a.b)(this.object,m.geometryHelper,e,r)}}]),r}((0,a.a)(o.Ue)),g=function(e){function r(e,n,i){l(this,r),(a=s(this,r)).super_Entity(e,n),a.castShadow=!0,a.shadow.mapSize.width=2048,a.shadow.mapSize.height=2048,a.shadow.normalBias=1,a.layers.enable(3);var a,u=a.shadow.camera;u.top=1250,u.bottom=-1250,u.right=1250,u.left=-1250,u.near=-1e4,u.far=2500;var c=new o.Ve(a.shadow.camera);return c.visible=!1,a.gizmos.shadowmap=c,a}return f(r,e),c(r,[{key:"update",value:function(){for(var e in this.shadow.camera.updateProjectionMatrix(),this.gizmos){var r=this.gizmos[e];p(r,o.Ve)&&r.update()}}},{key:"updateMatrixWorld",value:function(e){h(d(r.prototype),"updateMatrixWorld",this).call(this,e),this.objectHelper&&this.objectHelper.update()}},{key:"updateState",value:function(e,r){this.updateState_Light(e,r);var n,i=void 0!==e.depth&&e.depth!==this.shadow.camera.far||void 0!==e.size&&e.size/2!==this.shadow.camera.right;void 0!==e.size&&(n=e.size,this.shadow.camera.right=n/2,this.shadow.camera.left=-n/2,this.shadow.camera.top=n/2,this.shadow.camera.bottom=-n/2,this.shadow.needsUpdate=!0),void 0!==e.shadowRadius&&(this.shadow.radius=e.shadowRadius),void 0!==e.shadowResolution&&(this.shadow.mapSize.set(e.shadowResolution,e.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null)),void 0!==e.penumbraSize&&r.scene.markPenumbraSizeDirty(),i&&this.update()}}]),r}((0,i.d)(o.Be,m)),b=function(e){function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6710886;return l(this,r),(n=s(this,r,[e,i])).object=e,n.matrix=e.matrixWorld,n.name="SpotLightHelper: ".concat(e.uuid),n}return f(r,e),c(r,[{key:"raycast",value:function(e,r){(0,a.b)(this.object,b.geometryHelper,e,r)}},{key:"update",value:function(){if(void 0!==this.object){var e=b._vector,r=this.object.distance?this.object.distance:1e3,n=r*Math.tan(this.object.angle);this.cone.scale.set(n,n,r),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);var i=void 0!==this.color?this.color:this.light.color;if(p(this.cone.material,Array))for(var a=0,o=this.cone.material.length;a<o;a++)this.cone.material[a].color.set(i);else this.cone.material.color.set(i)}}}]),r}((0,a.a)(o.Se));b._vector=new o.Fc;var w=new o.Fc,x=new o.Fc,S=new o.Ec,k=function(e){function r(e,n,i){l(this,r),(a=s(this,r)).super_Entity(e,n),a.castShadow=!0,a.shadow.mapSize.width=1024,a.shadow.mapSize.height=1024,a.shadow.normalBias=1,a.layers.enable(3);var a,u=a.shadow.camera;u.fov=2*o.Cc.RAD2DEG*a.angle,u.aspect=1,u.near=100,u.far=2500;var c=new o.Ve(a.shadow.camera);return c.visible=!1,a.gizmos.shadowmap=c,a.update(),a}return f(r,e),c(r,[{key:"update",value:function(){for(var e in this.shadow.camera.updateProjectionMatrix(),this.gizmos){var r=this.gizmos[e];p(r,o.Ve)&&r.update()}}},{key:"updateMatrixWorld",value:function(e){h(d(r.prototype),"updateMatrixWorld",this).call(this,e),x.setFromMatrixPosition(this.matrixWorld),S.setFromRotationMatrix(this.matrixWorld),w.copy(this.up).applyQuaternion(S).negate().multiplyScalar(this.distance),this.target.position.copy(x).add(w),this.target.updateMatrixWorld(),this.objectHelper&&this.objectHelper.update()}},{key:"updateState",value:function(e,r){this.updateState_Light(e,r),void 0!==e.distance&&(this.distance=e.distance),void 0!==e.decay&&(this.decay=e.decay),void 0!==e.angle&&(this.angle=e.angle),void 0!==e.penumbra&&(this.penumbra=e.penumbra),void 0!==e.shadowRadius&&(this.shadow.radius=e.shadowRadius),void 0!==e.penumbraSize&&r.scene.markPenumbraSizeDirty(),void 0!==e.shadowResolution&&(this.shadow.mapSize.set(e.shadowResolution,e.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}}]),r}((0,i.d)(o.ye,b))},5181(e,r,n){n.d(r,{a:()=>y,b:()=>w,c:()=>i,d:()=>v});var i,a=n(843),o=n(3027);function s(e,r,n){return r=c(r),function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,p()?Reflect.construct(r,n||[],c(e).constructor):r.apply(e,n))}function l(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function u(e,r,n){return(u="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=c(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&f(e,r)}function d(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function f(e,r){return(f=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}(i||(i={})).is=function(e){return"objectHelper"in e};var v=function(e,r){return function(e){var n;function i(){var e;return l(this,i),e=s(this,i,arguments),e.objectHelper=new r(e),e.gizmos={},e}return h(i,e),n=[{key:"geometryHelper",get:function(){return r.geometryHelper}},{key:"raycast",value:function(e,r){this.objectHelper.raycast(e,r)}},{key:"showGizmos",value:function(){for(var e in this.gizmos){var r=this.gizmos[e];d(r,o.We)&&(r.visible=!0)}}},{key:"updateEntityBoxSize",value:function(e,r){this.objectHelper.visible&&d(this.geometryHelper,o.Ed)?(e.setScalar(0),r.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):u(c(i.prototype),"updateEntityBoxSize",this).call(this,e,r)}},{key:"hideGizmos",value:function(){for(var e in this.gizmos){var r=this.gizmos[e];d(r,o.We)&&(r.visible=!1)}}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(i.prototype,n),i}((0,a.j)(e))},y=function(e){var r;return(r=function(e){function r(){return l(this,r),s(this,r,arguments)}return h(r,e),r}(e)).geometryHelper=new o.Ed(30,30,30),r},m=new o.jd,g=new o.cd,b=new o.Oc,w=function(e,r,n,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,l=s.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),g.copy(r.boundingSphere),g.applyMatrix4(l),!1!==n.ray.intersectsSphere(g)&&(b.copy(l).invert(),m.copy(n.ray).applyMatrix4(b),null===r.boundingBox||!1!==m.intersectsBox(r.boundingBox))){var u,c,h,d,f=r.index,p=r.attributes.position,v=r.drawRange;if(!1===a){for(h=Math.max(0,v.start),d=Math.min(f.count,v.start+v.count);h<d;h+=3)if(c=f.getX(h),u=function(e,r,n,i,a,s,l){var u=new o.Fc,c=new o.Fc,h=new o.Fc,d=new o.Fc,f=new o.Fc;if(u.fromBufferAttribute(i,a),c.fromBufferAttribute(i,s),h.fromBufferAttribute(i,l),null===n.intersectTriangle(u,c,h,!1,d))return null;f.copy(d),f.applyMatrix4(e.matrixWorld);var p=r.ray.origin.distanceTo(f);return p<r.near||p>r.far?null:{faceIndex:1,distance:p,point:f.clone(),object:e}}(e,n,m,p,c,f.getX(h+1),f.getX(h+2)))return u.faceIndex=Math.floor(h/3),void i.push(u)}else for(var y=r.attributes.position,w=new o.Fc,x=new o.Fc,S=new o.Fc,k=new o.Fc,M=1/((s.scale.x+s.scale.y+s.scale.z)/3),A=M*M,O=Math.max(0,v.start),C=Math.min(y.count,v.start+v.count)-1;O<C;O+=2)if(w.fromBufferAttribute(y,O),x.fromBufferAttribute(y,O+1),!(m.distanceSqToSegment(w,x,k,S)>A)){k.applyMatrix4(s.matrixWorld);var _=n.ray.origin.distanceTo(k);_<n.near||_>n.far||i.push({distance:_,point:S.clone().applyMatrix4(s.matrixWorld),object:e})}}}},1091(e,r,n){n.d(r,{a:()=>o,b:()=>s,c:()=>l,d:()=>u});var i=null,a=null;function o(e){i=e}function s(){return i}function l(e){a=e}function u(){return a}},8526(e,r,n){n.d(r,{a:()=>A,b:()=>O,c:()=>C,d:()=>D,e:()=>j,f:()=>T,g:()=>L,h:()=>F});var i=n(3227),a=n(2995),o=n(9968),s=n(7295),l=n(7173),u=n(909),c=n(843),h=n(5222),d=n(461),f=n(3940),p=n(3027);function v(e,r,n){return(v="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=y(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function g(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function b(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function w(e,r){return(w=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(x=function(){return!!e})()}function S(e){return m(e,u.ha)&&e.needsAO&&!(0,h.c)(e)&&!0!==e.isDecalObject}function k(e){var r=e.cloner,n=!0,i=!1,a=void 0;if(r&&Array.isArray(r.children))try{for(var o,s=r.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;(null==l?void 0:l.layers)&&(l.layers.mask=e.layers.mask)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}function M(e){return e.getLayersOfType("reflection").filter(function(e){return e.data.visible}).length}function A(e){return e.getLayersOfType("reflection").some(function(e){return e.data.visible&&1===e.data.mirror})}function O(e){var r=1/0,n=-1/0,i=!0,a=!1,o=void 0;try{for(var s,l=e.getLayersOfType("reflection")[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value.data;if(u.visible&&1!==u.mirror){var c="number"==typeof u.blur?u.blur:null;r=Math.min(r,null!=c?c:0),n=Math.max(n,null!=c?c:10)}}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return r===1/0?null:{min:r,max:n}}function C(e){var r=!0,n=!1,i=void 0;try{for(var a,o=e.getLayersOfType("reflection")[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value.data;if(s.visible){var l=s.blur,u=s.thickness,c=s.steps,h=s.stepSize;return"number"!=typeof l||"number"!=typeof u||"number"!=typeof c||"number"!=typeof h?"variable":{blur:l,thickness:u,steps:c,stepSize:h,tracingMode:+(1===s.tracingMode)}}}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return null}function _(e,r){var n={outline:!1,cavity:!1},i=512&e.layers.mask,a=r.getLayersOfType("transmission"),o=r.getLayersOfType("outline"),s=M(r),u=r.getLayersOfType("cavity");return(o.length>0||u.length>0)&&(e.layers.set(8),a.length>0&&e.layers.enable(3),s>0&&e.layers.enable(4),n.outline=o.length>0,n.cavity=u.length>0,(0,l.b)(e),(0,l.a)(e)),0===a.length&&0===o.length&&0===u.length&&0===s&&e.layers.set(0),i&&e.layers.set(9),!i&&S(e)&&e.layers.enable(5),k(e),n}function P(e,r){if(!r.layers)return!1;var n=512&e.layers.mask,i=!1,a=r.getLayersOfType("transmission").filter(function(e){return e.data.visible}),o=r.getLayersOfType("outline").filter(function(e){return e.data.visible}),s=M(r),l=r.getLayersOfType("cavity").filter(function(e){return e.data.visible});return a.length>0&&(e.layers.set(3),(o.length>0||l.length>0)&&e.layers.enable(8),s>0&&e.layers.enable(4),i=!0),0===a.length&&0===o.length&&0===l.length&&0===s&&e.layers.set(0),n&&e.layers.set(9),!n&&S(e)&&e.layers.enable(5),k(e),i}function E(e,r){if(!r.layers)return!1;var n,i=512&e.layers.mask,a=!1,o=M(r),s=r.getLayersOfType("transmission").filter(function(e){return e.data.visible}),l=r.getLayersOfType("outline").filter(function(e){return e.data.visible}),u=r.getLayersOfType("cavity").filter(function(e){return e.data.visible});return o>0&&(null!=(n=e.userData).__splinePlanarMirror||(n.__splinePlanarMirror=0),e.layers.set(4),s.length>0&&e.layers.enable(3),(l.length>0||u.length>0)&&e.layers.enable(8),a=!0),0===o&&0===s.length&&0===l.length&&0===u.length&&e.layers.set(0),i&&e.layers.set(9),!i&&S(e)&&e.layers.enable(5),k(e),a}function D(e){var r={outline:!1,cavity:!1},n=function(e){r.outline=r.outline||e.outline,r.cavity=r.cavity||e.cavity};return e.traverseEntity(function(e){if(m(e,u.ha))if(Array.isArray(e.material))for(var r=0;r<e.material.length;r++)n(_(e,e.material[r]));else n(_(e,e.material))}),r}function j(e){var r=!1;return e.traverseEntity(function(e){if(m(e,u.ha))if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)P(e,e.material[n])&&(r=!0);else P(e,e.material)&&(r=!0)}),r}function T(e){var r=!1;return e.traverseEntity(function(e){if(m(e,u.ha))if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)E(e,e.material[n])&&(r=!0);else E(e,e.material)&&(r=!0)}),r}var I=new p.Ne,R=new p.Oc,B=new p.jd,z=new p.cd;function L(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.cloner;if(a){var o=null;if(e.raycast===p.ld.prototype.raycast||e.raycast===c.v.prototype.raycast){var s=e.geometry;s&&(null===s.boundingSphere&&s.computeBoundingSphere(),o=s.boundingSphere)}var l=!0,u=!1,h=void 0;try{for(var d,f=a.children[Symbol.iterator]();!(l=(d=f.next()).done);l=!0){var v=d.value;if(null===o||(z.copy(o).applyMatrix4(v.matrixWorld),r.ray.intersectsSphere(z))){var y=R.copy(v.matrixWorld).invert(),m=B.copy(r.ray).applyMatrix4(y),w=e.matrixWorld;m.applyMatrix4(w),I.set(m.origin,m.direction),I.near=r.near,I.far=r.far,I.layers.mask=r.layers.mask;var x=I.intersectObject(e,!1);x.length>0&&n.push(b(g({},x[0]),{object:i?v:e}))}}}catch(e){u=!0,h=e}finally{try{l||null==f.return||f.return()}finally{if(u)throw h}}}}var F=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(e,r,i){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");if(a=y(a=n),(o=function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,x()?Reflect.construct(a,[],y(this).constructor):a.apply(this,void 0))).data=r,o.bgColor=new u.i(1,1,1,1),o.fog=null,o.backupFog=new p.Uc(0xffffff,.1,2e3),o.fogUseBGColor=!1,o.fogMode="linear",o.fogDensity=f.pa.getDensity({}),o.fogHeightFalloff=f.pa.getHeightFalloff({}),o.fogHeightBase=f.pa.getHeightBase({}),o.isActive=!1,o.skyState=null,o.skyStateVersion=0,o.gradingState=null,o.skyHdriHolder=null,o.aoColor=new p.Tc,o.penumbraSizeArrayCache=null,o.super_Entity(e,r),o.personalCamera=new s.a(f.w,b(g({},f.ya.defaultData,r.camera),{name:"Personal Camera"})),o.personalCamera.objectHelper.visible=!1,o.add(o.personalCamera),o.activeCamera=o.personalCamera,o.ambientLight=new p.ve(0xd3d3d3,8553090,.75*Math.PI),o.ambientLight.name="Default Ambient Light",o.ambientLight.layers.enable(3),o.ambientLight.removeFromParent(),o.add(o.ambientLight),r.uiScene){var a,o,l=(0,d.l)();null===l?(0,d.c)("ui-2d","a page's 2D scene"):o.uiScene=new l.Scene2D((Array.isArray(e)?e[0]:e)+"-ui",r.uiScene,{dpr:window.devicePixelRatio,shared:i.shared})}else r.uiFrame&&o.createUICanvas(r.uiFrame,i);return o}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&w(n,e),r=[{key:"scene",get:function(){return this.parent}},{key:"postprocessing",get:function(){return this.data.postprocessing}},{key:"frameId",get:function(){return this.data.uiFrame}},{key:"frame",get:function(){var e;return null==(e=this.uiCanvas)?void 0:e.frame}},{key:"createUICanvas",value:function(e,r){var n=this,i=(0,d.l)();null!==i?(this.uiCanvas=new i.UICanvas(this.uuid+"-uiscreen",window.innerWidth,window.innerHeight,r),this.uiCanvas.isScreenSpace=!0,this.uiCanvas.promise.then(function(){var r,i;null==(r=n.uiCanvas)||r.applyFrame(e),null==(i=n.uiCanvas)||i.applySize()})):(0,d.c)("ui-2d","a page's UI canvas")}},{key:"updateVisible",value:function(){}},{key:"setBackgroundColor",value:function(e){this.bgColor=e,!0===this.fogUseBGColor&&(this.backupFog.color=e)}},{key:"entityChildrenCount",value:function(){return this.uiScene?this.uiScene.children.length:v(y(n.prototype),"entityChildrenCount",this).call(this)}},{key:"updateAmbientLight",value:function(e,r){void 0!==e.color&&(this.ambientLight.color=(0,o.a)(e.color,r)),void 0!==e.intensity&&(this.ambientLight.intensity=e.intensity*Math.PI),void 0!==e.enabled&&(e.enabled?this.add(this.ambientLight):this.remove(this.ambientLight))}},{key:"onDeactive",value:function(){this.isActive=!1}},{key:"onActive",value:function(e){this.isActive=!0,e.fog=this.fog,this.traverseEntity(function(e){m(e,a.b)&&e.recomputeBoolean()}),this.updateShadow(this.data.shadow)}},{key:"forceMaterialsUpdate",value:function(){this.traverseEntity(function(e){var r=!0,n=!1,i=void 0;if(m(e,u.ha))if(Array.isArray(e.material))try{for(var a,o=e.material[Symbol.iterator]();!(r=(a=o.next()).done);r=!0)a.value.needsUpdate=!0}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}else e.material.needsUpdate=!0,e.material.dispose()})}},{key:"updateShadow",value:function(e){if((void 0!==e.softShadowQuality||void 0!==e.type)&&this.isActive){var r=this.data.shadow,n=f.sa.isSoft(r);(0,u.X)(n,null==r?void 0:r.softShadowQuality)&&this.forceMaterialsUpdate()}}},{key:"updateFog",value:function(e,r){e.enabled?this.fog=this.backupFog:this.fog=null,this.isActive&&(this.scene.fog=this.fog),this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=(0,o.a)(e.color,r),this.backupFog.near=e.near,this.backupFog.far=e.far,this.fogMode=f.pa.getMode(e),this.fogDensity=f.pa.getDensity(e),this.fogHeightFalloff=f.pa.getHeightFalloff(e),this.fogHeightBase=f.pa.getHeightBase(e)}},{key:"updateSky",value:function(e,r){this.skyState=null!=e?e:null,this.skyStateVersion++;var n,i=null==e||null==(n=e.hdri)?void 0:n.image;this.skyHdriHolder=null!=i?r.image(i):null}},{key:"updateAo",value:function(e,r){void 0!==e.aoColor&&(this.aoColor=(0,o.a)(e.aoColor,r))}},{key:"updateByOp",value:function(e,r,i,a){var o,s=this.data.uiFrame;v(y(n.prototype),"updateByOp",this).call(this,e,r,i,a),(0,c.b)(e.path,["fog"])?this.updateFog(r.fog,i.shared):(0,c.b)(e.path,["sky"])?this.updateSky(r.sky,i.shared):(0,c.b)(e.path,["grading"])?this.gradingState=null!=(o=r.grading)?o:null:(0,c.b)(e.path,["ao"])?this.updateAo(r.ao,i.shared):(0,c.b)(e.path,["ambient"])?this.updateAmbientLight(r.ambient,i.shared):(0,c.b)(e.path,["shadow"])?this.updateShadow(r.shadow):0===e.type&&0===e.path.length&&(void 0!==e.props.uiFrame||s!==r.uiFrame)&&this.updateUIFrame(e.props.uiFrame,i)}},{key:"updateUIFrame",value:function(e,r){e?(this.uiCanvas||this.createUICanvas(e,r),this.uiCanvas.enabled=!0,this.uiCanvas.applyFrame(e)):this.uiCanvas&&(this.uiCanvas.enabled=!1)}},{key:"updateState",value:function(e,r){this.updateState_Entity(e,r),void 0!==e.backgroundColor&&this.setBackgroundColor((0,o.a)(e.backgroundColor,r.shared)),void 0!==e.fog&&this.updateFog(e.fog,r.shared),void 0!==e.sky&&this.updateSky(e.sky,r.shared),void 0!==e.grading&&(this.gradingState=e.grading),void 0!==e.ambient&&this.updateAmbientLight(e.ambient,r.shared),void 0!==e.ao&&this.updateAo(e.ao,r.shared),void 0!==e.shadow&&this.updateShadow(e.shadow)}},{key:"createFrame",value:function(e,r){}},{key:"raycast",value:function(e,r){v(y(n.prototype),"raycast",this).call(this,e,r)}},{key:"switchActiveCamera",value:function(e){e&&e.isDescendantOf(this)&&(this.activeCamera!==this.personalCamera&&(this.activeCamera.objectHelper.visible=!0),this.activeCamera=e,e.objectHelper.visible=!1)}},{key:"playCamera",get:function(){var e,r;return null!=(e=null==(r=this.scene)?void 0:r.find(this.data.publish.playCamera))?e:this.personalCamera}},{key:"switchToPlayCamera",value:function(){this.switchActiveCamera(this.playCamera)}},{key:"penumbraSizeArray",get:function(){return null===this.penumbraSizeArrayCache&&this.updatePenumbraSizeArray(),this.penumbraSizeArrayCache}},{key:"updatePenumbraSizeArray",value:function(){var e=this;this.penumbraSizeArrayCache=Array(u.d).fill(.5);var r=0,n=0;this.traverseEntity(function(a){var o,s;if(!a.visible)return!0;m(a,i.a)&&a.visible&&r<u.e&&(e.penumbraSizeArrayCache[r]=null!=(o=a.data.penumbraSize)?o:.5,r+=1),m(a,i.b)&&a.visible&&r<u.d-u.e&&(e.penumbraSizeArrayCache[u.e+n]=null!=(s=a.data.penumbraSize)?s:.5,n+=1)})}},{key:"raycastWithClones",value:function(e){var r=this,n=[],i=function(o){var s=!0,l=!1,u=void 0;try{for(var h,d=o.children[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var f=h.value,p=f.cloner;c.h.is(f)&&(f.visible||(null==p?void 0:p.object.data.visible))&&(((0,a.e)(f)||(0,a.g)(f)&&r.scene.enableHelpers&&f.objectHelper.visible)&&(e.intersectObject(f,!1,n),L(f,e,n,!0)),i(f))}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}};return i(this),n}},{key:"updateEntity2DByOp",value:function(e,r,n,i){var a;null==(a=this.uiCanvas)||a.updateEntity2DByOp(e,r,n,i)}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(n.prototype,r),n}((0,c.j)(p.Vc))},2220(e,r,n){n.d(r,{a:()=>ee,b:()=>eo,c:()=>j,d:()=>I,e:()=>R,f:()=>el,g:()=>eA,h:()=>eC,i:()=>e_,j:()=>eT,k:()=>eI,l:()=>eD,m:()=>eR});var i=n(4438),a=n(2865),o=n(2769),s=n(7913),l=n(909),u=n(7410),c=n(843),h=n(4691),d=n(5222),f=n(461),p=n(3940),v=n(3027);function y(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function m(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}function g(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function s(e){m(o,i,a,s,l,"next",e)}function l(e){m(o,i,a,s,l,"throw",e)}s(void 0)})}}function b(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function w(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function x(e,r,n){return r&&w(e.prototype,r),n&&w(e,n),e}function S(e,r,n){return(S="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=k(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function M(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function A(e,r){return(A=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function O(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||P(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||P(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function P(e,r){if(e){if("string"==typeof e)return y(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,r)}}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function D(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var j=200,T=null;function I(e){T=e}function R(e){var r=!1;return e.scene.objects.forEach(function(n){"Page"===n.data.type&&!r&&n.data.publish.gameControlObject&&p.Ea.traverseModuleInstances(e,n.id,function(e,n,i){var a=!0,o=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;"GameControl"===c.data.type&&c.data.navmesh.enabled&&(r=!0)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}})}),r}function B(e){return o.b?e.metaKey:e.ctrlKey}function z(e,r){return 2>=Math.abs(e+3*r)||2>=Math.abs(e+3*window.devicePixelRatio*r)}var L={type:"change"},F={type:"start"},U={type:"end",nonOrbit:!0},V={type:"end",nonOrbit:!1},N={type:"end",isZoom:!0,nonOrbit:!0},G={type:"end",changed:!1},W={type:"cameraAnimatingInTimeline"},H=new v.Ec,q=new v.Dc,Y=2*Math.PI,X=new v.Fc,Z=new v.Dc,K=new v.Fc,J=new v.Ec,Q=new v.Oc,$={type:"requestRender"},ee=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(e,n){var i,s,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isPlayMode:!1,isExport:!1},u=arguments.length>3?arguments[3]:void 0;return b(this,r),i=k(i=r),(s=function(e,r){if(r&&("object"===_(r)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,E()?Reflect.construct(i,[],k(this).constructor):i.apply(this,void 0))).object=e,s.domElement=n,s.options=l,s.timelineState=u,s.enabled=!0,s.useKeyEvents=!0,s.enableDamping=!1,s.enableZoom=!0,s.enableRotate=!0,s.enablePan=!0,s.autoRotate=!1,s.rotationLimitsMode=0,s.panLimitsMode=0,s.rotationSoftLimit=2,s.panSoftLimit=2,s.hoverRotatePanMode=0,s.zoomLimitsEnabled=!1,s.mouseButtons=[0,5],s.mouseButtonsPlay=[3,4,5],s.touches=[null,v.b.DOLLY_ROTATE,v.b.PAN],s.offset=new v.Fc,s.eye=new v.Fc,s.lastPosition=new v.Fc,s.lastQuaternion=new v.Ec,s.current=new v.Dc,s.overShoot=new v.Dc,s.overRatio=new v.Dc,s.spherical=new v.Oe,s.sphericalDelta=new v.Oe,s.panOffset=new v.Fc,s.panLeftV=new v.Fc,s.panUpV=new v.Fc,s.panV=new v.Fc,s.rotateStart=new v.Dc,s.rotateEnd=new v.Dc,s.rotateDelta=new v.Dc,s.panStart=new v.Dc,s.panEnd=new v.Dc,s.panDelta=new v.Dc,s.dollyStart=new v.Dc,s.dollyEnd=new v.Dc,s.dollyDelta=new v.Dc,s.rotationRangeFactor=new v.Dc,s.panRangeFactor=new v.Dc,s.state=-1,s.zoomChanged=!1,s.isPointerDown=!1,s.isThetaFlipped=!1,s.prevScale=0,s.scale=1,s.gesture=!1,s.lastTrackpadPanTime=-1/0,s.lastMouseWheelZoomTime=-1/0,s.timer=-1,s.timerHover=-1,s.minDistance=0,s.maxDistance=1/0,s.minZoom=0,s.maxZoom=1/0,s.minPhi=0,s.maxPhi=Math.PI,s.minTheta=-1/0,s.maxTheta=1/0,s.minH=0,s.maxH=Math.PI,s.minV=-1/0,s.maxV=1/0,s.autoRotateClockwise=!0,s.isPanOverShoot=!1,s.isRotateOverShoot=!1,s.resetHoverEffectOnPointerLeave=!1,s.hasChange=!1,s.useWindowEvents=!1,s.isTouchZoom=!0,s.autoRotateSpeed=2,s.dampingFactor=.125,s.zoomSpeed=2,s.rotateSpeed=1,s.rotateFactor=1,s.panSpeed=1,s.hoverRotatePanStrength=.1,s.hoverRotateDamping=s.dampingFactor,s.isCurrentlyDamping=!1,s.thetaIsFree=!1,s.phiIsFree=!1,s.needsUpdate=!0,s.onCameraChange=function(e){s.object.removeEventListener("beginState",s.onBeginState),s.object.removeEventListener("completeState",s.onCompleteState),s.object.removeEventListener("cameraChange",s.onCameraChange),s.object=e.camera,s.object.addEventListener("beginState",s.onBeginState),s.object.addEventListener("completeState",s.onCompleteState),s.object.addEventListener("cameraChange",s.onCameraChange)},s.update=function(){s.object.updateWorldMatrix(!0,!1),s.object.matrixWorld.decompose(K,J,X),s.offset.copy(K).sub(s.target),s.spherical.setFromVector3(s.offset),s.object.isUpVectorFlipped&&(s.spherical.phi*=-1,s.spherical.theta-=Math.PI),s.autoRotate&&-1===s.state&&s.rotateLeft((!0===s.autoRotateClockwise?1:-1)*s.getAutoRotationAngle()),0!==s.rotationLimitsMode&&s.applyLimits(s.sphericalDelta,s.rotationLimitsMode,s.rotationSoftLimit,s.maxTheta,s.minTheta,s.maxPhi,s.minPhi,s.rotationRangeFactor),2!==s.rotationLimitsMode&&(s.spherical.phi+=s.sphericalDelta.phi),(1!==s.rotationLimitsMode||!0===s.autoRotate)&&(s.spherical.theta+=s.sphericalDelta.theta),s.spherical.radius*=s.scale,s.zoomLimitsEnabled&&s.object.isPerspectiveCamera&&(s.spherical.radius=Math.max(s.minDistance,Math.min(s.maxDistance,s.spherical.radius))),0!==s.panLimitsMode&&(s.target.applyQuaternion(H.copy(J).invert()),s.panOffset.applyQuaternion(H),s.applyLimits(s.panOffset,s.panLimitsMode,s.panSoftLimit,s.maxH,s.minH,s.maxV,s.minV,s.panRangeFactor),s.target.applyQuaternion(J),s.panOffset.applyQuaternion(J)),2===s.panLimitsMode&&(s.panOffset.y=0),1===s.panLimitsMode&&(s.panOffset.x=0),-1!==s.state||s.gesture?(s.target.add(s.panOffset),s.panOffset.set(0,0,0)):(s.panOffset.multiplyScalar(1-s.dampingFactor),s.target.add(s.panOffset)),s.offset.setFromSpherical(s.spherical),K.copy(s.target).add(s.offset),s.object.position.copy(s.target).add(s.offset),s.object.parent&&(Q.copy(s.object.parent.matrixWorld).invert(),s.object.position.applyMatrix4(Q));var e=s.spherical.phi%Y;if(s.eye.copy(s.offset).normalize(),s.object.up.copy(v.Rc.DEFAULT_UP).applyAxisAngle(s.eye,s.object.angleOffsetFromUp),e>0&&e>Math.PI||e<0&&e>-Math.PI?(s.object.up.negate(),s.object.lookAt(s.target),s.object.isUpVectorFlipped=!0):(s.object.lookAt(s.target),s.object.isUpVectorFlipped=!1),-1===s.state||!0===s.enableDamping){var r=1===s.hoverRotatePanMode?s.hoverRotateDamping:s.dampingFactor;s.sphericalDelta.theta*=1-r,s.sphericalDelta.phi*=1-r}else s.sphericalDelta.set(0,0,0);(s.scale=1,s.lastPosition.distanceToSquared(s.object.position)>.01||8*(1-s.lastQuaternion.dot(s.object.quaternion))>1e-8)?(s.dispatchEvent(L),s.object.dispatchEvent($),s.lastPosition.copy(s.object.position),s.lastQuaternion.copy(s.object.quaternion),s.isCurrentlyDamping=!0):(s.isPanOverShoot=!1,s.isRotateOverShoot=!1,s.object.wasMovedBySwitchCameraAction=!1,s.sphericalDelta.set(0,0,0),s.panOffset.set(0,0,0),s.isCurrentlyDamping=!1)},s.onPointerDown=function(e){!1!==s.enabled&&("touch"===e.pointerType||"pen"===e.pointerType&&o.e?s.onPointerDownTouch(e):s.onPointerDownMouse(e),-1!==s.state&&(s.isPointerDown=!0,s.dispatchEvent(F),s.domElement.addEventListener("pointermove",s.onPointerMove),s.domElement.addEventListener("pointerup",s.onPointerUp),e.stopPropagation(),"touch"===e.pointerType||"pen"===e.pointerType&&o.e||s.domElement.setPointerCapture(e.pointerId)))},s.onPointerLeave=function(e){s.resetHoverEffectOnPointerLeave&&!s.useWindowEvents?(1===s.hoverRotatePanMode?(s.sphericalDelta.theta=-s.spherical.theta,s.sphericalDelta.phi=-s.spherical.phi,X.subVectors(s.position0,s.target0),s.spherical.setFromVector3(X),s.sphericalDelta.theta+=s.spherical.theta,s.sphericalDelta.phi+=s.spherical.phi,s.sphericalDelta.theta/=8,s.sphericalDelta.phi/=8):2===s.hoverRotatePanMode&&s.panOffset.subVectors(s.target0,s.target).divideScalar(8),s.update()):s.pointerLeaveEvent=e},s.onPointerEnter=function(e){s.resetHoverEffectOnPointerLeave||void 0===s.pointerLeaveEvent?Z.set(e.clientX-s.domElement.clientWidth/2,e.clientY-s.domElement.clientHeight/2):Z.set(e.clientX-s.pointerLeaveEvent.clientX,e.clientY-s.pointerLeaveEvent.clientY),1===s.hoverRotatePanMode?(s.rotateDelta.copy(Z).multiplyScalar(s.rotateSpeed*s.hoverRotatePanStrength).rotateAround(q,-s.object.angleOffsetFromUp),s.rotateLeft(2*Math.PI*s.rotateDelta.x/s.domElement.clientHeight),s.rotateUp(2*Math.PI*s.rotateDelta.y/s.domElement.clientHeight),s.rotateStart.set(e.clientX,e.clientY)):2===s.hoverRotatePanMode&&(s.panDelta.copy(Z).multiplyScalar(s.panSpeed*s.hoverRotatePanStrength),s.pan(s.panDelta.x,s.panDelta.y),s.panStart.set(e.clientX,e.clientY)),s.update()},s.onPointerMove=function(e){var r;(null==(r=s.timelineState)?void 0:r.isPlayingCameraAnimation)?s.dispatchEvent(W):!1!==s.enabled&&(s.checkRaycastLock()||("touch"===e.pointerType||"pen"===e.pointerType&&o.e?s.onPointerMoveTouch(e):s.onPointerMoveMouse(e),e.stopPropagation()))},s.onPointerUp=function(e){s.isPointerDown=!1,0===a.a.length&&(s.domElement.removeEventListener("pointermove",s.onPointerMove),s.domElement.removeEventListener("pointerup",s.onPointerUp)),a.a.length>1&&e.preventDefault(),s.hasChange?s.dispatchEvent(0===s.state?V:U):s.dispatchEvent(G),s.state=-1,e&&(e.stopPropagation(),"touch"===e.pointerType||"pen"===e.pointerType&&o.e||s.domElement.releasePointerCapture(e.pointerId))},s.onPointerDownMouse=function(e){switch(s.useKeyEvents?s.mouseButtons[e.button]:s.mouseButtonsPlay[e.button]){case 0:if(!0!==e.altKey||e.shiftKey||B(e)){if(" "===s.key){if(!1===s.enablePan)return;s.handleMouseDownPan(e),s.state=2}}else{if(!1===s.enableRotate)return;s.handleMouseDownRotate(e),s.state=0}break;case 4:if(!1===s.enablePan)return;s.handleMouseDownPan(e),s.state=2;break;case 3:if(B(e)||e.shiftKey){if(!1===s.enablePan)return;s.handleMouseDownPan(e),s.state=2}else{if(!1===s.enableRotate)return;s.handleMouseDownRotate(e),s.state=0}break;case 5:if(B(e)||e.shiftKey){if(!1===s.enableRotate)return;s.handleMouseDownRotate(e),s.state=0}else{if(!1===s.enablePan)return;s.handleMouseDownPan(e),s.state=2}break;default:s.state=-1}},s.onPointerMoveMouse=function(e){switch(s.state){case 0:if(!1===s.enableRotate)return;s.handleMouseMoveRotate(e);break;case 1:if(!1===s.enableZoom)return;s.handleMouseMoveDolly(e);break;case 2:if(!1===s.enablePan)return;s.handleMouseMovePan(e)}s.object.wasMovedByUser=!0},s.onPointerDownTouch=function(e){switch(a.a.length>1&&e.preventDefault(),s.touches[a.a.length-1]){case v.b.ROTATE:if(!1===s.enableRotate)return void(s.state=-1);s.handleTouchStartRotate(),s.state=3;break;case v.b.PAN:if(!1===s.enablePan)return void(s.state=-1);s.handleTouchStartPan(),s.state=4;break;case v.b.DOLLY_PAN:if(!1===s.enableZoom&&!1===s.enablePan)return;s.handleTouchStartDollyPan(),s.state=5;break;case v.b.DOLLY_ROTATE:if(!1===s.enableZoom&&!1===s.enableRotate)return;s.handleTouchStartDollyRotate(),s.state=6;break;default:s.state=-1}},s.onPointerMoveTouch=function(e){switch(a.a.length>1&&e.preventDefault(),s.state){case 3:if(!1===s.enableRotate)return;s.handleTouchMoveRotate(e),s.update();break;case 4:if(!1===s.enablePan)return;s.handleTouchMovePan(e),s.update();break;case 5:if(!1===s.enableZoom&&!1===s.enablePan)return;s.handleTouchMoveDollyPan(e),s.update();break;case 6:if(!1===s.enableZoom&&!1===s.enableRotate)return;s.handleTouchMoveDollyRotate(e),s.update();break;default:s.state=-1}s.object.wasMovedByUser=!0},s.dispatchEndDebounced=(0,h.a)(function(){s.zoomChanged?s.dispatchEvent(N):s.dispatchEvent(U),s.zoomChanged=!1},33),s.onMouseWheel=function(e){if(!1!==s.enabled&&(!1!==s.enableZoom||!1!==s.enablePan)&&!s.checkRaycastLock()){var r;if(s.options.isExport||s.domElement.clientHeight!==document.body.clientHeight||s.domElement.clientWidth!==document.body.clientWidth||e.preventDefault(),s.dispatchEvent(F),null==(r=s.timelineState)?void 0:r.isPlayingCameraAnimation)return void s.dispatchEvent(W);s.handleMouseWheel(e),s.dispatchEndDebounced(),s.object.wasMovedByUser=!0}},s.onGesture=function(e){if(e.preventDefault(),!1!==s.enabled&&!s.checkRaycastLock()&&!o.c){var r;if(null==(r=s.timelineState)?void 0:r.isPlayingCameraAnimation)return void s.dispatchEvent(W);if("gesturechange"===e.type){if(!1===s.enableZoom||!1===s.isTouchZoom)return;s.dispatchEvent(F),e.scale>s.prevScale?s.dollyIn(s.getZoomScale()):e.scale<s.prevScale&&s.dollyOut(s.getZoomScale()),s.prevScale=e.scale,s.update(),s.object.wasMovedByUser=!0}else s.dispatchEvent(U)}},s.onContextMenu=function(e){e.preventDefault()},s.onTouchEnd=function(e){e.preventDefault()},s.onKeyDown=function(e){!1!==s.enabled&&(s.key=e.key," "===e.key&&s.dispatchEvent(F))},s.onKeyUp=function(e){s.key=void 0,!1!==s.enabled&&(-1!==s.state&&"Alt"===e.key&&s.onPointerUp(a.a["0"])," "===e.key&&s.dispatchEvent(U))},s.onPointerHover=function(e){"mouse"!==e.pointerType||!1===s.enabled||-1!==s.state||2===s.hoverRotatePanMode&&s.isPanOverShoot||1===s.hoverRotatePanMode&&s.isRotateOverShoot||(s.isPointerDown=!0,2===s.hoverRotatePanMode?s.handleMouseMovePan(e,s.hoverRotatePanStrength):1===s.hoverRotatePanMode&&s.handleMouseMoveRotate(e,s.hoverRotatePanStrength))},s.onBeginState=function(){s.enabled=!1,s.needsUpdate=!1},s.onCompleteState=function(e){e.isfromEntity&&s.options.isPlayMode||(s.enabled=!0,s.needsUpdate=!0,s.object.updateUp(),s.object.getTarget(s.target))},s.target=s.object.getTarget(),s.target0=s.target.clone(),s.position0=s.object.position.clone(),s.zoom0=s.object.zoom,s.quat0=s.object.quaternion.clone(),s.isUpVectorFlipped0=s.object.isUpVectorFlipped,s.object.updateWorldMatrix(!0,!1),s.object.matrixWorld.decompose(K,J,X),s.offset.copy(K).sub(s.target),s.spherical.setFromVector3(s.offset),s.object.isUpVectorFlipped&&(s.spherical.phi*=-1,s.spherical.theta-=Math.PI),s.initialSphericalRadius=s.spherical.radius,s.addEventListenersToCamera(),s}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&A(r,e),x(r,[{key:"dispatchEvent",value:function(e){"start"===e.type?this.hasChange=!1:this.hasChange=!0,S(k(r.prototype),"dispatchEvent",this).call(this,e)}},{key:"addEventListenersToCamera",value:function(){this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)}},{key:"removeEventListenersFromCamera",value:function(){this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange)}},{key:"updateUseWindowEvents",value:function(e){if(window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("pointermove",this.onPointerHover),this.useWindowEvents=e,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover)),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),0!==this.hoverRotatePanMode&&!this.useWindowEvents){var r=this.useWindowEvents?window:this.domElement;r.addEventListener("pointerleave",this.onPointerLeave),r.addEventListener("pointerenter",this.onPointerEnter)}}},{key:"fromJSON",value:function(e,r){this.rotateFactor=null!=(n=e.rotationSpeed)?n:1,this.setEnableDampingSpeed(e.enableDamping),this.enablePan=e.enablePan,this.enableZoom=e.enableZoom,this.enableRotate=e.enableRotate,this.rotationLimitsMode=e.rotationLimitsMode,this.thetaIsFree=e.rotationHorizontalOffset.min===e.rotationHorizontalOffset.max&&e.rotationHorizontalOffset.min===Math.PI,this.phiIsFree=e.rotationVerticalOffset.min===e.rotationVerticalOffset.max&&e.rotationVerticalOffset.min===Math.PI,this.panLimitsMode=e.panLimitsMode,this.panSoftLimit=e.panSoftLimit,this.rotationSoftLimit=e.rotationSoftLimit,this.hoverRotatePanMode=e.hoverRotatePanMode,this.hoverRotateDamping=null!=(i=e.hoverRotateDamping)?i:this.dampingFactor,this.useWindowEvents="window"===r,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover));var n,i,a,o=e.hoverRotatePanStrength/100;this.hoverRotatePanStrength=Math.pow(o,2),this.zoomLimitsEnabled=e.zoomLimitsEnabled,this.minZoom=e.zoomLimits.min,this.maxZoom=Math.max(e.zoomLimits.min,e.zoomLimits.max),this.minDistance=1e3/this.maxZoom,this.maxDistance=Math.max(this.minDistance,1e3/e.zoomLimits.min),this.autoRotate=e.autoRotate,this.autoRotateSpeed=e.autoRotateSpeed,this.autoRotateClockwise=e.autoRotateClockwise;var s=this.object.getTarget().applyQuaternion(H.copy(this.object.quaternion).invert());this.minV=-e.panVerticalOffset.min+s.y,this.maxV=e.panVerticalOffset.max+s.y,this.minH=-e.panHorizontalOffset.min+s.x,this.maxH=e.panHorizontalOffset.max+s.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=et(this.spherical.phi-e.rotationVerticalOffset.min),this.maxPhi=et(this.spherical.phi+e.rotationVerticalOffset.max),this.minTheta=et(et(this.spherical.theta)-e.rotationHorizontalOffset.min),this.maxTheta=et(et(this.spherical.theta)+e.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,1===e.orbitTouches&&(this.touches[0]=v.b.ROTATE),1===e.panTouches&&(this.touches[0]=v.b.PAN),2===e.orbitTouches&&(this.touches[1]=v.b.DOLLY_ROTATE),2===e.panTouches&&(this.touches[1]=v.b.DOLLY_PAN),3===e.orbitTouches&&(this.touches[2]=v.b.ROTATE),3===e.panTouches&&(this.touches[2]=v.b.PAN),this.isTouchZoom=e.isTouchZoom,this.resetHoverEffectOnPointerLeave=null!=(a=e.resetHoverEffectOnPointerLeave)&&a}},{key:"connect",value:function(){if(this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture),this.domElement.addEventListener("touchend",this.onTouchEnd),0!==this.hoverRotatePanMode&&!this.useWindowEvents){var e=this.useWindowEvents?window:this.domElement;e.addEventListener("pointerleave",this.onPointerLeave),e.addEventListener("pointerenter",this.onPointerEnter)}this.pointerLeaveEvent=void 0}},{key:"dispose",value:function(){this.removeEventListenersFromCamera(),this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)}},{key:"applyLimits",value:function(e,r,n,i,a,o,s,l){var u,c,h;this.overShoot.set(0,0),M(e,v.Fc)?(u=e.x,c=e.y,this.current.set(this.target.x,this.target.y),h=!0):(u=e.theta,c=e.phi,this.current.set(et(this.spherical.theta),et(this.spherical.phi)),h=!1),0===n&&(this.current.x+=u,this.current.y+=c),(3===r||2===r)&&(!h&&this.isThetaFlipped?this.current.x>i&&this.current.x<0?this.overShoot.x=i-this.current.x:this.current.x<a&&this.current.x>0&&(this.overShoot.x=a-this.current.x):this.current.x>i?this.overShoot.x=i-this.current.x:this.current.x<a&&(this.overShoot.x=a-this.current.x)),(3===r||1===r)&&(this.current.y>o?this.overShoot.y=o-this.current.y:this.current.y<s&&(this.overShoot.y=s-this.current.y)),h||(this.overShoot.x=et(this.overShoot.x),this.overShoot.y=et(this.overShoot.y)),0!==n?(this.overRatio.copy(this.overShoot).divide(l),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),1===n&&(this.overRatio.x=er(Math.abs(this.overRatio.x)),this.overRatio.y=er(Math.abs(this.overRatio.y))),this.isPointerDown||1===n?2===n&&(this.overRatio.x>.9&&!this.thetaIsFree||this.overRatio.y>.9&&!this.phiIsFree)?this.isPointerDown=!1:(u*this.overShoot.x<0&&!this.thetaIsFree&&(u*=1-this.overRatio.x),c*this.overShoot.y<0&&!this.phiIsFree&&(c*=1-this.overRatio.y)):2===n&&(!h&&(this.overRatio.x>.002&&!this.thetaIsFree||this.overRatio.y>.002&&!this.phiIsFree)||h&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(this.thetaIsFree||(u=.05*this.overShoot.x),this.phiIsFree||(c=.05*this.overShoot.y),h?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):h?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(u+=this.overShoot.x,c+=this.overShoot.y),M(e,v.Fc)?(e.x=u,e.y=c):(this.thetaIsFree||(e.theta=u),this.phiIsFree||(e.phi=c))}},{key:"setEnableDampingSpeed",value:function(e){this.enableDamping=e,this.rotateSpeed=(!0===e?.2:1)*this.rotateFactor}},{key:"stopDamping",value:function(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0,this.panOffset.set(0,0,0)}},{key:"setTarget",value:function(e,r,n){this.stopDamping(),this.target.set(e,r,n)}},{key:"getAutoRotationAngle",value:function(){return 2*Math.PI/60/60*this.autoRotateSpeed}},{key:"getZoomScale",value:function(){return Math.pow(.95,this.zoomSpeed)}},{key:"rotateLeft",value:function(e){this.sphericalDelta.theta-=e}},{key:"rotateUp",value:function(e){this.sphericalDelta.phi-=e}},{key:"panLeft",value:function(e,r){this.panLeftV.setFromMatrixColumn(r,0),this.panLeftV.multiplyScalar(-e),this.panOffset.add(this.panLeftV)}},{key:"panUp",value:function(e,r){this.panUpV.setFromMatrixColumn(r,1),this.panUpV.multiplyScalar(e),this.panOffset.add(this.panUpV)}},{key:"pan",value:function(e,r){var n=this.domElement;if(n&&this.object.isPerspectiveCamera){var i=this.object.position;this.panV.copy(i).sub(this.target);var a=this.panV.length();a*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*e*a/n.clientHeight,this.object.matrixWorld),this.panUp(2*r*a/n.clientHeight,this.object.matrixWorld)}else n&&this.object.isOrthographicCamera&&(this.panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrixWorld),this.panUp(r*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrixWorld));this.dispatchEvent(L)}},{key:"dollyOut",value:function(e){this.object.isPerspectiveCamera?this.scale/=e:this.object.isOrthographicCamera&&(this.object.zoom*=e,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(L)}},{key:"dollyIn",value:function(e){this.object.isPerspectiveCamera?this.scale*=e:this.object.isOrthographicCamera&&(this.object.zoom/=e,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(L)}},{key:"setZoom",value:function(e){if(this.dispatchEvent(F),this.object.isPerspectiveCamera){var r=this.initialSphericalRadius/e/this.spherical.radius;this.scale=r}else this.object.isOrthographicCamera&&(this.object.zoom=e,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0);this.dispatchEvent(U)}},{key:"handleMouseDownRotate",value:function(e){this.rotateStart.set(e.clientX,e.clientY)}},{key:"handleMouseDownDolly",value:function(e){this.dollyStart.set(e.clientX,e.clientY)}},{key:"handleMouseDownPan",value:function(e){this.panStart.set(e.clientX,e.clientY)}},{key:"handleMouseMoveRotate",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;void 0!==e.movementX?this.rotateDelta.set(e.movementX,e.movementY):(this.rotateEnd.set(e.clientX,e.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd)),this.rotateDelta.multiplyScalar(this.rotateSpeed*r).rotateAround(q,-this.object.angleOffsetFromUp);var n=this.domElement,i=this.useWindowEvents?window.innerHeight:n.clientHeight,a=2*Math.PI*this.rotateDelta.x/i,o=2*Math.PI*this.rotateDelta.y/i;this.rotateLeft(a),this.rotateUp(o),this.update()}},{key:"handleMouseMoveDolly",value:function(e){this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}},{key:"handleMouseMovePan",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;void 0!==e.movementX?this.panDelta.set(e.movementX,e.movementY):(this.panEnd.set(e.clientX,e.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.panStart.copy(this.panEnd)),this.panDelta.multiplyScalar(this.panSpeed*r),this.pan(this.panDelta.x,this.panDelta.y),this.update()}},{key:"handleMouseWheel",value:function(e){var r=this;if(0!==e.deltaX||0!==e.deltaY){var n=!0===e.ctrlKey||!0===B(e),i=!1===B(e)&&!0===(0===e.wheelDeltaY||0===e.deltaY?!(o.b&&e.shiftKey&&Math.abs(e.wheelDeltaX)>=120)&&(e.wheelDeltaX?z(e.wheelDeltaX,e.deltaX):0===e.deltaMode):e.wheelDeltaY?z(e.wheelDeltaY,e.deltaY):0===e.deltaMode),a=!1===n&&(!0===this.gesture||e.timeStamp-this.lastTrackpadPanTime<300),s=!1===n&&!1===a&&e.timeStamp-this.lastMouseWheelZoomTime<300;if(!1!==o.d||!1!==s||!0!==i&&!0!==a){if(!1===this.enableZoom)return;this.gesture&&(window.clearTimeout(this.timer),this.gesture=!1,this.isPointerDown=!1,this.dispatchEvent(U)),!1===n&&!1===i&&(this.lastMouseWheelZoomTime=e.timeStamp),0===e.deltaY?e.deltaX<0?this.dollyIn(this.getZoomScale()):e.deltaX>0&&this.dollyOut(this.getZoomScale()):e.deltaY<0?this.dollyIn(this.getZoomScale()):e.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}else{if(!1===this.enablePan)return;var l=!1===this.gesture&&!1===a;this.lastTrackpadPanTime=e.timeStamp,this.gesture||(this.gesture=!0,this.isPointerDown=!0),!1===l&&(this.panDelta.set(-e.deltaX,-e.deltaY).multiplyScalar(this.panSpeed),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),e.altKey?this.pan(0,this.panDelta.y):e.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()),window.clearTimeout(this.timer),this.timer=window.setTimeout(function(){r.gesture=!1,r.isPointerDown=!1,r.dispatchEvent(U)},100)}}}},{key:"handleTouchStartRotate",value:function(){if(2===a.a.length){var e=.5*(a.a["0"].pageX+a.a["1"].pageX),r=.5*(a.a["0"].pageY+a.a["1"].pageY);this.rotateStart.set(e,r)}else this.rotateStart.set(a.a["0"].pageX,a.a["0"].pageY)}},{key:"handleTouchStartPan",value:function(){if(2===a.a.length){var e=.5*(a.a["0"].pageX+a.a["1"].pageX),r=.5*(a.a["0"].pageY+a.a["1"].pageY);this.panStart.set(e,r)}else this.panStart.set(a.a["0"].pageX,a.a["0"].pageY)}},{key:"handleTouchStartDolly",value:function(){var e=a.a["0"].pageX-a.a["1"].pageX,r=a.a["0"].pageY-a.a["1"].pageY,n=Math.sqrt(e*e+r*r);this.dollyStart.set(0,n)}},{key:"handleTouchStartDollyPan",value:function(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}},{key:"handleTouchStartDollyRotate",value:function(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}},{key:"handleTouchMoveRotate",value:function(e){if(2===a.a.length){var r=(0,a.c)(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this.rotateEnd.set(n,i)}else{if(e.pointerId!==a.a["0"].pointerId)return;this.rotateEnd.set(e.pageX,e.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);var o=this.domElement;o&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/o.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/o.clientHeight)),this.rotateStart.copy(this.rotateEnd)}},{key:"handleTouchMovePan",value:function(e){if(2===a.a.length){var r=(0,a.c)(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this.panEnd.set(n,i)}else{if(e.pointerId!==a.a["0"].pointerId)return;this.panEnd.set(e.pageX,e.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}},{key:"handleTouchMoveDolly",value:function(e){var r=(0,a.c)(e),n=e.pageX-r.x,i=e.pageY-r.y,o=Math.sqrt(n*n+i*i);this.dollyEnd.set(0,o),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}},{key:"handleTouchMoveDollyPan",value:function(e){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(e),this.enablePan&&this.handleTouchMovePan(e)}},{key:"handleTouchMoveDollyRotate",value:function(e){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(e),this.enableRotate&&this.handleTouchMoveRotate(e)}},{key:"checkRaycastLock",value:function(){if(this.object.data.raycastLock){if(this.options.isPlayMode)return!1;var e,r=null==(e=this.options)?void 0:e.showCameraLock;return r&&r(),!0}return!1}}]),r}(v.Bc);function et(e){for(var r=2*Math.PI;e<=-Math.PI;)e+=r;for(;e>Math.PI;)e-=r;return e}function er(e){return 1-Math.pow(1-e,4)}var en,ei,ea=new Promise(function(e){en=e});function eo(e){return ei||(ei=g(function(){var r,i,a,o;return D(this,function(s){switch(s.label){case 0:return r=null!=e?e:"https://cdn.spline.design/@splinetool/runtime@2.0.60/build",[4,Promise.all([n.e("7994").then(n.bind(n,1726)),fetch("".concat(r,"/physics.wasm")).then(function(e){return e.arrayBuffer()})])];case 1:return a=(i=O.apply(void 0,[s.sent(),2]))[0],o=i[1],[4,a.init(o)];case 2:return s.sent(),en(a),[2]}})})())}function es(e){var r=e.elements,n=Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2),i=Math.pow(r[4],2)+Math.pow(r[5],2)+Math.pow(r[6],2),a=Math.pow(r[8],2)+Math.pow(r[9],2)+Math.pow(r[10],2),o=Math.pow(r[0],2)+Math.pow(r[4],2)+Math.pow(r[8],2),s=Math.pow(r[1],2)+Math.pow(r[5],2)+Math.pow(r[9],2),l=Math.pow(r[2],2)+Math.pow(r[6],2)+Math.pow(r[10],2);return n<1e-8||i<1e-8||a<1e-8||o<1e-8||s<1e-8||l<1e-8}function el(e,r){var n=new v.dd;if(r&&es(r)||!e.getAttribute("position"))return n.setAttribute("position",new v.bd([],3)),n.setIndex([]),n;var i=(0,l.K)(e.getAttribute("position"),e.getIndex()),a=i.positions,o=i.triIndices;return n.setAttribute("position",new v.bd(a,3)),n.setIndex(o),r&&n.applyMatrix4(r),n}var eu,ec=function(){function e(r,n,i,a,o,s){b(this,e),this.id=r,this.data=n,this.object=i,this.initialDisabled=!1,this.actions=(0,u.f)(n,n.actions,a,o,s,i),this.target=n.target}return x(e,[{key:"disconnect",value:function(){(0,u.g)(this.actions)}},{key:"dispatch",value:function(e){var r=this;this.initialDisabled||(this.actions.Transition.forEach(function(e){e.object.currentTransitionEvent!==r&&(e.object.currentTransitionEvent=r,e.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Collision"}),this.actions.Transition.forEach(function(e){return e.play()}),this.actions.Animation.forEach(function(e){"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.TimelineAnimation.forEach(function(e){"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.Reset.forEach(function(e){e.dispatch()}),this.actions.Link.forEach(function(e){e.dispatch()}),this.actions.Reset.forEach(function(e){e.dispatch()}),this.actions.Create.forEach(function(e){e.dispatch()}),this.actions.Destroy.forEach(function(r){r.dispatch(null!=e&&e)}),this.actions.SetVariable.forEach(function(e){return e.checkConditions()}),this.actions.SetVariable.forEach(function(e){return e.dispatch()}),this.actions.DynamicVariablePlay.forEach(function(e){return e.dispatch()}),this.actions.Audio.forEach(function(e){e.dispatchBasic()}),this.actions.Particles.forEach(function(e){e.dispatchBasic()}),this.actions.Video.forEach(function(e){e.dispatchBasic()}),this.actions.ClearLocalStorage.forEach(function(e){return e.dispatch()}),this.actions.UserAPI.forEach(function(e){return e.dispatch()}))}}]),e}(),eh=function(){function e(r,n,i,a,o,s){b(this,e),this.id=r,this.data=n,this.object=i,this.page=a,this.currentIntersectedObjects=[],this.actions=(0,u.f)(n,n.actions,a,o,s,i),this.target=n.target,this.triggeringObjects=[];var l=!0,c=!1,h=void 0;try{for(var d,f=n.triggeringObjects[Symbol.iterator]();!(l=(d=f.next()).done);l=!0){var p=d.value,v=a.scene.find(p);v&&this.triggeringObjects.push(v)}}catch(e){c=!0,h=e}finally{try{l||null==f.return||f.return()}finally{if(c)throw h}}}return x(e,[{key:"isValidTriggeringObject",value:function(e){return"all"===this.target||this.triggeringObjects.some(function(r){return r===e||r.isAncestorOf(e.uuid)||e.isAncestorOf(r.uuid)})}},{key:"disconnect",value:function(){(0,u.g)(this.actions)}},{key:"dispatch",value:function(){var e=this;this.object.destroyedInAction||(this.actions.Transition.forEach(function(r){r.object.currentTransitionEvent!==e&&(r.object.currentTransitionEvent=e,r.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Trigger"}),this.actions.Transition.forEach(function(e){return e.play()}),this.actions.SwitchCamera.forEach(function(e){"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.TimelineAnimation.forEach(function(e){"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.Link.forEach(function(e){e.dispatch()}),this.actions.Reset.forEach(function(e){e.dispatch()}),this.actions.Create.forEach(function(e){e.dispatch()}),this.actions.Destroy.forEach(function(e){e.dispatch(!1)}),this.actions.Audio.forEach(function(e){e.dispatchBasic()}),this.actions.Particles.forEach(function(e){e.dispatchBasic()}),this.actions.Video.forEach(function(e){e.dispatchBasic()}),this.actions.SceneTransition.forEach(function(e){e.dispatch()}),this.actions.SetVariable.forEach(function(e){return e.checkConditions()}),this.actions.SetVariable.forEach(function(e){return e.dispatch()}),this.actions.DynamicVariablePlay.forEach(function(e){return e.dispatch()}),this.actions.ClearLocalStorage.forEach(function(e){return e.dispatch()}),this.actions.UserAPI.forEach(function(e){return e.dispatch()}))}}]),e}();ea.then(function(e){return eu=e});var ed=new v.Fc,ef=new v.Ec,ep=new v.Fc,ev=(new v.Pc(0,0,0,"YXZ"),new v.Pc(0,0,0,"XYZ")),ey=new v.Fc,em=new v.Fc,eg=new v.Fc(1,1,1),eb=new v.Ec,ew=new v.Oc,ex=new v.Oc,eS={type:"updateMatrix"},ek=new v.Ec,eM=new v.cd,eA={type:"beginEvent",eventName:"Collision"},eO={type:"beginEvent",eventName:"Trigger"};function eC(e){if(p.Ea.physicsEnabled(e.scene.objects))return!0;var r=!1;return e.scene.objects.traverse(function(e,n){if(n.events){var i=!0,a=!1,o=void 0;if(Array.isArray(n.events)){var s=!0,l=!1,u=void 0;try{for(var c,h=n.events[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=c.value;if(!0!==d.data.disabled&&"GameControl"===d.data.type&&d.data.collisionEnabled){r=!0;break}}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}else try{for(var f,p=Object.values(n.events)[Symbol.iterator]();!(i=(f=p.next()).done);i=!0){var v=f.value;if(!0!==v.disabled&&"GameControl"===v.type&&v.collisionEnabled){r=!0;break}}}catch(e){a=!0,o=e}finally{try{i||null==p.return||p.return()}finally{if(a)throw o}}}}),r}var e_=function(e){return e.states.some(function(e){return void 0!==e.data.position||void 0!==e.data.rotation||void 0!==e.data.hiddenMatrix||void 0!==e.data.cloner||void 0!==e.data.pathSnapping})};function eP(e){return(0,d.g)((0,d.i)(e)?e.object:e)}var eE,eD,ej,eT=function(){function e(r){var n=this;b(this,e),this.eventContext=r,this.isEnabled=!1,this.gameControl=null,this.joysticks=[],this.joystickToGameControls=[],this.sharedGameControlGlobals={entitiesWithTransformAnim:[],entityToCollisionEvents:{},colliderToEntity:new Map,kinematicBodyToEntity:new Map,triggers:[],gamePads:[],createdObjects:[],nCreatedPerAction:{}},this.sensorToTriggerEvent={},this.eventManager=void 0,this.needsCollisionDetection=!1,this.initializationCounter=-1,this.fixedBodiesToWatch=[],this.rigidBodyToMesh=new Map,this.nActiveRigidBodies=0,this.collisionEvents=[],this.isExport=!1,this.skipRender=!0,this._staticBVHAttrIds=new WeakMap,this._staticBVHNextAttrId=1,this.processRigidBody=function(e){if(e.bodyType()===eu.RigidBodyType.Dynamic){e.isSleeping()||n.nActiveRigidBodies++;var r=O(n.rigidBodyToMesh.get(e.handle),3),i=r[0],a=r[1],o=r[2];if(ed.copy(e.translation()).multiplyScalar(n.pixelsPerMeter),ef.copy(e.rotation()),i.matrixWorld.compose(ed,ef,a),i.hasNonUniformScale&&i.matrixWorld.multiply(i.shearScale),i.dispatchEvent(eS),o){var s=i.cloner;if(s&&void 0===s.objectForSample){s.matrixWorld.copy(i.matrixWorld);var l=!0,u=!1,c=void 0;try{for(var h,d=s.children[Symbol.iterator]();!(l=(h=d.next()).done);l=!0)h.value.updateMatrixWorld(!0)}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}var f=!0,p=!1,v=void 0;try{for(var y,m=i.children[Symbol.iterator]();!(f=(y=m.next()).done);f=!0)y.value.updateMatrixWorld(!0)}catch(e){p=!0,v=e}finally{try{f||null==m.return||m.return()}finally{if(p)throw v}}}}},this.accumulator=0,this.handleCollisionEvents=function(e,r,i){if(!1!==i)if(n.sensorToTriggerEvent[e]?(h=n.sensorToTriggerEvent[e],d=n.sharedGameControlGlobals.colliderToEntity.get(r)):n.sensorToTriggerEvent[r]&&(h=n.sensorToTriggerEvent[r],d=n.sharedGameControlGlobals.colliderToEntity.get(e)),h&&d&&h.isValidTriggeringObject(d))h.dispatch();else{for(var a=n.sharedGameControlGlobals.createdObjects.length-1;a>=0&&"break"!==function(i){var a,o,s=n.sharedGameControlGlobals.createdObjects[i];if(s.userData.hasCollisionDestroy&&((null==(a=s.rigidBody)?void 0:a.collider(0).handle)===e||(null==(o=s.rigidBody)?void 0:o.collider(0).handle)===r)){n.sharedGameControlGlobals.createdObjects.splice(i,1),s.removeFromParent();var l=s.rigidBody;return requestAnimationFrame(function(){var e;s.rigidBody===l&&(null==(e=n.sharedGameControlGlobals.rapierWorld)||e.removeRigidBody(l),s.rigidBody=void 0)}),"break"}}(a);a--);if(void 0!==(null==(f=n.gameControl)?void 0:f.object)&&n.gameControl.object===n.sharedGameControlGlobals.colliderToEntity.get(e)){var o=n.sharedGameControlGlobals.colliderToEntity.get(r),s=n.sharedGameControlGlobals.entityToCollisionEvents[o.uuid];if(void 0===s)return;var l=!0,u=!1,c=void 0;try{for(var h,d,f,p,v,y=s[Symbol.iterator]();!(l=(v=y.next()).done);l=!0){var m=v.value;"character"===m.data.target&&n.dispatchCollisionEvent(m,o,r)}}catch(e){u=!0,c=e}finally{try{l||null==y.return||y.return()}finally{if(u)throw c}}}else if(void 0!==(null==(p=n.gameControl)?void 0:p.object)&&n.gameControl.object===n.sharedGameControlGlobals.colliderToEntity.get(r)){var g=n.sharedGameControlGlobals.colliderToEntity.get(e),b=n.sharedGameControlGlobals.entityToCollisionEvents[g.uuid];if(void 0===b)return;var w=!0,x=!1,S=void 0;try{for(var k,M=b[Symbol.iterator]();!(w=(k=M.next()).done);w=!0){var A=k.value;"character"===A.data.target&&n.dispatchCollisionEvent(A,g,e)}}catch(e){x=!0,S=e}finally{try{w||null==M.return||M.return()}finally{if(x)throw S}}}else{var O=n.sharedGameControlGlobals.colliderToEntity.get(e),C=n.sharedGameControlGlobals.entityToCollisionEvents[O.uuid],_=!0,P=!1,E=void 0;if(void 0!==C)try{for(var D,j=C[Symbol.iterator]();!(_=(D=j.next()).done);_=!0){var T=D.value;"scene"===T.data.target&&n.dispatchCollisionEvent(T,O,e)}}catch(e){P=!0,E=e}finally{try{_||null==j.return||j.return()}finally{if(P)throw E}}var I=n.sharedGameControlGlobals.colliderToEntity.get(r),R=n.sharedGameControlGlobals.entityToCollisionEvents[null==I?void 0:I.uuid],B=!0,z=!1,L=void 0;if(void 0!==R)try{for(var F,U=R[Symbol.iterator]();!(B=(F=U.next()).done);B=!0){var V=F.value;"scene"===V.data.target&&n.dispatchCollisionEvent(V,I,r)}}catch(e){z=!0,L=e}finally{try{B||null==U.return||U.return()}finally{if(z)throw L}}}}},this.isExport=r.isExport,this.sharedAssets=r.sharedAssets,this.renderer=r.renderer,this.requestRender=r.requestRender,this.domElement=this.renderer.domElement,this.pixelsPerMeter=200,this.gravity=this.page.data.globalPhysics.gravity}return x(e,[{key:"page",get:function(){return this.eventContext.page}},{key:"markIsDestroyTarget",value:function(){var e=this;this.page.traverseVisibleEntity(function(r){var n=r.dataPatched,i=!0,a=!1,o=void 0;try{for(var s,l=n.events[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if(!0!==u.data.disabled){var c=null==(v=u.data.actions)||null==(p=v.find(function(e){return"Destroy"===e.data.type}))?void 0:p.data,h=!0,d=!1,f=void 0;if(c)try{for(var p,v,y,m=c.objects[Symbol.iterator]();!(h=(y=m.next()).done);h=!0){var g=y.value,b=e.page.scene.find(g);b&&(b.userData.hasDestroy=!0)}}catch(e){d=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(d)throw f}}}}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}})}},{key:"markIsDragObject",value:function(){var e=this;this.page.traverseVisibleEntity(function(r){var n=r.dataPatched,i=!0,a=!1,o=void 0,s=!0,l=!1,u=void 0;try{for(var c,h=n.events[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=c.value;if(!0!==d.data.disabled&&"DragDrop"===d.data.type)try{for(var f,p=d.data.objects[Symbol.iterator]();!(i=(f=p.next()).done);i=!0){var v=f.value,y=e.page.scene.find(v);y&&(y.userData.hasDrag=!0)}}catch(e){a=!0,o=e}finally{try{i||null==p.return||p.return()}finally{if(a)throw o}}}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}})}},{key:"_staticBVHIdOf",value:function(e){var r=this._staticBVHAttrIds.get(e);return void 0===r&&(r=this._staticBVHNextAttrId++,this._staticBVHAttrIds.set(e,r)),r}},{key:"initBVH",value:function(){var e=this;if(null===(0,i.b)())return void(0,f.c)("collision-bvh","trigger/collision detection");var r=[],n=[];if(this.page.traverseChildren(function(i){var a,o,l,u=M(i,s.a),c=(0,d.a)(i);if(!(0,d.h)(i)&&!u&&!c){var h=(l=(0,d.i)(i)?i.object:i).dataPatched;if("visibility"===(null==(a=h.physics)?void 0:a.enabled)?!h.visible:!(null==(o=h.physics)?void 0:o.enabled))return!0;var f=i.geometry,p=!0===l.userData.hasDestroy,v=!0===l.userData.hasDrag;if(e_(h)||p||v||l.dataPatched.events.some(function(e){return!0!==e.data.disabled&&("GameControl"===e.data.type||"Follow"===e.data.type)}))return i.updateMatrixWorldRigid(),e.addBoundsTree(i),!0;if(f){var y=f.getAttribute("position");if(void 0!==y&&y.count>0){r.push({geometry:f,matrixWorld:i.matrixWorld}),n.push(f.id,e._staticBVHIdOf(y),y.version,null!==f.index?e._staticBVHIdOf(f.index):-1,null!==f.index?f.index.version:-1);var m=!0,g=!1,b=void 0;try{for(var w,x=i.matrixWorld.elements[Symbol.iterator]();!(m=(w=x.next()).done);m=!0){var S=w.value;n.push(S)}}catch(e){g=!0,b=e}finally{try{m||null==x.return||x.return()}finally{if(g)throw b}}}}return!!eP(i)||void 0}}),r.length>0){var a=this._staticBVHCache;if(void 0!==a&&a.signature.length===n.length&&a.signature.every(function(e,r){return e===n[r]}))return void(this.sharedGameControlGlobals.staticMeshBVH=a.bvh);var o=r.map(function(e){return el(e.geometry,e.matrixWorld)}),u=(0,l.a)(o,!1),c=new((0,i.b)())(u);this._staticBVHCache={signature:n,bvh:c},this.sharedGameControlGlobals.staticMeshBVH=c}}},{key:"addRigidBody",value:function(e,r,n){if(!es(e.matrixWorld)){var i=[],a="geometry"in e?e.geometry:void 0,o=r.dataPatched;if(void 0!==(null==a?void 0:a.getAttribute("position"))&&i.push(el(a,e.shearScale)),o.physics.fusedBody){var s=this.gatherChildrenGeom(e,i);e.traverseObject(s),e.children.forEach(function(e){return e.updateMatrixWorld(!0)});var u=e.cloner;u&&void 0===u.objectForSample&&"dynamic"===o.physics.rigidBody&&(u.traverseObject(s),u.children.forEach(function(e){return e.updateMatrixWorld(!0)}))}if(i.length>0){var c,h,d,f=!1,p=!n.fromCreate&&"dynamic"===o.physics.rigidBody||n.fromCreate&&n.dynamic;p?(h=(c=(d=eu.RigidBodyDesc.dynamic()).setLinearDamping(o.physics.damping).setAngularDamping(o.physics.damping).setAdditionalMass(1e-9).setGravityScale(o.physics.gravityScale)).enabledRotations.apply(c,C(o.physics.enabledRotation))).enabledTranslations.apply(h,C(o.physics.enabledTranslation)):(n.hasTransformAnim||n.hasFollow||n.hasDrag)&&!n.fromCreate?(d=eu.RigidBodyDesc.kinematicPositionBased(),f=!0):d=eu.RigidBodyDesc.fixed();var v=(0,l.a)(i);(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).decompose(ed,ef,ep),e.position0=ed.clone().divideScalar(this.pixelsPerMeter),e.rotation0=ef.clone(),ed.divideScalar(this.pixelsPerMeter),d.setTranslation(ed.x,ed.y,ed.z).setRotation(ef),a?null==v||v.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter):null==v||v.scale(ep.x/this.pixelsPerMeter,ep.y/this.pixelsPerMeter,ep.z/this.pixelsPerMeter);var y=this.sharedGameControlGlobals.rapierWorld.createRigidBody(d),m=void 0!==o.geometry&&"SubdivGeometry"!==o.geometry.type&&"NonParametricGeometry"!==o.geometry.type&&"BooleanGeometry"!==o.geometry.type&&"VectorGeometry"!==o.geometry.type&&"StarGeometry"!==o.geometry.type&&"RectangleGeometry"!==o.geometry.type&&"EllipseGeometry"!==o.geometry.type&&"TriangleGeometry"!==o.geometry.type&&"TorusGeometry"!==o.geometry.type&&"HelixGeometry"!==o.geometry.type;try{this.addCollider(y,o.physics,v,r,m)}catch(e){try{this.addCollider(y,o.physics,v,r,!1)}catch(e){console.error(e)}}if(0===y.numColliders())return void this.sharedGameControlGlobals.rapierWorld.removeRigidBody(y);p?this.rigidBodyToMesh.set(y.handle,[e,ep.clone(),o.physics.fusedBody]):f?(this.sharedGameControlGlobals.kinematicBodyToEntity.set(y.handle,e),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e)):this.fixedBodiesToWatch.push([e,y,(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).clone()]),e.rigidBody=y}}}},{key:"addBoundsTree",value:function(e){var r,n,a=[];if(void 0!==(null==(r=e.geometry)?void 0:r.getAttribute("position"))&&(null==(n=e.geometry)?void 0:n.getAttribute("position").count)>0&&a.push(el(e.geometry,e.shearScale)),e.traverseObject(this.gatherChildrenGeom(e,a)),e.children.forEach(function(e){return e.updateMatrixWorld(!0)}),a.length>0){var o=(0,l.a)(a,!1);e.bvhGeometry=o,o.getAttribute("position").count>0&&(e.bvhGeometry.boundsTree=new((0,i.b)())(o),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e))}}},{key:"addCollider",value:function(e,r,n,i){var a,o,s,l=!(arguments.length>4)||void 0===arguments[4]||arguments[4];if(0!==(null==n?void 0:n.getAttribute("position").count)&&0!==(null==n||null==(a=n.getIndex())?void 0:a.count)){n&&(s="trimesh"===r.colliderType?eu.ColliderDesc.trimesh(n.getAttribute("position").array,n.getIndex().array):eu.ColliderDesc.convexMesh(n.getAttribute("position").array,l?n.getIndex().array:void 0)),s.setFrictionCombineRule(eu.CoefficientCombineRule.Average).setRestitutionCombineRule(eu.CoefficientCombineRule.Average).setDensity(r.density).setFriction(r.friction).setRestitution(r.restitution);var u=this.sharedGameControlGlobals.rapierWorld.createCollider(s,e);this.sharedGameControlGlobals.colliderToEntity.set(u.handle,i),(null==(o=this.sharedGameControlGlobals.entityToCollisionEvents[i.uuid])?void 0:o.some(function(e){return"scene"===e.target}))&&u.setActiveEvents(eu.ActiveEvents.COLLISION_EVENTS)}}},{key:"gatherChildrenGeom",value:function(e,r){var n=eP(e);return function(i,a){if(0!==a){if(n&&i.parent===e)return!0;if((0,d.h)(i)){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;s=i.object}else if((0,d.i)(i))s=i.object;else if(null==(o=(s=i).dataPatched.cloner)?void 0:o.hideBase)return!0;var o,s,l=s.dataPatched;if("visibility"===l.physics.enabled?!l.visible:!l.physics.enabled)return!0;1===a?e.hasNonUniformScale?i.matrixWorld.multiplyMatrices(e.shearScale,i.hiddenMatrix):i.matrixWorld.copy(i.hiddenMatrix):i.matrixWorld.multiplyMatrices(i.parent.matrixWorld,i.hiddenMatrix),i.matrixWorld.multiply(i.matrix);var u=i.geometry;return void 0!==(null==u?void 0:u.getAttribute("position"))&&r.push(el(u,i.matrixWorld)),!!eP(i)||void 0}}}},{key:"activate",value:function(e){var r,n=this;if(!this.isEnabled){this.isEnabled=!0,this.eventManager=e,this.usePhysics=this.page.data.globalPhysics.usePhysics;var i=this.page.playCamera,a=!1;this.page.traverseEntity(function(e){var r=!0,i=!1,a=void 0;try{for(var o,s=e.dataPatched.events[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;if(!1===l.data.disabled&&"Trigger"===l.data.type)return n.needsCollisionDetection=!0,!0}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}});var o=T;if(null!==o?a=o.setup({manager:this,camera:i,renderer:this.renderer,sharedAssets:this.sharedAssets,eventContext:this.eventContext,isExport:this.isExport})||a:null!==this.page.data.publish.gameControlObject&&(0,f.c)("game-controls","the scene's game controls"),!1===a){var s=this.eventManager.publish.orbitControls,l=s.enableRotate,u=s.enablePan,c=s.enableZoom,h=s.autoRotate,d=s.hoverRotatePanMode;(l||u||c||h||0!==d)&&(this.orbitControls=new ee(i,this.renderer.domElement,{isExport:this.isExport,isPlayMode:!0}),this.orbitControls.addEventListener("change",this.requestRender),this.orbitControls.addEventListener("end",this.requestRender),this.orbitControls.addEventListener("start",this.requestRender),this.orbitControls.fromJSON(this.eventManager.publish.orbitControls,this.eventManager.publish.mouseEventTarget),this.orbitControls.useKeyEvents=!1,this.orbitControls.addEventListenersToCamera(),this.orbitControls.connect(),this.orbitControls.update())}var p=this.renderer.domElement.width/this.renderer.getPixelRatio(),v=this.renderer.domElement.height/this.renderer.getPixelRatio();null==(r=T)||r.createJoysticks(this,p,v),this.markIsDestroyTarget(),this.markIsDragObject(),this.rebuildBVH(),this.initializationCounter++,window.setTimeout(function(){n.collisionEvents.forEach(function(e){return e.initialDisabled=!1})},80)}}},{key:"initPhysics",value:function(){var e=this;null==(y=this.sharedGameControlGlobals.rapierWorld)||y.free(),this.sharedGameControlGlobals.rapierWorld=new eu.World(new eu.Vector3(0,this.gravity,0)),this.events=new eu.EventQueue(!0);var r=[],n=[];if(this.page.traverseChildren(function(i){if((0,d.h)(i)){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;o=i.object}else if((0,d.i)(i))o=i.object;else{if((0,d.a)(i)||(0,d.b)(i)||M(i,s.a))return;if(!1===(null==(l=(o=i).dataPatched.cloner)?void 0:l.disabled)&&(null==(u=o.dataPatched.cloner)?void 0:u.hideBase)&&!0!==(null==(c=o.dataPatched.physics)?void 0:c.fusedBody))return!0}var a,o,l,u,c,h,f=o.dataPatched,p=!0,y=!1,m=void 0;try{for(var g,b=f.events[Symbol.iterator]();!(p=(g=b.next()).done);p=!0){var w=g.value;!0!==w.data.disabled&&"GameControl"===w.data.type&&(h=w.data)}}catch(e){y=!0,m=e}finally{try{p||null==b.return||b.return()}finally{if(y)throw m}}if(!f.physics||("visibility"===f.physics.enabled?!f.visible:!f.physics.enabled))return!0;i.updateMatrixWorldRigid();var x=e_(f),S=!1,k=o.userData.hasDestroy,A=o.userData.hasDrag,O=!1,C=!0,_=!1,P=void 0;try{for(var E,D=f.events[Symbol.iterator]();!(C=(E=D.next()).done);C=!0)!function(){var r=E.value;if(!0!==r.data.disabled){if("Collision"===r.data.type){S=!0;var n=new ec(r.id,r.data,o,e.page,e.sharedAssets,e.eventManager);n.initialDisabled=!0,e.collisionEvents.push(n),e.sharedGameControlGlobals.entityToCollisionEvents[o.uuid]&&e.sharedGameControlGlobals.entityToCollisionEvents[o.uuid].every(function(e){return e.id!==r.id})?e.sharedGameControlGlobals.entityToCollisionEvents[o.uuid].push(n):e.sharedGameControlGlobals.entityToCollisionEvents[o.uuid]=[n]}else if("Follow"===r.data.type){O=!0;var a=r.data.target;i.traverseVisible(function(e){e.userData.isFollowingObj=a})}}}()}catch(e){_=!0,P=e}finally{try{C||null==D.return||D.return()}finally{if(_)throw P}}"dynamic"===f.physics.rigidBody&&!1===f.physics.fusedBody&&(i.matrixWorldFusedFalse=i.matrixWorld.clone());var j=i.geometry;if(void 0!==h){var T=eu.RigidBodyDesc.kinematicPositionBased();(i.hasNonUniformScale?i.matrixWorldRigid:i.matrixWorld).decompose(ed,ef,ep),i.position0=ed.clone().divideScalar(e.pixelsPerMeter),i.rotation0=ef.clone(),ed.divideScalar(e.pixelsPerMeter),T.setTranslation(ed.x,ed.y,ed.z).setRotation(ef);var I,R=e.sharedGameControlGlobals.rapierWorld.createRigidBody(T);i.rigidBody=R,(I="sphere"===h.collider.type?eu.ColliderDesc.ball(h.collider.radius/e.pixelsPerMeter):"capsule"===h.collider.type?eu.ColliderDesc.capsule((h.collider.height/2-h.collider.radius)/e.pixelsPerMeter,h.collider.radius/e.pixelsPerMeter):eu.ColliderDesc.cuboid(h.collider.width/e.pixelsPerMeter/2,h.collider.height/e.pixelsPerMeter/2,h.collider.depth/e.pixelsPerMeter/2)).setFrictionCombineRule(eu.CoefficientCombineRule.Average).setDensity(f.physics.density).setFriction(f.physics.friction).setRestitution(0).setRestitutionCombineRule(eu.CoefficientCombineRule.Min);var B=e.sharedGameControlGlobals.rapierWorld.createCollider(I,R);e.sharedGameControlGlobals.colliderToEntity.set(B.handle,o),ed.fromArray(h.collider.position.map(function(e){return"number"==typeof e?e:0})).multiply(ep.setFromMatrixScale(o.matrixWorld)).divideScalar(e.pixelsPerMeter),B.setTranslationWrtParent(ed);var z=(new v.Ec).setFromEuler((new v.Pc).setFromVector3((new v.Fc).fromArray(h.collider.rotation.map(function(e){return"number"==typeof e?e:0}))));B.setRotationWrtParent(z),B.setActiveEvents(eu.ActiveEvents.COLLISION_EVENTS),e.generateSensorColliderDescs(o,!0)}else"dynamic"===f.physics.rigidBody||x||O||k||A||S?(e.addRigidBody(i,o,{hasFollow:O,hasTransformAnim:x,hasDrag:A}),e.generateSensorColliderDescs(o,f.physics.fusedBody)):(j&&r.push(el(j,i.matrixWorld)),f.physics.fusedBody&&!eP(i)&&i.traverseObject(function(e,n){if(0!==n){if((0,d.h)(e)){if(!e.objectForSample)return!0===e.object.dataPatched.physics.fusedBody&&"dynamic"===e.object.dataPatched.physics.rigidBody||void 0;if(e.objectForSample.dataPatched.physics.fusedBody)return;i=e.object}else{if((0,d.a)(e)||(0,d.b)(e)||M(e,s.a))return;if((0,d.i)(e))i=e.object;else if(null==(a=(i=e).dataPatched.cloner)?void 0:a.hideBase)return!0}var i,a,o=i.dataPatched;if("visibility"===o.physics.enabled?!o.visible:!o.physics.enabled)return!0;var l=e.geometry;return void 0!==(null==l?void 0:l.getAttribute("position"))&&r.push(el(l,e.matrixWorld)),!!eP(e)||void 0}}),e.generateSensorColliderDescs(o,f.physics.fusedBody,n));return!(!0!==(null==(a=f.physics)?void 0:a.fusedBody)&&!h&&!eP(i))||void 0}),0!==r.length){var i=(0,l.a)(r),a=i.getIndex().count>0;if(a||0!==n.length){i.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter);var o=eu.RigidBodyDesc.fixed(),u=this.sharedGameControlGlobals.rapierWorld.createRigidBody(o);if(a){var c=eu.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array).setFrictionCombineRule(eu.CoefficientCombineRule.Multiply).setRestitutionCombineRule(eu.CoefficientCombineRule.Multiply).setFriction(1).setRestitution(1);this.sharedGameControlGlobals.rapierWorld.createCollider(c,u)}var h=!0,f=!1,p=void 0;try{for(var y,m,g=n[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var b=O(m.value,2),w=b[0],x=b[1],S=this.sharedGameControlGlobals.rapierWorld.createCollider(w,u);this.sensorToTriggerEvent[S.handle]=x}}catch(e){f=!0,p=e}finally{try{h||null==g.return||g.return()}finally{if(f)throw p}}}}}},{key:"updatePositions",value:function(){return this.nActiveRigidBodies=0,this.sharedGameControlGlobals.rapierWorld.forEachRigidBody(this.processRigidBody),this.nActiveRigidBodies>0}},{key:"rebuildBVH",value:function(){var e=this;this.usePhysics?this.initPhysics():(this.page.traverseEntity(function(r){var n=!0,i=!1,a=void 0;try{for(var o,s=r.dataPatched.events[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;if("Trigger"===l.data.type&&!0!==l.data.disabled){var u=new eh(l.id,l.data,r,e.page,e.sharedAssets,e.eventManager),c=(new v.Oc).compose(ey.fromArray(l.data.position.map(function(e){return"number"==typeof e?e:0})),eb.setFromEuler(ev.fromArray(l.data.rotation.map(function(e){return"number"==typeof e?e:0}))),eg);if("box"===l.data.triggerZone){var h=new v.Xc;h.min.fromArray(l.data.size.map(function(e){return"number"==typeof e?e:0})).multiplyScalar(-.5),h.max.fromArray(l.data.size.map(function(e){return"number"==typeof e?e:0})).multiplyScalar(.5),e.sharedGameControlGlobals.triggers.push([h,c,r,u])}else e.sharedGameControlGlobals.triggers.push([l.data.radius,c,r,u])}}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}),this.needsCollisionDetection&&this.initBVH())}},{key:"disconnectEvents",value:function(){this.collisionEvents.forEach(function(e){return e.disconnect()}),this.sharedGameControlGlobals.triggers.forEach(function(e){return e[3].disconnect()}),this.sharedGameControlGlobals.triggers.length=0}},{key:"deactivate",value:function(){if(this.isEnabled){this.isEnabled=!1,this.page.traverse(function(e){e.matrixWorldFusedFalse&&(e.matrixWorldFusedFalse=void 0),e.rigidBody&&(e.rigidBody=void 0),e.position0&&(e.position0=void 0),e.rotation0&&(e.rotation0=void 0)}),null==(i=this.sharedGameControlGlobals.rapierWorld)||i.free(),this.sharedGameControlGlobals.rapierWorld=void 0,this.sharedGameControlGlobals.staticMeshBVH=void 0,this.accumulator=0,this.sharedGameControlGlobals.entitiesWithTransformAnim=[],this.sharedGameControlGlobals.kinematicBodyToEntity.clear(),this.fixedBodiesToWatch=[],this.disconnectEvents(),null==(a=this.gameControl)||a.reset(),null==(o=this.gameControl)||o.dispose(),this.gameControl=null,this.initializationCounter=-1,this.joysticks.forEach(function(e){var r=O(e,2),n=r[0],i=r[1];null==n||n.destroy(),i.remove()}),this.joystickToGameControls=[],this.joysticks=[],this.orbitControls&&(this.orbitControls.dispose(),this.orbitControls=void 0),null==(s=this.navigationMeshWrapper)||s.dispose(),this.navigationMeshWrapper=void 0;var e=!0,r=!1,n=void 0;try{for(var i,a,o,s,l,u=Object.values(this.sharedGameControlGlobals.entityToCollisionEvents)[Symbol.iterator]();!(e=(l=u.next()).done);e=!0)l.value.forEach(function(e){return e.disconnect()})}catch(e){r=!0,n=e}finally{try{e||null==u.return||u.return()}finally{if(r)throw n}}this.sharedGameControlGlobals.entityToCollisionEvents={},this.page.updateMatrixWorld(!0)}}},{key:"update",value:function(e){if(!this.isEnabled)return!0;var r=!0;if(void 0!==this.orbitControls&&this.orbitControls.needsUpdate&&(this.orbitControls.update(),r=!this.orbitControls.isCurrentlyDamping),this.initializationCounter>=0&&this.initializationCounter<2?(this.initializationCounter++,r=!1):2===this.initializationCounter&&this.gameControl&&(r=!this.gameControl.update(e)&&r),!1===this.usePhysics&&this.checkTrigger(),this.usePhysics)if(0===e)r=this.stepPhysics()&&r;else{var n=e/1e3;n<.016666666666666666&&n>.009166666666666667&&(n=.016666666666666666),this.accumulator+=n;for(var i=performance.now(),a=0;this.accumulator>=.016666666666666666&&a<6&&(r=this.stepPhysics()&&r,this.accumulator-=.016666666666666666,a++,!(performance.now()-i>16.666666666666668)););this.accumulator=this.accumulator%.016666666666666666}this.skipRender=r}},{key:"recordPhysicsPose",value:function(e){(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).decompose(ed,ef,ep),void 0===e.prevQ?(e.prevQ=ef.clone(),e.prevT=ed.clone()):(e.prevQ.copy(ef),e.prevT.copy(ed))}},{key:"promoteMovedFixedBodies",value:function(){for(var e=this.fixedBodiesToWatch.length-1;e>=0;e--){var r=O(this.fixedBodiesToWatch[e],3),n=r[0],i=r[1],a=r[2];n.rigidBody===i?(n.hasNonUniformScale?n.matrixWorldRigid:n.matrixWorld).equals(a)||(i.setBodyType(eu.RigidBodyType.KinematicPositionBased,!0),this.sharedGameControlGlobals.kinematicBodyToEntity.set(i.handle,n),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(n),this.fixedBodiesToWatch.splice(e,1)):this.fixedBodiesToWatch.splice(e,1)}}},{key:"clampPushedBodies",value:function(){var e,r=null==(e=this.gameControl)?void 0:e.object.rigidBody;if(void 0!==r)for(var n=this.sharedGameControlGlobals.rapierWorld,i=r.linvel(),a=r.translation(),o=Math.hypot(i.x,i.z),s=0;s<r.numColliders();s++)!function(e){var s=r.collider(e);n.contactPairsWith(s,function(e){var r=e.parent();if(null===r||!r.isDynamic())return;var l=r.translation(),u=-1/0,c=0,h=0;if(n.contactPair(s,e,function(e){var r=e.normal(),n=r.x*(l.x-a.x)+r.y*(l.y-a.y)+r.z*(l.z-a.z)<0?-1:1;if(!(Math.abs(r.y)>.7)){var o=n*r.x,s=n*r.z,d=Math.hypot(o,s);if(!(d<1e-4)){var f=(i.x*o+i.z*s)/d;f>u&&(u=f,c=o/d,h=s/d)}}}),u!==-1/0){var d=i.x*c+i.z*h;if(!(d<-.01)){var f=r.linvel();if(o>.01&&d>.01){var p=f.x*c+f.z*h;if(p<=0)return;var v=Math.min(p,d);return void r.setLinvel({x:c*v,y:f.y,z:h*v},!0)}var y=f.x*c+f.z*h-Math.max(0,d);if(!(y<=0)){var m=.5*y;r.setLinvel({x:f.x-c*m,y:f.y,z:f.z-h*m},!0)}}}})}(s)}},{key:"stepPhysics",value:function(){this.promoteMovedFixedBodies();var e=this.sharedGameControlGlobals.kinematicBodyToEntity,r=!0,n=!1,i=void 0;try{for(var a,o,s,l=e[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=O(s.value,2),c=u[0],h=u[1];void 0!==h.rigidBody?(this.recordPhysicsPose(h),h.rigidBody.setNextKinematicTranslation(ed.divideScalar(this.pixelsPerMeter)),h.rigidBody.setNextKinematicRotation(ef)):e.delete(c)}}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}var d=!0,f=!1,p=void 0;try{for(var v,y=this.sharedGameControlGlobals.entitiesWithTransformAnim[Symbol.iterator]();!(d=(v=y.next()).done);d=!0){var m=v.value;!0!==(null==(a=m.rigidBody)?void 0:a.isKinematic())&&this.recordPhysicsPose(m)}}catch(e){f=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(f)throw p}}return this.sharedGameControlGlobals.rapierWorld.step(this.events),this.clampPushedBodies(),null==(o=this.events)||o.drainCollisionEvents(this.handleCollisionEvents),!this.updatePositions()}},{key:"dispatchCollisionEvent",value:function(e,r,n){var i,a,o=(null==(i=this.sharedGameControlGlobals.rapierWorld)?void 0:i.getCollider(n))._parent;if(r.cloner){var s=!0,l=!1,u=void 0;try{for(var c,h=r.cloner.children[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=c.value;if(d.rigidBody===o){a=d;break}}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}e.dispatch(a),r.dispatchEvent(eA)}},{key:"updateUseWindowEvents",value:function(e){var r;null==(r=this.orbitControls)||r.updateUseWindowEvents(e)}},{key:"generateSensorColliderDescs",value:function(e,r,n){var i=this,a=ex.copy(e.matrixWorld).invert();e.traverseEntity(function(o,s){if(!1===r&&1===s)return!0;var l=!0,u=!1,c=void 0;try{for(var h,d=o.dataPatched.events[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;if("Trigger"===f.data.type&&!0!==f.data.disabled){var p,v=void 0,y=new eh(f.id,f.data,o,i.page,i.sharedAssets,i.eventManager);if((v="box"===f.data.triggerZone?(p=eu.ColliderDesc).cuboid.apply(p,C(f.data.size.map(function(e){return("number"==typeof e?e:1)/(2*i.pixelsPerMeter)}))):eu.ColliderDesc.ball(f.data.radius/i.pixelsPerMeter)).setDensity(0).setSensor(!0).setActiveEvents(eu.ActiveEvents.COLLISION_EVENTS),ey.fromArray(f.data.position.map(function(e){return"number"==typeof e?e:0})),eb.setFromEuler(ev.fromArray(f.data.rotation.map(function(e){return"number"==typeof e?e:0}))),ew.compose(ey,eb,eg).premultiply(o.matrixWorld),n?(ew.decompose(ey,eb,em),v.setActiveCollisionTypes(eu.ActiveCollisionTypes.KINEMATIC_FIXED|eu.ActiveCollisionTypes.DYNAMIC_FIXED)):(ew.premultiply(a).decompose(ey,eb,em),e.rigidBody.bodyType()===eu.RigidBodyType.Dynamic||(e.rigidBody.bodyType()===eu.RigidBodyType.Fixed?v.setActiveCollisionTypes(eu.ActiveCollisionTypes.KINEMATIC_FIXED|eu.ActiveCollisionTypes.DYNAMIC_FIXED):v.setActiveCollisionTypes(eu.ActiveCollisionTypes.KINEMATIC_KINEMATIC|eu.ActiveCollisionTypes.DYNAMIC_KINEMATIC))),ey.divideScalar(i.pixelsPerMeter),v.setTranslation(ey.x,ey.y,ey.z),v.setRotation(eb),n)n.push([v,y]);else{var m=i.sharedGameControlGlobals.rapierWorld.createCollider(v,e.rigidBody);i.sensorToTriggerEvent[m.handle]=y}}}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}})}},{key:"checkTrigger",value:function(){for(var e,r=0;r<this.sharedGameControlGlobals.triggers.length;r++)for(var n,i=O(this.sharedGameControlGlobals.triggers[r],4),a=i[0],o=i[1],s=i[2],l=i[3],u=0;u<this.sharedGameControlGlobals.entitiesWithTransformAnim.length;u++)n=this,function(r){var i=n.sharedGameControlGlobals.entitiesWithTransformAnim[r];if(s!==i&&!1!==l.isValidTriggeringObject(c.h.is(i)?i:i.object)){var u=ex.copy(s.matrixWorld).decompose(ey,ek,em).compose(ey,ek,eg).multiply(o),h=ew.copy(i.matrixWorld).invert().multiply(u),d=i.bvhGeometry.boundsTree;M(a,v.Xc)?e=d.intersectsBox(a,h):(eM.radius=a,eM.center.setFromMatrixPosition(h),e=d.intersectsSphere(eM)),e?-1===l.currentIntersectedObjects.indexOf(i)&&(l.currentIntersectedObjects.push(i),l.dispatch(),s.dispatchEvent(eO)):l.currentIntersectedObjects=l.currentIntersectedObjects.filter(function(e){return e!==i})}}(u)}}]),e}(),eI=new Promise(function(e){eE=e});function eR(e){return ej||(ej=g(function(){var r,i,a,o,s;return D(this,function(l){switch(l.label){case 0:return r=null!=e?e:"https://cdn.spline.design/@splinetool/runtime@2.0.60/build",("u"<typeof window?"undefined":_(window))<"u"&&(eD=new URL(r.endsWith("/")?r:"".concat(r,"/"),window.location.href).href),[4,Promise.all([n.e("6253").then(n.bind(n,1036)),fetch("".concat(r,"/navmesh.wasm")).then(function(e){return e.arrayBuffer()})])];case 1:return a=(i=O.apply(void 0,[l.sent(),2]))[0],o=i[1],[4,(0,a.default)({wasmBinary:o})];case 2:return s=l.sent(),eE(s),[2]}})})())}},3027(e,r,n){function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function a(e,r,n){return r=d(r),function(e,r){if(r&&("object"===b(r)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,S()?Reflect.construct(r,n||[],d(e).constructor):r.apply(e,n))}function o(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function s(e,r,n){return(s=S()?Reflect.construct:function(e,r,n){var i=[null];i.push.apply(i,r);var a=new(Function.bind.apply(e,i));return n&&y(a,n.prototype),a}).apply(null,arguments)}function l(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,r,n){return r&&l(e.prototype,r),n&&l(e,n),e}function c(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function h(e,r,n){return(h="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=d(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&y(e,r)}function p(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function v(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){c(e,r,n[r])})}return e}function y(e,r){return(y=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function m(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||w(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function w(e,r){if(e){if("string"==typeof e)return i(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,r)}}function x(e){var r="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return s(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)})(e)}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}function k(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}n.d(r,{$:()=>ek,$a:()=>tf,$b:()=>rn,$c:()=>iT,$d:()=>o6,A:()=>K,Aa:()=>eK,Ab:()=>tU,Ac:()=>rI,Ad:()=>or,Ae:()=>s4,B:()=>J,Ba:()=>eJ,Bb:()=>tV,Bc:()=>rR,Bd:()=>on,Be:()=>s8,C:()=>Q,Ca:()=>eQ,Cb:()=>tN,Cc:()=>rq,Cd:()=>oi,Ce:()=>s9,D:()=>$,Da:()=>e$,Db:()=>tG,Dc:()=>rX,Dd:()=>oa,De:()=>s7,E:()=>ee,Ea:()=>e0,Eb:()=>tW,Ec:()=>rZ,Ed:()=>oo,Ee:()=>lt,F:()=>et,Fa:()=>e1,Fb:()=>tH,Fc:()=>rJ,Fd:()=>os,Fe:()=>lr,G:()=>er,Ga:()=>e2,Gb:()=>tq,Gc:()=>r1,Gd:()=>ol,Ge:()=>ln,H:()=>en,Ha:()=>e3,Hb:()=>tY,Hc:()=>r4,Hd:()=>oc,He:()=>li,I:()=>ei,Ia:()=>e5,Ib:()=>tX,Ic:()=>nh,Id:()=>od,Ie:()=>la,J:()=>ea,Ja:()=>e4,Jb:()=>tZ,Jc:()=>nf,Jd:()=>oS,Je:()=>lo,K:()=>eo,Ka:()=>e6,Kb:()=>tK,Kc:()=>np,Kd:()=>ok,Ke:()=>lg,L:()=>es,La:()=>e8,Lb:()=>tJ,Lc:()=>nv,Ld:()=>oM,Le:()=>lb,M:()=>el,Ma:()=>e9,Mb:()=>tQ,Mc:()=>ny,Md:()=>oA,Me:()=>lw,N:()=>eu,Na:()=>e7,Nb:()=>t$,Nc:()=>nm,Nd:()=>oO,Ne:()=>lS,O:()=>ec,Oa:()=>te,Ob:()=>t0,Oc:()=>nb,Od:()=>oC,Oe:()=>lA,P:()=>eh,Pa:()=>tt,Pb:()=>t1,Pc:()=>nP,Pd:()=>oP,Pe:()=>lC,Q:()=>ed,Qa:()=>tr,Qb:()=>t2,Qc:()=>nE,Qd:()=>oE,Qe:()=>lP,R:()=>ef,Ra:()=>tn,Rb:()=>t3,Rc:()=>nq,Rd:()=>oD,Re:()=>lz,S:()=>ep,Sa:()=>ti,Sb:()=>t5,Sc:()=>nY,Sd:()=>oZ,Se:()=>lF,T:()=>ev,Ta:()=>ta,Tb:()=>t4,Tc:()=>nQ,Td:()=>oQ,Te:()=>lU,U:()=>ey,Ua:()=>to,Ub:()=>t6,Uc:()=>n0,Ud:()=>o$,Ue:()=>lW,V:()=>em,Va:()=>ts,Vb:()=>t8,Vc:()=>n1,Vd:()=>o0,Ve:()=>lY,W:()=>eg,Wa:()=>tl,Wb:()=>t9,Wc:()=>io,Wd:()=>o1,We:()=>lZ,X:()=>eb,Xa:()=>tu,Xb:()=>t7,Xc:()=>is,Xd:()=>o2,Xe:()=>lK,Y:()=>ew,Ya:()=>tc,Yb:()=>re,Yc:()=>iC,Yd:()=>o3,Ye:()=>lJ,Z:()=>ex,Za:()=>th,Zb:()=>rt,Zc:()=>iD,Zd:()=>o5,_:()=>eS,_a:()=>td,_b:()=>rr,_c:()=>ij,_d:()=>o4,a:()=>M,aa:()=>eM,ab:()=>tp,ac:()=>ri,ad:()=>iI,ae:()=>o9,b:()=>A,ba:()=>eA,bb:()=>tv,bc:()=>ra,bd:()=>iR,be:()=>o7,c:()=>O,ca:()=>eO,cb:()=>ty,cc:()=>ro,cd:()=>iF,ce:()=>se,d:()=>C,da:()=>eC,db:()=>tm,dc:()=>rs,dd:()=>iY,de:()=>st,e:()=>_,ea:()=>e_,eb:()=>tg,ec:()=>rl,ed:()=>iX,ee:()=>sr,f:()=>P,fa:()=>eP,fb:()=>tb,fc:()=>ru,fd:()=>iK,fe:()=>sn,g:()=>E,ga:()=>eE,gb:()=>tw,gc:()=>rc,gd:()=>iQ,ge:()=>si,h:()=>D,ha:()=>eD,hb:()=>tx,hc:()=>rh,hd:()=>i$,he:()=>sa,i:()=>j,ia:()=>ej,ib:()=>tS,ic:()=>rd,id:()=>ar,ie:()=>so,j:()=>T,ja:()=>eT,jb:()=>tk,jc:()=>rf,jd:()=>ah,je:()=>ss,k:()=>I,ka:()=>eI,kb:()=>tM,kc:()=>rp,kd:()=>ad,ke:()=>sl,l:()=>R,la:()=>eR,lb:()=>tA,lc:()=>rv,ld:()=>aM,le:()=>su,m:()=>B,ma:()=>eB,mb:()=>tO,mc:()=>ry,md:()=>aO,me:()=>sc,n:()=>z,na:()=>ez,nb:()=>tC,nc:()=>rm,nd:()=>aC,ne:()=>sh,o:()=>L,oa:()=>eL,ob:()=>t_,oc:()=>rg,od:()=>aE,oe:()=>sC,p:()=>F,pa:()=>eF,pb:()=>tP,pc:()=>rb,pd:()=>aD,pe:()=>sE,q:()=>U,qa:()=>eU,qb:()=>tE,qc:()=>rw,qd:()=>aF,qe:()=>sj,r:()=>V,ra:()=>eV,rb:()=>tD,rc:()=>rx,rd:()=>aG,re:()=>sR,s:()=>N,sa:()=>eN,sb:()=>tj,sc:()=>rM,sd:()=>aY,se:()=>sL,t:()=>G,ta:()=>eG,tb:()=>tT,tc:()=>rA,td:()=>aZ,te:()=>sF,u:()=>W,ua:()=>eW,ub:()=>tI,uc:()=>rO,ud:()=>aK,ue:()=>sU,v:()=>H,va:()=>eH,vb:()=>tR,vc:()=>r_,vd:()=>a5,ve:()=>sV,w:()=>q,wa:()=>eq,wb:()=>tB,wc:()=>rE,wd:()=>a9,we:()=>sZ,x:()=>Y,xa:()=>eY,xb:()=>tz,xc:()=>rD,xd:()=>a7,xe:()=>s$,y:()=>X,ya:()=>eX,yb:()=>tL,yc:()=>rj,yd:()=>oe,ye:()=>s1,z:()=>Z,za:()=>eZ,zb:()=>tF,zc:()=>rT,zd:()=>ot,ze:()=>s5});var M="185",A={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},O=0,C=1,_=2,P=0,E=1,D=2,j=3,T=0,I=1,R=2,B=0,z=1,L=2,F=3,U=4,V=5,N=6,G=100,W=101,H=102,q=103,Y=104,X=200,Z=201,K=202,J=203,Q=204,$=205,ee=206,et=207,er=208,en=209,ei=210,ea=211,eo=212,es=213,el=214,eu=0,ec=1,eh=2,ed=3,ef=4,ep=5,ev=6,ey=7,em=0,eg=1,eb=2,ew=0,ex=1,eS=2,ek=3,eM=4,eA=5,eO=6,eC=7,e_=300,eP=301,eE=302,eD=303,ej=304,eT=306,eI=1e3,eR=1001,eB=1002,ez=1003,eL=1004,eF=1005,eU=1006,eV=1007,eN=1008,eG=1008,eW=1009,eH=1010,eq=1011,eY=1012,eX=1013,eZ=1014,eK=1015,eJ=1016,eQ=1017,e$=1018,e0=1020,e1=35902,e2=35899,e3=1021,e5=1022,e4=1023,e6=1026,e8=1027,e9=1028,e7=1029,te=1030,tt=1031,tr=1032,tn=1033,ti=33776,ta=33777,to=33778,ts=33779,tl=35840,tu=35841,tc=35842,th=35843,td=36196,tf=37492,tp=37496,tv=37488,ty=37489,tm=37490,tg=37491,tb=37808,tw=37809,tx=37810,tS=37811,tk=37812,tM=37813,tA=37814,tO=37815,tC=37816,t_=37817,tP=37818,tE=37819,tD=37820,tj=37821,tT=36492,tI=36494,tR=36495,tB=36283,tz=36284,tL=36285,tF=36286,tU=2200,tV=2201,tN=2202,tG=3200,tW=3201,tH=0,tq=1,tY="",tX="srgb",tZ="srgb-linear",tK="linear",tJ="srgb",tQ="",t$="rg",t0="ga",t1=0,t2=7680,t3=7681,t5=7682,t4=7683,t6=34055,t8=34056,t9=5386,t7=512,re=513,rt=514,rr=515,rn=516,ri=517,ra=518,ro=519,rs=512,rl=513,ru=514,rc=515,rh=516,rd=517,rf=518,rp=519,rv=35044,ry=35048,rm="300 es",rg=2e3,rb=2001,rw={COMPUTE:"compute",RENDER:"render"},rx={TEXTURE_COMPARE:"depthTextureCompare"},rS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function rk(e,r){return new rS[e](r)}function rM(e){return ArrayBuffer.isView(e)&&!p(e,DataView)}function rA(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function rO(){var e=rA("canvas");return e.style.display="block",e}var rC={};function r_(){for(var e,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];var a="THREE."+n.shift();(e=console).log.apply(e,[a].concat(g(n)))}function rP(e){var r=e[0];if("string"==typeof r&&r.startsWith("TSL:")){var n=e[1];n&&n.isStackTrace?e[0]+=" "+n.getLocation():e[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return e}function rE(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];var i,a="THREE."+(r=rP(r)).shift(),o=r[0];o&&o.isStackTrace?console.warn(o.getError(a)):(i=console).warn.apply(i,[a].concat(g(r)))}function rD(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];var i,a="THREE."+(r=rP(r)).shift(),o=r[0];o&&o.isStackTrace?console.error(o.getError(a)):(i=console).error.apply(i,[a].concat(g(r)))}function rj(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r.join(" ");i in rC||(rC[i]=!0,rE.apply(void 0,g(r)))}function rT(e,r,n){return new Promise(function(i,a){setTimeout(function o(){switch(e.clientWaitSync(r,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:a();break;case e.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:i()}},n)})}var rI=(c(nn={},0,1),c(nn,eh,6),c(nn,ef,7),c(nn,ed,5),c(nn,ec,0),c(nn,ev,2),c(nn,ey,4),c(nn,ep,3),nn),rR=function(){function e(){o(this,e)}return u(e,[{key:"addEventListener",value:function(e,r){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(r)&&n[e].push(r)}},{key:"hasEventListener",value:function(e,r){var n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(r)}},{key:"removeEventListener",value:function(e,r){var n=this._listeners;if(void 0!==n){var i=n[e];if(void 0!==i){var a=i.indexOf(r);-1!==a&&i.splice(a,1)}}}},{key:"dispatchEvent",value:function(e){var r=this._listeners;if(void 0!==r){var n=r[e.type];if(void 0!==n){e.target=this;for(var i=n.slice(0),a=0,o=i.length;a<o;a++)i[a].call(this,e);e.target=null}}}}]),e}(),rB=["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"],rz=1234567,rL=Math.PI/180,rF=180/Math.PI;function rU(){var e=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0,n=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0;return(rB[255&e]+rB[e>>8&255]+rB[e>>16&255]+rB[e>>24&255]+"-"+rB[255&r]+rB[r>>8&255]+"-"+rB[r>>16&15|64]+rB[r>>24&255]+"-"+rB[63&n|128]+rB[n>>8&255]+"-"+rB[n>>16&255]+rB[n>>24&255]+rB[255&i]+rB[i>>8&255]+rB[i>>16&255]+rB[i>>24&255]).toLowerCase()}function rV(e,r,n){return Math.max(r,Math.min(n,e))}function rN(e,r){return(e%r+r)%r}function rG(e,r,n){return(1-n)*e+n*r}function rW(e,r){switch(r.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("THREE.MathUtils: Invalid component type.")}}function rH(e,r){switch(r.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("THREE.MathUtils: Invalid component type.")}}var rq={DEG2RAD:rL,RAD2DEG:rF,generateUUID:rU,clamp:rV,euclideanModulo:rN,mapLinear:function(e,r,n,i,a){return i+(e-r)*(a-i)/(n-r)},inverseLerp:function(e,r,n){return e!==r?(n-e)/(r-e):0},lerp:rG,damp:function(e,r,n,i){return rG(e,r,1-Math.exp(-n*i))},pingpong:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return r-Math.abs(rN(e,2*r)-r)},smoothstep:function(e,r,n){return e<=r?0:e>=n?1:(e=(e-r)/(n-r))*e*(3-2*e)},smootherstep:function(e,r,n){return e<=r?0:e>=n?1:(e=(e-r)/(n-r))*e*e*(e*(6*e-15)+10)},randInt:function(e,r){return e+Math.floor(Math.random()*(r-e+1))},randFloat:function(e,r){return e+Math.random()*(r-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(rz=e);var r=rz+=0x6d2b79f5;return r=Math.imul(r^r>>>15,1|r),(((r^=r+Math.imul(r^r>>>7,61|r))^r>>>14)>>>0)/0x100000000},degToRad:function(e){return e*rL},radToDeg:function(e){return e*rF},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,r,n,i,a){var o=Math.cos,s=Math.sin,l=o(n/2),u=s(n/2),c=o((r+i)/2),h=s((r+i)/2),d=o((r-i)/2),f=s((r-i)/2),p=o((i-r)/2),v=s((i-r)/2);switch(a){case"XYX":e.set(l*h,u*d,u*f,l*c);break;case"YZY":e.set(u*f,l*h,u*d,l*c);break;case"ZXZ":e.set(u*d,u*f,l*h,l*c);break;case"XZX":e.set(l*h,u*v,u*p,l*c);break;case"YXY":e.set(u*p,l*h,u*v,l*c);break;case"ZYZ":e.set(u*v,u*p,l*h,l*c);break;default:rE("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}},normalize:rH,denormalize:rW},rY=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.x=r,this.y=n}return u(e,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,r){return this.x=e,this.y=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;default:throw Error("THREE.Vector2: index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("THREE.Vector2: index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this}},{key:"addScaledVector",value:function(e,r){return this.x+=e.x*r,this.y+=e.y*r,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var r=this.x,n=this.y,i=e.elements;return this.x=i[0]*r+i[3]*n+i[6],this.y=i[1]*r+i[4]*n+i[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,r){return this.x=rV(this.x,e.x,r.x),this.y=rV(this.y,e.y,r.y),this}},{key:"clampScalar",value:function(e,r){return this.x=rV(this.x,e,r),this.y=rV(this.y,e,r),this}},{key:"clampLength",value:function(e,r){var n=this.length();return this.divideScalar(n||1).multiplyScalar(rV(n,e,r))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"angleTo",value:function(e){var r=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===r?Math.PI/2:Math.acos(rV(this.dot(e)/r,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this}},{key:"lerpVectors",value:function(e,r,n){return this.x=e.x+(r.x-e.x)*n,this.y=e.y+(r.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[r],this.y=e[r+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[r]=this.x,e[r+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,r){return this.x=e.getX(r),this.y=e.getY(r),this}},{key:"rotateAround",value:function(e,r){var n=Math.cos(r),i=Math.sin(r),a=this.x-e.x,o=this.y-e.y;return this.x=a*n-o*i+e.x,this.y=a*i+o*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:function(){return k(this,function(e){switch(e.label){case 0:return[4,this.x];case 1:return e.sent(),[4,this.y];case 2:return e.sent(),[2]}})}}]),e}(),rX=rY;rY.prototype.isVector2=!0;var rZ=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;o(this,e),this.isQuaternion=!0,this._x=r,this._y=n,this._z=i,this._w=a}return u(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,r,n,i){return this._x=e,this._y=r,this._z=n,this._w=i,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e){var r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=e._x,i=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(n/2),c=s(i/2),h=s(a/2),d=l(n/2),f=l(i/2),p=l(a/2);switch(o){case"XYZ":this._x=d*c*h+u*f*p,this._y=u*f*h-d*c*p,this._z=u*c*p+d*f*h,this._w=u*c*h-d*f*p;break;case"YXZ":this._x=d*c*h+u*f*p,this._y=u*f*h-d*c*p,this._z=u*c*p-d*f*h,this._w=u*c*h+d*f*p;break;case"ZXY":this._x=d*c*h-u*f*p,this._y=u*f*h+d*c*p,this._z=u*c*p+d*f*h,this._w=u*c*h-d*f*p;break;case"ZYX":this._x=d*c*h-u*f*p,this._y=u*f*h+d*c*p,this._z=u*c*p-d*f*h,this._w=u*c*h+d*f*p;break;case"YZX":this._x=d*c*h+u*f*p,this._y=u*f*h+d*c*p,this._z=u*c*p-d*f*h,this._w=u*c*h-d*f*p;break;case"XZY":this._x=d*c*h-u*f*p,this._y=u*f*h-d*c*p,this._z=u*c*p+d*f*h,this._w=u*c*h+d*f*p;break;default:rE("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!0===r&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,r){var n=r/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var r=e.elements,n=r[0],i=r[4],a=r[8],o=r[1],s=r[5],l=r[9],u=r[2],c=r[6],h=r[10],d=n+s+h;if(d>0){var f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(c-l)*f,this._y=(a-u)*f,this._z=(o-i)*f}else if(n>s&&n>h){var p=2*Math.sqrt(1+n-s-h);this._w=(c-l)/p,this._x=.25*p,this._y=(i+o)/p,this._z=(a+u)/p}else if(s>h){var v=2*Math.sqrt(1+s-n-h);this._w=(a-u)/v,this._x=(i+o)/v,this._y=.25*v,this._z=(l+c)/v}else{var y=2*Math.sqrt(1+h-n-s);this._w=(o-i)/y,this._x=(a+u)/y,this._y=(l+c)/y,this._z=.25*y}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,r){var n=e.dot(r)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*r.z-e.z*r.y,this._y=e.z*r.x-e.x*r.z,this._z=e.x*r.y-e.y*r.x),this._w=n,this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(rV(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,r){var n=this.angleTo(e);if(0===n)return this;var i=Math.min(1,r/n);return this.slerp(e,i),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var 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}},{key:"multiply",value:function(e){return this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,r){var n=e._x,i=e._y,a=e._z,o=e._w,s=r._x,l=r._y,u=r._z,c=r._w;return this._x=n*c+o*s+i*u-a*l,this._y=i*c+o*l+a*s-n*u,this._z=a*c+o*u+n*l-i*s,this._w=o*c-n*s-i*l-a*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,r){var n=e._x,i=e._y,a=e._z,o=e._w,s=this.dot(e);s<0&&(n=-n,i=-i,a=-a,o=-o,s=-s);var l=1-r;if(s<.9995){var u=Math.acos(s),c=Math.sin(u);l=Math.sin(l*u)/c,r=Math.sin(r*u)/c,this._x=this._x*l+n*r,this._y=this._y*l+i*r,this._z=this._z*l+a*r,this._w=this._w*l+o*r,this._onChangeCallback()}else this._x=this._x*l+n*r,this._y=this._y*l+i*r,this._z=this._z*l+a*r,this._w=this._w*l+o*r,this.normalize();return this}},{key:"slerpQuaternions",value:function(e,r,n){return this.copy(e).slerp(r,n)}},{key:"random",value:function(){var e=2*Math.PI*Math.random(),r=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),a=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),a*Math.sin(r),a*Math.cos(r))}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[r],this._y=e[r+1],this._z=e[r+2],this._w=e[r+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,r){return this._x=e.getX(r),this._y=e.getY(r),this._z=e.getZ(r),this._w=e.getW(r),this._onChangeCallback(),this}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:function(){return k(this,function(e){switch(e.label){case 0:return[4,this._x];case 1:return e.sent(),[4,this._y];case 2:return e.sent(),[4,this._z];case 3:return e.sent(),[4,this._w];case 4:return e.sent(),[2]}})}}],[{key:"slerpFlat",value:function(e,r,n,i,a,o,s){var l=n[i+0],u=n[i+1],c=n[i+2],h=n[i+3],d=a[o+0],f=a[o+1],p=a[o+2],v=a[o+3];if(h!==v||l!==d||u!==f||c!==p){var y=l*d+u*f+c*p+h*v;y<0&&(d=-d,f=-f,p=-p,v=-v,y=-y);var m=1-s;if(y<.9995){var g=Math.acos(y),b=Math.sin(g);l=l*(m=Math.sin(m*g)/b)+d*(s=Math.sin(s*g)/b),u=u*m+f*s,c=c*m+p*s,h=h*m+v*s}else{l=l*m+d*s,u=u*m+f*s;var w=1/Math.sqrt(l*l+u*u+(c=c*m+p*s)*c+(h=h*m+v*s)*h);l*=w,u*=w,c*=w,h*=w}}e[r]=l,e[r+1]=u,e[r+2]=c,e[r+3]=h}},{key:"multiplyQuaternionsFlat",value:function(e,r,n,i,a,o){var s=n[i],l=n[i+1],u=n[i+2],c=n[i+3],h=a[o],d=a[o+1],f=a[o+2],p=a[o+3];return e[r]=s*p+c*h+l*f-u*d,e[r+1]=l*p+c*d+u*h-s*f,e[r+2]=u*p+c*f+s*d-l*h,e[r+3]=c*p-s*h-l*d-u*f,e}}]),e}(),rK=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;o(this,e),this.x=r,this.y=n,this.z=i}return u(e,[{key:"set",value:function(e,r,n){return void 0===n&&(n=this.z),this.x=e,this.y=r,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;case 2:this.z=r;break;default:throw Error("THREE.Vector3: index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("THREE.Vector3: index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this.z=e.z+r.z,this}},{key:"addScaledVector",value:function(e,r){return this.x+=e.x*r,this.y+=e.y*r,this.z+=e.z*r,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this.z=e.z-r.z,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,r){return this.x=e.x*r.x,this.y=e.y*r.y,this.z=e.z*r.z,this}},{key:"applyEuler",value:function(e){return this.applyQuaternion(r$.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,r){return this.applyQuaternion(r$.setFromAxisAngle(e,r))}},{key:"applyMatrix3",value:function(e){var r=this.x,n=this.y,i=this.z,a=e.elements;return this.x=a[0]*r+a[3]*n+a[6]*i,this.y=a[1]*r+a[4]*n+a[7]*i,this.z=a[2]*r+a[5]*n+a[8]*i,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var r=this.x,n=this.y,i=this.z,a=e.elements,o=1/(a[3]*r+a[7]*n+a[11]*i+a[15]);return this.x=(a[0]*r+a[4]*n+a[8]*i+a[12])*o,this.y=(a[1]*r+a[5]*n+a[9]*i+a[13])*o,this.z=(a[2]*r+a[6]*n+a[10]*i+a[14])*o,this}},{key:"applyQuaternion",value:function(e){var r=this.x,n=this.y,i=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*i-s*n),c=2*(s*r-a*i),h=2*(a*n-o*r);return this.x=r+l*u+o*h-s*c,this.y=n+l*c+s*u-a*h,this.z=i+l*h+a*c-o*u,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var r=this.x,n=this.y,i=this.z,a=e.elements;return this.x=a[0]*r+a[4]*n+a[8]*i,this.y=a[1]*r+a[5]*n+a[9]*i,this.z=a[2]*r+a[6]*n+a[10]*i,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(e,r){return this.x=rV(this.x,e.x,r.x),this.y=rV(this.y,e.y,r.y),this.z=rV(this.z,e.z,r.z),this}},{key:"clampScalar",value:function(e,r){return this.x=rV(this.x,e,r),this.y=rV(this.y,e,r),this.z=rV(this.z,e,r),this}},{key:"clampLength",value:function(e,r){var n=this.length();return this.divideScalar(n||1).multiplyScalar(rV(n,e,r))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this.z+=(e.z-this.z)*r,this}},{key:"lerpVectors",value:function(e,r,n){return this.x=e.x+(r.x-e.x)*n,this.y=e.y+(r.y-e.y)*n,this.z=e.z+(r.z-e.z)*n,this}},{key:"cross",value:function(e){return this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,r){var n=e.x,i=e.y,a=e.z,o=r.x,s=r.y,l=r.z;return this.x=i*l-a*s,this.y=a*o-n*l,this.z=n*s-i*o,this}},{key:"projectOnVector",value:function(e){var r=e.lengthSq();if(0===r)return this.set(0,0,0);var n=e.dot(this)/r;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return rQ.copy(this).projectOnVector(e),this.sub(rQ)}},{key:"reflect",value:function(e){return this.sub(rQ.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var r=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===r?Math.PI/2:Math.acos(rV(this.dot(e)/r,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var r=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return r*r+n*n+i*i}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,r,n){var i=Math.sin(r)*e;return this.x=i*Math.sin(n),this.y=Math.cos(r)*e,this.z=i*Math.cos(n),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,r,n){return this.x=e*Math.sin(r),this.y=n,this.z=e*Math.cos(r),this}},{key:"setFromMatrixPosition",value:function(e){var r=e.elements;return this.x=r[12],this.y=r[13],this.z=r[14],this}},{key:"setFromMatrixScale",value:function(e){var r=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=r,this.y=n,this.z=i,this}},{key:"setFromMatrixColumn",value:function(e,r){return this.fromArray(e.elements,4*r)}},{key:"setFromMatrix3Column",value:function(e,r){return this.fromArray(e.elements,3*r)}},{key:"setFromEuler",value:function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}},{key:"setFromColor",value:function(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[r],this.y=e[r+1],this.z=e[r+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[r]=this.x,e[r+1]=this.y,e[r+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,r){return this.x=e.getX(r),this.y=e.getY(r),this.z=e.getZ(r),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var e=Math.random()*Math.PI*2,r=2*Math.random()-1,n=Math.sqrt(1-r*r);return this.x=n*Math.cos(e),this.y=r,this.z=n*Math.sin(e),this}},{key:Symbol.iterator,value:function(){return k(this,function(e){switch(e.label){case 0:return[4,this.x];case 1:return e.sent(),[4,this.y];case 2:return e.sent(),[4,this.z];case 3:return e.sent(),[2]}})}}]),e}(),rJ=rK;rK.prototype.isVector3=!0;var rQ=new rJ,r$=new rZ,r0=function(){function e(r,n,i,a,s,l,u,c,h){o(this,e),this.elements=[1,0,0,0,1,0,0,0,1],void 0!==r&&this.set(r,n,i,a,s,l,u,c,h)}return u(e,[{key:"set",value:function(e,r,n,i,a,o,s,l,u){var c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=r,c[4]=a,c[5]=l,c[6]=n,c[7]=o,c[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var r=this.elements,n=e.elements;return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],this}},{key:"extractBasis",value:function(e,r,n){return e.setFromMatrix3Column(this,0),r.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var r=e.elements;return this.set(r[0],r[4],r[8],r[1],r[5],r[9],r[2],r[6],r[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,r){var n=e.elements,i=r.elements,a=this.elements,o=n[0],s=n[3],l=n[6],u=n[1],c=n[4],h=n[7],d=n[2],f=n[5],p=n[8],v=i[0],y=i[3],m=i[6],g=i[1],b=i[4],w=i[7],x=i[2],S=i[5],k=i[8];return a[0]=o*v+s*g+l*x,a[3]=o*y+s*b+l*S,a[6]=o*m+s*w+l*k,a[1]=u*v+c*g+h*x,a[4]=u*y+c*b+h*S,a[7]=u*m+c*w+h*k,a[2]=d*v+f*g+p*x,a[5]=d*y+f*b+p*S,a[8]=d*m+f*w+p*k,this}},{key:"multiplyScalar",value:function(e){var r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=e,r[4]*=e,r[7]*=e,r[2]*=e,r[5]*=e,r[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return r*o*c-r*s*u-n*a*c+n*s*l+i*a*u-i*o*l}},{key:"invert",value:function(){var e=this.elements,r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,d=s*l-c*a,f=u*a-o*l,p=r*h+n*d+i*f;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);var v=1/p;return e[0]=h*v,e[1]=(i*u-c*n)*v,e[2]=(s*n-i*o)*v,e[3]=d*v,e[4]=(c*r-i*l)*v,e[5]=(i*a-s*r)*v,e[6]=f*v,e[7]=(n*l-u*r)*v,e[8]=(o*r-n*a)*v,this}},{key:"transpose",value:function(){var e,r=this.elements;return e=r[1],r[1]=r[3],r[3]=e,e=r[2],r[2]=r[6],r[6]=e,e=r[5],r[5]=r[7],r[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var r=this.elements;return e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8],this}},{key:"setUvTransform",value:function(e,r,n,i,a,o,s){var l=Math.cos(a),u=Math.sin(a);return this.set(n*l,n*u,-n*(l*o+u*s)+o+e,-i*u,i*l,-i*(-u*o+l*s)+s+r,0,0,1),this}},{key:"scale",value:function(e,r){return rj("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(r2.makeScale(e,r)),this}},{key:"rotate",value:function(e){return rj("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(r2.makeRotation(-e)),this}},{key:"translate",value:function(e,r){return rj("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(r2.makeTranslation(e,r)),this}},{key:"makeTranslation",value:function(e,r){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,r,0,0,1),this}},{key:"makeRotation",value:function(e){var r=Math.cos(e),n=Math.sin(e);return this.set(r,-n,0,n,r,0,0,0,1),this}},{key:"makeScale",value:function(e,r){return this.set(e,0,0,0,r,0,0,0,1),this}},{key:"equals",value:function(e){for(var r=this.elements,n=e.elements,i=0;i<9;i++)if(r[i]!==n[i])return!1;return!0}},{key:"fromArray",value:function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+r];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[r]=n[0],e[r+1]=n[1],e[r+2]=n[2],e[r+3]=n[3],e[r+4]=n[4],e[r+5]=n[5],e[r+6]=n[6],e[r+7]=n[7],e[r+8]=n[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}]),e}(),r1=r0;r0.prototype.isMatrix3=!0;var r2=new r1,r3=(new r1).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),r5=(new r1).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),r4=(ne=[.64,.33,.3,.6,.15,.06],nt=[.2126,.7152,.0722],nr=[.3127,.329],(r7={enabled:!1,workingColorSpace:tZ,spaces:{},convert:function(e,r,n){return!1!==this.enabled&&r!==n&&r&&n&&(this.spaces[r].transfer===tJ&&(e.r=r6(e.r),e.g=r6(e.g),e.b=r6(e.b)),this.spaces[r].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[r].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===tJ&&(e.r=r8(e.r),e.g=r8(e.g),e.b=r8(e.b))),e},workingToColorSpace:function(e,r){return this.convert(e,this.workingColorSpace,r)},colorSpaceToWorking:function(e,r){return this.convert(e,r,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return""===e?tK:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.workingColorSpace;return e.fromArray(this.spaces[r].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,r,n){return e.copy(this.spaces[r].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.workingColorSpace;return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,r){return rj("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r7.workingToColorSpace(e,r)},toWorkingColorSpace:function(e,r){return rj("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r7.colorSpaceToWorking(e,r)}}).define((c(r9={},tZ,{primaries:ne,whitePoint:nr,transfer:tK,toXYZ:r3,fromXYZ:r5,luminanceCoefficients:nt,workingColorSpaceConfig:{unpackColorSpace:tX},outputColorSpaceConfig:{drawingBufferColorSpace:tX}}),c(r9,tX,{primaries:ne,whitePoint:nr,transfer:tJ,toXYZ:r3,fromXYZ:r5,luminanceCoefficients:nt,outputColorSpaceConfig:{drawingBufferColorSpace:tX}}),r9)),r7);function r6(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function r8(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var r9,r7,ne,nt,nr,nn,ni,na=function(){function e(){o(this,e)}return u(e,null,[{key:"getDataURL",value:function(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";if(/^data:/i.test(e.src)||("u"<typeof HTMLCanvasElement?"undefined":b(HTMLCanvasElement))>"u")return e.src;if(p(e,HTMLCanvasElement))r=e;else{void 0===ni&&(ni=rA("canvas")),ni.width=e.width,ni.height=e.height;var i=ni.getContext("2d");p(e,ImageData)?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=ni}return r.toDataURL(n)}},{key:"sRGBToLinear",value:function(e){if(("u"<typeof HTMLImageElement?"undefined":b(HTMLImageElement))<"u"&&p(e,HTMLImageElement)||("u"<typeof HTMLCanvasElement?"undefined":b(HTMLCanvasElement))<"u"&&p(e,HTMLCanvasElement)||("u"<typeof ImageBitmap?"undefined":b(ImageBitmap))<"u"&&p(e,ImageBitmap)){var r=rA("canvas");r.width=e.width,r.height=e.height;var n=r.getContext("2d");n.drawImage(e,0,0,e.width,e.height);for(var i=n.getImageData(0,0,e.width,e.height),a=i.data,o=0;o<a.length;o++)a[o]=255*r6(a[o]/255);return n.putImageData(i,0,0),r}if(e.data){for(var s=e.data.slice(0),l=0;l<s.length;l++)p(s,Uint8Array)||p(s,Uint8ClampedArray)?s[l]=Math.floor(255*r6(s[l]/255)):s[l]=r6(s[l]);return{data:s,width:e.width,height:e.height}}return rE("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}]),e}(),no=0,ns=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o(this,e),this.isSource=!0,Object.defineProperty(this,"id",{value:no++}),this.uuid=rU(),this.data=r,this.dataReady=!0,this.version=0}return u(e,[{key:"getSize",value:function(e){var r=this.data;return("u"<typeof HTMLVideoElement?"undefined":b(HTMLVideoElement))<"u"&&p(r,HTMLVideoElement)?e.set(r.videoWidth,r.videoHeight,0):("u"<typeof VideoFrame?"undefined":b(VideoFrame))<"u"&&p(r,VideoFrame)?e.set(r.displayWidth,r.displayHeight,0):null!==r?e.set(r.width,r.height,r.depth||0):e.set(0,0,0),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"toJSON",value:function(e){var r,n=void 0===e||"string"==typeof e;if(!n&&void 0!==e.images[this.uuid])return e.images[this.uuid];var i={uuid:this.uuid,url:""},a=this.data;if(null!==a){if(Array.isArray(a)){r=[];for(var o=0,s=a.length;o<s;o++)a[o].isDataTexture?r.push(nl(a[o].image)):r.push(nl(a[o]))}else r=nl(a);i.url=r}return n||(e.images[this.uuid]=i),i}}]),e}();function nl(e){return("u"<typeof HTMLImageElement?"undefined":b(HTMLImageElement))<"u"&&p(e,HTMLImageElement)||("u"<typeof HTMLCanvasElement?"undefined":b(HTMLCanvasElement))<"u"&&p(e,HTMLCanvasElement)||("u"<typeof ImageBitmap?"undefined":b(ImageBitmap))<"u"&&p(e,ImageBitmap)?na.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(rE("Texture: Unable to serialize Texture."),{})}var nu=0,nc=new rJ,nh=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nh.DEFAULT_IMAGE,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nh.DEFAULT_MAPPING,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eR,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:eR,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:eU,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:eN,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e4,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:eW,f=arguments.length>8&&void 0!==arguments[8]?arguments[8]:nh.DEFAULT_ANISOTROPY,p=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";return o(this,r),(e=a(this,r)).isTexture=!0,Object.defineProperty(e,"id",{value:nu++}),e.uuid=rU(),e.name="",e.source=new ns(n),e.mipmaps=[],e.mapping=i,e.channel=0,e.wrapS=s,e.wrapT=l,e.magFilter=u,e.minFilter=c,e.anisotropy=f,e.format=h,e.internalFormat=null,e.type=d,e.offset=new rX(0,0),e.repeat=new rX(1,1),e.center=new rX(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new r1,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.colorSpace=p,e.userData={},e.updateRanges=[],e.version=0,e.onUpdate=null,e.renderTarget=null,e.isRenderTargetTexture=!1,e.isArrayTexture=!!(n&&n.depth&&n.depth>1),e.pmremVersion=0,e.normalized=!1,e}return f(r,e),u(r,[{key:"width",get:function(){return this.source.getSize(nc).x}},{key:"height",get:function(){return this.source.getSize(nc).y}},{key:"depth",get:function(){return this.source.getSize(nc).z}},{key:"image",get:function(){return this.source.data},set:function(e){this.source.data=e}},{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"addUpdateRange",value:function(e,r){this.updateRanges.push({start:e,count:r})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),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.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}},{key:"setValues",value:function(e){for(var r in e){var n=e[r];if(void 0===n){rE("Texture.setValues(): parameter '".concat(r,"' has value of undefined."));continue}var i=this[r];void 0!==i?i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[r]=n:rE("Texture.setValues(): property '".concat(r,"' does not exist."))}}},{key:"toJSON",value:function(e){var r=void 0===e||"string"==typeof e;if(!r&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.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,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),r||(e.textures[this.uuid]=n),n}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case eI:e.x=e.x-Math.floor(e.x);break;case eR:e.x=e.x<0?0:1;break;case eB: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 eI:e.y=e.y-Math.floor(e.y);break;case eR:e.y=e.y<0?0:1;break;case eB: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}},{key:"needsUpdate",set:function(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(e){!0===e&&this.pmremVersion++}}]),r}(rR);nh.DEFAULT_IMAGE=null,nh.DEFAULT_MAPPING=300,nh.DEFAULT_ANISOTROPY=1;var nd=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;o(this,e),this.x=r,this.y=n,this.z=i,this.w=a}return u(e,[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,r,n,i){return this.x=e,this.y=r,this.z=n,this.w=i,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;case 2:this.z=r;break;case 3:this.w=r;break;default:throw Error("THREE.Vector4: index is out of range: "+e)}return this}},{key:"getComponent",value:function(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 Error("THREE.Vector4: index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this.z=e.z+r.z,this.w=e.w+r.w,this}},{key:"addScaledVector",value:function(e,r){return this.x+=e.x*r,this.y+=e.y*r,this.z+=e.z*r,this.w+=e.w*r,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this.z=e.z-r.z,this.w=e.w-r.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var r=this.x,n=this.y,i=this.z,a=this.w,o=e.elements;return this.x=o[0]*r+o[4]*n+o[8]*i+o[12]*a,this.y=o[1]*r+o[5]*n+o[9]*i+o[13]*a,this.z=o[2]*r+o[6]*n+o[10]*i+o[14]*a,this.w=o[3]*r+o[7]*n+o[11]*i+o[15]*a,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var r=Math.sqrt(1-e.w*e.w);return r<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/r,this.y=e.y/r,this.z=e.z/r),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var r,n,i,a,o=e.elements,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],d=o[9],f=o[2],p=o[6],v=o[10];if(.01>Math.abs(l-c)&&.01>Math.abs(u-f)&&.01>Math.abs(d-p)){if(.1>Math.abs(l+c)&&.1>Math.abs(u+f)&&.1>Math.abs(d+p)&&.1>Math.abs(s+h+v-3))return this.set(1,0,0,0),this;r=Math.PI;var y=(s+1)/2,m=(h+1)/2,g=(v+1)/2,b=(l+c)/4,w=(u+f)/4,x=(d+p)/4;return y>m&&y>g?y<.01?(n=0,i=.707106781,a=.707106781):(i=b/(n=Math.sqrt(y)),a=w/n):m>g?m<.01?(n=.707106781,i=0,a=.707106781):(n=b/(i=Math.sqrt(m)),a=x/i):g<.01?(n=.707106781,i=.707106781,a=0):(n=w/(a=Math.sqrt(g)),i=x/a),this.set(n,i,a,r),this}var S=Math.sqrt((p-d)*(p-d)+(u-f)*(u-f)+(c-l)*(c-l));return .001>Math.abs(S)&&(S=1),this.x=(p-d)/S,this.y=(u-f)/S,this.z=(c-l)/S,this.w=Math.acos((s+h+v-1)/2),this}},{key:"setFromMatrixPosition",value:function(e){var r=e.elements;return this.x=r[12],this.y=r[13],this.z=r[14],this.w=r[15],this}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(e,r){return this.x=rV(this.x,e.x,r.x),this.y=rV(this.y,e.y,r.y),this.z=rV(this.z,e.z,r.z),this.w=rV(this.w,e.w,r.w),this}},{key:"clampScalar",value:function(e,r){return this.x=rV(this.x,e,r),this.y=rV(this.y,e,r),this.z=rV(this.z,e,r),this.w=rV(this.w,e,r),this}},{key:"clampLength",value:function(e,r){var n=this.length();return this.divideScalar(n||1).multiplyScalar(rV(n,e,r))}},{key:"floor",value:function(){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}},{key:"ceil",value:function(){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}},{key:"round",value:function(){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}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this.z+=(e.z-this.z)*r,this.w+=(e.w-this.w)*r,this}},{key:"lerpVectors",value:function(e,r,n){return this.x=e.x+(r.x-e.x)*n,this.y=e.y+(r.y-e.y)*n,this.z=e.z+(r.z-e.z)*n,this.w=e.w+(r.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[r],this.y=e[r+1],this.z=e[r+2],this.w=e[r+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[r]=this.x,e[r+1]=this.y,e[r+2]=this.z,e[r+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,r){return this.x=e.getX(r),this.y=e.getY(r),this.z=e.getZ(r),this.w=e.getW(r),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:function(){return k(this,function(e){switch(e.label){case 0:return[4,this.x];case 1:return e.sent(),[4,this.y];case 2:return e.sent(),[4,this.z];case 3:return e.sent(),[4,this.w];case 4:return e.sent(),[2]}})}}]),e}(),nf=nd;nd.prototype.isVector4=!0;var np=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,r),e=a(this,r),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:eU,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},s),e.isRenderTarget=!0,e.width=n,e.height=i,e.depth=s.depth,e.scissor=new nf(0,0,n,i),e.scissorTest=!1,e.viewport=new nf(0,0,n,i),e.textures=[];for(var l=new nh({width:n,height:i,depth:s.depth}),u=s.count,c=0;c<u;c++)e.textures[c]=l.clone(),e.textures[c].isRenderTargetTexture=!0,e.textures[c].renderTarget=e;return e._setTextureOptions(s),e.depthBuffer=s.depthBuffer,e.stencilBuffer=s.stencilBuffer,e.resolveDepthBuffer=s.resolveDepthBuffer,e.resolveStencilBuffer=s.resolveStencilBuffer,e._depthTexture=null,e.depthTexture=s.depthTexture,e.samples=s.samples,e.multiview=s.multiview,e.useArrayDepthTexture=s.useArrayDepthTexture,e}return f(r,e),u(r,[{key:"_setTextureOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={minFilter:eU,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(r.mapping=e.mapping),void 0!==e.wrapS&&(r.wrapS=e.wrapS),void 0!==e.wrapT&&(r.wrapT=e.wrapT),void 0!==e.wrapR&&(r.wrapR=e.wrapR),void 0!==e.magFilter&&(r.magFilter=e.magFilter),void 0!==e.minFilter&&(r.minFilter=e.minFilter),void 0!==e.format&&(r.format=e.format),void 0!==e.type&&(r.type=e.type),void 0!==e.anisotropy&&(r.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(r.colorSpace=e.colorSpace),void 0!==e.flipY&&(r.flipY=e.flipY),void 0!==e.generateMipmaps&&(r.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(r.internalFormat=e.internalFormat);for(var n=0;n<this.textures.length;n++)this.textures[n].setValues(r)}},{key:"texture",get:function(){return this.textures[0]},set:function(e){this.textures[0]=e}},{key:"depthTexture",get:function(){return this._depthTexture},set:function(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}},{key:"setSize",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==r||this.depth!==n){this.width=e,this.height=r,this.depth=n;for(var i=0,a=this.textures.length;i<a;i++)this.textures[i].image.width=e,this.textures[i].image.height=r,this.textures[i].image.depth=n,!0!==this.textures[i].isData3DTexture&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,r),this.scissor.set(0,0,e,r)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(var r=0,n=e.textures.length;r<n;r++){this.textures[r]=e.textures[r].clone(),this.textures[r].isRenderTargetTexture=!0,this.textures[r].renderTarget=this;var i=Object.assign({},e.textures[r].image);this.textures[r].source=new ns(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),r}(rR),nv=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),(e=a(this,r,[n,i,s])).isWebGLRenderTarget=!0,e}return f(r,e),r}(np),ny=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return o(this,r),(e=a(this,r,[null])).isDataArrayTexture=!0,e.image={data:n,width:i,height:s,depth:l},e.magFilter=ez,e.minFilter=ez,e.wrapR=eR,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.layerUpdates=new Set,e}return f(r,e),u(r,[{key:"addLayerUpdate",value:function(e){this.layerUpdates.add(e)}},{key:"clearLayerUpdates",value:function(){this.layerUpdates.clear()}}]),r}(nh),nm=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return o(this,r),(e=a(this,r,[null])).isData3DTexture=!0,e.image={data:n,width:i,height:s,depth:l},e.magFilter=ez,e.minFilter=ez,e.wrapR=eR,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return f(r,e),r}(nh),ng=function(){function e(r,n,i,a,s,l,u,c,h,d,f,p,v,y,m,g){o(this,e),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==r&&this.set(r,n,i,a,s,l,u,c,h,d,f,p,v,y,m,g)}return u(e,[{key:"set",value:function(e,r,n,i,a,o,s,l,u,c,h,d,f,p,v,y){var m=this.elements;return m[0]=e,m[4]=r,m[8]=n,m[12]=i,m[1]=a,m[5]=o,m[9]=s,m[13]=l,m[2]=u,m[6]=c,m[10]=h,m[14]=d,m[3]=f,m[7]=p,m[11]=v,m[15]=y,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new ng).fromArray(this.elements)}},{key:"copy",value:function(e){var r=this.elements,n=e.elements;return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r[9]=n[9],r[10]=n[10],r[11]=n[11],r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15],this}},{key:"copyPosition",value:function(e){var r=this.elements,n=e.elements;return r[12]=n[12],r[13]=n[13],r[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var r=e.elements;return this.set(r[0],r[3],r[6],0,r[1],r[4],r[7],0,r[2],r[5],r[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,r,n){return 0===this.determinantAffine()?(e.set(1,0,0),r.set(0,1,0),n.set(0,0,1)):(e.setFromMatrixColumn(this,0),r.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2)),this}},{key:"makeBasis",value:function(e,r,n){return this.set(e.x,r.x,n.x,0,e.y,r.y,n.y,0,e.z,r.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){if(0===e.determinantAffine())return this.identity();var r=this.elements,n=e.elements,i=1/nw.setFromMatrixColumn(e,0).length(),a=1/nw.setFromMatrixColumn(e,1).length(),o=1/nw.setFromMatrixColumn(e,2).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[3]=0,r[4]=n[4]*a,r[5]=n[5]*a,r[6]=n[6]*a,r[7]=0,r[8]=n[8]*o,r[9]=n[9]*o,r[10]=n[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){var r=this.elements,n=e.x,i=e.y,a=e.z,o=Math.cos(n),s=Math.sin(n),l=Math.cos(i),u=Math.sin(i),c=Math.cos(a),h=Math.sin(a);if("XYZ"===e.order){var d=o*c,f=o*h,p=s*c,v=s*h;r[0]=l*c,r[4]=-l*h,r[8]=u,r[1]=f+p*u,r[5]=d-v*u,r[9]=-s*l,r[2]=v-d*u,r[6]=p+f*u,r[10]=o*l}else if("YXZ"===e.order){var y=l*c,m=l*h,g=u*c,b=u*h;r[0]=y+b*s,r[4]=g*s-m,r[8]=o*u,r[1]=o*h,r[5]=o*c,r[9]=-s,r[2]=m*s-g,r[6]=b+y*s,r[10]=o*l}else if("ZXY"===e.order){var w=l*c,x=l*h,S=u*c,k=u*h;r[0]=w-k*s,r[4]=-o*h,r[8]=S+x*s,r[1]=x+S*s,r[5]=o*c,r[9]=k-w*s,r[2]=-o*u,r[6]=s,r[10]=o*l}else if("ZYX"===e.order){var M=o*c,A=o*h,O=s*c,C=s*h;r[0]=l*c,r[4]=O*u-A,r[8]=M*u+C,r[1]=l*h,r[5]=C*u+M,r[9]=A*u-O,r[2]=-u,r[6]=s*l,r[10]=o*l}else if("YZX"===e.order){var _=o*l,P=o*u,E=s*l,D=s*u;r[0]=l*c,r[4]=D-_*h,r[8]=E*h+P,r[1]=h,r[5]=o*c,r[9]=-s*c,r[2]=-u*c,r[6]=P*h+E,r[10]=_-D*h}else if("XZY"===e.order){var j=o*l,T=o*u,I=s*l,R=s*u;r[0]=l*c,r[4]=-h,r[8]=u*c,r[1]=j*h+R,r[5]=o*c,r[9]=T*h-I,r[2]=I*h-T,r[6]=s*c,r[10]=R*h+j}return r[3]=0,r[7]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(nS,e,nk)}},{key:"lookAt",value:function(e,r,n){var i=this.elements;return nO.subVectors(e,r),0===nO.lengthSq()&&(nO.z=1),nO.normalize(),nM.crossVectors(n,nO),0===nM.lengthSq()&&(1===Math.abs(n.z)?nO.x+=1e-4:nO.z+=1e-4,nO.normalize(),nM.crossVectors(n,nO)),nM.normalize(),nA.crossVectors(nO,nM),i[0]=nM.x,i[4]=nA.x,i[8]=nO.x,i[1]=nM.y,i[5]=nA.y,i[9]=nO.y,i[2]=nM.z,i[6]=nA.z,i[10]=nO.z,this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,r){var n=e.elements,i=r.elements,a=this.elements,o=n[0],s=n[4],l=n[8],u=n[12],c=n[1],h=n[5],d=n[9],f=n[13],p=n[2],v=n[6],y=n[10],m=n[14],g=n[3],b=n[7],w=n[11],x=n[15],S=i[0],k=i[4],M=i[8],A=i[12],O=i[1],C=i[5],_=i[9],P=i[13],E=i[2],D=i[6],j=i[10],T=i[14],I=i[3],R=i[7],B=i[11],z=i[15];return a[0]=o*S+s*O+l*E+u*I,a[4]=o*k+s*C+l*D+u*R,a[8]=o*M+s*_+l*j+u*B,a[12]=o*A+s*P+l*T+u*z,a[1]=c*S+h*O+d*E+f*I,a[5]=c*k+h*C+d*D+f*R,a[9]=c*M+h*_+d*j+f*B,a[13]=c*A+h*P+d*T+f*z,a[2]=p*S+v*O+y*E+m*I,a[6]=p*k+v*C+y*D+m*R,a[10]=p*M+v*_+y*j+m*B,a[14]=p*A+v*P+y*T+m*z,a[3]=g*S+b*O+w*E+x*I,a[7]=g*k+b*C+w*D+x*R,a[11]=g*M+b*_+w*j+x*B,a[15]=g*A+b*P+w*T+x*z,this}},{key:"multiplyScalar",value:function(e){var r=this.elements;return r[0]*=e,r[4]*=e,r[8]*=e,r[12]*=e,r[1]*=e,r[5]*=e,r[9]*=e,r[13]*=e,r[2]*=e,r[6]*=e,r[10]*=e,r[14]*=e,r[3]*=e,r[7]*=e,r[11]*=e,r[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,r=e[0],n=e[4],i=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],h=e[6],d=e[10],f=e[14],p=e[3],v=e[7],y=e[11],m=e[15],g=l*f-u*d,b=s*f-u*h,w=s*d-l*h,x=o*f-u*c,S=o*d-l*c,k=o*h-s*c;return r*(v*g-y*b+m*w)-n*(p*g-y*x+m*S)+i*(p*b-v*x+m*k)-a*(p*w-v*S+y*k)}},{key:"determinantAffine",value:function(){var e=this.elements,r=e[0],n=e[4],i=e[8],a=e[1],o=e[5],s=e[9],l=e[2],u=e[6],c=e[10];return r*(o*c-s*u)-n*(a*c-s*l)+i*(a*u-o*l)}},{key:"transpose",value:function(){var e,r=this.elements;return e=r[1],r[1]=r[4],r[4]=e,e=r[2],r[2]=r[8],r[8]=e,e=r[6],r[6]=r[9],r[9]=e,e=r[3],r[3]=r[12],r[12]=e,e=r[7],r[7]=r[13],r[13]=e,e=r[11],r[11]=r[14],r[14]=e,this}},{key:"setPosition",value:function(e,r,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=r,i[14]=n),this}},{key:"invert",value:function(){var e=this.elements,r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],v=e[13],y=e[14],m=e[15],g=r*s-n*o,b=r*l-i*o,w=r*u-a*o,x=n*l-i*s,S=n*u-a*s,k=i*u-a*l,M=c*v-h*p,A=c*y-d*p,O=c*m-f*p,C=h*y-d*v,_=h*m-f*v,P=d*m-f*y,E=g*P-b*_+w*C+x*O-S*A+k*M;if(0===E)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var D=1/E;return e[0]=(s*P-l*_+u*C)*D,e[1]=(i*_-n*P-a*C)*D,e[2]=(v*k-y*S+m*x)*D,e[3]=(d*S-h*k-f*x)*D,e[4]=(l*O-o*P-u*A)*D,e[5]=(r*P-i*O+a*A)*D,e[6]=(y*w-p*k-m*b)*D,e[7]=(c*k-d*w+f*b)*D,e[8]=(o*_-s*O+u*M)*D,e[9]=(n*O-r*_-a*M)*D,e[10]=(p*S-v*w+m*g)*D,e[11]=(h*w-c*S-f*g)*D,e[12]=(s*A-o*C-l*M)*D,e[13]=(r*C-n*A+i*M)*D,e[14]=(v*b-p*x-y*g)*D,e[15]=(c*x-h*b+d*g)*D,this}},{key:"scale",value:function(e){var r=this.elements,n=e.x,i=e.y,a=e.z;return r[0]*=n,r[4]*=i,r[8]*=a,r[1]*=n,r[5]*=i,r[9]*=a,r[2]*=n,r[6]*=i,r[10]*=a,r[3]*=n,r[7]*=i,r[11]*=a,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}},{key:"makeTranslation",value:function(e,r,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,r,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var r=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,r,-n,0,0,n,r,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var r=Math.cos(e),n=Math.sin(e);return this.set(r,0,n,0,0,1,0,0,-n,0,r,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var r=Math.cos(e),n=Math.sin(e);return this.set(r,-n,0,0,n,r,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,r){var n=Math.cos(r),i=Math.sin(r),a=1-n,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+n,u*s-i*l,u*l+i*s,0,u*s+i*l,c*s+n,c*l-i*o,0,u*l-i*s,c*l+i*o,a*l*l+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,r,n){return this.set(e,0,0,0,0,r,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,r,n,i,a,o){return this.set(1,n,a,0,e,1,o,0,r,i,1,0,0,0,0,1),this}},{key:"compose",value:function(e,r,n){var i=this.elements,a=r._x,o=r._y,s=r._z,l=r._w,u=a+a,c=o+o,h=s+s,d=a*u,f=a*c,p=a*h,v=o*c,y=o*h,m=s*h,g=l*u,b=l*c,w=l*h,x=n.x,S=n.y,k=n.z;return i[0]=(1-(v+m))*x,i[1]=(f+w)*x,i[2]=(p-b)*x,i[3]=0,i[4]=(f-w)*S,i[5]=(1-(d+m))*S,i[6]=(y+g)*S,i[7]=0,i[8]=(p+b)*k,i[9]=(y-g)*k,i[10]=(1-(d+v))*k,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}},{key:"decompose",value:function(e,r,n){var i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];var a=this.determinantAffine();if(0===a)return n.set(1,1,1),r.identity(),this;var o=nw.set(i[0],i[1],i[2]).length(),s=nw.set(i[4],i[5],i[6]).length(),l=nw.set(i[8],i[9],i[10]).length();a<0&&(o=-o),nx.copy(this);var u=1/o,c=1/s,h=1/l;return nx.elements[0]*=u,nx.elements[1]*=u,nx.elements[2]*=u,nx.elements[4]*=c,nx.elements[5]*=c,nx.elements[6]*=c,nx.elements[8]*=h,nx.elements[9]*=h,nx.elements[10]*=h,r.setFromRotationMatrix(nx),n.x=o,n.y=s,n.z=l,this}},{key:"makePerspective",value:function(e,r,n,i,a,o){var s,l,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:rg,c=arguments.length>7&&void 0!==arguments[7]&&arguments[7],h=this.elements;if(c)s=a/(o-a),l=o*a/(o-a);else if(u===rg)s=-(o+a)/(o-a),l=-2*o*a/(o-a);else{if(u!==rb)throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+u);s=-o/(o-a),l=-o*a/(o-a)}return h[0]=2*a/(r-e),h[4]=0,h[8]=(r+e)/(r-e),h[12]=0,h[1]=0,h[5]=2*a/(n-i),h[9]=(n+i)/(n-i),h[13]=0,h[2]=0,h[6]=0,h[10]=s,h[14]=l,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}},{key:"makeOrthographic",value:function(e,r,n,i,a,o){var s,l,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:rg,c=arguments.length>7&&void 0!==arguments[7]&&arguments[7],h=this.elements;if(c)s=1/(o-a),l=o/(o-a);else if(u===rg)s=-2/(o-a),l=-(o+a)/(o-a);else{if(u!==rb)throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+u);s=-1/(o-a),l=-a/(o-a)}return h[0]=2/(r-e),h[4]=0,h[8]=0,h[12]=-(r+e)/(r-e),h[1]=0,h[5]=2/(n-i),h[9]=0,h[13]=-(n+i)/(n-i),h[2]=0,h[6]=0,h[10]=s,h[14]=l,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}},{key:"equals",value:function(e){for(var r=this.elements,n=e.elements,i=0;i<16;i++)if(r[i]!==n[i])return!1;return!0}},{key:"fromArray",value:function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+r];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[r]=n[0],e[r+1]=n[1],e[r+2]=n[2],e[r+3]=n[3],e[r+4]=n[4],e[r+5]=n[5],e[r+6]=n[6],e[r+7]=n[7],e[r+8]=n[8],e[r+9]=n[9],e[r+10]=n[10],e[r+11]=n[11],e[r+12]=n[12],e[r+13]=n[13],e[r+14]=n[14],e[r+15]=n[15],e}}]),e}(),nb=ng;ng.prototype.isMatrix4=!0;var nw=new rJ,nx=new nb,nS=new rJ(0,0,0),nk=new rJ(1,1,1),nM=new rJ,nA=new rJ,nO=new rJ,nC=new nb,n_=new rZ,nP=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nP.DEFAULT_ORDER;o(this,e),this.isEuler=!0,this._x=r,this._y=n,this._z=i,this._order=a}return u(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=r,this._z=n,this._order=i,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],u=i[5],c=i[9],h=i[2],d=i[6],f=i[10];switch(r){case"XYZ":this._y=Math.asin(rV(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-c,f),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,u),this._z=0);break;case"YXZ":this._x=Math.asin(-rV(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(s,f),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(rV(d,-1,1)),.9999999>Math.abs(d)?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-rV(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(rV(l,-1,1)),.9999999>Math.abs(l)?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-rV(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,f),this._y=0);break;default:rE("Euler: .setFromRotationMatrix() encountered an unknown order: "+r)}return this._order=r,!0===n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,r,n){return nC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nC,r,n)}},{key:"setFromVector3",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,r)}},{key:"reorder",value:function(e){return n_.setFromEuler(this),this.setFromQuaternion(n_,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(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}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._order,e}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:function(){return k(this,function(e){switch(e.label){case 0:return[4,this._x];case 1:return e.sent(),[4,this._y];case 2:return e.sent(),[4,this._z];case 3:return e.sent(),[4,this._order];case 4:return e.sent(),[2]}})}}]),e}();nP.DEFAULT_ORDER="XYZ";var nE=function(){function e(){o(this,e),this.mask=1}return u(e,[{key:"set",value:function(e){this.mask=1<<e>>>0}},{key:"enable",value:function(e){this.mask|=1<<e}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(e){this.mask^=1<<e}},{key:"disable",value:function(e){this.mask&=~(1<<e)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(e){return 0!=(this.mask&e.mask)}},{key:"isEnabled",value:function(e){return!!(this.mask&1<<e)}}]),e}(),nD=0,nj=new rJ,nT=new rZ,nI=new nb,nR=new rJ,nB=new rJ,nz=new rJ,nL=new rZ,nF=new rJ(1,0,0),nU=new rJ(0,1,0),nV=new rJ(0,0,1),nN={type:"added"},nG={type:"removed"},nW={type:"childadded",child:null},nH={type:"childremoved",child:null},nq=function(e){function r(){o(this,r),(e=a(this,r)).isObject3D=!0,Object.defineProperty(e,"id",{value:nD++}),e.uuid=rU(),e.name="",e.type="Object3D",e.parent=null,e.children=[],e.up=nq.DEFAULT_UP.clone();var e,n=new rJ,i=new nP,s=new rZ,l=new rJ(1,1,1);return i._onChange(function(){s.setFromEuler(i,!1)}),s._onChange(function(){i.setFromQuaternion(s,void 0,!1)}),Object.defineProperties(e,{position:{configurable:!0,enumerable:!0,value:n},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:l},modelViewMatrix:{value:new nb},normalMatrix:{value:new r1}}),e.matrix=new nb,e.matrixWorld=new nb,e.matrixAutoUpdate=nq.DEFAULT_MATRIX_AUTO_UPDATE,e.matrixWorldAutoUpdate=nq.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,e.matrixWorldNeedsUpdate=!1,e.layers=new nE,e.visible=!0,e.castShadow=!1,e.receiveShadow=!1,e.frustumCulled=!0,e.renderOrder=0,e.animations=[],e.customDepthMaterial=void 0,e.customDistanceMaterial=void 0,e.static=!1,e.userData={},e.pivot=null,e}return f(r,e),u(r,[{key:"onBeforeShadow",value:function(){}},{key:"onAfterShadow",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(e){return this.quaternion.premultiply(e),this}},{key:"setRotationFromAxisAngle",value:function(e,r){this.quaternion.setFromAxisAngle(e,r)}},{key:"setRotationFromEuler",value:function(e){this.quaternion.setFromEuler(e,!0)}},{key:"setRotationFromMatrix",value:function(e){this.quaternion.setFromRotationMatrix(e)}},{key:"setRotationFromQuaternion",value:function(e){this.quaternion.copy(e)}},{key:"rotateOnAxis",value:function(e,r){return nT.setFromAxisAngle(e,r),this.quaternion.multiply(nT),this}},{key:"rotateOnWorldAxis",value:function(e,r){return nT.setFromAxisAngle(e,r),this.quaternion.premultiply(nT),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(nF,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(nU,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(nV,e)}},{key:"translateOnAxis",value:function(e,r){return nj.copy(e).applyQuaternion(this.quaternion),this.position.add(nj.multiplyScalar(r)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(nF,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(nU,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(nV,e)}},{key:"localToWorld",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(nI.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,r,n){e.isVector3?nR.copy(e):nR.set(e,r,n);var i=this.parent;this.updateWorldMatrix(!0,!1),nB.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?nI.lookAt(nB,nR,this.up):nI.lookAt(nR,nB,this.up),this.quaternion.setFromRotationMatrix(nI),i&&(nI.extractRotation(i.matrixWorld),nT.setFromRotationMatrix(nI),this.quaternion.premultiply(nT.invert()))}},{key:"add",value:function(e){if(arguments.length>1){for(var r=0;r<arguments.length;r++)this.add(arguments[r]);return this}return e===this?rD("Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(nN),nW.child=e,this.dispatchEvent(nW),nW.child=null):rD("Object3D.add: object not an instance of THREE.Object3D.",e),this}},{key:"remove",value:function(e){if(arguments.length>1){for(var r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}var n=this.children.indexOf(e);return -1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(nG),nH.child=e,this.dispatchEvent(nH),nH.child=null),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){return this.remove.apply(this,g(this.children))}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),nI.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),nI.multiply(e.parent.matrixWorld)),e.applyMatrix4(nI),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(nN),nW.child=e,this.dispatchEvent(nW),nW.child=null,this}},{key:"getObjectById",value:function(e){return this.getObjectByProperty("id",e)}},{key:"getObjectByName",value:function(e){return this.getObjectByProperty("name",e)}},{key:"getObjectByProperty",value:function(e,r){if(this[e]===r)return this;for(var n=0,i=this.children.length;n<i;n++){var a=this.children[n].getObjectByProperty(e,r);if(void 0!==a)return a}}},{key:"getObjectsByProperty",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[e]===r&&n.push(this);for(var i=this.children,a=0,o=i.length;a<o;a++)i[a].getObjectsByProperty(e,r,n);return n}},{key:"getWorldPosition",value:function(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nB,e,nz),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nB,nL,e),e}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var r=this.matrixWorld.elements;return e.set(r[8],r[9],r[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(e){e(this);for(var r=this.children,n=0,i=r.length;n<i;n++)r[n].traverse(e)}},{key:"traverseVisible",value:function(e){if(!1!==this.visible){e(this);for(var r=this.children,n=0,i=r.length;n<i;n++)r[n].traverseVisible(e)}}},{key:"traverseAncestors",value:function(e){var r=this.parent;null!==r&&(e(r),r.traverseAncestors(e))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale);var e=this.pivot;if(null!==e){var r=e.x,n=e.y,i=e.z,a=this.matrix.elements;a[12]+=r-a[0]*r-a[4]*n-a[8]*i,a[13]+=n-a[1]*r-a[5]*n-a[9]*i,a[14]+=i-a[2]*r-a[6]*n-a[10]*i}this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);for(var r=this.children,n=0,i=r.length;n<i;n++)r[n].updateMatrixWorld(e)}},{key:"updateWorldMatrix",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),!0===r)for(var a=this.children,o=0,s=a.length;o<s;o++)a[o].updateWorldMatrix(!1,!0,n)}},{key:"toJSON",value:function(e){var r=void 0===e||"string"==typeof e,n={};r&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});var i={};function a(r,n){return void 0===r[n.uuid]&&(r[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),!1!==this.static&&(i.static=this.static),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),null!==this.pivot&&(i.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(function(e){var r,n;return r=v({},e),n=n={boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r}),i.instanceInfo=this._instanceInfo.map(function(e){return v({},e)}),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=a(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var s=o.shapes;if(Array.isArray(s))for(var l=0,u=s.length;l<u;l++){var c=s[l];a(e.shapes,c)}else a(e.shapes,s)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var h=[],d=0,f=this.material.length;d<f;d++)h.push(a(e.materials,this.material[d]));i.material=h}else i.material=a(e.materials,this.material);if(this.children.length>0){i.children=[];for(var p=0;p<this.children.length;p++)i.children.push(this.children[p].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(var y=0;y<this.animations.length;y++){var m=this.animations[y];i.animations.push(a(e.animations,m))}}if(r){var g=O(e.geometries),b=O(e.materials),w=O(e.textures),x=O(e.images),S=O(e.shapes),k=O(e.skeletons),M=O(e.animations),A=O(e.nodes);g.length>0&&(n.geometries=g),b.length>0&&(n.materials=b),w.length>0&&(n.textures=w),x.length>0&&(n.images=x),S.length>0&&(n.shapes=S),k.length>0&&(n.skeletons=k),M.length>0&&(n.animations=M),A.length>0&&(n.nodes=A)}return n.object=i,n;function O(e){var r=[];for(var n in e){var i=e[n];delete i.metadata,r.push(i)}return r}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var r=!(arguments.length>1)||void 0===arguments[1]||arguments[1];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.pivot=null!==e.pivot?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===r)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}}]),r}(rR);nq.DEFAULT_UP=new rJ(0,1,0),nq.DEFAULT_MATRIX_AUTO_UPDATE=!0,nq.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var nY=function(e){function r(){var e;return o(this,r),(e=a(this,r)).isGroup=!0,e.type="Group",e}return f(r,e),r}(nq),nX={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,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:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},nZ={h:0,s:0,l:0},nK={h:0,s:0,l:0};function nJ(e,r,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(r-e)*n:n<.5?r:n<2/3?e+6*(r-e)*(2/3-n):e}var nQ=function(){function e(r,n,i){return o(this,e),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(r,n,i)}return u(e,[{key:"set",value:function(e,r,n){return void 0===r&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,r,n),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tX;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,r4.colorSpaceToWorking(this,r),this}},{key:"setRGB",value:function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r4.workingColorSpace;return this.r=e,this.g=r,this.b=n,r4.colorSpaceToWorking(this,i),this}},{key:"setHSL",value:function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r4.workingColorSpace;if(e=rN(e,1),r=rV(r,0,1),n=rV(n,0,1),0===r)this.r=this.g=this.b=n;else{var a=n<=.5?n*(1+r):n+r-n*r,o=2*n-a;this.r=nJ(o,a,e+1/3),this.g=nJ(o,a,e),this.b=nJ(o,a,e-1/3)}return r4.colorSpaceToWorking(this,i),this}},{key:"setStyle",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tX;function n(r){void 0!==r&&1>parseFloat(r)&&rE("Color: Alpha component of "+e+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){var i,a,o=i[1],s=i[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,r);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,r);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,r);break;default:rE("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){var l=i[1],u=l.length;if(3===u)return this.setRGB(parseInt(l.charAt(0),16)/15,parseInt(l.charAt(1),16)/15,parseInt(l.charAt(2),16)/15,r);if(6===u)return this.setHex(parseInt(l,16),r);rE("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,r);return this}},{key:"setColorName",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tX,n=nX[e.toLowerCase()];return void 0!==n?this.setHex(n,r):rE("Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copySRGBToLinear",value:function(e){return this.r=r6(e.r),this.g=r6(e.g),this.b=r6(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=r8(e.r),this.g=r8(e.g),this.b=r8(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tX;return r4.workingToColorSpace(n$.copy(this),e),65536*Math.round(rV(255*n$.r,0,255))+256*Math.round(rV(255*n$.g,0,255))+Math.round(rV(255*n$.b,0,255))}},{key:"getHexString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tX;return("000000"+this.getHex(e).toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r4.workingColorSpace;r4.workingToColorSpace(n$.copy(this),r);var n,i,a=n$.r,o=n$.g,s=n$.b,l=Math.max(a,o,s),u=Math.min(a,o,s),c=(u+l)/2;if(u===l)n=0,i=0;else{var h=l-u;switch(i=c<=.5?h/(l+u):h/(2-l-u),l){case a:n=(o-s)/h+6*(o<s);break;case o:n=(s-a)/h+2;break;case s:n=(a-o)/h+4}n/=6}return e.h=n,e.s=i,e.l=c,e}},{key:"getRGB",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r4.workingColorSpace;return r4.workingToColorSpace(n$.copy(this),r),e.r=n$.r,e.g=n$.g,e.b=n$.b,e}},{key:"getStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tX;r4.workingToColorSpace(n$.copy(this),e);var r=n$.r,n=n$.g,i=n$.b;return e!==tX?"color(".concat(e," ").concat(r.toFixed(3)," ").concat(n.toFixed(3)," ").concat(i.toFixed(3),")"):"rgb(".concat(Math.round(255*r),",").concat(Math.round(255*n),",").concat(Math.round(255*i),")")}},{key:"offsetHSL",value:function(e,r,n){return this.getHSL(nZ),this.setHSL(nZ.h+e,nZ.s+r,nZ.l+n)}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,r){return this.r=e.r+r.r,this.g=e.g+r.g,this.b=e.b+r.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(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}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(e,r){return this.r+=(e.r-this.r)*r,this.g+=(e.g-this.g)*r,this.b+=(e.b-this.b)*r,this}},{key:"lerpColors",value:function(e,r,n){return this.r=e.r+(r.r-e.r)*n,this.g=e.g+(r.g-e.g)*n,this.b=e.b+(r.b-e.b)*n,this}},{key:"lerpHSL",value:function(e,r){this.getHSL(nZ),e.getHSL(nK);var n=rG(nZ.h,nK.h,r),i=rG(nZ.s,nK.s,r),a=rG(nZ.l,nK.l,r);return this.setHSL(n,i,a),this}},{key:"setFromVector3",value:function(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}},{key:"applyMatrix3",value:function(e){var r=this.r,n=this.g,i=this.b,a=e.elements;return this.r=a[0]*r+a[3]*n+a[6]*i,this.g=a[1]*r+a[4]*n+a[7]*i,this.b=a[2]*r+a[5]*n+a[8]*i,this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[r],this.g=e[r+1],this.b=e[r+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[r]=this.r,e[r+1]=this.g,e[r+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,r){return this.r=e.getX(r),this.g=e.getY(r),this.b=e.getZ(r),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:function(){return k(this,function(e){switch(e.label){case 0:return[4,this.r];case 1:return e.sent(),[4,this.g];case 2:return e.sent(),[4,this.b];case 3:return e.sent(),[2]}})}}]),e}(),n$=new nQ;nQ.NAMES=nX;var n0=function(){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;o(this,e),this.isFog=!0,this.name="",this.color=new nQ(r),this.near=n,this.far=i}return u(e,[{key:"clone",value:function(){return new n0(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}]),e}(),n1=function(e){function r(){var e;return o(this,r),(e=a(this,r)).isScene=!0,e.type="Scene",e.background=null,e.environment=null,e.fog=null,e.backgroundBlurriness=0,e.backgroundIntensity=1,e.backgroundRotation=new nP,e.environmentIntensity=1,e.environmentRotation=new nP,e.overrideMaterial=null,("u"<typeof __THREE_DEVTOOLS__?"undefined":b(__THREE_DEVTOOLS__))<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:e})),e}return f(r,e),u(r,[{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),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,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return null!==this.fog&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}]),r}(nq),n2=new rJ,n3=new rJ,n5=new rJ,n4=new rJ,n6=new rJ,n8=new rJ,n9=new rJ,n7=new rJ,ie=new rJ,it=new rJ,ir=new nf,ii=new nf,ia=new nf,io=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new rJ;o(this,e),this.a=r,this.b=n,this.c=i}return u(e,[{key:"set",value:function(e,r,n){return this.a.copy(e),this.b.copy(r),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,r,n,i){return this.a.copy(e[r]),this.b.copy(e[n]),this.c.copy(e[i]),this}},{key:"setFromAttributeAndIndices",value:function(e,r,n,i){return this.a.fromBufferAttribute(e,r),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return n2.subVectors(this.c,this.b),n3.subVectors(this.a,this.b),.5*n2.cross(n3).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(e){return io.getNormal(this.a,this.b,this.c,e)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(e,r){return io.getBarycoord(e,this.a,this.b,this.c,r)}},{key:"getInterpolation",value:function(e,r,n,i,a){return io.getInterpolation(e,this.a,this.b,this.c,r,n,i,a)}},{key:"containsPoint",value:function(e){return io.containsPoint(e,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(e){return io.isFrontFacing(this.a,this.b,this.c,e)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,r){var n,i,a=this.a,o=this.b,s=this.c;n6.subVectors(o,a),n8.subVectors(s,a),n7.subVectors(e,a);var l=n6.dot(n7),u=n8.dot(n7);if(l<=0&&u<=0)return r.copy(a);ie.subVectors(e,o);var c=n6.dot(ie),h=n8.dot(ie);if(c>=0&&h<=c)return r.copy(o);var d=l*h-c*u;if(d<=0&&l>=0&&c<=0)return n=l/(l-c),r.copy(a).addScaledVector(n6,n);it.subVectors(e,s);var f=n6.dot(it),p=n8.dot(it);if(p>=0&&f<=p)return r.copy(s);var v=f*u-l*p;if(v<=0&&u>=0&&p<=0)return i=u/(u-p),r.copy(a).addScaledVector(n8,i);var y=c*p-f*h;if(y<=0&&h-c>=0&&f-p>=0)return n9.subVectors(s,o),i=(h-c)/(h-c+(f-p)),r.copy(o).addScaledVector(n9,i);var m=1/(y+v+d);return n=v*m,i=d*m,r.copy(a).addScaledVector(n6,n).addScaledVector(n8,i)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,r,n,i){i.subVectors(n,r),n2.subVectors(e,r),i.cross(n2);var a=i.lengthSq();return a>0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}},{key:"getBarycoord",value:function(e,r,n,i,a){n2.subVectors(i,r),n3.subVectors(n,r),n5.subVectors(e,r);var o=n2.dot(n2),s=n2.dot(n3),l=n2.dot(n5),u=n3.dot(n3),c=n3.dot(n5),h=o*u-s*s;if(0===h)return a.set(0,0,0),null;var d=1/h,f=(u*l-s*c)*d,p=(o*c-s*l)*d;return a.set(1-f-p,p,f)}},{key:"containsPoint",value:function(e,r,n,i){return null!==this.getBarycoord(e,r,n,i,n4)&&n4.x>=0&&n4.y>=0&&n4.x+n4.y<=1}},{key:"getInterpolation",value:function(e,r,n,i,a,o,s,l){return null===this.getBarycoord(e,r,n,i,n4)?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,n4.x),l.addScaledVector(o,n4.y),l.addScaledVector(s,n4.z),l)}},{key:"getInterpolatedAttribute",value:function(e,r,n,i,a,o){return ir.setScalar(0),ii.setScalar(0),ia.setScalar(0),ir.fromBufferAttribute(e,r),ii.fromBufferAttribute(e,n),ia.fromBufferAttribute(e,i),o.setScalar(0),o.addScaledVector(ir,a.x),o.addScaledVector(ii,a.y),o.addScaledVector(ia,a.z),o}},{key:"isFrontFacing",value:function(e,r,n,i){return n2.subVectors(n,r),n3.subVectors(e,r),0>n2.cross(n3).dot(i)}}]),e}(),is=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ(-1/0,-1/0,-1/0);o(this,e),this.isBox3=!0,this.min=r,this.max=n}return u(e,[{key:"set",value:function(e,r){return this.min.copy(e),this.max.copy(r),this}},{key:"setFromArray",value:function(e){this.makeEmpty();for(var r=0,n=e.length;r<n;r+=3)this.expandByPoint(iu.fromArray(e,r));return this}},{key:"setFromBufferAttribute",value:function(e){this.makeEmpty();for(var r=0,n=e.count;r<n;r++)this.expandByPoint(iu.fromBufferAttribute(e,r));return this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var r=0,n=e.length;r<n;r++)this.expandByPoint(e[r]);return this}},{key:"setFromCenterAndSize",value:function(e,r){var n=iu.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}},{key:"setFromObject",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,r)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"expandByObject",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);var n=e.geometry;if(void 0!==n){var i=n.getAttribute("position");if(!0===r&&void 0!==i&&!0!==e.isInstancedMesh)for(var a=0,o=i.count;a<o;a++)!0===e.isMesh?e.getVertexPosition(a,iu):iu.fromBufferAttribute(i,a),iu.applyMatrix4(e.matrixWorld),this.expandByPoint(iu);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),ic.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),ic.copy(n.boundingBox)),ic.applyMatrix4(e.matrixWorld),this.union(ic)}for(var s=e.children,l=0,u=s.length;l<u;l++)this.expandByObject(s[l],r);return this}},{key:"containsPoint",value:function(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}},{key:"containsBox",value:function(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}},{key:"getParameter",value:function(e,r){return r.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))}},{key:"intersectsBox",value:function(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}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,iu),iu.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var r,n;return e.normal.x>0?(r=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(r=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(r+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(r+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(r+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(r+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),r<=-e.constant&&n>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(ig),ib.subVectors(this.max,ig),ih.subVectors(e.a,ig),id.subVectors(e.b,ig),ip.subVectors(e.c,ig),iv.subVectors(id,ih),iy.subVectors(ip,id),im.subVectors(ih,ip);var r=[0,-iv.z,iv.y,0,-iy.z,iy.y,0,-im.z,im.y,iv.z,0,-iv.x,iy.z,0,-iy.x,im.z,0,-im.x,-iv.y,iv.x,0,-iy.y,iy.x,0,-im.y,im.x,0];return!(!iS(r,ih,id,ip,ib)||!iS(r=[1,0,0,0,1,0,0,0,1],ih,id,ip,ib))&&(iw.crossVectors(iv,iy),iS(r=[iw.x,iw.y,iw.z],ih,id,ip,ib))}},{key:"clampPoint",value:function(e,r){return r.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return this.clampPoint(e,iu).distanceTo(e)}},{key:"getBoundingSphere",value:function(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(iu).length()),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(il[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),il[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),il[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),il[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),il[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),il[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),il[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),il[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(il)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},{key:"toJSON",value:function(){return{min:this.min.toArray(),max:this.max.toArray()}}},{key:"fromJSON",value:function(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}]),e}(),il=[new rJ,new rJ,new rJ,new rJ,new rJ,new rJ,new rJ,new rJ],iu=new rJ,ic=new is,ih=new rJ,id=new rJ,ip=new rJ,iv=new rJ,iy=new rJ,im=new rJ,ig=new rJ,ib=new rJ,iw=new rJ,ix=new rJ;function iS(e,r,n,i,a){for(var o=0,s=e.length-3;o<=s;o+=3){ix.fromArray(e,o);var l=a.x*Math.abs(ix.x)+a.y*Math.abs(ix.y)+a.z*Math.abs(ix.z),u=r.dot(ix),c=n.dot(ix),h=i.dot(ix);if(Math.max(-Math.max(u,c,h),Math.min(u,c,h))>l)return!1}return!0}var ik=function(){for(var e=new ArrayBuffer(4),r=new Float32Array(e),n=new Uint32Array(e),i=new Uint32Array(512),a=new Uint32Array(512),o=0;o<256;++o){var s=o-127;s<-27?(i[o]=0,i[256|o]=32768,a[o]=24,a[256|o]=24):s<-14?(i[o]=1024>>-s-14,i[256|o]=1024>>-s-14|32768,a[o]=-s-1,a[256|o]=-s-1):s<=15?(i[o]=s+15<<10,i[256|o]=s+15<<10|32768,a[o]=13,a[256|o]=13):s<128?(i[o]=31744,i[256|o]=64512,a[o]=24,a[256|o]=24):(i[o]=31744,i[256|o]=64512,a[o]=13,a[256|o]=13)}for(var l=new Uint32Array(2048),u=new Uint32Array(64),c=new Uint32Array(64),h=1;h<1024;++h){for(var d=h<<13,f=0;!(8388608&d);)d<<=1,f-=8388608;d&=-8388609,f+=0x38800000,l[h]=d|f}for(var p=1024;p<2048;++p)l[p]=0x38000000+(p-1024<<13);for(var v=1;v<31;++v)u[v]=v<<23;u[31]=0x47800000,u[32]=0x80000000;for(var y=33;y<63;++y)u[y]=0x80000000+(y-32<<23);u[63]=0xc7800000;for(var m=1;m<64;++m)32!==m&&(c[m]=1024);return{floatView:r,uint32View:n,baseTable:i,shiftTable:a,mantissaTable:l,exponentTable:u,offsetTable:c}}();function iM(e){Math.abs(e)>65504&&rE("DataUtils.toHalfFloat(): Value out of range."),e=rV(e,-65504,65504),ik.floatView[0]=e;var r=ik.uint32View[0],n=r>>23&511;return ik.baseTable[n]+((8388607&r)>>ik.shiftTable[n])}function iA(e){var r=e>>10;return ik.uint32View[0]=ik.mantissaTable[ik.offsetTable[r]+(1023&e)]+ik.exponentTable[r],ik.floatView[0]}var iO,iC=function(){function e(){o(this,e)}return u(e,null,[{key:"toHalfFloat",value:function(e){return iM(e)}},{key:"fromHalfFloat",value:function(e){return iA(e)}}]),e}(),i_=new rJ,iP=new rX,iE=0,iD=function(e){function r(e,n){var i,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o(this,r),i=a(this,r),Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");return i.isBufferAttribute=!0,Object.defineProperty(i,"id",{value:iE++}),i.name="",i.array=e,i.itemSize=n,i.count=void 0!==e?e.length/n:0,i.normalized=s,i.usage=rv,i.updateRanges=[],i.gpuType=eK,i.version=0,i}return f(r,e),u(r,[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"addUpdateRange",value:function(e,r){this.updateRanges.push({start:e,count:r})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(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.gpuType=e.gpuType,this}},{key:"copyAt",value:function(e,r,n){e*=this.itemSize,n*=r.itemSize;for(var i=0,a=this.itemSize;i<a;i++)this.array[e+i]=r.array[n+i];return this}},{key:"copyArray",value:function(e){return this.array.set(e),this}},{key:"applyMatrix3",value:function(e){if(2===this.itemSize)for(var r=0,n=this.count;r<n;r++)iP.fromBufferAttribute(this,r),iP.applyMatrix3(e),this.setXY(r,iP.x,iP.y);else if(3===this.itemSize)for(var i=0,a=this.count;i<a;i++)i_.fromBufferAttribute(this,i),i_.applyMatrix3(e),this.setXYZ(i,i_.x,i_.y,i_.z);return this}},{key:"applyMatrix4",value:function(e){for(var r=0,n=this.count;r<n;r++)i_.fromBufferAttribute(this,r),i_.applyMatrix4(e),this.setXYZ(r,i_.x,i_.y,i_.z);return this}},{key:"applyNormalMatrix",value:function(e){for(var r=0,n=this.count;r<n;r++)i_.fromBufferAttribute(this,r),i_.applyNormalMatrix(e),this.setXYZ(r,i_.x,i_.y,i_.z);return this}},{key:"transformDirection",value:function(e){for(var r=0,n=this.count;r<n;r++)i_.fromBufferAttribute(this,r),i_.transformDirection(e),this.setXYZ(r,i_.x,i_.y,i_.z);return this}},{key:"set",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,r),this}},{key:"getComponent",value:function(e,r){var n=this.array[e*this.itemSize+r];return this.normalized&&(n=rW(n,this.array)),n}},{key:"setComponent",value:function(e,r,n){return this.normalized&&(n=rH(n,this.array)),this.array[e*this.itemSize+r]=n,this}},{key:"getX",value:function(e){var r=this.array[e*this.itemSize];return this.normalized&&(r=rW(r,this.array)),r}},{key:"setX",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize]=r,this}},{key:"getY",value:function(e){var r=this.array[e*this.itemSize+1];return this.normalized&&(r=rW(r,this.array)),r}},{key:"setY",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize+1]=r,this}},{key:"getZ",value:function(e){var r=this.array[e*this.itemSize+2];return this.normalized&&(r=rW(r,this.array)),r}},{key:"setZ",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize+2]=r,this}},{key:"getW",value:function(e){var r=this.array[e*this.itemSize+3];return this.normalized&&(r=rW(r,this.array)),r}},{key:"setW",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize+3]=r,this}},{key:"setXY",value:function(e,r,n){return e*=this.itemSize,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array)),this.array[e+0]=r,this.array[e+1]=n,this}},{key:"setXYZ",value:function(e,r,n,i){return e*=this.itemSize,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array),i=rH(i,this.array)),this.array[e+0]=r,this.array[e+1]=n,this.array[e+2]=i,this}},{key:"setXYZW",value:function(e,r,n,i,a){return e*=this.itemSize,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array),i=rH(i,this.array),a=rH(a,this.array)),this.array[e+0]=r,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=a,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==rv&&(e.usage=this.usage),e}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),r}(rR),ij=function(e){function r(e,n,i){return o(this,r),a(this,r,[new Uint16Array(e),n,i])}return f(r,e),r}(iD),iT=function(e){function r(e,n,i){return o(this,r),a(this,r,[new Uint32Array(e),n,i])}return f(r,e),r}(iD),iI=function(e){function r(e,n,i){var s;return o(this,r),(s=a(this,r,[new Uint16Array(e),n,i])).isFloat16BufferAttribute=!0,s}return f(r,e),u(r,[{key:"getX",value:function(e){var r=iA(this.array[e*this.itemSize]);return this.normalized&&(r=rW(r,this.array)),r}},{key:"setX",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize]=iM(r),this}},{key:"getY",value:function(e){var r=iA(this.array[e*this.itemSize+1]);return this.normalized&&(r=rW(r,this.array)),r}},{key:"setY",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize+1]=iM(r),this}},{key:"getZ",value:function(e){var r=iA(this.array[e*this.itemSize+2]);return this.normalized&&(r=rW(r,this.array)),r}},{key:"setZ",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize+2]=iM(r),this}},{key:"getW",value:function(e){var r=iA(this.array[e*this.itemSize+3]);return this.normalized&&(r=rW(r,this.array)),r}},{key:"setW",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.array[e*this.itemSize+3]=iM(r),this}},{key:"setXY",value:function(e,r,n){return e*=this.itemSize,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array)),this.array[e+0]=iM(r),this.array[e+1]=iM(n),this}},{key:"setXYZ",value:function(e,r,n,i){return e*=this.itemSize,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array),i=rH(i,this.array)),this.array[e+0]=iM(r),this.array[e+1]=iM(n),this.array[e+2]=iM(i),this}},{key:"setXYZW",value:function(e,r,n,i,a){return e*=this.itemSize,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array),i=rH(i,this.array),a=rH(a,this.array)),this.array[e+0]=iM(r),this.array[e+1]=iM(n),this.array[e+2]=iM(i),this.array[e+3]=iM(a),this}}]),r}(iD),iR=function(e){function r(e,n,i){return o(this,r),a(this,r,[new Float32Array(e),n,i])}return f(r,e),r}(iD),iB=new is,iz=new rJ,iL=new rJ,iF=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;o(this,e),this.isSphere=!0,this.center=r,this.radius=n}return u(e,[{key:"set",value:function(e,r){return this.center.copy(e),this.radius=r,this}},{key:"setFromPoints",value:function(e,r){var n=this.center;void 0!==r?n.copy(r):iB.setFromPoints(e).getCenter(n);for(var i=0,a=0,o=e.length;a<o;a++)i=Math.max(i,n.distanceToSquared(e[a]));return this.radius=Math.sqrt(i),this}},{key:"copy",value:function(e){return this.center.copy(e.center),this.radius=e.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(e){return e.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(e){var r=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=r*r}},{key:"intersectsBox",value:function(e){return e.intersectsSphere(this)}},{key:"intersectsPlane",value:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(e,r){var n=this.center.distanceToSquared(e);return r.copy(e),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;iz.subVectors(e,this.center);var r=iz.lengthSq();if(r>this.radius*this.radius){var n=Math.sqrt(r),i=.5*(n-this.radius);this.center.addScaledVector(iz,i/n),this.radius+=i}return this}},{key:"union",value:function(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(iL.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(iz.copy(e.center).add(iL)),this.expandByPoint(iz.copy(e.center).sub(iL)))),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){return{radius:this.radius,center:this.center.toArray()}}},{key:"fromJSON",value:function(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}]),e}(),iU=0,iV=new nb,iN=new nq,iG=new rJ,iW=new is,iH=new is,iq=new rJ,iY=function(e){function r(){var e;return o(this,r),(e=a(this,r)).isBufferGeometry=!0,Object.defineProperty(e,"id",{value:iU++}),e.uuid=rU(),e.name="",e.type="BufferGeometry",e.index=null,e.indirect=null,e.indirectOffset=0,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e._transformed=!1,e}return f(r,e),u(r,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(!function(e){for(var r=e.length-1;r>=0;--r)if(e[r]>=65535)return!0;return!1}(e)?ij:iT)(e,1):this.index=e,this}},{key:"setIndirect",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.indirect=e,this.indirectOffset=r,this}},{key:"getIndirect",value:function(){return this.indirect}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,r){return this.attributes[e]=r,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:r,materialIndex:n})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,r){this.drawRange.start=e,this.drawRange.count=r}},{key:"applyMatrix4",value:function(e){var r=this.attributes.position;void 0!==r&&(r.applyMatrix4(e),r.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new r1).getNormalMatrix(e);n.applyNormalMatrix(i),n.needsUpdate=!0}var a=this.attributes.tangent;return void 0!==a&&(a.transformDirection(e),a.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}},{key:"applyQuaternion",value:function(e){return iV.makeRotationFromQuaternion(e),this.applyMatrix4(iV),this}},{key:"rotateX",value:function(e){return iV.makeRotationX(e),this.applyMatrix4(iV),this}},{key:"rotateY",value:function(e){return iV.makeRotationY(e),this.applyMatrix4(iV),this}},{key:"rotateZ",value:function(e){return iV.makeRotationZ(e),this.applyMatrix4(iV),this}},{key:"translate",value:function(e,r,n){return iV.makeTranslation(e,r,n),this.applyMatrix4(iV),this}},{key:"scale",value:function(e,r,n){return iV.makeScale(e,r,n),this.applyMatrix4(iV),this}},{key:"lookAt",value:function(e){return iN.lookAt(e),iN.updateMatrix(),this.applyMatrix4(iN.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(iG).negate(),this.translate(iG.x,iG.y,iG.z),this}},{key:"setFromPoints",value:function(e){var r=this.getAttribute("position");if(void 0===r){for(var n=[],i=0,a=e.length;i<a;i++){var o=e[i];n.push(o.x,o.y,o.z||0)}this.setAttribute("position",new iR(n,3))}else{for(var s=Math.min(e.length,r.count),l=0;l<s;l++){var u=e[l];r.setXYZ(l,u.x,u.y,u.z||0)}e.length>r.count&&rE("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),r.needsUpdate=!0}return this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new is);var e=this.attributes.position,r=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return rD("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new rJ(-1/0,-1/0,-1/0),new rJ(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),r)for(var n=0,i=r.length;n<i;n++){var a=r[n];iW.setFromBufferAttribute(a),this.morphTargetsRelative?(iq.addVectors(this.boundingBox.min,iW.min),this.boundingBox.expandByPoint(iq),iq.addVectors(this.boundingBox.max,iW.max),this.boundingBox.expandByPoint(iq)):(this.boundingBox.expandByPoint(iW.min),this.boundingBox.expandByPoint(iW.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&rD('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new iF);var e=this.attributes.position,r=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return rD("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new rJ,1/0);if(e){var n=this.boundingSphere.center;if(iW.setFromBufferAttribute(e),r)for(var i=0,a=r.length;i<a;i++){var o=r[i];iH.setFromBufferAttribute(o),this.morphTargetsRelative?(iq.addVectors(iW.min,iH.min),iW.expandByPoint(iq),iq.addVectors(iW.max,iH.max),iW.expandByPoint(iq)):(iW.expandByPoint(iH.min),iW.expandByPoint(iH.max))}iW.getCenter(n);for(var s=0,l=0,u=e.count;l<u;l++)iq.fromBufferAttribute(e,l),s=Math.max(s,n.distanceToSquared(iq));if(r)for(var c=0,h=r.length;c<h;c++)for(var d=r[c],f=this.morphTargetsRelative,p=0,v=d.count;p<v;p++)iq.fromBufferAttribute(d,p),f&&(iG.fromBufferAttribute(e,p),iq.add(iG)),s=Math.max(s,n.distanceToSquared(iq));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&rD('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}},{key:"computeTangents",value:function(){var e=this.index,r=this.attributes;if(null===e||void 0===r.position||void 0===r.normal||void 0===r.uv)return void rD("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");var n=r.position,i=r.normal,a=r.uv,o=this.getAttribute("tangent");(void 0===o||o.count!==n.count)&&(o=new iD(new Float32Array(4*n.count),4),this.setAttribute("tangent",o));for(var s=[],l=[],u=0;u<n.count;u++)s[u]=new rJ,l[u]=new rJ;var c=new rJ,h=new rJ,d=new rJ,f=new rX,p=new rX,v=new rX,y=new rJ,m=new rJ,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(var b=0,w=g.length;b<w;++b)for(var x=g[b],S=x.start,k=S,M=S+x.count;k<M;k+=3)!function(e,r,i){c.fromBufferAttribute(n,e),h.fromBufferAttribute(n,r),d.fromBufferAttribute(n,i),f.fromBufferAttribute(a,e),p.fromBufferAttribute(a,r),v.fromBufferAttribute(a,i),h.sub(c),d.sub(c),p.sub(f),v.sub(f);var o=1/(p.x*v.y-v.x*p.y);isFinite(o)&&(y.copy(h).multiplyScalar(v.y).addScaledVector(d,-p.y).multiplyScalar(o),m.copy(d).multiplyScalar(p.x).addScaledVector(h,-v.x).multiplyScalar(o),s[e].add(y),s[r].add(y),s[i].add(y),l[e].add(m),l[r].add(m),l[i].add(m))}(e.getX(k+0),e.getX(k+1),e.getX(k+2));var A=new rJ,O=new rJ,C=new rJ,_=new rJ;function P(e){C.fromBufferAttribute(i,e),_.copy(C);var r=s[e];A.copy(r),A.sub(C.multiplyScalar(C.dot(r))).normalize(),O.crossVectors(_,r);var n=0>O.dot(l[e])?-1:1;o.setXYZW(e,A.x,A.y,A.z,n)}for(var E=0,D=g.length;E<D;++E)for(var j=g[E],T=j.start,I=T,R=T+j.count;I<R;I+=3)P(e.getX(I+0)),P(e.getX(I+1)),P(e.getX(I+2));this._transformed=!0}},{key:"computeVertexNormals",value:function(){var e=this.index,r=this.getAttribute("position");if(void 0!==r){var n=this.getAttribute("normal");if(void 0===n||n.count!==r.count)n=new iD(new Float32Array(3*r.count),3),this.setAttribute("normal",n);else for(var i=0,a=n.count;i<a;i++)n.setXYZ(i,0,0,0);var o=new rJ,s=new rJ,l=new rJ,u=new rJ,c=new rJ,h=new rJ,d=new rJ,f=new rJ;if(e)for(var p=0,v=e.count;p<v;p+=3){var y=e.getX(p+0),m=e.getX(p+1),g=e.getX(p+2);o.fromBufferAttribute(r,y),s.fromBufferAttribute(r,m),l.fromBufferAttribute(r,g),d.subVectors(l,s),f.subVectors(o,s),d.cross(f),u.fromBufferAttribute(n,y),c.fromBufferAttribute(n,m),h.fromBufferAttribute(n,g),u.add(d),c.add(d),h.add(d),n.setXYZ(y,u.x,u.y,u.z),n.setXYZ(m,c.x,c.y,c.z),n.setXYZ(g,h.x,h.y,h.z)}else for(var b=0,w=r.count;b<w;b+=3)o.fromBufferAttribute(r,b+0),s.fromBufferAttribute(r,b+1),l.fromBufferAttribute(r,b+2),d.subVectors(l,s),f.subVectors(o,s),d.cross(f),n.setXYZ(b+0,d.x,d.y,d.z),n.setXYZ(b+1,d.x,d.y,d.z),n.setXYZ(b+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}},{key:"normalizeNormals",value:function(){for(var e=this.attributes.normal,r=0,n=e.count;r<n;r++)iq.fromBufferAttribute(e,r),iq.normalize(),e.setXYZ(r,iq.x,iq.y,iq.z)}},{key:"toNonIndexed",value:function(){function e(e,r){for(var n=e.array,i=e.itemSize,a=e.normalized,o=new n.constructor(r.length*i),s=0,l=0,u=0,c=r.length;u<c;u++){s=e.isInterleavedBufferAttribute?r[u]*e.data.stride+e.offset:r[u]*i;for(var h=0;h<i;h++)o[l++]=n[s++]}return new iD(o,i,a)}if(null===this.index)return rE("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;var r=new iY,n=this.index.array,i=this.attributes;for(var a in i){var o=e(i[a],n);r.setAttribute(a,o)}var s=this.morphAttributes;for(var l in s){for(var u=[],c=s[l],h=0,d=c.length;h<d;h++){var f=e(c[h],n);u.push(f)}r.morphAttributes[l]=u}r.morphTargetsRelative=this.morphTargetsRelative;for(var p=this.groups,v=0,y=p.length;v<y;v++){var m=p[v];r.addGroup(m.start,m.count,m.materialIndex)}return r}},{key:"toJSON",value:function(){var e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){var r=this.parameters;for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e}e.data={attributes:{}};var i=this.index;null!==i&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var a=this.attributes;for(var o in a){var s=a[o];e.data.attributes[o]=s.toJSON(e.data)}var l={},u=!1;for(var c in this.morphAttributes){for(var h=this.morphAttributes[c],d=[],f=0,p=h.length;f<p;f++){var v=h[f];d.push(v.toJSON(e.data))}d.length>0&&(l[c]=d,u=!0)}u&&(e.data.morphAttributes=l,e.data.morphTargetsRelative=this.morphTargetsRelative);var y=this.groups;y.length>0&&(e.data.groups=JSON.parse(JSON.stringify(y)));var m=this.boundingSphere;return null!==m&&(e.data.boundingSphere=m.toJSON()),e}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var r={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone());var i=e.attributes;for(var a in i){var o=i[a];this.setAttribute(a,o.clone(r))}var s=e.morphAttributes;for(var l in s){for(var u=[],c=s[l],h=0,d=c.length;h<d;h++)u.push(c[h].clone(r));this.morphAttributes[l]=u}this.morphTargetsRelative=e.morphTargetsRelative;for(var f=e.groups,p=0,v=f.length;p<v;p++){var y=f[p];this.addGroup(y.start,y.count,y.materialIndex)}var m=e.boundingBox;null!==m&&(this.boundingBox=m.clone());var g=e.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),r}(rR),iX=function(){function e(r,n){o(this,e),this.isInterleavedBuffer=!0,this.array=r,this.stride=n,this.count=void 0!==r?r.length/n:0,this.usage=rv,this.updateRanges=[],this.version=0,this.uuid=rU()}return u(e,[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"addUpdateRange",value:function(e,r){this.updateRanges.push({start:e,count:r})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}},{key:"copyAt",value:function(e,r,n){e*=this.stride,n*=r.stride;for(var i=0,a=this.stride;i<a;i++)this.array[e+i]=r.array[n+i];return this}},{key:"set",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,r),this}},{key:"clone",value:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=rU()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var r=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(r,this.stride);return n.setUsage(this.usage),n}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"toJSON",value:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=rU()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}]),e}(),iZ=new rJ,iK=function(){function e(r,n,i){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];o(this,e),this.isInterleavedBufferAttribute=!0,this.name="",this.data=r,this.itemSize=n,this.offset=i,this.normalized=a}return u(e,[{key:"count",get:function(){return this.data.count}},{key:"array",get:function(){return this.data.array}},{key:"needsUpdate",set:function(e){this.data.needsUpdate=e}},{key:"applyMatrix4",value:function(e){for(var r=0,n=this.data.count;r<n;r++)iZ.fromBufferAttribute(this,r),iZ.applyMatrix4(e),this.setXYZ(r,iZ.x,iZ.y,iZ.z);return this}},{key:"applyNormalMatrix",value:function(e){for(var r=0,n=this.count;r<n;r++)iZ.fromBufferAttribute(this,r),iZ.applyNormalMatrix(e),this.setXYZ(r,iZ.x,iZ.y,iZ.z);return this}},{key:"transformDirection",value:function(e){for(var r=0,n=this.count;r<n;r++)iZ.fromBufferAttribute(this,r),iZ.transformDirection(e),this.setXYZ(r,iZ.x,iZ.y,iZ.z);return this}},{key:"getComponent",value:function(e,r){var n=this.array[e*this.data.stride+this.offset+r];return this.normalized&&(n=rW(n,this.array)),n}},{key:"setComponent",value:function(e,r,n){return this.normalized&&(n=rH(n,this.array)),this.data.array[e*this.data.stride+this.offset+r]=n,this}},{key:"setX",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.data.array[e*this.data.stride+this.offset]=r,this}},{key:"setY",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.data.array[e*this.data.stride+this.offset+1]=r,this}},{key:"setZ",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.data.array[e*this.data.stride+this.offset+2]=r,this}},{key:"setW",value:function(e,r){return this.normalized&&(r=rH(r,this.array)),this.data.array[e*this.data.stride+this.offset+3]=r,this}},{key:"getX",value:function(e){var r=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(r=rW(r,this.array)),r}},{key:"getY",value:function(e){var r=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(r=rW(r,this.array)),r}},{key:"getZ",value:function(e){var r=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(r=rW(r,this.array)),r}},{key:"getW",value:function(e){var r=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(r=rW(r,this.array)),r}},{key:"setXY",value:function(e,r,n){return e=e*this.data.stride+this.offset,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array)),this.data.array[e+0]=r,this.data.array[e+1]=n,this}},{key:"setXYZ",value:function(e,r,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array),i=rH(i,this.array)),this.data.array[e+0]=r,this.data.array[e+1]=n,this.data.array[e+2]=i,this}},{key:"setXYZW",value:function(e,r,n,i,a){return e=e*this.data.stride+this.offset,this.normalized&&(r=rH(r,this.array),n=rH(n,this.array),i=rH(i,this.array),a=rH(a,this.array)),this.data.array[e+0]=r,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=a,this}},{key:"clone",value:function(e){if(void 0===e){r_("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");for(var r=[],n=0;n<this.count;n++)for(var i=n*this.data.stride+this.offset,a=0;a<this.itemSize;a++)r.push(this.data.array[i+a]);return new iD(new this.array.constructor(r),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 iK(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}},{key:"toJSON",value:function(e){if(void 0===e){r_("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");for(var r=[],n=0;n<this.count;n++)for(var i=n*this.data.stride+this.offset,a=0;a<this.itemSize;a++)r.push(this.data.array[i+a]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:r,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}}}]),e}(),iJ=0,iQ=function(e){function r(){var e;return o(this,r),(e=a(this,r)).isMaterial=!0,Object.defineProperty(e,"id",{value:iJ++}),e.uuid=rU(),e.name="",e.type="Material",e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.alphaHash=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.blendColor=new nQ(0,0,0),e.blendAlpha=0,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=t2,e.stencilZFail=t2,e.stencilZPass=t2,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.forceSinglePass=!1,e.allowOverride=!0,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e._alphaTest=0,e}return f(r,e),u(r,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var r in e){var n=e[r];if(void 0===n){rE("Material: parameter '".concat(r,"' has value of undefined."));continue}var i=this[r];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector2&&n&&n.isVector2||i&&i.isEuler&&n&&n.isEuler||i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[r]=n:rE("Material: '".concat(r,"' is not a property of THREE.").concat(this.type,"."))}}},{key:"toJSON",value:function(e){var r=void 0===e||"string"==typeof e;r&&(e={textures:{},images:{}});var n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){var r=[];for(var n in e){var i=e[n];delete i.metadata,r.push(i)}return r}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()),void 0!==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()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),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),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.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.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),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),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==t2&&(n.stencilFail=this.stencilFail),this.stencilZFail!==t2&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==t2&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),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.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!1===this.allowOverride&&(n.allowOverride=!1),!0===this.wireframe&&(n.wireframe=!0),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=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),r){var a=i(e.textures),o=i(e.images);a.length>0&&(n.textures=a),o.length>0&&(n.images=o)}return n}},{key:"fromJSON",value:function(e,r){if(void 0!==e.uuid&&(this.uuid=e.uuid),void 0!==e.name&&(this.name=e.name),void 0!==e.color&&void 0!==this.color&&this.color.setHex(e.color),void 0!==e.roughness&&(this.roughness=e.roughness),void 0!==e.metalness&&(this.metalness=e.metalness),void 0!==e.sheen&&(this.sheen=e.sheen),void 0!==e.sheenColor&&(this.sheenColor=(new nQ).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(this.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==this.emissive&&this.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==this.specular&&this.specular.setHex(e.specular),void 0!==e.specularIntensity&&(this.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(this.shininess=e.shininess),void 0!==e.clearcoat&&(this.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(this.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(this.dispersion=e.dispersion),void 0!==e.iridescence&&(this.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(this.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(this.transmission=e.transmission),void 0!==e.thickness&&(this.thickness=e.thickness),void 0!==e.attenuationDistance&&(this.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(this.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(this.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(this.fog=e.fog),void 0!==e.flatShading&&(this.flatShading=e.flatShading),void 0!==e.blending&&(this.blending=e.blending),void 0!==e.combine&&(this.combine=e.combine),void 0!==e.side&&(this.side=e.side),void 0!==e.shadowSide&&(this.shadowSide=e.shadowSide),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.transparent&&(this.transparent=e.transparent),void 0!==e.alphaTest&&(this.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(this.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(this.depthFunc=e.depthFunc),void 0!==e.depthTest&&(this.depthTest=e.depthTest),void 0!==e.depthWrite&&(this.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(this.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(this.blendSrc=e.blendSrc),void 0!==e.blendDst&&(this.blendDst=e.blendDst),void 0!==e.blendEquation&&(this.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(this.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(this.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(this.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(this.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(this.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(this.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(this.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(this.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(this.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(this.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(this.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(this.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(this.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(this.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(this.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(this.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(this.rotation=e.rotation),void 0!==e.linewidth&&(this.linewidth=e.linewidth),void 0!==e.dashSize&&(this.dashSize=e.dashSize),void 0!==e.gapSize&&(this.gapSize=e.gapSize),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.polygonOffset&&(this.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(this.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(this.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(this.dithering=e.dithering),void 0!==e.alphaToCoverage&&(this.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(this.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(this.forceSinglePass=e.forceSinglePass),void 0!==e.allowOverride&&(this.allowOverride=e.allowOverride),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.toneMapped&&(this.toneMapped=e.toneMapped),void 0!==e.userData&&(this.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),void 0!==e.size&&(this.size=e.size),void 0!==e.sizeAttenuation&&(this.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(this.map=r[e.map]||null),void 0!==e.matcap&&(this.matcap=r[e.matcap]||null),void 0!==e.alphaMap&&(this.alphaMap=r[e.alphaMap]||null),void 0!==e.bumpMap&&(this.bumpMap=r[e.bumpMap]||null),void 0!==e.bumpScale&&(this.bumpScale=e.bumpScale),void 0!==e.normalMap&&(this.normalMap=r[e.normalMap]||null),void 0!==e.normalMapType&&(this.normalMapType=e.normalMapType),void 0!==e.normalScale){var n=e.normalScale;!1===Array.isArray(n)&&(n=[n,n]),this.normalScale=(new rX).fromArray(n)}return void 0!==e.displacementMap&&(this.displacementMap=r[e.displacementMap]||null),void 0!==e.displacementScale&&(this.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(this.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(this.roughnessMap=r[e.roughnessMap]||null),void 0!==e.metalnessMap&&(this.metalnessMap=r[e.metalnessMap]||null),void 0!==e.emissiveMap&&(this.emissiveMap=r[e.emissiveMap]||null),void 0!==e.emissiveIntensity&&(this.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(this.specularMap=r[e.specularMap]||null),void 0!==e.specularIntensityMap&&(this.specularIntensityMap=r[e.specularIntensityMap]||null),void 0!==e.specularColorMap&&(this.specularColorMap=r[e.specularColorMap]||null),void 0!==e.envMap&&(this.envMap=r[e.envMap]||null),void 0!==e.envMapRotation&&this.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(this.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(this.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(this.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(this.lightMap=r[e.lightMap]||null),void 0!==e.lightMapIntensity&&(this.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(this.aoMap=r[e.aoMap]||null),void 0!==e.aoMapIntensity&&(this.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(this.gradientMap=r[e.gradientMap]||null),void 0!==e.clearcoatMap&&(this.clearcoatMap=r[e.clearcoatMap]||null),void 0!==e.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=r[e.clearcoatRoughnessMap]||null),void 0!==e.clearcoatNormalMap&&(this.clearcoatNormalMap=r[e.clearcoatNormalMap]||null),void 0!==e.clearcoatNormalScale&&(this.clearcoatNormalScale=(new rX).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(this.iridescenceMap=r[e.iridescenceMap]||null),void 0!==e.iridescenceThicknessMap&&(this.iridescenceThicknessMap=r[e.iridescenceThicknessMap]||null),void 0!==e.transmissionMap&&(this.transmissionMap=r[e.transmissionMap]||null),void 0!==e.thicknessMap&&(this.thicknessMap=r[e.thicknessMap]||null),void 0!==e.anisotropyMap&&(this.anisotropyMap=r[e.anisotropyMap]||null),void 0!==e.sheenColorMap&&(this.sheenColorMap=r[e.sheenColorMap]||null),void 0!==e.sheenRoughnessMap&&(this.sheenRoughnessMap=r[e.sheenRoughnessMap]||null),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,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;var r=e.clippingPlanes,n=null;if(null!==r){var i=r.length;n=Array(i);for(var a=0;a!==i;++a)n[a]=r[a].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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),r}(rR),i$=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isSpriteMaterial=!0,n.type="SpriteMaterial",n.color=new nQ(0xffffff),n.map=null,n.alphaMap=null,n.rotation=0,n.sizeAttenuation=!0,n.transparent=!0,n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}]),r}(iQ),i0=new rJ,i1=new rJ,i2=new rJ,i3=new rX,i5=new rX,i4=new nb,i6=new rJ,i8=new rJ,i9=new rJ,i7=new rX,ae=new rX,at=new rX,ar=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i$;if(o(this,r),(e=a(this,r)).isSprite=!0,e.type="Sprite",void 0===iO){iO=new iY;var i=new iX(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);iO.setIndex([0,1,2,0,2,3]),iO.setAttribute("position",new iK(i,3,0,!1)),iO.setAttribute("uv",new iK(i,2,3,!1))}return e.geometry=iO,e.material=n,e.center=new rX(.5,.5),e.count=1,e}return f(r,e),u(r,[{key:"raycast",value:function(e,r){null===e.camera&&rD('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),i1.setFromMatrixScale(this.matrixWorld),i4.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),i2.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&i1.multiplyScalar(-i2.z);var n,i,a=this.material.rotation;0!==a&&(i=Math.cos(a),n=Math.sin(a));var o=this.center;an(i6.set(-.5,-.5,0),i2,o,i1,n,i),an(i8.set(.5,-.5,0),i2,o,i1,n,i),an(i9.set(.5,.5,0),i2,o,i1,n,i),i7.set(0,0),ae.set(1,0),at.set(1,1);var s=e.ray.intersectTriangle(i6,i8,i9,!1,i0);if(null!==s||(an(i8.set(-.5,.5,0),i2,o,i1,n,i),ae.set(0,1),null!==(s=e.ray.intersectTriangle(i6,i9,i8,!1,i0)))){var l=e.ray.origin.distanceTo(i0);l<e.near||l>e.far||r.push({distance:l,point:i0.clone(),uv:io.getInterpolation(i0,i6,i8,i9,i7,ae,at,new rX),face:null,object:this})}}},{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}]),r}(nq);function an(e,r,n,i,a,o){i3.subVectors(e,n).addScalar(.5).multiply(i),void 0!==a?(i5.x=o*i3.x-a*i3.y,i5.y=a*i3.x+o*i3.y):i5.copy(i3),e.copy(r),e.x+=i5.x,e.y+=i5.y,e.applyMatrix4(i4)}var ai=new rJ,aa=new rJ,ao=new rJ,as=new rJ,al=new rJ,au=new rJ,ac=new rJ,ah=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ(0,0,-1);o(this,e),this.origin=r,this.direction=n}return u(e,[{key:"set",value:function(e,r){return this.origin.copy(e),this.direction.copy(r),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,r){return r.copy(this.origin).addScaledVector(this.direction,e)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,ai)),this}},{key:"closestPointToPoint",value:function(e,r){r.subVectors(e,this.origin);var n=r.dot(this.direction);return n<0?r.copy(this.origin):r.copy(this.origin).addScaledVector(this.direction,n)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var r=ai.subVectors(e,this.origin).dot(this.direction);return r<0?this.origin.distanceToSquared(e):(ai.copy(this.origin).addScaledVector(this.direction,r),ai.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,r,n,i){aa.copy(e).add(r).multiplyScalar(.5),ao.copy(r).sub(e).normalize(),as.copy(this.origin).sub(aa);var a,o,s,l,u=.5*e.distanceTo(r),c=-this.direction.dot(ao),h=as.dot(this.direction),d=-as.dot(ao),f=as.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(a=c*d-h,o=c*h-d,l=u*p,a>=0)if(o>=-l)if(o<=l){var v=1/p;a*=v,o*=v,s=a*(a+c*o+2*h)+o*(c*a+o+2*d)+f}else s=-(a=Math.max(0,-(c*(o=u)+h)))*a+o*(o+2*d)+f;else s=-(a=Math.max(0,-(c*(o=-u)+h)))*a+o*(o+2*d)+f;else o<=-l?(o=(a=Math.max(0,-(-c*u+h)))>0?-u:Math.min(Math.max(-u,-d),u),s=-a*a+o*(o+2*d)+f):o<=l?(a=0,s=(o=Math.min(Math.max(-u,-d),u))*(o+2*d)+f):(o=(a=Math.max(0,-(c*u+h)))>0?u:Math.min(Math.max(-u,-d),u),s=-a*a+o*(o+2*d)+f);else o=c>0?-u:u,s=-(a=Math.max(0,-(c*o+h)))*a+o*(o+2*d)+f;return n&&n.copy(this.origin).addScaledVector(this.direction,a),i&&i.copy(aa).addScaledVector(ao,o),s}},{key:"intersectSphere",value:function(e,r){ai.subVectors(e.center,this.origin);var n=ai.dot(this.direction),i=ai.dot(ai)-n*n,a=e.radius*e.radius;if(i>a)return null;var o=Math.sqrt(a-i),s=n-o,l=n+o;return l<0?null:s<0?this.at(l,r):this.at(s,r)}},{key:"intersectsSphere",value:function(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var r=e.normal.dot(this.direction);if(0===r)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/r;return n>=0?n:null}},{key:"intersectPlane",value:function(e,r){var n=this.distanceToPlane(e);return null===n?null:this.at(n,r)}},{key:"intersectsPlane",value:function(e){var r=e.distanceToPoint(this.origin);return 0===r||e.normal.dot(this.direction)*r<0}},{key:"intersectBox",value:function(e,r){var n,i,a,o,s,l,u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,d=this.origin;return u>=0?(n=(e.min.x-d.x)*u,i=(e.max.x-d.x)*u):(n=(e.max.x-d.x)*u,i=(e.min.x-d.x)*u),c>=0?(a=(e.min.y-d.y)*c,o=(e.max.y-d.y)*c):(a=(e.max.y-d.y)*c,o=(e.min.y-d.y)*c),n>o||a>i||((a>n||isNaN(n))&&(n=a),(o<i||isNaN(i))&&(i=o),h>=0?(s=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(s=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||s>i)||((s>n||n!=n)&&(n=s),(l<i||i!=i)&&(i=l),i<0)?null:this.at(n>=0?n:i,r)}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,ai)}},{key:"intersectTriangle",value:function(e,r,n,i,a){al.subVectors(r,e),au.subVectors(n,e),ac.crossVectors(al,au);var o,s=this.direction.dot(ac);if(s>0){if(i)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}as.subVectors(this.origin,e);var l=o*this.direction.dot(au.crossVectors(as,au));if(l<0)return null;var u=o*this.direction.dot(al.cross(as));if(u<0||l+u>s)return null;var c=-o*as.dot(ac);return c<0?null:this.at(c/s,a)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),ad=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshBasicMaterial=!0,n.type="MeshBasicMaterial",n.color=new nQ(0xffffff),n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new nP,n.combine=0,n.reflectivity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,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.envMapRotation.copy(e.envMapRotation),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}}]),r}(iQ),af=new nb,ap=new ah,av=new iF,ay=new rJ,am=new rJ,ag=new rJ,ab=new rJ,aw=new rJ,ax=new rJ,aS=new rJ,ak=new rJ,aM=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new iY,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ad;return o(this,r),(e=a(this,r)).isMesh=!0,e.type="Mesh",e.geometry=n,e.material=i,e.morphTargetDictionary=void 0,e.morphTargetInfluences=void 0,e.count=1,e.updateMorphTargets(),e}return f(r,e),u(r,[{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,r=Object.keys(e);if(r.length>0){var n=e[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=n.length;i<a;i++){var o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}},{key:"getVertexPosition",value:function(e,r){var n=this.geometry,i=n.attributes.position,a=n.morphAttributes.position,o=n.morphTargetsRelative;r.fromBufferAttribute(i,e);var s=this.morphTargetInfluences;if(a&&s){ax.set(0,0,0);for(var l=0,u=a.length;l<u;l++){var c=s[l],h=a[l];0!==c&&(aw.fromBufferAttribute(h,e),o?ax.addScaledVector(aw,c):ax.addScaledVector(aw.sub(r),c))}r.add(ax)}return r}},{key:"raycast",value:function(e,r){var n=this.geometry,i=this.material,a=this.matrixWorld;void 0!==i&&(null===n.boundingSphere&&n.computeBoundingSphere(),av.copy(n.boundingSphere),av.applyMatrix4(a),ap.copy(e.ray).recast(e.near),!1===av.containsPoint(ap.origin)&&(null===ap.intersectSphere(av,ay)||ap.origin.distanceToSquared(ay)>Math.pow(e.far-e.near,2))||(af.copy(a).invert(),ap.copy(e.ray).applyMatrix4(af),(null===n.boundingBox||!1!==ap.intersectsBox(n.boundingBox))&&this._computeIntersections(e,r,ap)))}},{key:"_computeIntersections",value:function(e,r,n){var i,a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,h=a.attributes.normal,d=a.groups,f=a.drawRange;if(null!==s)if(Array.isArray(o))for(var p=0,v=d.length;p<v;p++)for(var y=d[p],m=o[y.materialIndex],g=Math.max(y.start,f.start),b=Math.min(s.count,Math.min(y.start+y.count,f.start+f.count));g<b;g+=3)(i=aA(this,m,e,n,u,c,h,s.getX(g),s.getX(g+1),s.getX(g+2)))&&(i.faceIndex=Math.floor(g/3),i.face.materialIndex=y.materialIndex,r.push(i));else for(var w=Math.max(0,f.start),x=Math.min(s.count,f.start+f.count);w<x;w+=3)(i=aA(this,o,e,n,u,c,h,s.getX(w),s.getX(w+1),s.getX(w+2)))&&(i.faceIndex=Math.floor(w/3),r.push(i));else if(void 0!==l)if(Array.isArray(o))for(var S=0,k=d.length;S<k;S++)for(var M=d[S],A=o[M.materialIndex],O=Math.max(M.start,f.start),C=Math.min(l.count,Math.min(M.start+M.count,f.start+f.count));O<C;O+=3)(i=aA(this,A,e,n,u,c,h,O,O+1,O+2))&&(i.faceIndex=Math.floor(O/3),i.face.materialIndex=M.materialIndex,r.push(i));else for(var _=Math.max(0,f.start),P=Math.min(l.count,f.start+f.count);_<P;_+=3)(i=aA(this,o,e,n,u,c,h,_,_+1,_+2))&&(i.faceIndex=Math.floor(_/3),r.push(i))}}]),r}(nq);function aA(e,r,n,i,a,o,s,l,u,c){e.getVertexPosition(l,am),e.getVertexPosition(u,ag),e.getVertexPosition(c,ab);var h=function(e,r,n,i,a,o,s,l){if(null===(1===r.side?i.intersectTriangle(s,o,a,!0,l):i.intersectTriangle(a,o,s,0===r.side,l)))return null;ak.copy(l),ak.applyMatrix4(e.matrixWorld);var u=n.ray.origin.distanceTo(ak);return u<n.near||u>n.far?null:{distance:u,point:ak.clone(),object:e}}(e,r,n,i,am,ag,ab,aS);if(h){var d=new rJ;io.getBarycoord(aS,am,ag,ab,d),a&&(h.uv=io.getInterpolatedAttribute(a,l,u,c,d,new rX)),o&&(h.uv1=io.getInterpolatedAttribute(o,l,u,c,d,new rX)),s&&(h.normal=io.getInterpolatedAttribute(s,l,u,c,d,new rJ),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));var f={a:l,b:u,c:c,normal:new rJ,materialIndex:0};io.getNormal(am,ag,ab,f.normal),h.face=f,h.barycoord=d}return h}var aO=function(e){function r(){var e;return o(this,r),(e=a(this,r)).isBone=!0,e.type="Bone",e}return f(r,e),r}(nq),aC=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,h=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0,f=arguments.length>8&&void 0!==arguments[8]?arguments[8]:ez,p=arguments.length>9&&void 0!==arguments[9]?arguments[9]:ez,v=arguments.length>10?arguments[10]:void 0,y=arguments.length>11?arguments[11]:void 0;return o(this,r),(e=a(this,r,[null,c,h,d,f,p,l,u,v,y])).isDataTexture=!0,e.image={data:n,width:i,height:s},e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return f(r,e),r}(nh),a_=new nb,aP=new nb,aE=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];o(this,e),this.uuid=rU(),this.bones=r.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.init()}return u(e,[{key:"init",value:function(){var e=this.bones,r=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===r.length)this.calculateInverses();else if(e.length!==r.length){rE("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new nb)}}},{key:"calculateInverses",value:function(){this.boneInverses.length=0;for(var e=0,r=this.bones.length;e<r;e++){var n=new nb;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}},{key:"pose",value:function(){for(var e=0,r=this.bones.length;e<r;e++){var n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(var i=0,a=this.bones.length;i<a;i++){var o=this.bones[i];o&&(o.parent&&o.parent.isBone?(o.matrix.copy(o.parent.matrixWorld).invert(),o.matrix.multiply(o.matrixWorld)):o.matrix.copy(o.matrixWorld),o.matrix.decompose(o.position,o.quaternion,o.scale))}}},{key:"update",value:function(){for(var e=this.bones,r=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,a=0,o=e.length;a<o;a++){var s=e[a]?e[a].matrixWorld:aP;a_.multiplyMatrices(s,r[a]),a_.toArray(n,16*a)}null!==i&&(i.needsUpdate=!0)}},{key:"clone",value:function(){return new aE(this.bones,this.boneInverses)}},{key:"computeBoneTexture",value:function(){var e=Math.sqrt(4*this.bones.length),r=new Float32Array((e=Math.max(e=4*Math.ceil(e/4),4))*e*4);r.set(this.boneMatrices);var n=new aC(r,e,e,e4,eK);return n.needsUpdate=!0,this.boneMatrices=r,this.boneTexture=n,this}},{key:"getBoneByName",value:function(e){for(var r=0,n=this.bones.length;r<n;r++){var i=this.bones[r];if(i.name===e)return i}}},{key:"dispose",value:function(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}},{key:"fromJSON",value:function(e,r){this.uuid=e.uuid;for(var n=0,i=e.bones.length;n<i;n++){var a=e.bones[n],o=r[a];void 0===o&&(rE("Skeleton: No bone found with UUID:",a),o=new aO),this.bones.push(o),this.boneInverses.push((new nb).fromArray(e.boneInverses[n]))}return this.init(),this}},{key:"toJSON",value:function(){var e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;for(var r=this.bones,n=this.boneInverses,i=0,a=r.length;i<a;i++){var o=r[i];e.bones.push(o.uuid);var s=n[i];e.boneInverses.push(s.toArray())}return e}}]),e}(),aD=function(e){function r(e,n,i){var s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return o(this,r),(s=a(this,r,[e,n,i])).isInstancedBufferAttribute=!0,s.meshPerAttribute=l,s}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}]),r}(iD),aj=new nb,aT=new nb,aI=[],aR=new is,aB=new nb,az=new aM,aL=new iF,aF=function(e){function r(e,n,i){o(this,r),(s=a(this,r,[e,n])).isInstancedMesh=!0,s.instanceMatrix=new aD(new Float32Array(16*i),16),s.instanceColor=null,s.morphTexture=null,s.count=i,s.boundingBox=null,s.boundingSphere=null;for(var s,l=0;l<i;l++)s.setMatrixAt(l,aB);return s}return f(r,e),u(r,[{key:"computeBoundingBox",value:function(){var e=this.geometry,r=this.count;null===this.boundingBox&&(this.boundingBox=new is),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(var n=0;n<r;n++)this.getMatrixAt(n,aj),aR.copy(e.boundingBox).applyMatrix4(aj),this.boundingBox.union(aR)}},{key:"computeBoundingSphere",value:function(){var e=this.geometry,r=this.count;null===this.boundingSphere&&(this.boundingSphere=new iF),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(var n=0;n<r;n++)this.getMatrixAt(n,aj),aL.copy(e.boundingSphere).applyMatrix4(aj),this.boundingSphere.union(aL)}},{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}},{key:"getColorAt",value:function(e,r){return null===this.instanceColor?r.setRGB(1,1,1):r.fromArray(this.instanceColor.array,3*e)}},{key:"getMatrixAt",value:function(e,r){return r.fromArray(this.instanceMatrix.array,16*e)}},{key:"getMorphAt",value:function(e,r){for(var n=r.morphTargetInfluences,i=this.morphTexture.source.data.data,a=e*(n.length+1)+1,o=0;o<n.length;o++)n[o]=i[a+o]}},{key:"raycast",value:function(e,r){var n=this.matrixWorld,i=this.count;if(az.geometry=this.geometry,az.material=this.material,void 0!==az.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),aL.copy(this.boundingSphere),aL.applyMatrix4(n),!1!==e.ray.intersectsSphere(aL)))for(var a=0;a<i;a++){this.getMatrixAt(a,aj),aT.multiplyMatrices(n,aj),az.matrixWorld=aT,az.raycast(e,aI);for(var o=0,s=aI.length;o<s;o++){var l=aI[o];l.instanceId=a,l.object=this,r.push(l)}aI.length=0}}},{key:"setColorAt",value:function(e,r){return null===this.instanceColor&&(this.instanceColor=new aD(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),r.toArray(this.instanceColor.array,3*e),this}},{key:"setMatrixAt",value:function(e,r){return r.toArray(this.instanceMatrix.array,16*e),this}},{key:"setMorphAt",value:function(e,r){var n=r.morphTargetInfluences,i=n.length+1;null===this.morphTexture&&(this.morphTexture=new aC(new Float32Array(i*this.count),i,this.count,e9,eK));for(var a=this.morphTexture.source.data.data,o=0,s=0;s<n.length;s++)o+=n[s];var l=this.geometry.morphTargetsRelative?1:1-o,u=i*e;return a[u]=l,a.set(n,u+1),this}},{key:"updateMorphTargets",value:function(){}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}]),r}(aM),aU=new rJ,aV=new rJ,aN=new r1,aG=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ(1,0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.isPlane=!0,this.normal=r,this.constant=n}return u(e,[{key:"set",value:function(e,r){return this.normal.copy(e),this.constant=r,this}},{key:"setComponents",value:function(e,r,n,i){return this.normal.set(e,r,n),this.constant=i,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,r){return this.normal.copy(e),this.constant=-r.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,r,n){var i=aU.subVectors(n,r).cross(aV.subVectors(e,r)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,r){return r.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}},{key:"intersectLine",value:function(e,r){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=e.delta(aU),a=this.normal.dot(i);if(0===a)return 0===this.distanceToPoint(e.start)?r.copy(e.start):null;var o=-(e.start.dot(this.normal)+this.constant)/a;return!0===n&&(o<0||o>1)?null:r.copy(e.start).addScaledVector(i,o)}},{key:"intersectsLine",value:function(e){var r=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return r<0&&n>0||n<0&&r>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,r){var n=r||aN.getNormalMatrix(e),i=this.coplanarPoint(aU).applyMatrix4(e),a=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(a),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),aW=new iF,aH=new rX(.5,.5),aq=new rJ,aY=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new aG,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new aG,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new aG,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new aG,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new aG,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new aG;o(this,e),this.planes=[r,n,i,a,s,l]}return u(e,[{key:"set",value:function(e,r,n,i,a,o){var s=this.planes;return s[0].copy(e),s[1].copy(r),s[2].copy(n),s[3].copy(i),s[4].copy(a),s[5].copy(o),this}},{key:"copy",value:function(e){for(var r=this.planes,n=0;n<6;n++)r[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rg,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.planes,a=e.elements,o=a[0],s=a[1],l=a[2],u=a[3],c=a[4],h=a[5],d=a[6],f=a[7],p=a[8],v=a[9],y=a[10],m=a[11],g=a[12],b=a[13],w=a[14],x=a[15];if(i[0].setComponents(u-o,f-c,m-p,x-g).normalize(),i[1].setComponents(u+o,f+c,m+p,x+g).normalize(),i[2].setComponents(u+s,f+h,m+v,x+b).normalize(),i[3].setComponents(u-s,f-h,m-v,x-b).normalize(),n)i[4].setComponents(l,d,y,w).normalize(),i[5].setComponents(u-l,f-d,m-y,x-w).normalize();else if(i[4].setComponents(u-l,f-d,m-y,x-w).normalize(),r===rg)i[5].setComponents(u+l,f+d,m+y,x+w).normalize();else{if(r!==rb)throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+r);i[5].setComponents(l,d,y,w).normalize()}return this}},{key:"intersectsObject",value:function(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),aW.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{var r=e.geometry;null===r.boundingSphere&&r.computeBoundingSphere(),aW.copy(r.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(aW)}},{key:"intersectsSprite",value:function(e){return aW.center.set(0,0,0),aW.radius=.7071067811865476+aH.distanceTo(e.center),aW.applyMatrix4(e.matrixWorld),this.intersectsSphere(aW)}},{key:"intersectsSphere",value:function(e){for(var r=this.planes,n=e.center,i=-e.radius,a=0;a<6;a++)if(r[a].distanceToPoint(n)<i)return!1;return!0}},{key:"intersectsBox",value:function(e){for(var r=this.planes,n=0;n<6;n++){var i=r[n];if(aq.x=i.normal.x>0?e.max.x:e.min.x,aq.y=i.normal.y>0?e.max.y:e.min.y,aq.z=i.normal.z>0?e.max.z:e.min.z,0>i.distanceToPoint(aq))return!1}return!0}},{key:"containsPoint",value:function(e){for(var r=this.planes,n=0;n<6;n++)if(0>r[n].distanceToPoint(e))return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),aX=new nb,aZ=function(){function e(){o(this,e),this.coordinateSystem=rg,this._frustums=[],this._count=0}return u(e,[{key:"setFromArrayCamera",value:function(e){for(var r=e.cameras,n=this._frustums,i=0;i<r.length;i++){var a=r[i];aX.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),void 0===n[i]&&(n[i]=new aY),n[i].setFromProjectionMatrix(aX,a.coordinateSystem,a.reversedDepth)}return this._count=r.length,this}},{key:"intersectsObject",value:function(e){for(var r=this._frustums,n=0;n<this._count;n++)if(r[n].intersectsObject(e))return!0;return!1}},{key:"intersectsSprite",value:function(e){for(var r=this._frustums,n=0;n<this._count;n++)if(r[n].intersectsSprite(e))return!0;return!1}},{key:"intersectsSphere",value:function(e){for(var r=this._frustums,n=0;n<this._count;n++)if(r[n].intersectsSphere(e))return!0;return!1}},{key:"intersectsBox",value:function(e){for(var r=this._frustums,n=0;n<this._count;n++)if(r[n].intersectsBox(e))return!0;return!1}},{key:"containsPoint",value:function(e){for(var r=this._frustums,n=0;n<this._count;n++)if(r[n].containsPoint(e))return!0;return!1}},{key:"copy",value:function(e){this.coordinateSystem=e.coordinateSystem;for(var r=this._frustums,n=e._frustums,i=0;i<e._count;i++)void 0===r[i]&&(r[i]=new aY),r[i].copy(n[i]);return this._count=e._count,this}},{key:"clone",value:function(){return(new aZ).copy(this)}}]),e}(),aK=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isLineBasicMaterial=!0,n.type="LineBasicMaterial",n.color=new nQ(0xffffff),n.map=null,n.linewidth=1,n.linecap="round",n.linejoin="round",n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}]),r}(iQ),aJ=new rJ,aQ=new rJ,a$=new nb,a0=new ah,a1=new iF,a2=new rJ,a3=new rJ,a5=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new iY,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new aK;return o(this,r),(e=a(this,r)).isLine=!0,e.type="Line",e.geometry=n,e.material=i,e.morphTargetDictionary=void 0,e.morphTargetInfluences=void 0,e.updateMorphTargets(),e}return f(r,e),u(r,[{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"computeLineDistances",value:function(){var e=this.geometry;if(null===e.index){for(var r=e.attributes.position,n=[0],i=1,a=r.count;i<a;i++)aJ.fromBufferAttribute(r,i-1),aQ.fromBufferAttribute(r,i),n[i]=n[i-1],n[i]+=aJ.distanceTo(aQ);e.setAttribute("lineDistance",new iR(n,1))}else rE("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},{key:"raycast",value:function(e,r){var n=this.geometry,i=this.matrixWorld,a=e.params.Line.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),a1.copy(n.boundingSphere),a1.applyMatrix4(i),a1.radius+=a,!1!==e.ray.intersectsSphere(a1)){a$.copy(i).invert(),a0.copy(e.ray).applyMatrix4(a$);var s=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,u=this.isLineSegments?2:1,c=n.index,h=n.attributes.position;if(null!==c){for(var d=Math.max(0,o.start),f=Math.min(c.count,o.start+o.count),p=d,v=f-1;p<v;p+=u){var y=a4(this,e,a0,l,c.getX(p),c.getX(p+1),p);y&&r.push(y)}if(this.isLineLoop){var m=a4(this,e,a0,l,c.getX(f-1),c.getX(d),f-1);m&&r.push(m)}}else{for(var g=Math.max(0,o.start),b=Math.min(h.count,o.start+o.count),w=g,x=b-1;w<x;w+=u){var S=a4(this,e,a0,l,w,w+1,w);S&&r.push(S)}if(this.isLineLoop){var k=a4(this,e,a0,l,b-1,g,b-1);k&&r.push(k)}}}}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,r=Object.keys(e);if(r.length>0){var n=e[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=n.length;i<a;i++){var o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}]),r}(nq);function a4(e,r,n,i,a,o,s){var l=e.geometry.attributes.position;if(aJ.fromBufferAttribute(l,a),aQ.fromBufferAttribute(l,o),!(n.distanceSqToSegment(aJ,aQ,a2,a3)>i)){a2.applyMatrix4(e.matrixWorld);var u=r.ray.origin.distanceTo(a2);return u<r.near||u>r.far?void 0:{distance:u,point:a3.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}}var a6=new rJ,a8=new rJ,a9=function(e){function r(e,n){var i;return o(this,r),(i=a(this,r,[e,n])).isLineSegments=!0,i.type="LineSegments",i}return f(r,e),u(r,[{key:"computeLineDistances",value:function(){var e=this.geometry;if(null===e.index){for(var r=e.attributes.position,n=[],i=0,a=r.count;i<a;i+=2)a6.fromBufferAttribute(r,i),a8.fromBufferAttribute(r,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+a6.distanceTo(a8);e.setAttribute("lineDistance",new iR(n,1))}else rE("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}]),r}(a5),a7=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isPointsMaterial=!0,n.type="PointsMaterial",n.color=new nQ(0xffffff),n.map=null,n.alphaMap=null,n.size=1,n.sizeAttenuation=!0,n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}]),r}(iQ),oe=function(e){function r(e,n,i,s){var l,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:eU,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:eU,h=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0,f=arguments.length>8?arguments[8]:void 0;return o(this,r),(l=a(this,r,[e,n,i,s,u,c,h,d,f])).isVideoTexture=!0,l.generateMipmaps=!1,l._requestVideoFrameCallbackId=0,"requestVideoFrameCallback"in e&&(l._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function r(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=e.requestVideoFrameCallback(r)})),l}return f(r,e),u(r,[{key:"clone",value:function(){return new this.constructor(this.image).copy(this)}},{key:"update",value:function(){var e=this.image;"requestVideoFrameCallback"in e==0&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},{key:"dispose",value:function(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),h(d(r.prototype),"dispose",this).call(this)}}]),r}(nh),ot=function(e){function r(e,n){var i;return o(this,r),(i=a(this,r,[{width:e,height:n}])).isFramebufferTexture=!0,i.magFilter=ez,i.minFilter=ez,i.generateMipmaps=!1,i.needsUpdate=!0,i}return f(r,e),r}(nh),or=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:301,s=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,h=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0,f=arguments.length>8?arguments[8]:void 0,p=arguments.length>9?arguments[9]:void 0;return o(this,r),(e=a(this,r,[n,i,s,l,u,c,h,d,f,p])).isCubeTexture=!0,e.flipY=!1,e}return f(r,e),u(r,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}]),r}(nh),on=function(e){function r(e,n,i,s,l,u,c,h,d){var f;return o(this,r),(f=a(this,r,[e,n,i,s,l,u,c,h,d])).isCanvasTexture=!0,f.needsUpdate=!0,f}return f(r,e),r}(nh),oi=function(e){function r(e,n){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eZ,l=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:ez,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:ez,f=arguments.length>8?arguments[8]:void 0,p=arguments.length>9&&void 0!==arguments[9]?arguments[9]:e6,v=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1;if(o(this,r),p!==e6&&1027!==p)throw Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return(i=a(this,r,[{width:e,height:n,depth:v},l,u,c,h,d,p,s,f])).isDepthTexture=!0,i.flipY=!1,i.generateMipmaps=!1,i.compareFunction=null,i}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.source=new ns(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return null!==this.compareFunction&&(n.compareFunction=this.compareFunction),n}}]),r}(nh),oa=function(e){function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eZ,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:301,l=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:ez,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:ez,d=arguments.length>7?arguments[7]:void 0,f=arguments.length>8&&void 0!==arguments[8]?arguments[8]:e6;o(this,r);var p={width:e,height:e,depth:1};return(n=a(this,r,[e,e,i,s,l,u,c,h,d,f])).image=[p,p,p,p,p,p],n.isCubeDepthTexture=!0,n.isCubeTexture=!0,n}return f(r,e),u(r,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}]),r}(oi),oo=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;o(this,r);var h=function(e,r,n,i,a,o,s,l,u,c,h){for(var b=o/u,w=s/c,x=o/2,S=s/2,k=l/2,M=u+1,A=c+1,O=0,C=0,_=new rJ,P=0;P<A;P++)for(var E=P*w-S,D=0;D<M;D++){var j=D*b-x;_[e]=j*i,_[r]=E*a,_[n]=k,p.push(_.x,_.y,_.z),_[e]=0,_[r]=0,_[n]=l>0?1:-1,v.push(_.x,_.y,_.z),y.push(D/u),y.push(1-P/c),O+=1}for(var T=0;T<c;T++)for(var I=0;I<u;I++){var R=m+I+M*T,B=m+I+M*(T+1),z=m+(I+1)+M*(T+1),L=m+(I+1)+M*T;f.push(R,B,L),f.push(B,z,L),C+=6}d.addGroup(g,C,h),g+=C,m+=O};(e=a(this,r)).type="BoxGeometry",e.parameters={width:n,height:i,depth:s,widthSegments:l,heightSegments:u,depthSegments:c};var d=e;l=Math.floor(l),u=Math.floor(u);var f=[],p=[],v=[],y=[],m=0,g=0;return h("z","y","x",-1,-1,s,i,n,c=Math.floor(c),u,0),h("z","y","x",1,-1,s,i,-n,c,u,1),h("x","z","y",1,1,n,s,i,l,c,2),h("x","z","y",1,-1,n,s,-i,l,c,3),h("x","y","z",1,-1,n,i,s,l,u,4),h("x","y","z",-1,-1,n,i,-s,l,u,5),e.setIndex(f),e.setAttribute("position",new iR(p,3)),e.setAttribute("normal",new iR(v,3)),e.setAttribute("uv",new iR(y,2)),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new oo(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}]),r}(iY),os=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;o(this,r);var f=function(e){for(var r=b,a=new rX,o=new rJ,s=0,u=!0===e?n:i,c=!0===e?1:-1,f=1;f<=l;f++)y.push(0,x*c,0),m.push(0,c,0),g.push(.5,.5),b++;for(var w=b,k=0;k<=l;k++){var M=k/l*d+h,A=Math.cos(M),O=Math.sin(M);o.x=u*O,o.y=x*c,o.z=u*A,y.push(o.x,o.y,o.z),m.push(0,c,0),a.x=.5*A+.5,a.y=.5*O*c+.5,g.push(a.x,a.y),b++}for(var C=0;C<l;C++){var _=r+C,P=w+C;!0===e?v.push(P,P+1,_):v.push(P+1,P,_),s+=3}p.addGroup(S,s,!0===e?1:2),S+=s};(e=a(this,r)).type="CylinderGeometry",e.parameters={radiusTop:n,radiusBottom:i,height:s,radialSegments:l,heightSegments:u,openEnded:c,thetaStart:h,thetaLength:d};var p=e;l=Math.floor(l),u=Math.floor(u);var v=[],y=[],m=[],g=[],b=0,w=[],x=s/2,S=0;return function(){for(var e=new rJ,r=new rJ,a=0,o=(i-n)/s,c=0;c<=u;c++){for(var f=[],k=c/u,M=k*(i-n)+n,A=0;A<=l;A++){var O=A/l,C=O*d+h,_=Math.sin(C),P=Math.cos(C);r.x=M*_,r.y=-k*s+x,r.z=M*P,y.push(r.x,r.y,r.z),e.set(_,o,P).normalize(),m.push(e.x,e.y,e.z),g.push(O,1-k),f.push(b++)}w.push(f)}for(var E=0;E<l;E++)for(var D=0;D<u;D++){var j=w[D][E],T=w[D+1][E],I=w[D+1][E+1],R=w[D][E+1];(n>0||0!==D)&&(v.push(j,T,R),a+=3),(i>0||D!==u-1)&&(v.push(T,I,R),a+=3)}p.addGroup(S,a,0),S+=a}(),!1===c&&(n>0&&f(!0),i>0&&f(!1)),e.setIndex(v),e.setAttribute("position",new iR(y,3)),e.setAttribute("normal",new iR(m,3)),e.setAttribute("uv",new iR(g,2)),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new os(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}]),r}(iY),ol=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return o(this,r),(e=a(this,r,[0,n,i,s,l,u,c,h])).type="ConeGeometry",e.parameters={radius:n,height:i,radialSegments:s,heightSegments:l,openEnded:u,thetaStart:c,thetaLength:h},e}return f(r,e),u(r,null,[{key:"fromJSON",value:function(e){return new ol(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}]),r}(os),ou=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o(this,r);var u=function(e,r,n,i){for(var a=i+1,o=[],s=0;s<=a;s++){o[s]=[];for(var l=e.clone().lerp(n,s/a),u=r.clone().lerp(n,s/a),h=a-s,d=0;d<=h;d++)o[s][d]=0===d&&s===a?l:l.clone().lerp(u,d/h)}for(var f=0;f<a;f++)for(var p=0;p<2*(a-f)-1;p++){var v=Math.floor(p/2);p%2==0?(c(o[f][v+1]),c(o[f+1][v]),c(o[f][v])):(c(o[f][v+1]),c(o[f+1][v+1]),c(o[f+1][v]))}},c=function(e){p.push(e.x,e.y,e.z)},h=function(e,r){var i=3*e;r.x=n[i+0],r.y=n[i+1],r.z=n[i+2]},d=function(e,r,n,i){i<0&&1===e.x&&(v[r]=e.x-1),0===n.x&&0===n.z&&(v[r]=i/2/Math.PI+.5)},f=function(e){return Math.atan2(e.z,-e.x)};(e=a(this,r)).type="PolyhedronGeometry",e.parameters={vertices:n,indices:i,radius:s,detail:l};var p=[],v=[];return function(e){for(var r=new rJ,n=new rJ,a=new rJ,o=0;o<i.length;o+=3)h(i[o+0],r),h(i[o+1],n),h(i[o+2],a),u(r,n,a,e)}(l),function(e){for(var r=new rJ,n=0;n<p.length;n+=3)r.x=p[n+0],r.y=p[n+1],r.z=p[n+2],r.normalize().multiplyScalar(e),p[n+0]=r.x,p[n+1]=r.y,p[n+2]=r.z}(s),function(){for(var e=new rJ,r=0;r<p.length;r+=3){e.x=p[r+0],e.y=p[r+1],e.z=p[r+2];var n=f(e)/2/Math.PI+.5,i=Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;v.push(n,1-i)}(function(){for(var e=new rJ,r=new rJ,n=new rJ,i=new rJ,a=new rX,o=new rX,s=new rX,l=0,u=0;l<p.length;l+=9,u+=6){e.set(p[l+0],p[l+1],p[l+2]),r.set(p[l+3],p[l+4],p[l+5]),n.set(p[l+6],p[l+7],p[l+8]),a.set(v[u+0],v[u+1]),o.set(v[u+2],v[u+3]),s.set(v[u+4],v[u+5]),i.copy(e).add(r).add(n).divideScalar(3);var c=f(i);d(a,u+0,e,c),d(o,u+2,r,c),d(s,u+4,n,c)}})(),function(){for(var e=0;e<v.length;e+=6){var r=v[e+0],n=v[e+2],i=v[e+4],a=Math.max(r,n,i),o=Math.min(r,n,i);a>.9&&o<.1&&(r<.2&&(v[e+0]+=1),n<.2&&(v[e+2]+=1),i<.2&&(v[e+4]+=1))}}()}(),e.setAttribute("position",new iR(p,3)),e.setAttribute("normal",new iR(p.slice(),3)),e.setAttribute("uv",new iR(v,2)),0===l?e.computeVertexNormals():e.normalizeNormals(),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new ou(e.vertices,e.indices,e.radius,e.detail)}}]),r}(iY),oc=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,r);var s=(1+Math.sqrt(5))/2,l=1/s;return(e=a(this,r,[[-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,-l,-s,0,-l,s,0,l,-s,0,l,s,-l,-s,0,-l,s,0,l,-s,0,l,s,0,-s,0,-l,s,0,-l,-s,0,l,s,0,l],[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],n,i])).type="DodecahedronGeometry",e.parameters={radius:n,detail:i},e}return f(r,e),u(r,null,[{key:"fromJSON",value:function(e){return new oc(e.radius,e.detail)}}]),r}(ou),oh=function(){function e(){o(this,e),this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}return u(e,[{key:"getPoint",value:function(){rE("Curve: .getPoint() not implemented.")}},{key:"getPointAt",value:function(e,r){var n=this.getUtoTmapping(e);return this.getPoint(n,r)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,r=[],n=0;n<=e;n++)r.push(this.getPoint(n/e));return r}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,r=[],n=0;n<=e;n++)r.push(this.getPointAt(n/e));return r}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var r,n=[],i=this.getPoint(0),a=0;n.push(0);for(var o=1;o<=e;o++)n.push(a+=(r=this.getPoint(o/e)).distanceTo(i)),i=r;return this.cacheArcLengths=n,n}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.getLengths(),a=0,o=i.length;r=n||e*i[o-1];for(var s,l=0,u=o-1;l<=u;)if((s=i[a=Math.floor(l+(u-l)/2)]-r)<0)l=a+1;else{if(!(s>0)){u=a;break}u=a-1}if(i[a=u]===r)return a/(o-1);var c=i[a];return(a+(r-c)/(i[a+1]-c))/(o-1)}},{key:"getTangent",value:function(e,r){var n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);var a=this.getPoint(n),o=this.getPoint(i),s=r||(a.isVector2?new rX:new rJ);return s.copy(o).sub(a).normalize(),s}},{key:"getTangentAt",value:function(e,r){var n=this.getUtoTmapping(e);return this.getTangent(n,r)}},{key:"computeFrenetFrames",value:function(e){for(var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new rJ,i=[],a=[],o=[],s=new rJ,l=new nb,u=0;u<=e;u++){var c=u/e;i[u]=this.getTangentAt(c,new rJ)}a[0]=new rJ,o[0]=new rJ;var h=Number.MAX_VALUE,d=Math.abs(i[0].x),f=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=h&&(h=d,n.set(1,0,0)),f<=h&&(h=f,n.set(0,1,0)),p<=h&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),a[0].crossVectors(i[0],s),o[0].crossVectors(i[0],a[0]);for(var v=1;v<=e;v++){if(a[v]=a[v-1].clone(),o[v]=o[v-1].clone(),s.crossVectors(i[v-1],i[v]),s.length()>Number.EPSILON){s.normalize();var y=Math.acos(rV(i[v-1].dot(i[v]),-1,1));a[v].applyMatrix4(l.makeRotationAxis(s,y))}o[v].crossVectors(i[v],a[v])}if(!0===r){var m=Math.acos(rV(a[0].dot(a[e]),-1,1));m/=e,i[0].dot(s.crossVectors(a[0],a[e]))>0&&(m=-m);for(var g=1;g<=e;g++)a[g].applyMatrix4(l.makeRotationAxis(i[g],m*g)),o[g].crossVectors(i[g],a[g])}return{tangents:i,normals:a,binormals:o}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}]),e}(),od=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,h=arguments.length>6&&void 0!==arguments[6]&&arguments[6],d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return o(this,r),(e=a(this,r)).isEllipseCurve=!0,e.type="EllipseCurve",e.aX=n,e.aY=i,e.xRadius=s,e.yRadius=l,e.aStartAngle=u,e.aEndAngle=c,e.aClockwise=h,e.aRotation=d,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=n;for(;i>n;)i-=n;i<Number.EPSILON&&(i=a?0:n),!0!==this.aClockwise||a||(i===n?i=-n:i-=n);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var u=Math.cos(this.aRotation),c=Math.sin(this.aRotation),h=s-this.aX,d=l-this.aY;s=h*u-d*c+this.aX,l=h*c+d*u+this.aY}return r.set(s,l)}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,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}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);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}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,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}}]),r}(oh);function of(){var e=0,r=0,n=0,i=0;function a(a,o,s,l){e=a,r=s,n=-3*a+3*o-2*s-l,i=2*a-2*o+s+l}return{initCatmullRom:function(e,r,n,i,o){a(r,n,o*(n-e),o*(i-r))},initNonuniformCatmullRom:function(e,r,n,i,o,s,l){var u=(r-e)/o-(n-e)/(o+s)+(n-r)/s,c=(n-r)/s-(i-r)/(s+l)+(i-n)/l;a(r,n,u*=s,c*=s)},calc:function(a){var o=a*a;return e+r*a+n*o+o*a*i}}}var op=new rJ,ov=new rJ,oy=new of,om=new of,og=new of;function ob(e,r,n,i,a){var o=.5*(i-r),s=.5*(a-n),l=e*e;return e*l*(2*n-2*i+o+s)+(-3*n+3*i-2*o-s)*l+o*e+n}function ow(e,r,n,i){var a;return(a=1-e)*a*r+2*(1-e)*e*n+e*e*i}function ox(e,r,n,i,a){var o,s;return(o=1-e)*o*o*r+3*(s=1-e)*s*e*n+3*(1-e)*e*e*i+e*e*e*a}var oS=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rX,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new rX,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new rX;return o(this,r),(e=a(this,r)).isCubicBezierCurve=!0,e.type="CubicBezierCurve",e.v0=n,e.v1=i,e.v2=s,e.v3=l,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX,n=this.v0,i=this.v1,a=this.v2,o=this.v3;return r.set(ox(e,n.x,i.x,a.x,o.x),ox(e,n.y,i.y,a.y,o.y)),r}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),r}(oh),ok=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new rJ,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new rJ;return o(this,r),(e=a(this,r)).isCubicBezierCurve3=!0,e.type="CubicBezierCurve3",e.v0=n,e.v1=i,e.v2=s,e.v3=l,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ,n=this.v0,i=this.v1,a=this.v2,o=this.v3;return r.set(ox(e,n.x,i.x,a.x,o.x),ox(e,n.y,i.y,a.y,o.y),ox(e,n.z,i.z,a.z,o.z)),r}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),r}(oh),oM=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rX,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX;return o(this,r),(e=a(this,r)).isLineCurve=!0,e.type="LineCurve",e.v1=n,e.v2=i,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}},{key:"getPointAt",value:function(e,r){return this.getPoint(e,r)}},{key:"getTangent",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX;return r.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,r){return this.getTangent(e,r)}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(oh),oA=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ;return o(this,r),(e=a(this,r)).isLineCurve3=!0,e.type="LineCurve3",e.v1=n,e.v2=i,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}},{key:"getPointAt",value:function(e,r){return this.getPoint(e,r)}},{key:"getTangent",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ;return r.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,r){return this.getTangent(e,r)}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(oh),oO=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rX,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new rX;return o(this,r),(e=a(this,r)).isQuadraticBezierCurve=!0,e.type="QuadraticBezierCurve",e.v0=n,e.v1=i,e.v2=s,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX,n=this.v0,i=this.v1,a=this.v2;return r.set(ow(e,n.x,i.x,a.x),ow(e,n.y,i.y,a.y)),r}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(oh),oC=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return o(this,r),(e=a(this,r)).isSplineCurve=!0,e.type="SplineCurve",e.points=n,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX,n=this.points,i=(n.length-1)*e,a=Math.floor(i),o=i-a,s=n[0===a?a:a-1],l=n[a],u=n[a>n.length-2?n.length-1:a+1],c=n[a>n.length-3?n.length-1:a+2];return r.set(ob(o,s.x,l.x,u.x,c.x),ob(o,s.y,l.y,u.y,c.y)),r}},{key:"copy",value:function(e){h(d(r.prototype),"copy",this).call(this,e),this.points=[];for(var n=0,i=e.points.length;n<i;n++){var a=e.points[n];this.points.push(a.clone())}return this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);e.points=[];for(var n=0,i=this.points.length;n<i;n++){var a=this.points[n];e.points.push(a.toArray())}return e}},{key:"fromJSON",value:function(e){h(d(r.prototype),"fromJSON",this).call(this,e),this.points=[];for(var n=0,i=e.points.length;n<i;n++){var a=e.points[n];this.points.push((new rX).fromArray(a))}return this}}]),r}(oh),o_=Object.freeze({__proto__:null,ArcCurve:function(e){function r(e,n,i,s,l,u){var c;return o(this,r),(c=a(this,r,[e,n,i,i,s,l,u])).isArcCurve=!0,c.type="ArcCurve",c}return f(r,e),r}(od),CatmullRomCurve3:function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return o(this,r),(e=a(this,r)).isCatmullRomCurve3=!0,e.type="CatmullRomCurve3",e.points=n,e.closed=i,e.curveType=s,e.tension=l,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ,a=this.points,o=a.length,s=(o-!this.closed)*e,l=Math.floor(s),u=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/o)+1)*o:0===u&&l===o-1&&(l=o-2,u=1),this.closed||l>0?r=a[(l-1)%o]:(ov.subVectors(a[0],a[1]).add(a[0]),r=ov);var c=a[l%o],h=a[(l+1)%o];if(this.closed||l+2<o?n=a[(l+2)%o]:(op.subVectors(a[o-1],a[o-2]).add(a[o-1]),n=op),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(r.distanceToSquared(c),d),p=Math.pow(c.distanceToSquared(h),d),v=Math.pow(h.distanceToSquared(n),d);p<1e-4&&(p=1),f<1e-4&&(f=p),v<1e-4&&(v=p),oy.initNonuniformCatmullRom(r.x,c.x,h.x,n.x,f,p,v),om.initNonuniformCatmullRom(r.y,c.y,h.y,n.y,f,p,v),og.initNonuniformCatmullRom(r.z,c.z,h.z,n.z,f,p,v)}else"catmullrom"===this.curveType&&(oy.initCatmullRom(r.x,c.x,h.x,n.x,this.tension),om.initCatmullRom(r.y,c.y,h.y,n.y,this.tension),og.initCatmullRom(r.z,c.z,h.z,n.z,this.tension));return i.set(oy.calc(u),om.calc(u),og.calc(u)),i}},{key:"copy",value:function(e){h(d(r.prototype),"copy",this).call(this,e),this.points=[];for(var n=0,i=e.points.length;n<i;n++){var a=e.points[n];this.points.push(a.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);e.points=[];for(var n=0,i=this.points.length;n<i;n++){var a=this.points[n];e.points.push(a.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}},{key:"fromJSON",value:function(e){h(d(r.prototype),"fromJSON",this).call(this,e),this.points=[];for(var n=0,i=e.points.length;n<i;n++){var a=e.points[n];this.points.push((new rJ).fromArray(a))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}]),r}(oh),CubicBezierCurve:oS,CubicBezierCurve3:ok,EllipseCurve:od,LineCurve:oM,LineCurve3:oA,QuadraticBezierCurve:oO,QuadraticBezierCurve3:function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new rJ;return o(this,r),(e=a(this,r)).isQuadraticBezierCurve3=!0,e.type="QuadraticBezierCurve3",e.v0=n,e.v1=i,e.v2=s,e}return f(r,e),u(r,[{key:"getPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ,n=this.v0,i=this.v1,a=this.v2;return r.set(ow(e,n.x,i.x,a.x),ow(e,n.y,i.y,a.y),ow(e,n.z,i.z,a.z)),r}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(oh),SplineCurve:oC}),oP=function(e){function r(){var e;return o(this,r),(e=a(this,r)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return f(r,e),u(r,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),r=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(r)){var n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new o_[n](r,e))}return this}},{key:"getPoint",value:function(e,r){for(var n=e*this.getLength(),i=this.getCurveLengths(),a=0;a<i.length;){if(i[a]>=n){var o=i[a]-n,s=this.curves[a],l=s.getLength(),u=0===l?0:1-o/l;return s.getPointAt(u,r)}a++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],r=0,n=0,i=this.curves.length;n<i;n++)e.push(r+=this.curves[n].getLength());return this.cacheLengths=e,e}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,r=[],n=0;n<=e;n++)r.push(this.getPoint(n/e));return this.autoClose&&r.push(r[0]),r}},{key:"getPoints",value:function(){for(var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[],i=0,a=this.curves;i<a.length;i++)for(var o=a[i],s=o.isEllipseCurve?2*r:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?r*o.points.length:r,l=o.getPoints(s),u=0;u<l.length;u++){var c=l[u];e&&e.equals(c)||(n.push(c),e=c)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}},{key:"copy",value:function(e){h(d(r.prototype),"copy",this).call(this,e),this.curves=[];for(var n=0,i=e.curves.length;n<i;n++){var a=e.curves[n];this.curves.push(a.clone())}return this.autoClose=e.autoClose,this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);e.autoClose=this.autoClose,e.curves=[];for(var n=0,i=this.curves.length;n<i;n++){var a=this.curves[n];e.curves.push(a.toJSON())}return e}},{key:"fromJSON",value:function(e){h(d(r.prototype),"fromJSON",this).call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var n=0,i=e.curves.length;n<i;n++){var a=e.curves[n];this.curves.push((new o_[a.type]).fromJSON(a))}return this}}]),r}(oh),oE=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).type="Path",n.currentPoint=new rX,e&&n.setFromPoints(e),n}return f(r,e),u(r,[{key:"setFromPoints",value:function(e){this.moveTo(e[0].x,e[0].y);for(var r=1,n=e.length;r<n;r++)this.lineTo(e[r].x,e[r].y);return this}},{key:"moveTo",value:function(e,r){return this.currentPoint.set(e,r),this}},{key:"lineTo",value:function(e,r){var n=new oM(this.currentPoint.clone(),new rX(e,r));return this.curves.push(n),this.currentPoint.set(e,r),this}},{key:"quadraticCurveTo",value:function(e,r,n,i){var a=new oO(this.currentPoint.clone(),new rX(e,r),new rX(n,i));return this.curves.push(a),this.currentPoint.set(n,i),this}},{key:"bezierCurveTo",value:function(e,r,n,i,a,o){var s=new oS(this.currentPoint.clone(),new rX(e,r),new rX(n,i),new rX(a,o));return this.curves.push(s),this.currentPoint.set(a,o),this}},{key:"splineThru",value:function(e){var r=new oC([this.currentPoint.clone()].concat(e));return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}},{key:"arc",value:function(e,r,n,i,a,o){var s=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+s,r+l,n,i,a,o),this}},{key:"absarc",value:function(e,r,n,i,a,o){return this.absellipse(e,r,n,n,i,a,o),this}},{key:"ellipse",value:function(e,r,n,i,a,o,s,l){var u=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+u,r+c,n,i,a,o,s,l),this}},{key:"absellipse",value:function(e,r,n,i,a,o,s,l){var u=new od(e,r,n,i,a,o,s,l);if(this.curves.length>0){var c=u.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(u);var h=u.getPoint(1);return this.currentPoint.copy(h),this}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return h(d(r.prototype),"fromJSON",this).call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}]),r}(oP),oD=function(e){function r(e){var n;return o(this,r),(n=a(this,r,[e])).uuid=rU(),n.type="Shape",n.holes=[],n}return f(r,e),u(r,[{key:"getPointsHoles",value:function(e){for(var r=[],n=0,i=this.holes.length;n<i;n++)r[n]=this.holes[n].getPoints(e);return r}},{key:"extractPoints",value:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}},{key:"copy",value:function(e){h(d(r.prototype),"copy",this).call(this,e),this.holes=[];for(var n=0,i=e.holes.length;n<i;n++){var a=e.holes[n];this.holes.push(a.clone())}return this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);e.uuid=this.uuid,e.holes=[];for(var n=0,i=this.holes.length;n<i;n++){var a=this.holes[n];e.holes.push(a.toJSON())}return e}},{key:"fromJSON",value:function(e){h(d(r.prototype),"fromJSON",this).call(this,e),this.uuid=e.uuid,this.holes=[];for(var n=0,i=e.holes.length;n<i;n++){var a=e.holes[n];this.holes.push((new oE).fromJSON(a))}return this}}]),r}(oE);function oj(e,r,n,i,a){var o;if(a===function(e,r,n,i){for(var a=0,o=r,s=n-i;o<n;o+=i)a+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return a}(e,r,n,i)>0)for(var s=r;s<n;s+=i)o=oH(s/i|0,e[s],e[s+1],o);else for(var l=n-i;l>=r;l-=i)o=oH(l/i|0,e[l],e[l+1],o);return o&&oF(o,o.next)&&(oq(o),o=o.next),o}function oT(e,r){if(!e)return e;r||(r=e);var n,i=e;do if(n=!1,i.steiner||!oF(i,i.next)&&0!==oL(i.prev,i,i.next))i=i.next;else{if(oq(i),(i=r=i.prev)===i.next)break;n=!0}while(n||i!==r);return r}function oI(e,r){var n=e.x-r.x;return 0===n&&0==(n=e.y-r.y)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(r.next.y-r.y)/(r.next.x-r.x)),n}function oR(e,r,n,i,a){return(e=0x55555555&((e=0x33333333&((e=0xf0f0f0f&((e=0xff00ff&((e=(e-n)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))|(r=0x55555555&((r=0x33333333&((r=0xf0f0f0f&((r=0xff00ff&((r=(r-i)*a|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function oB(e,r,n,i,a,o,s,l){return(a-s)*(r-l)>=(e-s)*(o-l)&&(e-s)*(i-l)>=(n-s)*(r-l)&&(n-s)*(o-l)>=(a-s)*(i-l)}function oz(e,r,n,i,a,o,s,l){return(e!==s||r!==l)&&oB(e,r,n,i,a,o,s,l)}function oL(e,r,n){return(r.y-e.y)*(n.x-r.x)-(r.x-e.x)*(n.y-r.y)}function oF(e,r){return e.x===r.x&&e.y===r.y}function oU(e,r,n,i){var a=oN(oL(e,r,n)),o=oN(oL(e,r,i)),s=oN(oL(n,i,e)),l=oN(oL(n,i,r));return!!(a!==o&&s!==l||0===a&&oV(e,n,r)||0===o&&oV(e,i,r)||0===s&&oV(n,e,i)||0===l&&oV(n,r,i))}function oV(e,r,n){return r.x<=Math.max(e.x,n.x)&&r.x>=Math.min(e.x,n.x)&&r.y<=Math.max(e.y,n.y)&&r.y>=Math.min(e.y,n.y)}function oN(e){return e>0?1:e<0?-1:0}function oG(e,r){return 0>oL(e.prev,e,e.next)?oL(e,r,e.next)>=0&&oL(e,e.prev,r)>=0:0>oL(e,r,e.prev)||0>oL(e,e.next,r)}function oW(e,r){var n=oY(e.i,e.x,e.y),i=oY(r.i,r.x,r.y),a=e.next,o=r.prev;return e.next=r,r.prev=e,n.next=a,a.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function oH(e,r,n,i){var a=oY(e,r,n);return i?(a.next=i.next,a.prev=i,i.next.prev=a,i.next=a):(a.prev=a,a.next=a),a}function oq(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 oY(e,r,n){return{i:e,x:r,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var oX=function(){function e(){o(this,e)}return u(e,null,[{key:"triangulate",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return function(e,r){var n,i,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,s=r&&r.length,l=s?r[0]*o:e.length,u=oj(e,0,l,o,!0),c=[];if(!u||u.next===u.prev)return c;if(s&&(u=function(e,r,n,i){for(var a=[],o=0,s=r.length;o<s;o++){var l=oj(e,r[o]*i,o<s-1?r[o+1]*i:e.length,i,!1);l===l.next&&(l.steiner=!0),a.push(function(e){var r=e,n=e;do(r.x<n.x||r.x===n.x&&r.y<n.y)&&(n=r),r=r.next;while(r!==e);return n}(l))}a.sort(oI);for(var u=0;u<a.length;u++)n=function(e,r){var n=function(e,r){var n,i=r,a=e.x,o=e.y,s=-1/0;if(oF(e,i))return i;do{if(oF(e,i.next))return i.next;if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var l=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(l<=a&&l>s&&(s=l,n=i.x<i.next.x?i:i.next,l===a))return n}i=i.next}while(i!==r);if(!n)return null;var u=n,c=n.x,h=n.y,d=1/0;i=n;do{if(a>=i.x&&i.x>=c&&a!==i.x&&oB(o<h?a:s,o,c,h,o<h?s:a,o,i.x,i.y)){var f,p,v=Math.abs(o-i.y)/(a-i.x);oG(i,e)&&(v<d||v===d&&(i.x>n.x||i.x===n.x&&(f=n,p=i,0>oL(f.prev,f,p.prev)&&0>oL(p.next,f,f.next))))&&(n=i,d=v)}i=i.next}while(i!==u);return n}(e,r);if(!n)return r;var i=oW(n,e);return oT(i,i.next),oT(n,n.next)}(a[u],n);return n}(e,r,u,o)),e.length>80*o){n=e[0],i=e[1];for(var h=n,d=i,f=o;f<l;f+=o){var p=e[f],v=e[f+1];p<n&&(n=p),v<i&&(i=v),p>h&&(h=p),v>d&&(d=v)}a=0!==(a=Math.max(h-n,d-i))?32767/a:0}return function e(r,n,i,a,o,s,l){if(r){!l&&s&&function(e,r,n,i){var a=e;do 0===a.z&&(a.z=oR(a.x,a.y,r,n,i)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var r,n=1;do{var i=void 0,a=e;e=null;var o=null;for(r=0;a;){r++;for(var s=a,l=0,u=0;u<n&&(l++,s=s.nextZ);u++);for(var c=n;l>0||c>0&&s;)0!==l&&(0===c||!s||a.z<=s.z)?(i=a,a=a.nextZ,l--):(i=s,s=s.nextZ,c--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;a=s}o.nextZ=null,n*=2}while(r>1)}(a)}(r,a,o,s);for(var u=r;r.prev!==r.next;){var c=r.prev,h=r.next;if(s?function(e,r,n,i){var a=e.prev,o=e.next;if(oL(a,e,o)>=0)return!1;for(var s=a.x,l=e.x,u=o.x,c=a.y,h=e.y,d=o.y,f=Math.min(s,l,u),p=Math.min(c,h,d),v=Math.max(s,l,u),y=Math.max(c,h,d),m=oR(f,p,r,n,i),g=oR(v,y,r,n,i),b=e.prevZ,w=e.nextZ;b&&b.z>=m&&w&&w.z<=g;){if(b.x>=f&&b.x<=v&&b.y>=p&&b.y<=y&&b!==a&&b!==o&&oz(s,c,l,h,u,d,b.x,b.y)&&oL(b.prev,b,b.next)>=0||(b=b.prevZ,w.x>=f&&w.x<=v&&w.y>=p&&w.y<=y&&w!==a&&w!==o&&oz(s,c,l,h,u,d,w.x,w.y)&&oL(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;b&&b.z>=m;){if(b.x>=f&&b.x<=v&&b.y>=p&&b.y<=y&&b!==a&&b!==o&&oz(s,c,l,h,u,d,b.x,b.y)&&oL(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;w&&w.z<=g;){if(w.x>=f&&w.x<=v&&w.y>=p&&w.y<=y&&w!==a&&w!==o&&oz(s,c,l,h,u,d,w.x,w.y)&&oL(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}(r,a,o,s):function(e){var r=e.prev,n=e.next;if(oL(r,e,n)>=0)return!1;for(var i=r.x,a=e.x,o=n.x,s=r.y,l=e.y,u=n.y,c=Math.min(i,a,o),h=Math.min(s,l,u),d=Math.max(i,a,o),f=Math.max(s,l,u),p=n.next;p!==r;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&oz(i,s,a,l,o,u,p.x,p.y)&&oL(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(r))n.push(c.i,r.i,h.i),oq(r),r=h.next,u=h.next;else if((r=h)===u){l?1===l?e(r=function(e,r){var n=e;do{var i=n.prev,a=n.next.next;!oF(i,a)&&oU(i,n,n.next,a)&&oG(i,a)&&oG(a,i)&&(r.push(i.i,n.i,a.i),oq(n),oq(n.next),n=e=a),n=n.next}while(n!==e);return oT(n)}(oT(r),n),n,i,a,o,s,2):2===l&&function(r,n,i,a,o,s){var l=r;do{for(var u,c,h=l.next.next;h!==l.prev;){if(l.i!==h.i&&(u=l,c=h,u.next.i!==c.i&&u.prev.i!==c.i&&!function(e,r){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==r.i&&n.next.i!==r.i&&oU(n,n.next,e,r))return!0;n=n.next}while(n!==e);return!1}(u,c)&&(oG(u,c)&&oG(c,u)&&function(e,r){var n=e,i=!1,a=(e.x+r.x)/2,o=(e.y+r.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&a<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}(u,c)&&(oL(u.prev,u,c.prev)||oL(u,c.prev,c))||oF(u,c)&&oL(u.prev,u,u.next)>0&&oL(c.prev,c,c.next)>0))){var d=oW(l,h);return l=oT(l,l.next),d=oT(d,d.next),e(l,n,i,a,o,s,0),void e(d,n,i,a,o,s,0)}h=h.next}l=l.next}while(l!==r)}(r,n,i,a,o,s):e(oT(r),n,i,a,o,s,1);break}}}}(u,c,o,n,i,a,0),c}(e,r,n)}}]),e}(),oZ=function(){function e(){o(this,e)}return u(e,null,[{key:"area",value:function(e){for(var r=e.length,n=0,i=r-1,a=0;a<r;i=a++)n+=e[i].x*e[a].y-e[a].x*e[i].y;return .5*n}},{key:"isClockWise",value:function(e){return 0>oZ.area(e)}},{key:"triangulateShape",value:function(e,r){var n=[],i=[],a=[];oK(e),oJ(n,e);var o=e.length;r.forEach(oK);for(var s=0;s<r.length;s++)i.push(o),o+=r[s].length,oJ(n,r[s]);for(var l=oX.triangulate(n,i),u=0;u<l.length;u+=3)a.push(l.slice(u,u+3));return a}}]),e}();function oK(e){var r=e.length;r>2&&e[r-1].equals(e[0])&&e.pop()}function oJ(e,r){for(var n=0;n<r.length;n++)e.push(r[n].x),e.push(r[n].y)}var oQ=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,r);var s=(1+Math.sqrt(5))/2;return(e=a(this,r,[[-1,s,0,1,s,0,-1,-s,0,1,-s,0,0,-1,s,0,1,s,0,-1,-s,0,1,-s,s,0,-1,s,0,1,-s,0,-1,-s,0,1],[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],n,i])).type="IcosahedronGeometry",e.parameters={radius:n,detail:i},e}return f(r,e),u(r,null,[{key:"fromJSON",value:function(e){return new oQ(e.radius,e.detail)}}]),r}(ou),o$=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new rX(0,-.5),new rX(.5,0),new rX(0,.5)],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;o(this,r),(e=a(this,r)).type="LatheGeometry",e.parameters={points:n,segments:i,phiStart:s,phiLength:l},i=Math.floor(i),l=rV(l,0,2*Math.PI);for(var u=[],c=[],h=[],d=[],f=[],p=1/i,v=new rJ,y=new rX,m=new rJ,g=new rJ,b=new rJ,w=0,x=0,S=0;S<=n.length-1;S++)switch(S){case 0:w=n[S+1].x-n[S].x,m.x=+(x=n[S+1].y-n[S].y),m.y=-w,m.z=0*x,b.copy(m),m.normalize(),d.push(m.x,m.y,m.z);break;case n.length-1:d.push(b.x,b.y,b.z);break;default:w=n[S+1].x-n[S].x,m.x=+(x=n[S+1].y-n[S].y),m.y=-w,m.z=0*x,g.copy(m),m.x+=b.x,m.y+=b.y,m.z+=b.z,m.normalize(),d.push(m.x,m.y,m.z),b.copy(g)}for(var k=0;k<=i;k++)for(var M=s+k*p*l,A=Math.sin(M),O=Math.cos(M),C=0;C<=n.length-1;C++){v.x=n[C].x*A,v.y=n[C].y,v.z=n[C].x*O,c.push(v.x,v.y,v.z),y.x=k/i,y.y=C/(n.length-1),h.push(y.x,y.y);var _=d[3*C+0]*A,P=d[3*C+1],E=d[3*C+0]*O;f.push(_,P,E)}for(var D=0;D<i;D++)for(var j=0;j<n.length-1;j++){var T=j+D*n.length,I=T+n.length,R=T+n.length+1,B=T+1;u.push(T,I,B),u.push(R,B,I)}return e.setIndex(u),e.setAttribute("position",new iR(c,3)),e.setAttribute("uv",new iR(h,2)),e.setAttribute("normal",new iR(f,3)),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new o$(e.points,e.segments,e.phiStart,e.phiLength)}}]),r}(iY),o0=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;o(this,r),(e=a(this,r)).type="PlaneGeometry",e.parameters={width:n,height:i,widthSegments:s,heightSegments:l};for(var u=n/2,c=i/2,h=Math.floor(s),d=Math.floor(l),f=h+1,p=d+1,v=n/h,y=i/d,m=[],g=[],b=[],w=[],x=0;x<p;x++)for(var S=x*y-c,k=0;k<f;k++){var M=k*v-u;g.push(M,-S,0),b.push(0,0,1),w.push(k/h),w.push(1-x/d)}for(var A=0;A<d;A++)for(var O=0;O<h;O++){var C=O+f*A,_=O+f*(A+1),P=O+1+f*(A+1),E=O+1+f*A;m.push(C,_,E),m.push(_,P,E)}return e.setIndex(m),e.setAttribute("position",new iR(g,3)),e.setAttribute("normal",new iR(b,3)),e.setAttribute("uv",new iR(w,2)),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new o0(e.width,e.height,e.widthSegments,e.heightSegments)}}]),r}(iY),o1=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;o(this,r),(e=a(this,r)).type="SphereGeometry",e.parameters={radius:n,widthSegments:i,heightSegments:s,phiStart:l,phiLength:u,thetaStart:c,thetaLength:h},i=Math.max(3,Math.floor(i)),s=Math.max(2,Math.floor(s));for(var d=Math.min(c+h,Math.PI),f=0,p=[],v=new rJ,y=new rJ,m=[],g=[],b=[],w=[],x=0;x<=s;x++){var S=[],k=x/s,M=n*Math.cos(c+k*h),A=Math.sqrt(n*n-M*M),O=0;0===x&&0===c?O=.5/i:x===s&&d===Math.PI&&(O=-.5/i);for(var C=0;C<=i;C++){var _=C/i,P=l+_*u;v.x=-A*Math.cos(P),v.y=M,v.z=A*Math.sin(P),g.push(v.x,v.y,v.z),y.copy(v).normalize(),b.push(y.x,y.y,y.z),w.push(_+O,1-k),S.push(f++)}p.push(S)}for(var E=0;E<s;E++)for(var D=0;D<i;D++){var j=p[E][D+1],T=p[E][D],I=p[E+1][D],R=p[E+1][D+1];(0!==E||c>0)&&m.push(j,T,R),(E!==s-1||d<Math.PI)&&m.push(T,I,R)}return e.setIndex(m),e.setAttribute("position",new iR(g,3)),e.setAttribute("normal",new iR(b,3)),e.setAttribute("uv",new iR(w,2)),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new o1(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}]),r}(iY),o2=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;o(this,r),(e=a(this,r)).type="TorusGeometry",e.parameters={radius:n,tube:i,radialSegments:s,tubularSegments:l,arc:u,thetaStart:c,thetaLength:h},s=Math.floor(s),l=Math.floor(l);for(var d=[],f=[],p=[],v=[],y=new rJ,m=new rJ,g=new rJ,b=0;b<=s;b++)for(var w=c+b/s*h,x=0;x<=l;x++){var S=x/l*u;m.x=(n+i*Math.cos(w))*Math.cos(S),m.y=(n+i*Math.cos(w))*Math.sin(S),m.z=i*Math.sin(w),f.push(m.x,m.y,m.z),y.x=n*Math.cos(S),y.y=n*Math.sin(S),g.subVectors(m,y).normalize(),p.push(g.x,g.y,g.z),v.push(x/l),v.push(b/s)}for(var k=1;k<=s;k++)for(var M=1;M<=l;M++){var A=(l+1)*k+M-1,O=(l+1)*(k-1)+M-1,C=(l+1)*(k-1)+M,_=(l+1)*k+M;d.push(A,O,_),d.push(O,C,_)}return e.setIndex(d),e.setAttribute("position",new iR(f,3)),e.setAttribute("normal",new iR(p,3)),e.setAttribute("uv",new iR(v,2)),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new o2(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}]),r}(iY),o3=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;o(this,r);var h=function(e,r,n,i,a){var o=Math.cos(e),s=Math.sin(e),l=n/r*e,u=Math.cos(l);a.x=i*(2+u)*.5*o,a.y=i*(2+u)*s*.5,a.z=i*Math.sin(l)*.5};(e=a(this,r)).type="TorusKnotGeometry",e.parameters={radius:n,tube:i,tubularSegments:s,radialSegments:l,p:u,q:c},s=Math.floor(s),l=Math.floor(l);for(var d=[],f=[],p=[],v=[],y=new rJ,m=new rJ,g=new rJ,b=new rJ,w=new rJ,x=new rJ,S=new rJ,k=0;k<=s;++k){var M=k/s*u*Math.PI*2;h(M,u,c,n,g),h(M+.01,u,c,n,b),x.subVectors(b,g),S.addVectors(b,g),w.crossVectors(x,S),S.crossVectors(w,x),w.normalize(),S.normalize();for(var A=0;A<=l;++A){var O=A/l*Math.PI*2,C=-i*Math.cos(O),_=i*Math.sin(O);y.x=g.x+(C*S.x+_*w.x),y.y=g.y+(C*S.y+_*w.y),y.z=g.z+(C*S.z+_*w.z),f.push(y.x,y.y,y.z),m.subVectors(y,g).normalize(),p.push(m.x,m.y,m.z),v.push(k/s),v.push(A/l)}}for(var P=1;P<=s;P++)for(var E=1;E<=l;E++){var D=(l+1)*(P-1)+(E-1),j=(l+1)*P+(E-1),T=(l+1)*P+E,I=(l+1)*(P-1)+E;d.push(D,j,I),d.push(j,T,I)}return e.setIndex(d),e.setAttribute("position",new iR(f,3)),e.setAttribute("normal",new iR(p,3)),e.setAttribute("uv",new iR(v,2)),e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new o3(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}]),r}(iY),o5=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isShadowMaterial=!0,n.type="ShadowMaterial",n.color=new nQ(0),n.transparent=!0,n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.fog=e.fog,this}}]),r}(iQ);function o4(e){var r={};for(var n in e)for(var i in r[n]={},e[n]){var a=e[n][i];if(o8(a))a.isRenderTargetTexture?(rE("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),r[n][i]=null):r[n][i]=a.clone();else if(Array.isArray(a))if(o8(a[0])){for(var o=[],s=0,l=a.length;s<l;s++)o[s]=a[s].clone();r[n][i]=o}else r[n][i]=a.slice();else r[n][i]=a}return r}function o6(e){for(var r={},n=0;n<e.length;n++){var i=o4(e[n]);for(var a in i)r[a]=i[a]}return r}function o8(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function o9(e){var r=e.getRenderTarget();return null===r?e.outputColorSpace:!0===r.isXRRenderTarget?r.texture.colorSpace:r4.workingColorSpace}var o7={clone:o4,merge:o6},se=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isShaderMaterial=!0,n.type="ShaderMaterial",n.defines={},n.uniforms={},n.uniformsGroups=[],n.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",n.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",n.linewidth=1,n.wireframe=!1,n.wireframeLinewidth=1,n.fog=!1,n.lights=!1,n.clipping=!1,n.forceSinglePass=!0,n.extensions={clipCullDistance:!1,multiDraw:!1},n.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},n.index0AttributeName=void 0,n.uniformsNeedUpdate=!1,n.glslVersion=null,void 0!==e&&n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=o4(e.uniforms),this.uniformsGroups=function(e){for(var r=[],n=0;n<e.length;n++)r.push(e[n].clone());return r}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);for(var i in n.glslVersion=this.glslVersion,n.uniforms={},this.uniforms){var a=this.uniforms[i].value;a&&a.isTexture?n.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?n.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?n.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?n.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?n.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?n.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?n.uniforms[i]={type:"m4",value:a.toArray()}:n.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;var o={};for(var s in this.extensions)!0===this.extensions[s]&&(o[s]=!0);return Object.keys(o).length>0&&(n.extensions=o),n}},{key:"fromJSON",value:function(e,n){if(h(d(r.prototype),"fromJSON",this).call(this,e,n),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(this.uniforms[i]={},a.type){case"t":this.uniforms[i].value=n[a.value]||null;break;case"c":this.uniforms[i].value=(new nQ).setHex(a.value);break;case"v2":this.uniforms[i].value=(new rX).fromArray(a.value);break;case"v3":this.uniforms[i].value=(new rJ).fromArray(a.value);break;case"v4":this.uniforms[i].value=(new nf).fromArray(a.value);break;case"m3":this.uniforms[i].value=(new r1).fromArray(a.value);break;case"m4":this.uniforms[i].value=(new nb).fromArray(a.value);break;default:this.uniforms[i].value=a.value}}if(void 0!==e.defines&&(this.defines=e.defines),void 0!==e.vertexShader&&(this.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(this.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(this.glslVersion=e.glslVersion),void 0!==e.extensions)for(var o in e.extensions)this.extensions[o]=e.extensions[o];return void 0!==e.lights&&(this.lights=e.lights),void 0!==e.clipping&&(this.clipping=e.clipping),this}}]),r}(iQ),st=function(e){function r(e){var n;return o(this,r),(n=a(this,r,[e])).isRawShaderMaterial=!0,n.type="RawShaderMaterial",n}return f(r,e),r}(se),sr=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshStandardMaterial=!0,n.type="MeshStandardMaterial",n.defines={STANDARD:""},n.color=new nQ(0xffffff),n.roughness=1,n.metalness=0,n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new nQ(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new rX(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.roughnessMap=null,n.metalnessMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new nP,n.envMapIntensity=1,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.flatShading=!1,n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,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.envMapRotation.copy(e.envMapRotation),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}}]),r}(iQ),sn=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshPhysicalMaterial=!0,n.defines={STANDARD:"",PHYSICAL:""},n.type="MeshPhysicalMaterial",n.anisotropyRotation=0,n.anisotropyMap=null,n.clearcoatMap=null,n.clearcoatRoughness=0,n.clearcoatRoughnessMap=null,n.clearcoatNormalScale=new rX(1,1),n.clearcoatNormalMap=null,n.ior=1.5,Object.defineProperty(n,"reflectivity",{get:function(){return rV(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),n.iridescenceMap=null,n.iridescenceIOR=1.3,n.iridescenceThicknessRange=[100,400],n.iridescenceThicknessMap=null,n.sheenColor=new nQ(0),n.sheenColorMap=null,n.sheenRoughness=1,n.sheenRoughnessMap=null,n.transmissionMap=null,n.thickness=0,n.thicknessMap=null,n.attenuationDistance=1/0,n.attenuationColor=new nQ(1,1,1),n.specularIntensity=1,n.specularIntensityMap=null,n.specularColor=new nQ(1,1,1),n.specularColorMap=null,n._anisotropy=0,n._clearcoat=0,n._dispersion=0,n._iridescence=0,n._sheen=0,n._transmission=0,n.setValues(e),n}return f(r,e),u(r,[{key:"anisotropy",get:function(){return this._anisotropy},set:function(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}},{key:"clearcoat",get:function(){return this._clearcoat},set:function(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}},{key:"iridescence",get:function(){return this._iridescence},set:function(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}},{key:"dispersion",get:function(){return this._dispersion},set:function(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}},{key:"sheen",get:function(){return this._sheen},set:function(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}},{key:"transmission",get:function(){return this._transmission},set:function(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,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.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=g(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}}]),r}(sr),si=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshPhongMaterial=!0,n.type="MeshPhongMaterial",n.color=new nQ(0xffffff),n.specular=new nQ(1118481),n.shininess=30,n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new nQ(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new rX(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new nP,n.combine=0,n.reflectivity=1,n.envMapIntensity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.flatShading=!1,n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,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}}]),r}(iQ),sa=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshToonMaterial=!0,n.defines={TOON:""},n.type="MeshToonMaterial",n.color=new nQ(0xffffff),n.map=null,n.gradientMap=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new nQ(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new rX(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.alphaMap=null,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}]),r}(iQ),so=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshNormalMaterial=!0,n.type="MeshNormalMaterial",n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new rX(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.wireframe=!1,n.wireframeLinewidth=1,n.flatShading=!1,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,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}}]),r}(iQ),ss=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshLambertMaterial=!0,n.type="MeshLambertMaterial",n.color=new nQ(0xffffff),n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new nQ(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new rX(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new nP,n.combine=0,n.reflectivity=1,n.envMapIntensity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.flatShading=!1,n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,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}}]),r}(iQ),sl=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshDepthMaterial=!0,n.type="MeshDepthMaterial",n.depthPacking=3200,n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.wireframe=!1,n.wireframeLinewidth=1,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.depthPacking=e.depthPacking,this.map=e.map,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}}]),r}(iQ),su=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshDistanceMaterial=!0,n.type="MeshDistanceMaterial",n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}]),r}(iQ),sc=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isMeshMatcapMaterial=!0,n.defines={MATCAP:""},n.type="MeshMatcapMaterial",n.color=new nQ(0xffffff),n.matcap=null,n.map=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new rX(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.alphaMap=null,n.wireframe=!1,n.wireframeLinewidth=1,n.flatShading=!1,n.fog=!0,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}]),r}(iQ),sh=function(e){function r(e){var n;return o(this,r),(n=a(this,r)).isLineDashedMaterial=!0,n.type="LineDashedMaterial",n.scale=1,n.dashSize=3,n.gapSize=1,n.setValues(e),n}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}]),r}(aK);function sd(e,r){return e&&e.constructor!==r?"number"==typeof r.BYTES_PER_ELEMENT?new r(e):Array.prototype.slice.call(e):e}function sf(e,r,n){for(var i=e.length,a=new e.constructor(i),o=0,s=0;s!==i;++o)for(var l=n[o]*r,u=0;u!==r;++u)a[s++]=e[l+u];return a}var sp=function(){function e(r,n,i,a){o(this,e),this.parameterPositions=r,this._cachedIndex=0,this.resultBuffer=void 0!==a?a:new n.constructor(i),this.sampleValues=n,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}return u(e,[{key:"evaluate",value:function(e){var r,n=this.parameterPositions,i=this._cachedIndex,a=n[i],o=n[i-1];t:{e:{r:{n:if(!(e<a)){for(var s=i+2;;){if(void 0===a){if(e<o)break n;return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===s)break;if(o=a,e<(a=n[++i]))break e}r=n.length;break r}if(!(e>=o)){var l=n[1];e<l&&(i=2,o=l);for(var u=i-2;;){if(void 0===o)return this._cachedIndex=0,this.copySampleValue_(0);if(i===u)break;if(a=o,e>=(o=n[--i-1]))break e}r=i,i=0;break r}break t}for(;i<r;){var c=i+r>>>1;e<n[c]?r=c:i=c+1}if(a=n[i],void 0===(o=n[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===a)return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,o,a)}return this.interpolate_(i,o,e,a)}},{key:"getSettings_",value:function(){return this.settings||this.DefaultSettings_}},{key:"copySampleValue_",value:function(e){for(var r=this.resultBuffer,n=this.sampleValues,i=this.valueSize,a=e*i,o=0;o!==i;++o)r[o]=n[a+o];return r}},{key:"interpolate_",value:function(){throw Error("THREE.Interpolant: Call to abstract method.")}},{key:"intervalChanged_",value:function(){}}]),e}(),sv=function(e){function r(e,n,i,s){var l;return o(this,r),(l=a(this,r,[e,n,i,s]))._weightPrev=-0,l._offsetPrev=-0,l._weightNext=-0,l._offsetNext=-0,l.DefaultSettings_={endingStart:2400,endingEnd:2400},l}return f(r,e),u(r,[{key:"intervalChanged_",value:function(e,r,n){var i=this.parameterPositions,a=e-2,o=e+1,s=i[a],l=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case 2401:a=e,s=2*r-n;break;case 2402:a=i.length-2,s=r+i[a]-i[a+1];break;default:a=e,s=n}if(void 0===l)switch(this.getSettings_().endingEnd){case 2401:o=e,l=2*n-r;break;case 2402:o=1,l=n+i[1]-i[0];break;default:o=e-1,l=r}var u=.5*(n-r),c=this.valueSize;this._weightPrev=u/(r-s),this._weightNext=u/(l-n),this._offsetPrev=a*c,this._offsetNext=o*c}},{key:"interpolate_",value:function(e,r,n,i){for(var a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,u=l-s,c=this._offsetPrev,h=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-r)/(i-r),v=p*p,y=v*p,m=-d*y+2*d*v-d*p,g=(1+d)*y+(-1.5-2*d)*v+(-.5+d)*p+1,b=(-1-f)*y+(1.5+f)*v+.5*p,w=f*y-f*v,x=0;x!==s;++x)a[x]=m*o[c+x]+g*o[u+x]+b*o[l+x]+w*o[h+x];return a}}]),r}(sp),sy=function(e){function r(e,n,i,s){return o(this,r),a(this,r,[e,n,i,s])}return f(r,e),u(r,[{key:"interpolate_",value:function(e,r,n,i){for(var a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,u=l-s,c=(n-r)/(i-r),h=1-c,d=0;d!==s;++d)a[d]=o[u+d]*h+o[l+d]*c;return a}}]),r}(sp),sm=function(e){function r(e,n,i,s){return o(this,r),a(this,r,[e,n,i,s])}return f(r,e),u(r,[{key:"interpolate_",value:function(e){return this.copySampleValue_(e-1)}}]),r}(sp),sg=function(e){function r(){return o(this,r),a(this,r,arguments)}return f(r,e),u(r,[{key:"interpolate_",value:function(e,r,n,i){var a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,u=l-s,c=this.inTangents,h=this.outTangents;if(!c||!h){for(var d=(n-r)/(i-r),f=1-d,p=0;p!==s;++p)a[p]=o[u+p]*f+o[l+p]*d;return a}for(var v=2*s,y=e-1,m=0;m!==s;++m){for(var g=void 0,b=void 0,w=void 0,x=void 0,S=void 0,k=o[u+m],M=o[l+m],A=y*v+2*m,O=h[A],C=h[A+1],_=e*v+2*m,P=c[_],E=c[_+1],D=(n-r)/(i-r),j=0;j<8;j++){b=(g=D*D)*D;var T=(S=(x=(w=1-D)*w)*w)*r+3*x*D*O+3*w*g*P+b*i-n;if(1e-10>Math.abs(T))break;var I=3*x*(O-r)+6*w*D*(P-O)+3*g*(i-P);if(1e-10>Math.abs(I))break;D-=T/I,D=Math.max(0,Math.min(1,D))}a[m]=S*k+3*x*D*C+3*w*g*E+b*M}return a}}]),r}(sp),sb=function(){function e(r,n,i,a){if(o(this,e),void 0===r)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===n||0===n.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+r);this.name=r,this.times=sd(n,this.TimeBufferType),this.values=sd(i,this.ValueBufferType),this.setInterpolation(a||this.DefaultInterpolation)}return u(e,[{key:"InterpolantFactoryMethodDiscrete",value:function(e){return new sm(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodLinear",value:function(e){return new sy(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodSmooth",value:function(e){return new sv(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodBezier",value:function(e){var r=new sg(this.times,this.values,this.getValueSize(),e);return this.settings&&(r.inTangents=this.settings.inTangents,r.outTangents=this.settings.outTangents),r}},{key:"setInterpolation",value:function(e){var r;switch(e){case 2300:r=this.InterpolantFactoryMethodDiscrete;break;case 2301:r=this.InterpolantFactoryMethodLinear;break;case 2302:r=this.InterpolantFactoryMethodSmooth;break;case 2303:r=this.InterpolantFactoryMethodBezier}if(void 0===r){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw Error(n);this.setInterpolation(this.DefaultInterpolation)}return rE("KeyframeTrack:",n),this}return this.createInterpolant=r,this}},{key:"getInterpolation",value:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302;case this.InterpolantFactoryMethodBezier:return 2303}}},{key:"getValueSize",value:function(){return this.values.length/this.times.length}},{key:"shift",value:function(e){if(0!==e)for(var r=this.times,n=0,i=r.length;n!==i;++n)r[n]+=e;return this}},{key:"scale",value:function(e){if(1!==e)for(var r=this.times,n=0,i=r.length;n!==i;++n)r[n]*=e;return this}},{key:"trim",value:function(e,r){for(var n=this.times,i=n.length,a=0,o=i-1;a!==i&&n[a]<e;)++a;for(;-1!==o&&n[o]>r;)--o;if(++o,0!==a||o!==i){a>=o&&(a=(o=Math.max(o,1))-1);var s=this.getValueSize();this.times=n.slice(a,o),this.values=this.values.slice(a*s,o*s)}return this}},{key:"validate",value:function(){var e=!0,r=this.getValueSize();r-Math.floor(r)!=0&&(rD("KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,i=this.values,a=n.length;0===a&&(rD("KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,s=0;s!==a;s++){var l=n[s];if("number"==typeof l&&isNaN(l)){rD("KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(null!==o&&o>l){rD("KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(void 0!==i&&rM(i))for(var u=0,c=i.length;u!==c;++u){var h=i[u];if(isNaN(h)){rD("KeyframeTrack: Value is not a valid number.",this,u,h),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=this.times.slice(),r=this.values.slice(),n=this.getValueSize(),i=2302===this.getInterpolation(),a=e.length-1,o=1,s=1;s<a;++s){var l=!1,u=e[s];if(u!==e[s+1]&&(1!==s||u!==e[0]))if(i)l=!0;else for(var c=s*n,h=c-n,d=c+n,f=0;f!==n;++f){var p=r[c+f];if(p!==r[h+f]||p!==r[d+f]){l=!0;break}}if(l){if(s!==o){e[o]=e[s];for(var v=s*n,y=o*n,m=0;m!==n;++m)r[y+m]=r[v+m]}++o}}if(a>0){e[o]=e[a];for(var g=a*n,b=o*n,w=0;w!==n;++w)r[b+w]=r[g+w];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=r.slice(0,o*n)):(this.times=e,this.values=r),this}},{key:"clone",value:function(){var e=this.times.slice(),r=this.values.slice(),n=new(0,this.constructor)(this.name,e,r);return n.createInterpolant=this.createInterpolant,n}}],[{key:"toJSON",value:function(e){var r,n=e.constructor;if(n.toJSON!==this.toJSON)r=n.toJSON(e);else{r={name:e.name,times:sd(e.times,Array),values:sd(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}}]),e}();sb.prototype.ValueTypeName="",sb.prototype.TimeBufferType=Float32Array,sb.prototype.ValueBufferType=Float32Array,sb.prototype.DefaultInterpolation=2301;var sw=function(e){function r(e,n,i){return o(this,r),a(this,r,[e,n,i])}return f(r,e),r}(sb);sw.prototype.ValueTypeName="bool",sw.prototype.ValueBufferType=Array,sw.prototype.DefaultInterpolation=2300,sw.prototype.InterpolantFactoryMethodLinear=void 0,sw.prototype.InterpolantFactoryMethodSmooth=void 0;var sx=function(e){function r(e,n,i,s){return o(this,r),a(this,r,[e,n,i,s])}return f(r,e),r}(sb);sx.prototype.ValueTypeName="color";var sS=function(e){function r(e,n,i,s){return o(this,r),a(this,r,[e,n,i,s])}return f(r,e),r}(sb);sS.prototype.ValueTypeName="number";var sk=function(e){function r(e,n,i,s){return o(this,r),a(this,r,[e,n,i,s])}return f(r,e),u(r,[{key:"interpolate_",value:function(e,r,n,i){for(var a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=(n-r)/(i-r),u=e*s,c=u+s;u!==c;u+=4)rZ.slerpFlat(a,0,o,u-s,o,u,l);return a}}]),r}(sp),sM=function(e){function r(e,n,i,s){return o(this,r),a(this,r,[e,n,i,s])}return f(r,e),u(r,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new sk(this.times,this.values,this.getValueSize(),e)}}]),r}(sb);sM.prototype.ValueTypeName="quaternion",sM.prototype.InterpolantFactoryMethodSmooth=void 0;var sA=function(e){function r(e,n,i){return o(this,r),a(this,r,[e,n,i])}return f(r,e),r}(sb);sA.prototype.ValueTypeName="string",sA.prototype.ValueBufferType=Array,sA.prototype.DefaultInterpolation=2300,sA.prototype.InterpolantFactoryMethodLinear=void 0,sA.prototype.InterpolantFactoryMethodSmooth=void 0;var sO=function(e){function r(e,n,i,s){return o(this,r),a(this,r,[e,n,i,s])}return f(r,e),r}(sb);sO.prototype.ValueTypeName="vector";var sC=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;o(this,e),this.name=r,this.tracks=i,this.duration=n,this.blendMode=a,this.uuid=rU(),this.userData={},this.duration<0&&this.resetDuration()}return u(e,[{key:"resetDuration",value:function(){for(var e=0,r=0,n=this.tracks.length;r!==n;++r){var i=this.tracks[r];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this}},{key:"trim",value:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}},{key:"validate",value:function(){for(var e=!0,r=0;r<this.tracks.length;r++)e=e&&this.tracks[r].validate();return e}},{key:"optimize",value:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}},{key:"clone",value:function(){for(var e=[],r=0;r<this.tracks.length;r++)e.push(this.tracks[r].clone());var n=new this.constructor(this.name,this.duration,e,this.blendMode);return n.userData=JSON.parse(JSON.stringify(this.userData)),n}},{key:"toJSON",value:function(){return this.constructor.toJSON(this)}}],[{key:"parse",value:function(e){for(var r=[],n=e.tracks,i=1/(e.fps||1),a=0,o=n.length;a!==o;++a)r.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var r=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return sS;case"vector":case"vector2":case"vector3":case"vector4":return sO;case"color":return sx;case"quaternion":return sM;case"bool":case"boolean":return sw;case"string":return sA}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],i=[];(function(e,r,n,i){for(var a=1,o=e[0];void 0!==o&&void 0===o[i];)o=e[a++];if(void 0!==o){var s=o[i];if(void 0!==s)if(Array.isArray(s))do void 0!==(s=o[i])&&(r.push(o.time),n.push.apply(n,g(s))),o=e[a++];while(void 0!==o);else if(void 0!==s.toArray)do void 0!==(s=o[i])&&(r.push(o.time),s.toArray(n,n.length)),o=e[a++];while(void 0!==o);else do void 0!==(s=o[i])&&(r.push(o.time),n.push(s)),o=e[a++];while(void 0!==o)}})(e.keys,n,i,"value"),e.times=n,e.values=i}return void 0!==r.parse?r.parse(e):new r(e.name,e.times,e.values,e.interpolation)})(n[a]).scale(i));var s=new this(e.name,e.duration,r,e.blendMode);return s.uuid=e.uuid,s.userData=JSON.parse(e.userData||"{}"),s}},{key:"toJSON",value:function(e){for(var r=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:r,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)},a=0,o=n.length;a!==o;++a)r.push(sb.toJSON(n[a]));return i}},{key:"CreateFromMorphTargetSequence",value:function(e,r,n,i){for(var a=r.length,o=[],s=0;s<a;s++){var l=[],u=[];l.push((s+a-1)%a,s,(s+1)%a),u.push(0,1,0);var c=function(e){for(var r=e.length,n=Array(r),i=0;i!==r;++i)n[i]=i;return n.sort(function(r,n){return e[r]-e[n]}),n}(l);l=sf(l,1,c),u=sf(u,1,c),i||0!==l[0]||(l.push(a),u.push(u[0])),o.push(new sS(".morphTargetInfluences["+r[s].name+"]",l,u).scale(1/n))}return new this(e,-1,o)}},{key:"findByName",value:function(e,r){var n=e;Array.isArray(e)||(n=e.geometry&&e.geometry.animations||e.animations);for(var i=0;i<n.length;i++)if(n[i].name===r)return n[i];return null}},{key:"CreateClipsFromMorphTargetSequences",value:function(e,r,n){for(var i={},a=/^([\w-]*?)([\d]+)$/,o=0,s=e.length;o<s;o++){var l=e[o],u=l.name.match(a);if(u&&u.length>1){var c=u[1],h=i[c];h||(i[c]=h=[]),h.push(l)}}var d=[];for(var f in i)d.push(this.CreateFromMorphTargetSequence(f,i[f],r,n));return d}}]),e}(),s_={enabled:!1,files:{},add:function(e,r){!1!==this.enabled&&(sP(e)||(this.files[e]=r))},get:function(e){if(!1!==this.enabled&&!sP(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function sP(e){try{var r=e.slice(e.indexOf(":")+1);return"blob:"===new URL(r).protocol}catch(e){return!1}}var sE=function(){function e(r,n,i){o(this,e);var a,s=this,l=!1,u=0,c=0,h=[];this.onStart=void 0,this.onLoad=r,this.onProgress=n,this.onError=i,this._abortController=null,this.itemStart=function(e){c++,!1===l&&void 0!==s.onStart&&s.onStart(e,u,c),l=!0},this.itemEnd=function(e){u++,void 0!==s.onProgress&&s.onProgress(e,u,c),u===c&&(l=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(e){void 0!==s.onError&&s.onError(e)},this.resolveURL=function(e){return e=e.normalize("NFC"),a?a(e):e},this.setURLModifier=function(e){return a=e,this},this.addHandler=function(e,r){return h.push(e,r),this},this.removeHandler=function(e){var r=h.indexOf(e);return -1!==r&&h.splice(r,2),this},this.getHandler=function(e){for(var r=0,n=h.length;r<n;r+=2){var i=h[r],a=h[r+1];if(i.global&&(i.lastIndex=0),i.test(e))return a}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}return u(e,[{key:"abortController",get:function(){return this._abortController||(this._abortController=new AbortController),this._abortController}}]),e}(),sD=new sE,sj=function(){function e(r){o(this,e),this.manager=void 0!==r?r:sD,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},("u"<typeof __THREE_DEVTOOLS__?"undefined":b(__THREE_DEVTOOLS__))<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}return u(e,[{key:"load",value:function(){}},{key:"loadAsync",value:function(e,r){var n=this;return new Promise(function(i,a){n.load(e,i,r,a)})}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(e){return this.crossOrigin=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setPath",value:function(e){return this.path=e,this}},{key:"setResourcePath",value:function(e){return this.resourcePath=e,this}},{key:"setRequestHeader",value:function(e){return this.requestHeader=e,this}},{key:"abort",value:function(){return this}}]),e}();sj.DEFAULT_MATERIAL_NAME="__DEFAULT";var sT={},sI=function(e){function r(e,n){var i;return o(this,r),(i=a(this,r,[e])).response=n,i}return f(r,e),r}(x(Error)),sR=function(e){function r(e){var n;return o(this,r),(n=a(this,r,[e])).mimeType="",n.responseType="",n._abortController=new AbortController,n}return f(r,e),u(r,[{key:"load",value:function(e,r,n,i){var a=this;void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var o=s_.get("file:".concat(e));if(void 0!==o)return this.manager.itemStart(e),void setTimeout(function(){r&&r(o),a.manager.itemEnd(e)},0);if(void 0!==sT[e])return void sT[e].push({onLoad:r,onProgress:n,onError:i});sT[e]=[],sT[e].push({onLoad:r,onProgress:n,onError:i});var s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),l=this.mimeType,u=this.responseType;fetch(s).then(function(r){if(200===r.status||0===r.status){if(0===r.status&&rE("FileLoader: HTTP Status 0 received."),("u"<typeof ReadableStream?"undefined":b(ReadableStream))>"u"||void 0===r.body||void 0===r.body.getReader)return r;var n=sT[e],i=r.body.getReader(),a=r.headers.get("X-File-Size")||r.headers.get("Content-Length"),o=a?parseInt(a):0,s=0!==o,l=0;return new Response(new ReadableStream({start:function(e){!function r(){i.read().then(function(i){var a=i.done,u=i.value;if(a)e.close();else{for(var c=new ProgressEvent("progress",{lengthComputable:s,loaded:l+=u.byteLength,total:o}),h=0,d=n.length;h<d;h++){var f=n[h];f.onProgress&&f.onProgress(c)}e.enqueue(u),r()}},function(r){e.error(r)})}()}}))}throw new sI('fetch for "'.concat(r.url,'" responded with ').concat(r.status,": ").concat(r.statusText),r)}).then(function(e){switch(u){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(function(e){return(new DOMParser).parseFromString(e,l)});case"json":return e.json();default:if(""===l)return e.text();var r=/charset="?([^;"\s]*)"?/i.exec(l),n=new TextDecoder(r&&r[1]?r[1].toLowerCase():void 0);return e.arrayBuffer().then(function(e){return n.decode(e)})}}).then(function(r){s_.add("file:".concat(e),r);var n=sT[e];delete sT[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onLoad&&o.onLoad(r)}}).catch(function(r){var n=sT[e];if(void 0===n)throw a.manager.itemError(e),r;delete sT[e];for(var i=0,o=n.length;i<o;i++){var s=n[i];s.onError&&s.onError(r)}a.manager.itemError(e)}).finally(function(){a.manager.itemEnd(e)}),this.manager.itemStart(e)}},{key:"setResponseType",value:function(e){return this.responseType=e,this}},{key:"setMimeType",value:function(e){return this.mimeType=e,this}},{key:"abort",value:function(){return this._abortController.abort(),this._abortController=new AbortController,this}}]),r}(sj),sB=new WeakMap,sz=function(e){function r(e){return o(this,r),a(this,r,[e])}return f(r,e),u(r,[{key:"load",value:function(e,r,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var a=this,o=s_.get("image:".concat(e));if(void 0!==o){if(!0===o.complete)a.manager.itemStart(e),setTimeout(function(){r&&r(o),a.manager.itemEnd(e)},0);else{var s=sB.get(o);void 0===s&&(s=[],sB.set(o,s)),s.push({onLoad:r,onError:i})}return o}var l=rA("img");function u(){h(),r&&r(this);for(var n=sB.get(this)||[],i=0;i<n.length;i++){var o=n[i];o.onLoad&&o.onLoad(this)}sB.delete(this),a.manager.itemEnd(e)}function c(r){h(),i&&i(r),s_.remove("image:".concat(e));for(var n=sB.get(this)||[],o=0;o<n.length;o++){var s=n[o];s.onError&&s.onError(r)}sB.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function h(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(l.crossOrigin=this.crossOrigin),s_.add("image:".concat(e),l),a.manager.itemStart(e),l.src=e,l}}]),r}(sj),sL=function(e){function r(e){return o(this,r),a(this,r,[e])}return f(r,e),u(r,[{key:"load",value:function(e,r,n,i){var a=this,o=new aC,s=new sR(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(a.withCredentials),s.load(e,function(e){var n;try{n=a.parse(e)}catch(e){return void(void 0!==i?i(e):rD(e))}a._applyTexData(o,n),r&&r(o,n)},n,i),o}},{key:"createDataTexture",value:function(e){var r=new aC;return this._applyTexData(r,this.parse(e)),r}},{key:"_applyTexData",value:function(e,r){void 0!==r.image?e.image=r.image:void 0!==r.data&&(e.image.width=r.width,e.image.height=r.height,e.image.data=r.data),e.wrapS=void 0!==r.wrapS?r.wrapS:eR,e.wrapT=void 0!==r.wrapT?r.wrapT:eR,e.magFilter=void 0!==r.magFilter?r.magFilter:eU,e.minFilter=void 0!==r.minFilter?r.minFilter:eU,e.anisotropy=void 0!==r.anisotropy?r.anisotropy:1,void 0!==r.colorSpace&&(e.colorSpace=r.colorSpace),void 0!==r.flipY&&(e.flipY=r.flipY),void 0!==r.format&&(e.format=r.format),void 0!==r.type&&(e.type=r.type),void 0!==r.mipmaps&&(e.mipmaps=r.mipmaps,e.minFilter=eN),1===r.mipmapCount&&(e.minFilter=eU),void 0!==r.generateMipmaps&&(e.generateMipmaps=r.generateMipmaps),e.needsUpdate=!0}}]),r}(sj),sF=function(e){function r(e){return o(this,r),a(this,r,[e])}return f(r,e),u(r,[{key:"load",value:function(e,r,n,i){var a=new nh,o=new sz(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(e){a.image=e,a.needsUpdate=!0,void 0!==r&&r(a)},n,i),a}}]),r}(sj),sU=function(e){function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return o(this,r),(n=a(this,r)).isLight=!0,n.type="Light",n.color=new nQ(e),n.intensity=i,n}return f(r,e),u(r,[{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),this.color.copy(e.color),this.intensity=e.intensity,this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}]),r}(nq),sV=function(e){function r(e,n,i){var s;return o(this,r),(s=a(this,r,[e,i])).isHemisphereLight=!0,s.type="HemisphereLight",s.position.copy(nq.DEFAULT_UP),s.updateMatrix(),s.groundColor=new nQ(n),s}return f(r,e),u(r,[{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),this.groundColor.copy(e.groundColor),this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.groundColor=this.groundColor.getHex(),n}}]),r}(sU),sN=new nb,sG=new rJ,sW=new rJ,sH=function(){function e(r){o(this,e),this.camera=r,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new rX(512,512),this.mapType=eW,this.map=null,this.mapPass=null,this.matrix=new nb,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new aY,this._frameExtents=new rX(1,1),this._viewportCount=1,this._viewports=[new nf(0,0,1,1)]}return u(e,[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var r=this.camera,n=this.matrix;sG.setFromMatrixPosition(e.matrixWorld),r.position.copy(sG),sW.setFromMatrixPosition(e.target.matrixWorld),r.lookAt(sW),r.updateMatrixWorld(),sN.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(sN,r.coordinateSystem,r.reversedDepth),r.coordinateSystem===rb||r.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(sN)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var e={};return 1!==this.intensity&&(e.intensity=this.intensity),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}}]),e}(),sq=new rJ,sY=new rZ,sX=new rJ,sZ=function(e){function r(){var e;return o(this,r),(e=a(this,r)).isCamera=!0,e.type="Camera",e.matrixWorldInverse=new nb,e.projectionMatrix=new nb,e.projectionMatrixInverse=new nb,e.coordinateSystem=rg,e._reversedDepth=!1,e}return f(r,e),u(r,[{key:"reversedDepth",get:function(){return this._reversedDepth}},{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}},{key:"getWorldDirection",value:function(e){return h(d(r.prototype),"getWorldDirection",this).call(this,e).negate()}},{key:"updateMatrixWorld",value:function(e){h(d(r.prototype),"updateMatrixWorld",this).call(this,e),this.matrixWorld.decompose(sq,sY,sX),1===sX.x&&1===sX.y&&1===sX.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(sq,sY,sX.set(1,1,1)).invert()}},{key:"updateWorldMatrix",value:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];h(d(r.prototype),"updateWorldMatrix",this).call(this,e,n,i),this.matrixWorld.decompose(sq,sY,sX),1===sX.x&&1===sX.y&&1===sX.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(sq,sY,sX.set(1,1,1)).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),r}(nq),sK=new rJ,sJ=new rX,sQ=new rX,s$=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;return o(this,r),(e=a(this,r)).isPerspectiveCamera=!0,e.type="PerspectiveCamera",e.fov=n,e.zoom=1,e.near=s,e.far=l,e.focus=10,e.aspect=i,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return f(r,e),u(r,[{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),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:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}},{key:"setFocalLength",value:function(e){var r=.5*this.getFilmHeight()/e;this.fov=2*rF*Math.atan(r),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*rL*this.fov);return .5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*rF*Math.atan(Math.tan(.5*rL*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"getViewBounds",value:function(e,r,n){sK.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(sK.x,sK.y).multiplyScalar(-e/sK.z),sK.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(sK.x,sK.y).multiplyScalar(-e/sK.z)}},{key:"getViewSize",value:function(e,r){return this.getViewBounds(e,sJ,sQ),r.subVectors(sQ,sJ)}},{key:"setViewOffset",value:function(e,r,n,i,a,o){this.aspect=e/r,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=r,this.view.offsetX=n,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,r=e*Math.tan(.5*rL*this.fov)/this.zoom,n=2*r,i=this.aspect*n,a=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var s=o.fullWidth,l=o.fullHeight;a+=o.offsetX*i/s,r-=o.offsetY*n/l,i*=o.width/s,n*=o.height/l}var u=this.filmOffset;0!==u&&(a+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+i,r,r-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,null!==this.view&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}]),r}(sZ),s0=function(e){function r(){var e;return o(this,r),(e=a(this,r,[new s$(50,1,.5,500)])).isSpotLightShadow=!0,e.focus=1,e.aspect=1,e}return f(r,e),u(r,[{key:"updateMatrices",value:function(e){var n=this.camera,i=2*rF*e.angle*this.focus,a=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||n.far;(i!==n.fov||a!==n.aspect||o!==n.far)&&(n.fov=i,n.aspect=a,n.far=o,n.updateProjectionMatrix()),h(d(r.prototype),"updateMatrices",this).call(this,e)}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.focus=e.focus,this}}]),r}(sH),s1=function(e){function r(e,n){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;return o(this,r),(i=a(this,r,[e,n])).isSpotLight=!0,i.type="SpotLight",i.position.copy(nq.DEFAULT_UP),i.updateMatrix(),i.target=new nq,i.distance=s,i.angle=l,i.penumbra=u,i.decay=c,i.map=null,i.shadow=new s0,i}return f(r,e),u(r,[{key:"power",get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}},{key:"dispose",value:function(){h(d(r.prototype),"dispose",this).call(this),this.shadow.dispose()}},{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.distance=this.distance,n.object.angle=this.angle,n.object.decay=this.decay,n.object.penumbra=this.penumbra,n.object.target=this.target.uuid,this.map&&this.map.isTexture&&(n.object.map=this.map.toJSON(e).uuid),n.object.shadow=this.shadow.toJSON(),n}}]),r}(sU),s2=new rJ,s3=function(e){function r(){var e;return o(this,r),(e=a(this,r,[new s$(90,1,.5,500)])).isPointLightShadow=!0,e}return f(r,e),u(r,[{key:"updateMatrices",value:function(e){var r=this.camera,n=this.matrix,i=e.distance||r.far;i!==r.far&&(r.far=i,r.updateProjectionMatrix()),s2.setFromMatrixPosition(e.matrixWorld),r.position.copy(s2),n.makeTranslation(-s2.x,-s2.y,-s2.z)}}]),r}(sH),s5=function(e){function r(e,n){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return o(this,r),(i=a(this,r,[e,n])).isPointLight=!0,i.type="PointLight",i.distance=s,i.decay=l,i.shadow=new s3,i}return f(r,e),u(r,[{key:"power",get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}},{key:"dispose",value:function(){h(d(r.prototype),"dispose",this).call(this),this.shadow.dispose()}},{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}]),r}(sU),s4=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return o(this,r),(e=a(this,r)).isOrthographicCamera=!0,e.type="OrthographicCamera",e.zoom=1,e.view=null,e.left=n,e.right=i,e.top=s,e.bottom=l,e.near=u,e.far=c,e.updateProjectionMatrix(),e}return f(r,e),u(r,[{key:"copy",value:function(e,n){return h(d(r.prototype),"copy",this).call(this,e,n),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:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,r,n,i,a,o){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=r,this.view.offsetX=n,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),r=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,a=n-e,o=n+e,s=i+r,l=i-r;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,null!==this.view&&(n.object.view=Object.assign({},this.view)),n}}]),r}(sZ),s6=function(e){function r(){var e;return o(this,r),(e=a(this,r,[new s4(-5,5,5,-5,.5,500)])).isDirectionalLightShadow=!0,e}return f(r,e),r}(sH),s8=function(e){function r(e,n){var i;return o(this,r),(i=a(this,r,[e,n])).isDirectionalLight=!0,i.type="DirectionalLight",i.position.copy(nq.DEFAULT_UP),i.updateMatrix(),i.target=new nq,i.shadow=new s6,i}return f(r,e),u(r,[{key:"dispose",value:function(){h(d(r.prototype),"dispose",this).call(this),this.shadow.dispose()}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}]),r}(sU),s9=function(e){function r(e,n){var i;return o(this,r),(i=a(this,r,[e,n])).isAmbientLight=!0,i.type="AmbientLight",i}return f(r,e),r}(sU),s7=function(e){function r(e,n){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return o(this,r),(i=a(this,r,[e,n])).isRectAreaLight=!0,i.type="RectAreaLight",i.width=s,i.height=l,i}return f(r,e),u(r,[{key:"power",get:function(){return this.intensity*this.width*this.height*Math.PI},set:function(e){this.intensity=e/(this.width*this.height*Math.PI)}},{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.width=e.width,this.height=e.height,this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.width=this.width,n.object.height=this.height,n}}]),r}(sU),le=function(){function e(){o(this,e),this.isSphericalHarmonics3=!0,this.coefficients=[];for(var r=0;r<9;r++)this.coefficients.push(new rJ)}return u(e,[{key:"set",value:function(e){for(var r=0;r<9;r++)this.coefficients[r].copy(e[r]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,r){var n=e.x,i=e.y,a=e.z,o=this.coefficients;return r.copy(o[0]).multiplyScalar(.282095),r.addScaledVector(o[1],.488603*i),r.addScaledVector(o[2],.488603*a),r.addScaledVector(o[3],.488603*n),r.addScaledVector(o[4],n*i*1.092548),r.addScaledVector(o[5],i*a*1.092548),r.addScaledVector(o[6],.315392*(3*a*a-1)),r.addScaledVector(o[7],n*a*1.092548),r.addScaledVector(o[8],.546274*(n*n-i*i)),r}},{key:"getIrradianceAt",value:function(e,r){var n=e.x,i=e.y,a=e.z,o=this.coefficients;return r.copy(o[0]).multiplyScalar(.886227),r.addScaledVector(o[1],1.023328*i),r.addScaledVector(o[2],1.023328*a),r.addScaledVector(o[3],1.023328*n),r.addScaledVector(o[4],.858086*n*i),r.addScaledVector(o[5],.858086*i*a),r.addScaledVector(o[6],.743125*a*a-.247708),r.addScaledVector(o[7],.858086*n*a),r.addScaledVector(o[8],.429043*(n*n-i*i)),r}},{key:"add",value:function(e){for(var r=0;r<9;r++)this.coefficients[r].add(e.coefficients[r]);return this}},{key:"addScaledSH",value:function(e,r){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],r);return this}},{key:"scale",value:function(e){for(var r=0;r<9;r++)this.coefficients[r].multiplyScalar(e);return this}},{key:"lerp",value:function(e,r){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],r);return this}},{key:"equals",value:function(e){for(var r=0;r<9;r++)if(!this.coefficients[r].equals(e.coefficients[r]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,i=0;i<9;i++)n[i].fromArray(e,r+3*i);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,i=0;i<9;i++)n[i].toArray(e,r+3*i);return e}}],[{key:"getBasisAt",value:function(e,r){var n=e.x,i=e.y,a=e.z;r[0]=.282095,r[1]=.488603*i,r[2]=.488603*a,r[3]=.488603*n,r[4]=1.092548*n*i,r[5]=1.092548*i*a,r[6]=.315392*(3*a*a-1),r[7]=1.092548*n*a,r[8]=.546274*(n*n-i*i)}}]),e}(),lt=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new le,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return o(this,r),(e=a(this,r,[void 0,i])).isLightProbe=!0,e.sh=n,e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.sh.copy(e.sh),this}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.object.sh=this.sh.toArray(),n}}]),r}(sU),lr=function(){function e(){o(this,e)}return u(e,null,[{key:"extractUrlBase",value:function(e){var r=e.lastIndexOf("/");return -1===r?"./":e.slice(0,r+1)}},{key:"resolveURL",value:function(e,r){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(r)&&/^\//.test(e)&&(r=r.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:r+e)}}]),e}(),ln=function(e){function r(){var e;return o(this,r),(e=a(this,r)).isInstancedBufferGeometry=!0,e.type="InstancedBufferGeometry",e.instanceCount=1/0,e}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.instanceCount=e.instanceCount,this}},{key:"toJSON",value:function(){var e=h(d(r.prototype),"toJSON",this).call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}]),r}(iY),li=function(e){function r(e){return o(this,r),a(this,r,[e])}return f(r,e),u(r,[{key:"load",value:function(e,r,n,i){var a=this,o=new sR(a.manager);o.setPath(a.path),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,function(n){try{r(a.parse(JSON.parse(n)))}catch(r){i?i(r):rD(r),a.manager.itemError(e)}},n,i)}},{key:"parse",value:function(e){var r={},n={};function i(e,i){if(void 0!==r[i])return r[i];var a=e.interleavedBuffers[i],o=function(e,r){if(void 0!==n[r])return n[r];var i=new Uint32Array(e.arrayBuffers[r]).buffer;return n[r]=i,i}(e,a.buffer),s=new iX(rk(a.type,o),a.stride);return s.uuid=a.uuid,r[i]=s,s}var a=e.isInstancedBufferGeometry?new ln:new iY,o=e.data.index;if(void 0!==o){var s=rk(o.type,o.array);a.setIndex(new iD(s,1))}var l=e.data.attributes;for(var u in l){var c=void 0,h=l[u];if(h.isInterleavedBufferAttribute)c=new iK(i(e.data,h.data),h.itemSize,h.offset,h.normalized);else{var d=rk(h.type,h.array);c=new(h.isInstancedBufferAttribute?aD:iD)(d,h.itemSize,h.normalized)}void 0!==h.name&&(c.name=h.name),void 0!==h.usage&&c.setUsage(h.usage),a.setAttribute(u,c)}var f=e.data.morphAttributes;if(f)for(var p in f){for(var v=f[p],y=[],m=0,g=v.length;m<g;m++){var b=void 0,w=v[m];b=w.isInterleavedBufferAttribute?new iK(i(e.data,w.data),w.itemSize,w.offset,w.normalized):new iD(rk(w.type,w.array),w.itemSize,w.normalized),void 0!==w.name&&(b.name=w.name),y.push(b)}a.morphAttributes[p]=y}e.data.morphTargetsRelative&&(a.morphTargetsRelative=!0);var x=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==x)for(var S=0,k=x.length;S!==k;++S){var M=x[S];a.addGroup(M.start,M.count,M.materialIndex)}var A=e.data.boundingSphere;return void 0!==A&&(a.boundingSphere=(new iF).fromJSON(A)),e.name&&(a.name=e.name),e.userData&&(a.userData=e.userData),a}}]),r}(sj),la=function(e){function r(e,n,i){o(this,r),(s=a(this,r)).type="CubeCamera",s.renderTarget=i,s.coordinateSystem=null,s.activeMipmapLevel=0;var s,l=new s$(-90,1,e,n);l.layers=s.layers,s.add(l);var u=new s$(-90,1,e,n);u.layers=s.layers,s.add(u);var c=new s$(-90,1,e,n);c.layers=s.layers,s.add(c);var h=new s$(-90,1,e,n);h.layers=s.layers,s.add(h);var d=new s$(-90,1,e,n);d.layers=s.layers,s.add(d);var f=new s$(-90,1,e,n);return f.layers=s.layers,s.add(f),s}return f(r,e),u(r,[{key:"updateCoordinateSystem",value:function(){var e=this.coordinateSystem,r=this.children.concat(),n=m(r,6),i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],u=n[5],c=!0,h=!1,d=void 0;try{for(var f,p=r[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;this.remove(v)}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}if(e===rg)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else{if(e!==rb)throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1)}var y=!0,g=!1,b=void 0;try{for(var w,x=r[Symbol.iterator]();!(y=(w=x.next()).done);y=!0){var S=w.value;this.add(S),S.updateMatrixWorld()}}catch(e){g=!0,b=e}finally{try{y||null==x.return||x.return()}finally{if(g)throw b}}}},{key:"update",value:function(e,r){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,i=this.activeMipmapLevel;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());var a=m(this.children,6),o=a[0],s=a[1],l=a[2],u=a[3],c=a[4],h=a[5],d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;var y=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;var g=!1;g=!0===e.isWebGLRenderer?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,i),g&&!1===e.autoClear&&e.clearDepth(),e.render(r,o),e.setRenderTarget(n,1,i),g&&!1===e.autoClear&&e.clearDepth(),e.render(r,s),e.setRenderTarget(n,2,i),g&&!1===e.autoClear&&e.clearDepth(),e.render(r,l),e.setRenderTarget(n,3,i),g&&!1===e.autoClear&&e.clearDepth(),e.render(r,u),e.setRenderTarget(n,4,i),g&&!1===e.autoClear&&e.clearDepth(),e.render(r,c),n.texture.generateMipmaps=y,e.setRenderTarget(n,5,i),g&&!1===e.autoClear&&e.clearDepth(),e.render(r,h),e.setRenderTarget(d,f,p),e.xr.enabled=v,n.texture.needsPMREMUpdate=!0}}]),r}(nq),lo=function(){function e(){o(this,e),this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}return u(e,[{key:"connect",value:function(e){this._document=e,void 0!==e.hidden&&(this._pageVisibilityHandler=ls.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}},{key:"disconnect",value:function(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}},{key:"getDelta",value:function(){return this._delta/1e3}},{key:"getElapsed",value:function(){return this._elapsed/1e3}},{key:"getTimescale",value:function(){return this._timescale}},{key:"setTimescale",value:function(e){return this._timescale=e,this}},{key:"reset",value:function(){return this._currentTime=performance.now()-this._startTime,this}},{key:"dispose",value:function(){this.disconnect()}},{key:"update",value:function(e){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==e?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}]),e}();function ls(){!1===this._document.hidden&&this.reset()}var ll=function(){function e(r,n,i){var a,s,l;switch(o(this,e),this.binding=r,this.valueSize=i,n){case"quaternion":a=this._slerp,s=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":a=this._select,s=this._select,l=this._setAdditiveIdentityOther,this.buffer=Array(5*i);break;default:a=this._lerp,s=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=a,this._mixBufferRegionAdditive=s,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}return u(e,[{key:"accumulate",value:function(e,r){var n=this.buffer,i=this.valueSize,a=e*i+i,o=this.cumulativeWeight;if(0===o){for(var s=0;s!==i;++s)n[a+s]=n[s];o=r}else{o+=r;var l=r/o;this._mixBufferRegion(n,a,0,l,i)}this.cumulativeWeight=o}},{key:"accumulateAdditive",value:function(e){var r=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(r,i,0,e,n),this.cumulativeWeightAdditive+=e}},{key:"apply",value:function(e){var r=this.valueSize,n=this.buffer,i=e*r+r,a=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){var l=r*this._origIndex;this._mixBufferRegion(n,i,l,1-a,r)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*r,1,r);for(var u=r,c=r+r;u!==c;++u)if(n[u]!==n[u+r]){s.setValue(n,i);break}}},{key:"saveOriginalState",value:function(){var e=this.binding,r=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(r,i);for(var a=n;a!==i;++a)r[a]=r[i+a%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}},{key:"restoreOriginalState",value:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}},{key:"_setAdditiveIdentityNumeric",value:function(){for(var e=this._addIndex*this.valueSize,r=e+this.valueSize,n=e;n<r;n++)this.buffer[n]=0}},{key:"_setAdditiveIdentityQuaternion",value:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}},{key:"_setAdditiveIdentityOther",value:function(){for(var e=this._origIndex*this.valueSize,r=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[r+n]=this.buffer[e+n]}},{key:"_select",value:function(e,r,n,i,a){if(i>=.5)for(var o=0;o!==a;++o)e[r+o]=e[n+o]}},{key:"_slerp",value:function(e,r,n,i){rZ.slerpFlat(e,r,e,r,e,n,i)}},{key:"_slerpAdditive",value:function(e,r,n,i,a){var o=this._workIndex*a;rZ.multiplyQuaternionsFlat(e,o,e,r,e,n),rZ.slerpFlat(e,r,e,r,e,o,i)}},{key:"_lerp",value:function(e,r,n,i,a){for(var o=1-i,s=0;s!==a;++s){var l=r+s;e[l]=e[l]*o+e[n+s]*i}}},{key:"_lerpAdditive",value:function(e,r,n,i,a){for(var o=0;o!==a;++o){var s=r+o;e[s]=e[s]+e[n+o]*i}}}]),e}(),lu="\\[\\]\\.:\\/",lc=RegExp("["+lu+"]","g"),lh="[^"+lu+"]",ld="[^"+lu.replace("\\.","")+"]",lf=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",lh)+/(WCOD+)?/.source.replace("WCOD",ld)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",lh)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",lh)+"$"),lp=["material","materials","bones","map"],lv=function(){function e(r,n,i){o(this,e),this.path=n,this.parsedPath=i||lv.parseTrackName(n),this.node=lv.findNode(r,this.parsedPath.nodeName),this.rootNode=r,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return u(e,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(e,r){e[r]=this.targetObject[this.propertyName]}},{key:"_getValue_array",value:function(e,r){for(var n=this.resolvedProperty,i=0,a=n.length;i!==a;++i)e[r++]=n[i]}},{key:"_getValue_arrayElement",value:function(e,r){e[r]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(e,r){this.resolvedProperty.toArray(e,r)}},{key:"_setValue_direct",value:function(e,r){this.targetObject[this.propertyName]=e[r]}},{key:"_setValue_direct_setNeedsUpdate",value:function(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(e,r){for(var n=this.resolvedProperty,i=0,a=n.length;i!==a;++i)n[i]=e[r++]}},{key:"_setValue_array_setNeedsUpdate",value:function(e,r){for(var n=this.resolvedProperty,i=0,a=n.length;i!==a;++i)n[i]=e[r++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(e,r){for(var n=this.resolvedProperty,i=0,a=n.length;i!==a;++i)n[i]=e[r++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(e,r){this.resolvedProperty[this.propertyIndex]=e[r]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(e,r){this.resolvedProperty.fromArray(e,r)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(e,r){this.bind(),this.getValue(e,r)}},{key:"_setValue_unbound",value:function(e,r){this.bind(),this.setValue(e,r)}},{key:"bind",value:function(){var e=this.node,r=this.parsedPath,n=r.objectName,i=r.propertyName,a=r.propertyIndex;if(e||(e=lv.findNode(this.rootNode,r.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void rE("PropertyBinding: No target node found for track: "+this.path+".");if(n){var o=r.objectIndex;switch(n){case"materials":if(!e.material)return void rD("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void rD("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 rD("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var s=0;s<e.length;s++)if(e[s].name===o){o=s;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void rD("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void rD("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void rD("PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==o){if(void 0===e[o])return void rD("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[o]}}var l=e[i];if(void 0===l)return void rD("PropertyBinding: Trying to update property for track: "+r.nodeName+"."+i+" but it wasn't found.",e);var u=this.Versioning.None;this.targetObject=e,!0===e.isMaterial?u=this.Versioning.NeedsUpdate:!0===e.isObject3D&&(u=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==a){if("morphTargetInfluences"===i){if(!e.geometry)return void rD("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void rD("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[a]&&(a=e.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=a}else void 0!==l.fromArray&&void 0!==l.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(c=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][u]}},{key:"unbind",value:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}],[{key:"create",value:function(e,r,n){return e&&e.isAnimationObjectGroup?new lv.Composite(e,r,n):new lv(e,r,n)}},{key:"sanitizeNodeName",value:function(e){return e.replace(/\s/g,"_").replace(lc,"")}},{key:"parseTrackName",value:function(e){var r=lf.exec(e);if(null===r)throw Error("THREE.PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:r[2],objectName:r[3],objectIndex:r[4],propertyName:r[5],propertyIndex:r[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var a=n.nodeName.substring(i+1);-1!==lp.indexOf(a)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=a)}if(null===n.propertyName||0===n.propertyName.length)throw Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+e);return n}},{key:"findNode",value:function(e,r){if(void 0===r||""===r||"."===r||-1===r||r===e.name||r===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(r);if(void 0!==n)return n}if(e.children){var i=function(e){for(var n=0;n<e.length;n++){var a=e[n];if(a.name===r||a.uuid===r)return a;var o=i(a.children);if(o)return o}return null},a=i(e.children);if(a)return a}return null}}]),e}();lv.Composite=function(){function e(r,n,i){o(this,e);var a=i||lv.parseTrackName(n);this._targetGroup=r,this._bindings=r.subscribe_(n,a)}return u(e,[{key:"getValue",value:function(e,r){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,r)}},{key:"setValue",value:function(e,r){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,a=n.length;i!==a;++i)n[i].setValue(e,r)}},{key:"bind",value:function(){for(var e=this._bindings,r=this._targetGroup.nCachedObjects_,n=e.length;r!==n;++r)e[r].bind()}},{key:"unbind",value:function(){for(var e=this._bindings,r=this._targetGroup.nCachedObjects_,n=e.length;r!==n;++r)e[r].unbind()}}]),e}(),lv.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},lv.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},lv.prototype.GetterByBindingType=[lv.prototype._getValue_direct,lv.prototype._getValue_array,lv.prototype._getValue_arrayElement,lv.prototype._getValue_toArray],lv.prototype.SetterByBindingTypeAndVersioning=[[lv.prototype._setValue_direct,lv.prototype._setValue_direct_setNeedsUpdate,lv.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[lv.prototype._setValue_array,lv.prototype._setValue_array_setNeedsUpdate,lv.prototype._setValue_array_setMatrixWorldNeedsUpdate],[lv.prototype._setValue_arrayElement,lv.prototype._setValue_arrayElement_setNeedsUpdate,lv.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[lv.prototype._setValue_fromArray,lv.prototype._setValue_fromArray_setNeedsUpdate,lv.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var ly=function(){function e(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.blendMode;o(this,e),this._mixer=r,this._clip=n,this._localRoot=i,this.blendMode=a;for(var s=n.tracks,l=s.length,u=Array(l),c={endingStart:2400,endingEnd:2400},h=0;h!==l;++h){var d=s[h].createInterpolant(null);u[h]=d,d.settings=c}this._interpolantSettings=c,this._interpolants=u,this._propertyBindings=Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._restoreTimeScale=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return u(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,r){return this.loop=e,this.repetitions=r,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.fadeOut(r),this.fadeIn(r),!0===n){var i=this._clip.duration,a=e._clip.duration;e._restoreTimeScale=e.timeScale,this._restoreTimeScale=this.timeScale,e.warp(1,a/i,r),this.warp(i/a,1,r)}return this}},{key:"crossFadeTo",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.crossFadeFrom(this,r,n)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,r,n){var i=this._mixer,a=i.time,o=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);var l=s.parameterPositions,u=s.sampleValues;return l[0]=a,l[1]=a+n,u[0]=e/o,u[1]=r/o,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this._restoreTimeScale=null,this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,r,n,i){if(!this.enabled)return void this._updateWeight(e);var a=this._startTime;if(null!==a){var o=(e-a)*n;o<0||0===n?r=0:(this._startTime=null,r=n*o)}r*=this._updateTimeScale(e);var s=this._updateTime(r),l=this._updateWeight(e);if(l>0){var u=this._interpolants,c=this._propertyBindings;if(2501===this.blendMode)for(var h=0,d=u.length;h!==d;++h)u[h].evaluate(s),c[h].accumulateAdditive(l);else for(var f=0,p=u.length;f!==p;++f)u[f].evaluate(s),c[f].accumulate(i,l)}}},{key:"_updateWeight",value:function(e){var r=0;if(this.enabled){r=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(e)[0];r*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=r,r}},{key:"_updateTimeScale",value:function(e){var r=0;if(!this.paused){r=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(r*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(0===r?this.paused=!0:(null!==this._restoreTimeScale&&(r=this._restoreTimeScale),this.timeScale=r),this.stopWarping()))}return this._effectiveTimeScale=r,r}},{key:"_updateTime",value:function(e){var r=this._clip.duration,n=this.loop,i=this.time+e,a=this._loopCount,o=2202===n;if(0===e)return -1===a||!o||1&~a?i:r-i;if(2200===n){-1===a&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=r)i=r;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===a&&(e>=0?(a=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),i>=r||i<0){var s=Math.floor(i/r);i-=r*s,a+=Math.abs(s);var l=this.repetitions-a;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?r:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===l){var u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=a,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:s})}}else this._loopCount=a,this.time=i;if(o&&!(1&~a))return r-i}return i}},{key:"_setEndings",value:function(e,r,n){var i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,i.endingEnd=r?this.zeroSlopeAtEnd?2401:2400:2402)}},{key:"_scheduleFading",value:function(e,r,n){var i=this._mixer,a=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);var s=o.parameterPositions,l=o.sampleValues;return s[0]=a,l[0]=r,s[1]=a+e,l[1]=n,this}}]),e}(),lm=new Float32Array(1),lg=function(e){function r(e){var n;return o(this,r),(n=a(this,r))._root=e,n._initMemoryManager(),n._accuIndex=0,n.time=0,n.timeScale=1,("u"<typeof __THREE_DEVTOOLS__?"undefined":b(__THREE_DEVTOOLS__))<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:n})),n}return f(r,e),u(r,[{key:"_bindAction",value:function(e,r){var n=e._localRoot||this._root,i=e._clip.tracks,a=i.length,o=e._propertyBindings,s=e._interpolants,l=n.uuid,u=this._bindingsByRootAndName,c=u[l];void 0===c&&(c={},u[l]=c);for(var h=0;h!==a;++h){var d=i[h],f=d.name,p=c[f];if(void 0!==p)++p.referenceCount,o[h]=p;else{if(void 0!==(p=o[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}var v=r&&r._propertyBindings[h].binding.parsedPath;p=new ll(lv.create(n,f,v),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}s[h].resultBuffer=p.buffer}}},{key:"_activateAction",value:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var r=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,r)}for(var a=e._propertyBindings,o=0,s=a.length;o!==s;++o){var l=a[o];0==l.useCount++&&(this._lendBinding(l),l.saveOriginalState())}this._lendAction(e)}}},{key:"_deactivateAction",value:function(e){if(this._isActiveAction(e)){for(var r=e._propertyBindings,n=0,i=r.length;n!==i;++n){var a=r[n];0==--a.useCount&&(a.restoreOriginalState(),this._takeBackBinding(a))}this._takeBackAction(e)}}},{key:"_initMemoryManager",value:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}},{key:"_isActiveAction",value:function(e){var r=e._cacheIndex;return null!==r&&r<this._nActiveActions}},{key:"_addInactiveAction",value:function(e,r,n){var i=this._actions,a=this._actionsByClip,o=a[r];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[r]=o;else{var s=o.knownActions;e._byClipCacheIndex=s.length,s.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[n]=e}},{key:"_removeInactiveAction",value:function(e){var r=this._actions,n=r[r.length-1],i=e._cacheIndex;n._cacheIndex=i,r[i]=n,r.pop(),e._cacheIndex=null;var a=e._clip.uuid,o=this._actionsByClip,s=o[a],l=s.knownActions,u=l[l.length-1],c=e._byClipCacheIndex;u._byClipCacheIndex=c,l[c]=u,l.pop(),e._byClipCacheIndex=null,delete s.actionByRoot[(e._localRoot||this._root).uuid],0===l.length&&delete o[a],this._removeInactiveBindingsForAction(e)}},{key:"_removeInactiveBindingsForAction",value:function(e){for(var r=e._propertyBindings,n=0,i=r.length;n!==i;++n){var a=r[n];0==--a.referenceCount&&this._removeInactiveBinding(a)}}},{key:"_lendAction",value:function(e){var r=this._actions,n=e._cacheIndex,i=this._nActiveActions++,a=r[i];e._cacheIndex=i,r[i]=e,a._cacheIndex=n,r[n]=a}},{key:"_takeBackAction",value:function(e){var r=this._actions,n=e._cacheIndex,i=--this._nActiveActions,a=r[i];e._cacheIndex=i,r[i]=e,a._cacheIndex=n,r[n]=a}},{key:"_addInactiveBinding",value:function(e,r,n){var i=this._bindingsByRootAndName,a=this._bindings,o=i[r];void 0===o&&(o={},i[r]=o),o[n]=e,e._cacheIndex=a.length,a.push(e)}},{key:"_removeInactiveBinding",value:function(e){var r=this._bindings,n=e.binding,i=n.rootNode.uuid,a=n.path,o=this._bindingsByRootAndName,s=o[i],l=r[r.length-1],u=e._cacheIndex;l._cacheIndex=u,r[u]=l,r.pop(),delete s[a],0===Object.keys(s).length&&delete o[i]}},{key:"_lendBinding",value:function(e){var r=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,a=r[i];e._cacheIndex=i,r[i]=e,a._cacheIndex=n,r[n]=a}},{key:"_takeBackBinding",value:function(e){var r=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,a=r[i];e._cacheIndex=i,r[i]=e,a._cacheIndex=n,r[n]=a}},{key:"_lendControlInterpolant",value:function(){var e=this._controlInterpolants,r=this._nActiveControlInterpolants++,n=e[r];return void 0===n&&((n=new sy(new Float32Array(2),new Float32Array(2),1,lm)).__cacheIndex=r,e[r]=n),n}},{key:"_takeBackControlInterpolant",value:function(e){var r=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,a=r[i];e.__cacheIndex=i,r[i]=e,a.__cacheIndex=n,r[n]=a}},{key:"clipAction",value:function(e,r,n){var i=r||this._root,a=i.uuid,o="string"==typeof e?sC.findByName(i,e):e,s=null!==o?o.uuid:e,l=this._actionsByClip[s],u=null;if(void 0===n&&(n=null!==o?o.blendMode:2500),void 0!==l){var c=l.actionByRoot[a];if(void 0!==c&&c.blendMode===n)return c;u=l.knownActions[0],null===o&&(o=u._clip)}if(null===o)return null;var h=new ly(this,o,r,n);return this._bindAction(h,u),this._addInactiveAction(h,s,a),h}},{key:"existingAction",value:function(e,r){var n=r||this._root,i=n.uuid,a="string"==typeof e?sC.findByName(n,e):e,o=a?a.uuid:e,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[i]||null}},{key:"stopAllAction",value:function(){for(var e=this._actions,r=this._nActiveActions-1;r>=0;--r)e[r].stop();return this}},{key:"update",value:function(e){e*=this.timeScale;for(var r=this._actions,n=this._nActiveActions,i=this.time+=e,a=Math.sign(e),o=this._accuIndex^=1,s=0;s!==n;++s)r[s]._update(i,e,a,o);for(var l=this._bindings,u=this._nActiveBindings,c=0;c!==u;++c)l[c].apply(o);return this}},{key:"setTime",value:function(e){this.time=0;for(var r=0;r<this._actions.length;r++)this._actions[r].time=0;return this.update(e)}},{key:"getRoot",value:function(){return this._root}},{key:"uncacheClip",value:function(e){var r=this._actions,n=e.uuid,i=this._actionsByClip,a=i[n];if(void 0!==a){for(var o=a.knownActions,s=0,l=o.length;s!==l;++s){var u=o[s];this._deactivateAction(u);var c=u._cacheIndex,h=r[r.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,h._cacheIndex=c,r[c]=h,r.pop(),this._removeInactiveBindingsForAction(u)}delete i[n]}}},{key:"uncacheRoot",value:function(e){var r=e.uuid,n=this._actionsByClip;for(var i in n){var a=n[i].actionByRoot[r];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName[r];if(void 0!==o)for(var s in o){var l=o[s];l.restoreOriginalState(),this._removeInactiveBinding(l)}}},{key:"uncacheAction",value:function(e,r){var n=this.existingAction(e,r);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}]),r}(rR),lb=function(){function e(r){o(this,e),this.value=r}return u(e,[{key:"clone",value:function(){return new lb(void 0===this.value.clone?this.value:this.value.clone())}}]),e}(),lw=function(e){function r(e,n){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return o(this,r),(i=a(this,r,[e,n])).isInstancedInterleavedBuffer=!0,i.meshPerAttribute=s,i}return f(r,e),u(r,[{key:"copy",value:function(e){return h(d(r.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"clone",value:function(e){var n=h(d(r.prototype),"clone",this).call(this,e);return n.meshPerAttribute=this.meshPerAttribute,n}},{key:"toJSON",value:function(e){var n=h(d(r.prototype),"toJSON",this).call(this,e);return n.isInstancedInterleavedBuffer=!0,n.meshPerAttribute=this.meshPerAttribute,n}}]),r}(iX),lx=new nb,lS=function(){function e(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;o(this,e),this.ray=new ah(r,n),this.near=i,this.far=a,this.camera=null,this.layers=new nE,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}return u(e,[{key:"set",value:function(e,r){this.ray.set(e,r)}},{key:"setFromCamera",value:function(e,r){r.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(r.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(r).sub(this.ray.origin).normalize(),this.camera=r):r.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,r.projectionMatrix.elements[14]).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld),this.camera=r):rD("Raycaster: Unsupported camera type: "+r.type)}},{key:"setFromXRController",value:function(e){return lx.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(lx),this}},{key:"intersectObject",value:function(e){var r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return lM(e,this,n,r),n.sort(lk),n}},{key:"intersectObjects",value:function(e){for(var r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0,a=e.length;i<a;i++)lM(e[i],this,n,r);return n.sort(lk),n}}]),e}();function lk(e,r){return e.distance-r.distance}function lM(e,r,n,i){var a=!0;if(e.layers.test(r.layers)&&!1===e.raycast(r,n)&&(a=!1),!0===a&&!0===i)for(var o=e.children,s=0,l=o.length;s<l;s++)lM(o[s],r,n,!0)}var lA=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;o(this,e),this.radius=r,this.phi=n,this.theta=i}return u(e,[{key:"set",value:function(e,r,n){return this.radius=e,this.phi=r,this.theta=n,this}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}},{key:"makeSafe",value:function(){return this.phi=rV(this.phi,1e-6,Math.PI-1e-6),this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,r,n){return this.radius=Math.sqrt(e*e+r*r+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(rV(r/this.radius,-1,1))),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),lO=function(){function e(r,n,i,a){o(this,e),this.elements=[1,0,0,1],void 0!==r&&this.set(r,n,i,a)}return u(e,[{key:"identity",value:function(){return this.set(1,0,0,1),this}},{key:"fromArray",value:function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<4;n++)this.elements[n]=e[n+r];return this}},{key:"set",value:function(e,r,n,i){var a=this.elements;return a[0]=e,a[2]=r,a[1]=n,a[3]=i,this}}]),e}(),lC=lO;lO.prototype.isMatrix2=!0;var l_=new rX,lP=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rX(1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rX(-1/0,-1/0);o(this,e),this.isBox2=!0,this.min=r,this.max=n}return u(e,[{key:"set",value:function(e,r){return this.min.copy(e),this.max.copy(r),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var r=0,n=e.length;r<n;r++)this.expandByPoint(e[r]);return this}},{key:"setFromCenterAndSize",value:function(e,r){var n=l_.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y}},{key:"getCenter",value:function(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"containsPoint",value:function(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}},{key:"containsBox",value:function(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}},{key:"getParameter",value:function(e,r){return r.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}},{key:"intersectsBox",value:function(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}},{key:"clampPoint",value:function(e,r){return r.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return this.clampPoint(e,l_).distanceTo(e)}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}(),lE=new rJ,lD=new rJ,lj=new rJ,lT=new rJ,lI=new rJ,lR=new rJ,lB=new rJ,lz=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rJ,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rJ;o(this,e),this.start=r,this.end=n}return u(e,[{key:"set",value:function(e,r){return this.start.copy(e),this.end.copy(r),this}},{key:"copy",value:function(e){return this.start.copy(e.start),this.end.copy(e.end),this}},{key:"getCenter",value:function(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}},{key:"delta",value:function(e){return e.subVectors(this.end,this.start)}},{key:"distanceSq",value:function(){return this.start.distanceToSquared(this.end)}},{key:"distance",value:function(){return this.start.distanceTo(this.end)}},{key:"at",value:function(e,r){return this.delta(r).multiplyScalar(e).add(this.start)}},{key:"closestPointToPointParameter",value:function(e,r){lE.subVectors(e,this.start),lD.subVectors(this.end,this.start);var n=lD.dot(lD);if(0===n)return 0;var i=lD.dot(lE)/n;return r&&(i=rV(i,0,1)),i}},{key:"closestPointToPoint",value:function(e,r,n){var i=this.closestPointToPointParameter(e,r);return this.delta(n).multiplyScalar(i).add(this.start)}},{key:"distanceSqToLine3",value:function(e){var r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lR,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lB,o=this.start,s=e.start,l=this.end,u=e.end;lj.subVectors(l,o),lT.subVectors(u,s),lI.subVectors(o,s);var c=lj.dot(lj),h=lT.dot(lT),d=lT.dot(lI);if(c<=10000000000000001e-32&&h<=10000000000000001e-32)return i.copy(o),a.copy(s),i.sub(a),i.dot(i);if(c<=10000000000000001e-32)r=0,n=rV(n=d/h,0,1);else{var f=lj.dot(lI);if(h<=10000000000000001e-32)n=0,r=rV(-f/c,0,1);else{var p=lj.dot(lT),v=c*h-p*p;r=0!==v?rV((p*d-f*h)/v,0,1):0,(n=(p*r+d)/h)<0?(n=0,r=rV(-f/c,0,1)):n>1&&(n=1,r=rV((p-f)/c,0,1))}}return i.copy(o).addScaledVector(lj,r),a.copy(s).addScaledVector(lT,n),i.distanceToSquared(a)}},{key:"applyMatrix4",value:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}},{key:"equals",value:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),lL=new rJ,lF=function(e){function r(e,n){o(this,r),(i=a(this,r)).light=e,i.matrixAutoUpdate=!1,i.color=n,i.type="SpotLightHelper";for(var i,s=new iY,l=[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],u=0,c=1;u<32;u++,c++){var h=u/32*Math.PI*2,d=c/32*Math.PI*2;l.push(Math.cos(h),Math.sin(h),1,Math.cos(d),Math.sin(d),1)}return s.setAttribute("position",new iR(l,3)),i.cone=new a9(s,new aK({fog:!1,toneMapped:!1})),i.add(i.cone),i.update(),i}return f(r,e),u(r,[{key:"dispose",value:function(){this.cone.geometry.dispose(),this.cone.material.dispose()}},{key:"update",value:function(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorldNeedsUpdate=!0;var e=this.light.distance?this.light.distance:1e3,r=e*Math.tan(this.light.angle);this.cone.scale.set(r,r,e),lL.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(lL),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}]),r}(nq),lU=function(e){function r(e,n,i){var s;return o(this,r),(s=a(this,r,[new o1(n,4,2),new ad({wireframe:!0,fog:!1,toneMapped:!1})])).light=e,s.color=i,s.type="PointLightHelper",s.matrix=s.light.matrixWorld,s.matrixAutoUpdate=!1,s.update(),s}return f(r,e),u(r,[{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose()}},{key:"update",value:function(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}]),r}(aM),lV=new rJ,lN=new rJ,lG=new rJ,lW=function(e){function r(e,n,i){o(this,r),(s=a(this,r)).light=e,s.matrix=e.matrixWorld,s.matrixAutoUpdate=!1,s.color=i,s.type="DirectionalLightHelper",void 0===n&&(n=1);var s,l=new iY;l.setAttribute("position",new iR([-n,n,0,n,n,0,n,-n,0,-n,-n,0,-n,n,0],3));var u=new aK({fog:!1,toneMapped:!1});return s.lightPlane=new a5(l,u),s.add(s.lightPlane),(l=new iY).setAttribute("position",new iR([0,0,0,0,0,1],3)),s.targetLine=new a5(l,u),s.add(s.targetLine),s.update(),s}return f(r,e),u(r,[{key:"dispose",value:function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}},{key:"update",value:function(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),lV.setFromMatrixPosition(this.light.matrixWorld),lN.setFromMatrixPosition(this.light.target.matrixWorld),lG.subVectors(lN,lV),this.lightPlane.lookAt(lN),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(lN),this.targetLine.scale.z=lG.length()}}]),r}(nq),lH=new rJ,lq=new sZ,lY=function(e){function r(e){o(this,r);var n,i=function(e,r){s(e),s(r)},s=function(e){c.push(0,0,0),h.push(0,0,0),void 0===d[e]&&(d[e]=[]),d[e].push(c.length/3-1)},l=new iY,u=new aK({color:0xffffff,vertexColors:!0,toneMapped:!1}),c=[],h=[],d={};i("n1","n2"),i("n2","n4"),i("n4","n3"),i("n3","n1"),i("f1","f2"),i("f2","f4"),i("f4","f3"),i("f3","f1"),i("n1","f1"),i("n2","f2"),i("n3","f3"),i("n4","f4"),i("p","n1"),i("p","n2"),i("p","n3"),i("p","n4"),i("u1","u2"),i("u2","u3"),i("u3","u1"),i("c","t"),i("p","c"),i("cn1","cn2"),i("cn3","cn4"),i("cf1","cf2"),i("cf3","cf4"),l.setAttribute("position",new iR(c,3)),l.setAttribute("color",new iR(h,3)),(n=a(this,r,[l,u])).type="CameraHelper",n.camera=e,n.camera.updateProjectionMatrix&&n.camera.updateProjectionMatrix(),n.matrix=e.matrixWorld,n.matrixAutoUpdate=!1,n.pointMap=d,n.update();var f=new nQ(0xffaa00),p=new nQ(0xff0000),v=new nQ(43775),y=new nQ(0xffffff),m=new nQ(3355443);return n.setColors(f,p,v,y,m),n}return f(r,e),u(r,[{key:"setColors",value:function(e,r,n,i,a){var o=this.geometry.getAttribute("color");return o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,r.r,r.g,r.b),o.setXYZ(25,r.r,r.g,r.b),o.setXYZ(26,r.r,r.g,r.b),o.setXYZ(27,r.r,r.g,r.b),o.setXYZ(28,r.r,r.g,r.b),o.setXYZ(29,r.r,r.g,r.b),o.setXYZ(30,r.r,r.g,r.b),o.setXYZ(31,r.r,r.g,r.b),o.setXYZ(32,n.r,n.g,n.b),o.setXYZ(33,n.r,n.g,n.b),o.setXYZ(34,n.r,n.g,n.b),o.setXYZ(35,n.r,n.g,n.b),o.setXYZ(36,n.r,n.g,n.b),o.setXYZ(37,n.r,n.g,n.b),o.setXYZ(38,i.r,i.g,i.b),o.setXYZ(39,i.r,i.g,i.b),o.setXYZ(40,a.r,a.g,a.b),o.setXYZ(41,a.r,a.g,a.b),o.setXYZ(42,a.r,a.g,a.b),o.setXYZ(43,a.r,a.g,a.b),o.setXYZ(44,a.r,a.g,a.b),o.setXYZ(45,a.r,a.g,a.b),o.setXYZ(46,a.r,a.g,a.b),o.setXYZ(47,a.r,a.g,a.b),o.setXYZ(48,a.r,a.g,a.b),o.setXYZ(49,a.r,a.g,a.b),o.needsUpdate=!0,this}},{key:"update",value:function(){var e,r,n=this.geometry,i=this.pointMap;if(lq.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)e=1,r=0;else if(this.camera.coordinateSystem===rg)e=-1,r=1;else{if(this.camera.coordinateSystem!==rb)throw Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);e=0,r=1}lX("c",i,n,lq,0,0,e),lX("t",i,n,lq,0,0,r),lX("n1",i,n,lq,-1,-1,e),lX("n2",i,n,lq,1,-1,e),lX("n3",i,n,lq,-1,1,e),lX("n4",i,n,lq,1,1,e),lX("f1",i,n,lq,-1,-1,r),lX("f2",i,n,lq,1,-1,r),lX("f3",i,n,lq,-1,1,r),lX("f4",i,n,lq,1,1,r),lX("u1",i,n,lq,.7,1.1,e),lX("u2",i,n,lq,-.7,1.1,e),lX("u3",i,n,lq,0,2,e),lX("cf1",i,n,lq,-1,0,r),lX("cf2",i,n,lq,1,0,r),lX("cf3",i,n,lq,0,-1,r),lX("cf4",i,n,lq,0,1,r),lX("cn1",i,n,lq,-1,0,e),lX("cn2",i,n,lq,1,0,e),lX("cn3",i,n,lq,0,-1,e),lX("cn4",i,n,lq,0,1,e),n.getAttribute("position").needsUpdate=!0}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose()}}]),r}(a9);function lX(e,r,n,i,a,o,s){lH.set(a,o,s).unproject(i);var l=r[e];if(void 0!==l)for(var u=n.getAttribute("position"),c=0,h=l.length;c<h;c++)u.setXYZ(l[c],lH.x,lH.y,lH.z)}var lZ=function(e){function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0xffff00;o(this,r);var s=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]),l=new iY;return l.setIndex(new iD(s,1)),l.setAttribute("position",new iR([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),(n=a(this,r,[l,new aK({color:i,toneMapped:!1})])).box=e,n.type="Box3Helper",n.geometry.computeBoundingSphere(),n}return f(r,e),u(r,[{key:"updateMatrixWorld",value:function(e){var n=this.box;n.isEmpty()||(n.getCenter(this.position),n.getSize(this.scale),this.scale.multiplyScalar(.5),h(d(r.prototype),"updateMatrixWorld",this).call(this,e))}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose()}}]),r}(a9),lK=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;o(this,r);var i=new iY;return i.setAttribute("position",new iR([0,0,0,n,0,0,0,0,0,0,n,0,0,0,0,0,0,n],3)),i.setAttribute("color",new iR([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),(e=a(this,r,[i,new aK({vertexColors:!0,toneMapped:!1})])).type="AxesHelper",e}return f(r,e),u(r,[{key:"setColors",value:function(e,r,n){var i=new nQ,a=this.geometry.attributes.color.array;return i.set(e),i.toArray(a,0),i.toArray(a,3),i.set(r),i.toArray(a,6),i.toArray(a,9),i.set(n),i.toArray(a,12),i.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose()}}]),r}(a9);function lJ(e,r,n,i){var a=function(e){switch(e){case eW:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case eZ:case 1013:case eK:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error("THREE.TextureUtils: Unknown texture type ".concat(e,"."))}(i);switch(n){case 1021:return e*r;case e9:case 1029:return e*r/a.components*a.byteLength;case 1030:case 1031:return e*r*2/a.components*a.byteLength;case 1022:return e*r*3/a.components*a.byteLength;case e4:case 1033:return e*r*4/a.components*a.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16;case 35841:case 35843:return Math.max(e,16)*Math.max(r,8)/4;case 35840:case 35842:return Math.max(e,8)*Math.max(r,8)/2;case 37809:return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16;case 37810:return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16;case 37811:return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16;case 37812:return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16;case 37813:return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16;case 37814:return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16;case 37815:return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16;case 37816:return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16;case 37817:return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16;case 37818:return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16;case 37819:return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16;case 37820:return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16;case 37821:return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(e/4)*Math.ceil(r/4)*16;case 36283:case 36284:return Math.ceil(e/4)*Math.ceil(r/4)*8}throw Error("Unable to determine texture byte length for ".concat(n," format."))}("u"<typeof __THREE_DEVTOOLS__?"undefined":b(__THREE_DEVTOOLS__))<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:M}})),("u"<typeof window?"undefined":b(window))<"u"&&(window.__THREE__?rE("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=M)},7913(e,r,n){n.d(r,{a:()=>c});var i=n(1483),a=n(5181),o=n(3027);function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,r){return(l=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var c=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(e,r,i){var a,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return o=s(o=n),(a=function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,u()?Reflect.construct(o,[],s(this).constructor):o.apply(this,void 0))).super_Entity(e,r),a.context=i,a.objectHelper.update(),a}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),r=[{key:"updateState",value:function(e,r){this.updateState_Entity(e,r)}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(n.prototype,r),n}((0,a.d)(o.Sc,i.a))},6679(e,r,n){n.d(r,{a:()=>c});var i=n(1483),a=n(5181),o=n(3027);function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,r){return(l=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var c=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(e,r){var i,a;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return a=s(a=n),(i=function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,u()?Reflect.construct(a,[],s(this).constructor):a.apply(this,void 0))).super_Entity(e,r),i.objectHelper.update(),"Empty"===i.data.type&&(i.objectHelper.visible=!1),i}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),r=[{key:"updateState",value:function(e,r){this.updateState_Entity(e,r),"buffer"in e&&1===Object.keys(e).length&&r.scene.reloadSplats()}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(n.prototype,r),n}((0,a.d)(o.Sc,i.a))},1483(e,r,n){n.d(r,{a:()=>p});var i=n(5181),a=n(3027);function o(e,r,n){return(o="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=s(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,r){return(l=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var c=new a.Fc(1,1,1),h=new a.Fc,d=new a.Fc,f=new a.Ec,p=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(e){var r,i,o,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,i=[l],r=s(r),(o=function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,u()?Reflect.construct(r,i||[],s(this).constructor):r.apply(this,i))).object=e,o.dummy=new a.Sc,o.object.updateMatrixWorld(),o.name="EmptyObjectHelper: ".concat(e.uuid),o.matrix=o.dummy.matrixWorld,o.matrixAutoUpdate=!1,o.object.isBone&&(o.visible=!1),o}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),r=[{key:"raycast",value:function(e,r){(0,i.b)(this.object,p.geometryHelper,e,r,!1,this.dummy)}},{key:"update",value:function(){}},{key:"updateMatrix",value:function(){}},{key:"updateMatrixWorld",value:function(e){this.object.matrixWorld.decompose(h,f,d),this.matrix.compose(h,f,c),o(s(n.prototype),"updateMatrixWorld",this).call(this,e)}},{key:"updateWorldMatrix",value:function(e,r){}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(n.prototype,r),n}((0,i.a)(a.Xe))},9657(e,r,n){n.d(r,{a:()=>s,b:()=>a,c:()=>o});var i=new Map;function a(e,r){i.set(e,r)}function o(e){return i.get(e)}var s=function(){var e;function r(e){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");this.eventContext=e,this.domEventsNeeded=new Set,this.hasVideoAction=!1}return e=[{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"dispose",value:function(){this.disconnect(),this.eventContext=void 0}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(r.prototype,e),r}()},3486(e,r,n){n.d(r,{a:()=>R,b:()=>V,c:()=>X,d:()=>$,e:()=>en,f:()=>ea,g:()=>eo});var i,a,o,s,l,u,c,h,d,f,p,v,y,m,g,b,w,x,S,k,M,A,O,C,_,P,E,D,j,T,I,R,B,z,L,F,U,V,N,G,W,H,q,Y,X,Z,K,J,Q,$,ee,et,er,en,ei,ea,eo,es=n(3940);function el(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function eu(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ec(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){eu(e,r,n[r])})}return e}function eh(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function ed(e){return function(e){if(Array.isArray(e))return el(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ef(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ef(e,r){if(e){if("string"==typeof e)return el(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return el(e,r)}}(d||(d={})).defaultData={type:"SwitchCamera",name:"",targetCamera:"",delay:0,animate:!0,duration:1e3,easing:4,runMode:"Normal"},(f||(f={})).defaultData={type:"SceneTransition",name:"",target:"",delay:0,duration:1,transition:"none"},(p||(p={})).defaultData={type:"Link",name:"",url:null,context:"tab"},(v||(v={})).defaultData={type:"Destroy",name:"",objects:[],delay:0},(y||(y={})).defaultData={type:"Particles",name:"",emitterObjectId:"",delay:0,emission:"start",triggerAfter:"any"},(m||(m={})).defaultData={type:"Create",name:"",object:"",delay:0,creationSpeed:10,coordinateSystem:"world",dynamic:!0,destroy:"No",destroyAfterQuantity:5,lifetime:2,position:[0,0,0],rotation:[0,0,0],velocity:[1e3,0,0],hideBase:"No"},(g||(g={})).defaultData={type:"Reset",name:"",delay:0},(b||(b={})).defaultData={interaction:"play",delay:0,volume:.5,loop:1},(x=w||(w={})).pauseDefaultData={interaction:"pause",delay:0},x.stopDefaultData={interaction:"stop",delay:0},(k=S||(S={})).defaultData=ec({type:"Audio",name:""},b.defaultData),k.hasAudioByActions=function(e){return e.some(function(e){var r=e.data;return"Audio"===r.type&&"play"===r.interaction&&r.audio})},k.hasAudioByEvents=function(e){return k.getAudiosByEvents(e).length>0},k.getAudiosByActions=function(e){var r=[];return e.forEach(function(e){var n=e.data;"Audio"===n.type&&"play"===n.interaction&&n.audio&&r.push(e),"Conditional"===n.type&&(r.push.apply(r,ed(k.getAudiosByActions(n.ifActions))),r.push.apply(r,ed(k.getAudiosByActions(n.elseActions))))}),r},k.getAudiosByEvents=function(e){var r=[];return e.forEach(function(e){var n=e.data;es.r.is(n)||"Collision"===n.type||"Start"===n.type||"Trigger"===n.type||"VariableChange"===n.type||"WEBHOOK"===n.type||"AIAssistantTrigger"===n.type?r.push.apply(r,ed(k.getAudiosByActions(n.actions))):"Conditional"===n.type?(r.push.apply(r,ed(k.getAudiosByActions(n.inActions))),r.push.apply(r,ed(k.getAudiosByActions(n.outActions)))):"GameControl"===n.type?Object.values(n.gameActions).forEach(function(e){r.push.apply(r,ed(k.getAudiosByActions(e)))}):"DragDrop"===n.type?(r.push.apply(r,ed(k.getAudiosByActions(n.dragDropActions.drag))),r.push.apply(r,ed(k.getAudiosByActions(n.dragDropActions.drop)))):"Resize"===n.type?n.breakpoints.forEach(function(e){var n=e.data;r.push.apply(r,ed(k.getAudiosByActions(n.actions)))}):"API"===n.type&&(r.push.apply(r,ed(k.getAudiosByActions(n.successActions))),r.push.apply(r,ed(k.getAudiosByActions(n.errorActions))))}),r},(M||(M={})).defaultData={interaction:"play",delay:0,volume:.5,loop:1/0},(i=A||(A={})).pauseDefaultData={interaction:"pause",delay:0},i.stopDefaultData={interaction:"stop",delay:0},(a=O||(O={})).defaultData=ec({type:"Video",name:"",triggerAfter:"autoplay"},M.defaultData),a.hasVideoByActions=function(e){return e.some(function(e){var r=e.data;return"Video"===r.type&&"play"===r.interaction&&r.layerId})},a.hasVideoByObject=function(e){if(e.events){var r=!0,n=!1,i=void 0;try{for(var o,s=e.events[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value.data;if((es.r.is(l)||"Start"===l.type)&&a.hasVideoByActions(l.actions))return!0}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}}},a.getVideosByActions=function(e){var r=[];return e.forEach(function(e){var n=e.data;"Video"===n.type&&"play"===n.interaction&&n.layerId&&r.push(e)}),r},a.getVideosByEvents=function(e){var r=[];return e.forEach(function(e){var n=e.data;(es.r.is(n)||"Start"===n.type)&&r.push.apply(r,ed(a.getVideosByActions(n.actions)))}),r},(C||(C={})).defaultData=function(e){return{state:e,repeat:0,delay:0,delayDirection:"start-once",direction:"normal",duration:1e3,easing:4}},(_||(_={})).defaultData=function(){return{tweens:new es.f,repeat:0,delay:0,delayDirection:"start-once",direction:"normal"}},(P||(P={})).defaultData=function(e){return ec({type:"Transition",name:"",runMode:"Once",object:null!=e?e:null},_.defaultData())},(E||(E={})).defaultData=function(e){return{interaction:"play",timeline:e,repeat:0,delay:0,delayDirection:"start-once",direction:"normal",runMode:"Once"}},(o=D||(D={})).pauseDefaultData={interaction:"pause",delay:0},o.stopDefaultData={interaction:"stop",delay:0},(j||(j={})).defaultData=function(e){return ec({type:"TimelineAnimation",name:""},E.defaultData(e))},(T||(T={})).defaultData=function(e,r,n){return{interaction:"play",object:e,clipId:r,crop:n,crop2:n,repeat:-1,delay:0,delayDirection:"start-once",direction:"normal",runMode:"Normal"}},(s=I||(I={})).pauseDefaultData={interaction:"pause",delay:0},s.stopDefaultData={interaction:"stop",delay:0},(l=R||(R={})).defaultData=function(e,r,n){return ec({type:"Animation",name:""},T.defaultData(e,r,n))},l.isPause=function(e){return"pause"===e.interaction||"stop"===e.interaction},(B||(B={})).defaultData={type:"SetVariable",name:"",variableId:"",expression:[]},(z||(z={})).defaultData=function(){return{type:"Conditional",name:"",ifActions:new es.f,elseActions:new es.f,condition:[]}},(L||(L={})).defaultData={type:"DynamicVariablePlay",name:"",variableId:"",mode:"PlayPause",delay:0,pauseDelay:0},(F||(F={})).defaultData={type:"ClearLocalStorage",name:"",target:"all"},(U||(U={})).defaultData={name:"",type:"UserAPI"},(V||(V={})).emptyImage={data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",name:"empty"},(N||(N={})).is=function(e){return!0},(W=G||(G={})).defaultData={position:[0,0],scale:[1,1],rotation:0,shear:[0,0]},W.merge=function(e,r){var n,i,a,o;return{position:null!=(n=null==r?void 0:r.position)?n:e.position,rotation:null!=(i=null==r?void 0:r.rotation)?i:e.rotation,scale:null!=(a=null==r?void 0:r.scale)?a:e.scale,shear:null!=(o=null==r?void 0:r.shear)?o:e.shear}},W.diff=function(e,r){return(0,es.d)({position:es.z.isEqual(e.position,r.position)?void 0:r.position,rotation:e.rotation===r.rotation?void 0:r.rotation,scale:es.z.isEqual(e.scale,r.scale)?void 0:r.scale,shear:e.shear&&r.shear&&es.z.isEqual(e.shear,r.shear)?void 0:r.shear})},(H||(H={})).defaultData={horizontalConstraint:0,verticalConstraint:0},(q||(q={})).defaultData={direction:"row",wrap:"unwrap",align:"top-left",gap:10,rowGap:10,autoGap:!1,autoRowGap:!1,leftPadding:8,rightPadding:8,topPadding:8,bottomPadding:8},(Y||(Y={})).defaultData={opacity:1,fill:{color:es.E.fromHexAndA(es.x,1),enabled:!0},stroke:{color:es.E.from0to1([0,0,0,1]),thickness:1,enabled:!1,mode:"inside"},layerBlur:{radius:2,enabled:!1},backgroundBlur:{radius:2,enabled:!1},dropShadow:{offset:[10,10],blurRadius:10,color:es.E.from0to1([0,0,0,1]),enabled:!1,spread:0},innerShadow:{offset:[10,10],blurRadius:10,color:es.E.from0to1([0,0,0,1]),enabled:!1,spread:0}},(u=X||(X={})).newEmpty=function(e,r){return{name:r}},u.patch=function(e,r){if(void 0===r)return e;var n=ec({},e);return Object.assign(n,G.merge(n,r)),n=function(e,r){if(void 0===r)return e;var n=ec({},e);return"fill"in n&&"fill"in r&&void 0!==r.fill&&Object.assign(n,{fill:ec({},n.fill,r.fill)}),"stroke"in n&&"stroke"in r&&void 0!==r.stroke&&Object.assign(n,{stroke:ec({},n.stroke,r.stroke)}),"layerBlur"in n&&"layerBlur"in r&&void 0!==r.layerBlur&&Object.assign(n,{layerBlur:ec({},n.layerBlur,r.layerBlur)}),"backgroundBlur"in n&&"backgroundBlur"in r&&void 0!==r.backgroundBlur&&Object.assign(n,{backgroundBlur:ec({},n.backgroundBlur,r.backgroundBlur)}),"dropShadow"in n&&"dropShadow"in r&&void 0!==r.dropShadow&&Object.assign(n,{dropShadow:ec({},n.dropShadow,r.dropShadow)}),"innerShadow"in n&&"innerShadow"in r&&void 0!==r.innerShadow&&Object.assign(n,{innerShadow:ec({},n.innerShadow,r.innerShadow)}),n}(n=function(e,r){if(void 0===r)return e;var n=ec({},e),i=!0,a=!1,o=void 0;try{for(var s,l=["width","height","cornerRadius"][Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;u in n&&u in r&&void 0!==r[u]&&Object.assign(n,eu({},u,r[u]))}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return n}(n,r),r)},u.toOps=function(e,r){var n,i=[],a=!0,o=!1,s=void 0;try{for(var l,u=Object.entries(r)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c,h=(c=l.value,function(e){if(Array.isArray(e))return e}(c)||function(e){var r,n,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw n}}return a}}(c)||ef(c,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=h[0],f=h[1];"name"!==d&&(void 0===n&&(n={path:[],props:{},type:0},i.push(n)),n.props[d]=f)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return i},(Z||(Z={})).defaultData=eh(ec({},G.defaultData,H.defaultData),{states:new es.f,events:new es.f,visible:!0,raycastLock:!1}),(K||(K={})).defaultData=ec({},Z.defaultData,Y.defaultData),(J||(J={})).defaultData={cornerRadius:[0,0,0,0]},(Q||(Q={})).defaultData=eh(ec({},K.defaultData),{type:"ellipse2d",width:100,height:100,name:"Ellipse"}),($||($={})).defaultData=eh(ec({},K.defaultData,J.defaultData),{type:"rectangle2d",width:100,height:100,name:"Rectangle"}),(ee||(ee={})).defaultData=eh(ec({},K.defaultData),{type:"text2d",width:100,height:100,fontSize:12,lineHeight:1.2,letterSpacing:0,text:{textValue:"Hello world"},horizontalAlign:1,verticalAlign:1,textTransform:1,font:"Roboto_regular",name:"Text"}),(et||(et={})).defaultData=eh(ec({},K.defaultData),{type:"path2d",path:"",name:"Path"}),(er||(er={})).is=function(e){return"ellipse2d"===e.type||"rectangle2d"===e.type||"text2d"===e.type||"vector2d"===e.type||"path2d"===e.type},(en||(en={})).defaultData=eh(ec({},Z.defaultData),{name:"Group",type:"group2d"}),(ei||(ei={})).defaultData=function(){return eh(ec({},Z.defaultData,J.defaultData,Y.defaultData),{name:"Frame",type:"frame2d",clipped:!0,width:200,height:200,fill:{color:es.E.fromHexAndA(4737101,1),enabled:!0},stroke:{color:es.E.fromHexAndA(0,1),thickness:1,enabled:!1,mode:"inside"},backgroundBlur:{radius:2,enabled:!1},layerBlur:{radius:2,enabled:!1}})},(c=ea||(ea={})).defaultData=function(e){switch(e){case"rectangle2d":case"vector2d":return ec({},$.defaultData);case"ellipse2d":return ec({},Q.defaultData);case"text2d":return ec({},ee.defaultData);case"path2d":return ec({},et.defaultData);case"frame2d":return ec({},ei.defaultData());case"group2d":return ec({},en.defaultData)}},c.getPivot=function(e){return"width"in e&&"height"in e?["number"==typeof e.width?.5*e.width:0,"number"==typeof e.height?.5*e.height:0]:[0,0]},c.isResizeable=function(e){return"rectangle2d"===e.type||"ellipse2d"===e.type||"text2d"===e.type||"frame2d"===e.type},c.isAutoLayoutable=function(e){return"frame2d"===e.type&&void 0!==e.autoLayout},c.hasCorners=function(e){return"rectangle2d"===e.type||"frame2d"===e.type},(h=eo||(eo={})).defaultData={name:"UI",type:"scene2d",objects:new es.e},h.emptyData=function(){return{type:"scene2d",objects:new es.e}}},2995(e,r,n){n.d(r,{a:()=>O,b:()=>E,c:()=>P,d:()=>D,e:()=>j,f:()=>T,g:()=>I});var i=n(7173),a=n(5181),o=n(909),s=n(843),l=n(5222),u=n(3027);function c(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,r,n){var i,a,o;return r=y(r),i=e,(a=w()?Reflect.construct(r,n||[],y(e).constructor):r.apply(e,n))&&("object"==((o=a)&&"u">typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)||"function"==typeof a)?a:c(i)}function d(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function f(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function p(e,r,n){return r&&f(e.prototype,r),n&&f(e,n),e}function v(e,r,n){return(v="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=y(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&b(e,r)}function g(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function b(e,r){return(b=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}var x=new u.Oc,S=new u.Oc,k=new u.Oc,M=new u.Oc,A=new u.Oc;function O(e){var r=!1;return e.scene.objects.traverse(function(e,n){var i;"BooleanGeometry"===(null==(i=n.geometry)?void 0:i.type)&&(r=!0)}),r}var C=new Float32Array(0);function _(e,r,n,i){var a=16*(r.children.length+1);C.length<a&&(C=new Float32Array(a));var o=0,u=function(e){e.toArray(C,16*o),o++},c=!0!==r.parameters.hideBase;c&&u(i),k.multiplyMatrices(e.hiddenMatrix,e.matrix);var h=!0,d=!1,f=void 0;try{for(var p,v=r.children[Symbol.iterator]();!(h=(p=v.next()).done);h=!0){var y=p.value;!(0,l.i)(y)||!1===y.playModeVisible||(M.multiplyMatrices(y.hiddenMatrix,y.matrix).multiply(y.pivotMatrix),A.multiplyMatrices(k,M),c&&A.equals(i)||u(A))}}catch(e){d=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(d)throw f}}try{return 0===o?0:(0,s.t)(n,C.subarray(0,16*o))}finally{(0,s.s)(n)}}var P,E=function(e){function r(e,n,i){var a;return d(this,r),(a=h(this,r,[e,n])).data=n,a.meshSetAddresses=[],a.needsTransformForDownstream=!1,a.geometry=new u.dd,a.onAfterRender=function(e,n,i,o,s,l){v((c(a),y(r.prototype)),"onAfterRender",a).call(a,e,n,i,o,s,l),a.recomputeBoolean()},a.geometry.userData.parameters={width:0,height:0,depth:0},a}return m(r,e),p(r,[{key:"booleanOp",get:function(){return this.data.geometry.operation}},{key:"phongAngle",get:function(){var e;return null!=(e=this.data.geometry.phongAngle)?e:45}},{key:"isLOD",get:function(){return this.recomputeBoolean(),!1}},{key:"updateByPatchedOp",value:function(e,n,i){v(y(r.prototype),"updateByPatchedOp",this).call(this,e,n,i),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}},{key:"freeBooleanPointer",value:function(){v(y(r.prototype),"freeBooleanPointer",this).call(this),this.geometry.dispose()}},{key:"recomputeBoolean",value:function(e){var r,n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(-1===this.booleanMeshSetAddress||e){for(var a=0;a<this.children.length;a++){var o=this.children[a];g(o,E)&&!0===o.dataPatched.visible&&o.recomputeBoolean(!0===e,n)}this.meshSetAddresses=[];for(var l=0;l<this.children.length;l++){var c=this.children[l];if(g(c,s.v)&&!0===c.dataPatched.visible&&(null==(h=c.geometry.attributes.position)?void 0:h.count)>0&&c.geometry.drawRange.count>0&&0!==c.booleanMeshSetAddress){x.multiplyMatrices(c.hiddenMatrix,c.matrix).multiply(c.pivotMatrix);try{var h,d,f=function(e,r){var n=e.cloner;return void 0!==n&&n.parent===r?n:void 0}(c,this);if(-1===c.booleanMeshSetAddress){if((null!=(d=c.geometry.index)?d:c.geometry.getAttribute("position")).count/3<15e5){var p=(0,s.o)(c.geometry,!0===e,n);c.booleanMeshSetAddress=void 0===f||-1===p?p:_(c,f,p,x)}if(-1===c.booleanMeshSetAddress)return;void 0===f&&(0,s.r)(c.booleanMeshSetAddress,x),c.booleanMatrixInvOld.copy(x).invert(),c.booleanWasTransformed=!1}else g(c,E)&&!0===c.needsTransformForDownstream?(void 0===f?(0,s.r)(c.booleanMeshSetAddress,x):c.booleanMeshSetAddress=_(c,f,c.booleanMeshSetAddress,x),c.needsTransformForDownstream=!1):!0===c.booleanWasTransformed&&((0,s.r)(c.booleanMeshSetAddress,S.multiplyMatrices(x,c.booleanMatrixInvOld)),c.booleanMatrixInvOld.copy(x).invert(),c.booleanWasTransformed=!1)}catch(e){console.error(e),c.booleanMeshSetAddress=0,c.geometry.userData.booleanOperationDidFail=!0;continue}if(0===c.booleanMeshSetAddress)continue;this.meshSetAddresses.push(c.booleanMeshSetAddress),c.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==(null==(r=this.geometry.getAttribute("position"))?void 0:r.array.length)){var v=this.geometry;v.dispose(),this.geometry=new u.dd,this.geometry.userData=v.userData,this.geometry.boundingSphere=v.boundingSphere,this.geometry.setAttribute("position",new u.bd([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===e)return(0,s.q)(this.meshSetAddresses,this.booleanOp);var y=this.geometry;y.dispose(),this.geometry=new u.dd,this.geometry.userData=y.userData,this.geometry.boundingSphere=y.boundingSphere;try{this.booleanMeshSetAddress=(0,s.p)(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,(0,i.a)(this),(0,i.b)(this)}}},{key:"dispose",value:function(){v(y(r.prototype),"dispose",this).call(this),this.geometry.dispose()}}]),r}(o.ha);(P||(P={})).is=function(e){return s.h.is(e)&&g(e,u.ue)};var D=function(e,r){var n=(0,a.d)(e,r);function i(){return d(this,i),h(this,i,arguments)}return m(i,n),p(i,[{key:"updateState_Light",value:function(e,r){if(this.updateState_Entity(e,r),void 0!==e.color&&(this.color=r.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){var n=this.shadow;n.camera.far=e.depth,n.needsUpdate=!0}void 0!==e.shadows&&(this.castShadow=e.shadows)}}]),i},j=function(e){return g(e,s.v)},T=function(e){return null!==e&&g(e,E)},I=function(e){return a.c.is(e)}},2769(e,r,n){function i(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}n.d(r,{a:()=>a,b:()=>o,c:()=>s,d:()=>l,e:()=>u,f:()=>c,g:()=>h});var a=!(("u"<typeof window?"undefined":i(window))>"u")&&window.navigator.userAgent.toLowerCase().includes(" electron/"),o=(a&&function(){if(!(("u"<typeof window?"undefined":i(window))>"u")){var e=new URLSearchParams(window.location.search).get("desktop-app-version");e?window.localStorage.setItem("desktop-app-version",e):window.localStorage.getItem("desktop-app-version")}}(),("u"<typeof window?"undefined":i(window))>"u"||window.spline,!(("u"<typeof window?"undefined":i(window))>"u")&&window.navigator.platform.toUpperCase().includes("MAC")),s=!(("u"<typeof window?"undefined":i(window))>"u")&&(/iPad|iPhone|iPod/.test(window.navigator.userAgent)||o&&"ontouchend"in document),l=!(("u"<typeof window?"undefined":i(window))>"u")&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,u=!(("u"<typeof window?"undefined":i(window))>"u")&&("ontouchstart"in window||navigator.maxTouchPoints>0),c=function(){if(("u"<typeof window?"undefined":i(window))>"u")return!1;var e=navigator.userAgent,r=navigator.vendor;return/Safari/i.test(e)&&/Apple Computer/.test(r)}(),h=Number(function(){if(("u"<typeof window?"undefined":i(window))>"u")return null;var e=navigator.userAgent.match(/Version\/(\d+\.\d)/);return e&&e[1]}())},3763(e,r,n){n.d(r,{a:()=>function e(r){if(r.component){var n=r.component.instances.indexOf(r);n>=0&&r.component.instances.splice(n,1);var a=!0,o=!1,s=void 0;try{for(var l,u=r.children[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;i.h.is(c)&&e(c)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}}}});var i=n(843)},5635(e,r,n){function i(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function a(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function o(e,r,n){return r&&a(e.prototype,r),n&&a(e,n),e}function s(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}n.d(r,{a:()=>c});var l=function(){function e(){i(this,e),this.elapsed=0,this.lastRealTimeMs=null,this.paused=!1}return o(e,[{key:"time",get:function(){return this.elapsed}},{key:"tick",value:function(e){var r=0;return null!==this.lastRealTimeMs&&(r=Math.min((e-this.lastRealTimeMs)/1e3,.25))<0&&(r=0),this.lastRealTimeMs=e,this.paused||(this.elapsed+=r),this.elapsed}},{key:"step",value:function(e){return this.paused||(this.elapsed+=e),this.elapsed}},{key:"resync",value:function(e){this.lastRealTimeMs=e}},{key:"seek",value:function(e){this.elapsed=e}},{key:"reset",value:function(){this.elapsed=0,this.lastRealTimeMs=null,this.paused=!1}}]),e}();function u(){return("u"<typeof performance?"undefined":s(performance))<"u"?performance.now():Date.now()}var c=new(function(){function e(){var r=this;i(this,e),this.clock=new l,this.tickables=new Set,this.pendingRemovals=new Set,this.rafId=null,this.isFlushing=!1,this.useInternalRaf=!0,this.step=function(e){r.rafId=null,r.clock.tick(e),r.flush(),r.tickables.size>0&&r.requestFrame()}}return o(e,[{key:"isUsingInternalRaf",get:function(){return this.useInternalRaf},set:function(e){this.useInternalRaf=e,e?(this.clock.resync(u()),this.requestFrame()):null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}},{key:"time",get:function(){return this.clock.time}},{key:"running",get:function(){return this.tickables.size>0}},{key:"add",value:function(e){this.pendingRemovals.delete(e),0===this.tickables.size&&null===this.rafId&&this.clock.resync(u()),this.tickables.add(e),this.requestFrame()}},{key:"remove",value:function(e){this.isFlushing?this.pendingRemovals.add(e):this.tickables.delete(e)}},{key:"init",value:function(){this.clock.resync(u())}},{key:"dispose",value:function(){this.removeAll(),this.clock.reset()}},{key:"removeAll",value:function(){this.tickables.clear(),this.pendingRemovals.clear(),null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}},{key:"update",value:function(e){this.clock.step(e/1e3),this.flush()}},{key:"pause",value:function(){this.clock.paused=!0}},{key:"resume",value:function(){this.clock.paused=!1,this.clock.resync(u()),this.requestFrame()}},{key:"requestFrame",value:function(){null!==this.rafId||!this.useInternalRaf||0!==this.tickables.size&&(("u"<typeof requestAnimationFrame?"undefined":s(requestAnimationFrame))>"u"||(this.rafId=requestAnimationFrame(this.step)))}},{key:"flush",value:function(){var e=this.clock.time;this.isFlushing=!0;try{var r=!0,n=!1,i=void 0;try{for(var a,o=this.tickables[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.pendingRemovals.has(s)||s.update(e)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}finally{this.isFlushing=!1;var l=!0,u=!1,c=void 0;try{for(var h,d=this.pendingRemovals[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;this.tickables.delete(f)}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}this.pendingRemovals.clear()}}}]),e}())},5963(e,r,n){n.d(r,{a:()=>Z,b:()=>V,c:()=>$,d:()=>es,e:()=>e_,f:()=>eE});var i=n(8005),a=n(6679),o=n(8526),s=n(3227),l=n(2995),u=n(3763),c=n(7295),h=n(7913),d=n(1955),f=n(7173),p=n(1483),v=n(5181),y=n(909),m=n(843),g=n(5222),b=n(461),w=n(3940),x=n(3027),S=n(2784);function k(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function M(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}function A(e,r,n){return r=E(r),function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,F()?Reflect.construct(r,n||[],E(e).constructor):r.apply(e,n))}function O(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function C(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _(e,r,n){return r&&C(e.prototype,r),n&&C(e,n),e}function P(e,r,n){return(P="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=E(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&R(e,r)}function j(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function T(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function I(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function R(e,r){return(R=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function B(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||L(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||L(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,r){if(e){if("string"==typeof e)return k(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,r)}}function F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(F=function(){return!!e})()}var U=null;function V(e){U=e}var N=new WeakMap,G=1;function W(e){var r=N.get(e);return void 0===r&&(r=G++,N.set(e,r)),r}var H=[8,32,128,512],q=H[H.length-1],Y=(new x.Oc).makeScale(0,0,0),X=function(e){function r(e,n,i,a){O(this,r),(o=A(this,r,[e,n,i])).isInstanceGroup=!0,o.members=Array(i).fill(null),o.raycast=function(){},o.matrixAutoUpdate=!1,o.frustumCulled=!1,o.adoptPassState(a);for(var o,s=0;s<i;s++)o.setMatrixAt(s,Y);return o.instanceMatrix.needsUpdate=!0,o}return D(r,e),_(r,[{key:"adoptPassState",value:function(e){this.layers.mask=e.layers.mask,this.renderOrder=e.renderOrder,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow}},{key:"assign",value:function(e,r){this.members[e]=r}},{key:"writeSlot",value:function(e,r,n){return!1===n?(this.setMatrixAt(e,Y),!1):(this.setMatrixAt(e,r.matrixWorld),!0)}},{key:"park",value:function(e){this.members[e]=null,this.setMatrixAt(e,Y)}},{key:"memberCount",get:function(){var e=0,r=!0,n=!1,i=void 0;try{for(var a,o=this.members[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;null!==s&&e++}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return e}}]),r}(x.qd),Z=8,K=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;O(this,e),this.minGroupSize=r,this.groups=[],this.groupKeys=new WeakMap,this.placements=new Map,this.visibilityMemo=new Map,this.page=null,this.stats={instancingGroups:0,instancedDrawsSaved:0,instancingRegroups:0,instancingParks:0,instancingIneligible:{}}}return _(e,[{key:"update",value:function(e,r){this.page!==e&&(this.teardown(),this.page=e,r=!0),!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),r&&this.reconcile(e),this.refresh()}},{key:"reconcile",value:function(e){var r=this,n={},i=new Map;e.traverse(function(e){if(!0!==e.isInstanceGroup){var r,a=function(e){if(!0!==e.isMesh)return"not-a-mesh";if((0,g.c)(e)||(0,g.f)(e)||(0,g.b)(e)||(0,g.a)(e))return"excluded-type";var r,n,i,a,o,s,l,u=void 0!==(s=(0,g.i)(e)?e.object:e).geometry?s:void 0;if(void 0===u)return"not-a-mesh";var c=u.material;if(void 0===c)return"not-a-mesh";if(Array.isArray(c))return"array-material";var h=u.builtSharedGeometry;if(void 0===h)return"unrealized-geometry";if(!0!==h.isShared)return"unshared-geometry";if(void 0===h.attributes.position)return"empty-geometry";if(void 0!==h.morphAttributes.position)return"morph";if(!0===u.isSkinnedMesh)return"skinned";var d=u.morphTargetInfluences;return void 0!==d&&d.length>0?"morph":0!==h.drawRange.start||h.drawRange.count!==1/0?"draw-range":null!=c.positionNode||null!=c.castShadowPositionNode?"position-node":!0===c.transparent?"transparent":void 0!==(null==(l=u.userData)?void 0:l.__splinePlanarMirror)?"reflection":!function(e){for(var r=e;null!==r;){var n=r.states;if(void 0!==n&&Object.keys(n).length>0)return!0;r=r.parent}return!1}(u)?{object:e,owner:u,geometry:h,material:c,key:[W(h),W(c),null!=(r=null==(o=e.layers)?void 0:o.mask)?r:0,null!=(n=e.renderOrder)?n:0,+(!0===(null!=(i=e.castShadow)?i:u.castShadow)),+(!0===(null!=(a=e.receiveShadow)?a:u.receiveShadow))].join(":")}:"interaction-states"}(e);if("string"==typeof a)return void(n[a]=(null!=(r=n[a])?r:0)+1);var o=i.get(a.key);void 0===o?i.set(a.key,[a]):o.push(a)}});var a=new Map,o=!0,s=!1,l=void 0,u=!0,c=!1,h=void 0;try{for(var d,f=i[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){var p=B(d.value,2),v=p[0],y=p[1];try{for(var m,b=y[Symbol.iterator]();!(o=(m=b.next()).done);o=!0){var w=m.value;a.set(w.object,v)}}catch(e){s=!0,l=e}finally{try{o||null==b.return||b.return()}finally{if(s)throw l}}}}catch(e){c=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw h}}var x=!1,S=!0,k=!1,M=void 0;try{for(var A,O=this.placements[Symbol.iterator]();!(S=(A=O.next()).done);S=!0){var C=B(A.value,2),_=C[0],P=C[1];a.get(_)!==this.groupKeys.get(P.group)&&this.parkPlacement(_,P)}}catch(e){k=!0,M=e}finally{try{S||null==O.return||O.return()}finally{if(k)throw M}}for(var E=this.groups.length-1;E>=0;E--){var D=this.groups[E];D.memberCount>=this.minGroupSize||(this.destroyGroup(D),this.groups.splice(E,1),x=!0)}var j=!0,T=!1,I=void 0;try{for(var R,z=i[Symbol.iterator]();!(j=(R=z.next()).done);j=!0){var L=B(R.value,2),F=L[0],U=L[1].filter(function(e){return!r.placements.has(e.object)});if(0!==U.length){var V=0,N=!0,G=!1,H=void 0;try{for(var Y,X=this.groups[Symbol.iterator]();!(N=(Y=X.next()).done);N=!0){var Z=Y.value;if(V>=U.length)break;if(this.groupKeys.get(Z)===F)for(var K=Z.members,J=0;J<K.length&&V<U.length;J++)null===K[J]&&this.place(Z,J,U[V++].object)}}catch(e){G=!0,H=e}finally{try{N||null==X.return||X.return()}finally{if(G)throw H}}for(;U.length-V>=this.minGroupSize;){var Q=U.slice(V,V+q);this.groups.push(this.createGroup(e,F,Q)),V+=Q.length,x=!0}}}}catch(e){T=!0,I=e}finally{try{j||null==z.return||z.return()}finally{if(T)throw I}}x&&this.stats.instancingRegroups++,this.publishGroupStats(),this.stats.instancingIneligible=n}},{key:"createGroup",value:function(e,r,n){var i=n[0],a=new X(i.geometry,i.material,function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=H[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(e<=s)return s}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return q}(n.length),i.object);this.groupKeys.set(a,r);for(var o=0;o<n.length;o++)this.place(a,o,n[o].object);return e.add(a),a}},{key:"destroyGroup",value:function(e){for(var r=0;r<e.members.length;r++){var n=e.members[r];null!==n&&this.parkPlacement(n,{group:e,slot:r})}e.removeFromParent(),e.dispose()}},{key:"place",value:function(e,r,n){e.assign(r,n),this.placements.set(n,{group:e,slot:r}),n.isDrawSuppressed=!0}},{key:"parkPlacement",value:function(e,r){r.group.park(r.slot),r.group.instanceMatrix.needsUpdate=!0,this.placements.delete(e),e.isDrawSuppressed=!1,this.stats.instancingParks++}},{key:"refresh",value:function(){this.visibilityMemo.clear();var e=!0,r=!1,n=void 0;try{for(var i,a=this.groups[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){for(var o=i.value,s=o.members,l=null,u=0;u<s.length;u++){var c=s[u];null!==c&&(null===l&&(l=c),o.writeSlot(u,c,function e(r,n){var i=n.get(r);if(void 0!==i)return i;var a=r.visible&&(null===r.parent||e(r.parent,n));return n.set(r,a),a}(c,this.visibilityMemo)))}null!==l&&(o.adoptPassState(l),o.instanceMatrix.needsUpdate=!0)}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"teardown",value:function(){var e=!0,r=!1,n=void 0;try{for(var i,a=this.groups[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;this.destroyGroup(o)}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}this.groups.length=0;var s=!0,l=!1,u=void 0;try{for(var c,h=this.placements.keys()[Symbol.iterator]();!(s=(c=h.next()).done);s=!0)c.value.isDrawSuppressed=!1}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}this.placements.clear(),this.publishGroupStats()}},{key:"dispose",value:function(){this.teardown(),this.page=null}},{key:"publishGroupStats",value:function(){var e=0,r=!0,n=!1,i=void 0;try{for(var a,o=this.groups[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value.memberCount;s>0&&(e+=s-1)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}this.stats.instancingGroups=this.groups.length,this.stats.instancedDrawsSaved=e}}]),e}(),J=(et=new Int32Array((ee=new Float32Array(1)).buffer),function(e){return ee[0]=e,et[0]}),Q=new x.Dc;function $(e){var r=!1;return e.scene.objects.traverse(function(e,n){if(!1===n.visible)return!0;"Splat"===n.type&&(r=!0)}),r}var ee,et,er,en,ei=function(e){function r(e,n,i,a){var o,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0;return O(this,r),(o=A(this,r,[i,a])).splatCount=n,o.meshIndexIntervals=u,o.meshMatrixWorlds=c,o.splatBuffers=e,o.geometry=i,o.material=a,o.splatDataTextures=null,o.halfPrecisionCovariancesOnGPU=s,o.devicePixelRatio=l,o.resetLocalSplatDataAndTexturesFromSplatBuffer(),o}return D(r,e),_(r,[{key:"resetLocalSplatDataAndTexturesFromSplatBuffer",value:function(){this.updateLocalSplatDataFromSplatBuffer(),this.allocateAndStoreLocalSplatDataInTextures()}},{key:"updateLocalSplatDataFromSplatBuffer",value:function(){this.splatBuffers.forEach(function(e){return e.buildPreComputedBuffers()}),this.covariances=new Float32Array(6*this.splatCount),this.colors=new Uint8Array(4*this.splatCount),this.centers=new Float32Array(3*this.splatCount);var e=0,r=0,n=0,i=!0,a=!1,o=void 0;try{for(var s,l=this.splatBuffers[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=u.nsplats;this.colors.subarray(e,e+4*c).set(u.colorsA),e+=4*c,this.centers.subarray(r,r+3*c).set(u.decoded.xyz.denormDequant().data),r+=3*c,this.covariances.subarray(n,n+6*c).set(new Float32Array(u.precomputedCovarianceBufferData)),n+=6*c}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}},{key:"allocateAndStoreLocalSplatDataInTextures",value:function(){for(var e=this.splatCount,r=new x.Dc(4096,1024);r.x*r.y*2<6*e;)r.y*=2;for(var n,i,a=new x.Dc(4096,1024);a.x*a.y*4<4*e;)a.y*=2;if(this.halfPrecisionCovariancesOnGPU){i=new Uint16Array(r.x*r.y*2);for(var o=0;o<this.covariances.length;o++)i[o]=x.Yc.toHalfFloat(this.covariances[o]);n=new x.nd(i,r.x,r.y,x.Oa,x.Ba)}else(i=new Float32Array(r.x*r.y*2)).set(this.covariances),n=new x.nd(i,r.x,r.y,x.Oa,x.Aa);n.needsUpdate=!0,this.material.uniforms.covariancesTexture.value=n,this.material.uniforms.covariancesTextureSize.value.copy(r);for(var s=new Uint32Array(a.x*a.y*4),l=0;l<e;l++){var u,c,h=4*l,d=3*l,f=4*l;s[f]=(u=this.colors[h],c=this.colors[h+1],u+(c<<8)+(this.colors[h+2]<<16)+(this.colors[h+3]<<24)),s[f+1]=J(this.centers[d]),s[f+2]=J(this.centers[d+1]),s[f+3]=J(this.centers[d+2])}var p=new x.nd(s,a.x,a.y,x.Ra,x.za);"webgpu"!==(0,y.O)()&&(p.internalFormat="RGBA32UI"),p.needsUpdate=!0,this.material.uniforms.centersColorsTexture.value=p,this.material.uniforms.centersColorsTextureSize.value.copy(a);for(var v=new Float32Array(4096),m=0;m<this.meshMatrixWorlds.length;m++)v.set(this.meshMatrixWorlds[m].elements,16*m);var g=new x.nd(v,1024,1,x.Ja,x.Aa);g.needsUpdate=!0,this.material.uniforms.meshMatrixWorldsTexture.value=g,this.material.uniformsNeedUpdate=!0,this.splatDataTextures={covariances:{data:i,texture:n,size:r},centerColors:{data:s,texture:p,size:a},meshMatrixWorlds:{data:v,texture:g}}}},{key:"updateIndexes",value:function(e){var r=this.geometry;r.attributes.splatIndex.set(e),r.attributes.splatIndex.needsUpdate=!0,r.instanceCount=e.length}},{key:"updateUniforms",value:function(e,r,n,i){this.splatCount>0&&(Q.set(e.x*this.devicePixelRatio,e.y*this.devicePixelRatio),this.material.uniforms.viewport.value.copy(Q),this.material.uniforms.basisViewport.value.set(2/Q.x,2/Q.y),this.material.uniforms.focal.value.set(r,n),this.material.uniforms.orthoZoom.value=i,this.material.uniformsNeedUpdate=!0)}},{key:"getSplatDataTextures",value:function(){return this.splatDataTextures}},{key:"getSplatCount",value:function(){return this.splatCount}},{key:"getCenters",value:function(){return this.centers}},{key:"getColors",value:function(){return this.colors}},{key:"getCovariances",value:function(){return this.covariances}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose(),this.splatDataTextures&&(this.splatDataTextures.covariances.texture.dispose(),this.splatDataTextures.centerColors.texture.dispose(),this.splatDataTextures.meshMatrixWorlds.texture.dispose()),this.removeFromParent()}}],[{key:"buildMesh",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=ei.buildGeomtery(r),l=ei.buildMaterial(a);return new ei(e,r,s,l,n,i,a,o)}},{key:"buildMaterial",value:function(e){if("webgpu"===(0,y.O)()&&U)return U.createSplatMaterial(e);var r={covariancesTexture:{type:"t",value:null},centersColorsTexture:{type:"t",value:null},meshIndexIntervals:{value:e},meshMatrixWorldsTexture:{type:"t",value:null},focal:{type:"v2",value:new x.Dc},viewport:{type:"v2",value:new x.Dc},basisViewport:{type:"v2",value:new x.Dc},debugColor:{type:"v3",value:new x.Tc},covariancesTextureSize:{type:"v2",value:new x.Dc(1024,1024)},centersColorsTextureSize:{type:"v2",value:new x.Dc(1024,1024)},orthoZoom:{type:"f",value:-1}};return new x.ce({uniforms:r,vertexShader:"\n precision highp float;\n #include <common>\n\n attribute uint splatIndex;\n\n uniform highp sampler2D covariancesTexture;\n uniform highp usampler2D centersColorsTexture;\n uniform vec2 focal;\n uniform vec2 viewport;\n uniform vec2 basisViewport;\n uniform vec2 covariancesTextureSize;\n uniform vec2 centersColorsTextureSize;\n uniform highp sampler2D meshMatrixWorldsTexture;\n uniform uint meshIndexIntervals[257];\n uniform float orthoZoom;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n\n const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n const uvec4 shift4 = uvec4(0, 8, 16, 24);\n vec4 uintToRGBAVec (uint u) {\n uvec4 urgba = mask4 & u;\n urgba = urgba >> shift4;\n vec4 rgba = vec4(urgba) * encodeNorm4;\n return rgba;\n }\n\n vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(splatIndex * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n void main () {\n uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n vColor = uintToRGBAVec(sampledCenterColor.r);\n\n vPosition = position.xy * 2.0;\n\n uint meshIndex;\n for (int i = 1; i < 257; i++) {\n if (splatIndex < meshIndexIntervals[i]) {\n meshIndex = uint(i - 1);\n break;\n }\n }\n\n float strideMulmeshIndex = float(4u*meshIndex);\n float meshMatrixWorldsTextureLength = float(256*4);\n\n mat4 modelMat = mat4(\n texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+0.0)/meshMatrixWorldsTextureLength, 0)),\n texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+1.0)/meshMatrixWorldsTextureLength, 0)),\n texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+2.0)/meshMatrixWorldsTextureLength, 0)),\n texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+3.0)/meshMatrixWorldsTextureLength, 0))\n );\n mat4 modelViewMat = viewMatrix * modelMat;\n vec4 viewCenter = modelViewMat * vec4(splatCenter, 1.0); \n vec4 clipCenter = projectionMatrix * viewCenter;\n\n vec2 sampledCovarianceA = texture(covariancesTexture, getDataUV(3, 0, covariancesTextureSize)).rg;\n vec2 sampledCovarianceB = texture(covariancesTexture, getDataUV(3, 1, covariancesTextureSize)).rg;\n vec2 sampledCovarianceC = texture(covariancesTexture, getDataUV(3, 2, covariancesTextureSize)).rg;\n\n vec3 cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rg, sampledCovarianceB.r);\n vec3 cov3D_M22_M23_M33 = vec3(sampledCovarianceB.g, sampledCovarianceC.rg);\n\n \n mat3 Vrk = mat3(\n cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\n cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\n cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\n );\n float s = 1.0 / (viewCenter.z * viewCenter.z);\n\n mat3 W = transpose(mat3(modelViewMat));\n mat3 T = orthoZoom > 0.0 ? W : W * mat3(\n focal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\n 0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\n 0., 0., 0.\n );\n mat3 cov2Dm = transpose(T) * Vrk * T;\n cov2Dm[0][0] += 0.3;\n cov2Dm[1][1] += 0.3;\n\n \n \n \n \n vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\n\n \n \n \n \n \n \n \n \n float a = cov2Dv.x;\n float d = cov2Dv.z;\n float b = cov2Dv.y;\n float D = a * d - b * b;\n float trace = a + d;\n float traceOver2 = 0.5 * trace;\n float term2 = sqrt(trace * trace / 4.0 - D);\n float eigenValue1 = traceOver2 + term2;\n float eigenValue2 = max(traceOver2 - term2, 0.00); \n\n const float maxSplatSize = 1024.0;\n vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n \n vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n vec2 basisVector1 = eigenVector1 * min(sqrt(2.0 * eigenValue1), maxSplatSize);\n vec2 basisVector2 = eigenVector2 * min(sqrt(2.0 * eigenValue2), maxSplatSize);\n\n vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) * basisViewport;\n\n if (orthoZoom > 0.0) {\n ndcOffset *= orthoZoom;\n }\n\n gl_Position = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n }",fragmentShader:"\n precision highp float;\n #include <common>\n\n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n layout(location = 1) out vec4 gVelocity; \n\n void main () {\n \n \n float A = -dot(vPosition, vPosition);\n if (A < -4.0) discard;\n vec3 color = vColor.rgb;\n A = exp(A) * vColor.a;\n gl_FragColor = vec4(color.rgb, A);\n gVelocity = vec4(0.0); \n }",transparent:!0,alphaTest:1,blending:x.n,depthTest:!0,depthWrite:!1,side:x.l})}},{key:"buildGeomtery",value:function(e){var r=new x.dd;r.setIndex([0,1,2,0,2,3]);var n=new Float32Array(12),i=new x.Zc(n,3);r.setAttribute("position",i),i.setXYZ(0,-1,-1,0),i.setXYZ(1,-1,1,0),i.setXYZ(2,1,1,0),i.setXYZ(3,1,-1,0),i.needsUpdate=!0;var a=(new x.Ge).copy(r),o=new Uint32Array(e),s=new x.pd(o,1,!1);return s.setUsage(x.mc),a.setAttribute("splatIndex",s),a.instanceCount=e,a}}]),r}(x.ld),ea=new Promise(function(e){er=e}),eo=!1;function es(){if(!eo){var e;return en||(en=(e=function(){var e;return function(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,n.e("3032").then(n.bind(n,5867))];case 1:return e=r.sent(),er(e),eo=!0,[2]}})},function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function s(e){M(o,i,a,s,l,"next",e)}function l(e){M(o,i,a,s,l,"throw",e)}s(void 0)})})())}}var el=new x.Oc,eu=new x.Gc,ec=new x.Fc,eh=new x.Fc,ed=new x.Fc,ef=new x.Fc,ep=new x.Fc,ev=new x.Fc,ey=new x.Xc,em=new x.Xc,eg=new x.Oc,eb=new x.Fc,ew=function(e){function r(e,n,i){O(this,r),(a=A(this,r,[e,n])).data=n,a.geometry=new x.dd,a.lastSignature=[],a.nextSignature=[],a.scanned=[],a.lastParams={width:0,height:0,depth:0,offset:0},a.targetFilter=new Set,a.context=i;var a,o,s=a.data.geometry;return a.lastParams={width:a.resolveNumber(s.width,0),height:a.resolveNumber(s.height,0),depth:a.resolveNumber(s.depth,0),offset:null!=(o=s.offset)?o:0},a.geometry.userData={type:"DecalGeometry",parameters:T({},a.lastParams)},a}return D(r,e),_(r,[{key:"isLOD",get:function(){return this.updateDecal(),!1}},{key:"isDecalObject",get:function(){return!0}},{key:"resolveNumber",value:function(e,r){if("number"==typeof e)return e;var n=Number(this.context.shared.getVariable(e));return Number.isFinite(n)?n:r}},{key:"currentParams",value:function(){var e,r=this.dataPatched.geometry;return{width:this.resolveNumber(r.width,this.lastParams.width),height:this.resolveNumber(r.height,this.lastParams.height),depth:this.resolveNumber(r.depth,this.lastParams.depth),offset:null!=(e=r.offset)?e:0}}},{key:"projectionRoot",value:function(){for(var e,r=this.parent;null!==r&&m.h.is(r);){if("Page"===(null==(e=r.data)?void 0:e.type))return r;r=r.parent}return this.context.scene}},{key:"currentTargetFilter",value:function(){var e=this.dataPatched.geometry;if("select"!==e.projection)return null;var r=e.projectionTargets,n=!0,i=!1,a=void 0;if(r!==this.targetFilterSource&&(this.targetFilterSource=r,this.targetFilter.clear(),void 0!==r))try{for(var o,s=r[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;this.targetFilter.add(l)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return this.targetFilter}},{key:"scanTargets",value:function(e,r,n){var i=this,a=this.scanned;a.length=0;var o=this.projectionRoot();if(null===o)return a;var s=this.currentTargetFilter();if(null!==s&&0===s.size)return a;ey.makeEmpty();for(var l=0;l<8;l++)eb.set((1&l?.5:-.5)*e,(2&l?.5:-.5)*r,(4&l?.5:-.5)*n).applyMatrix4(this.matrixWorld),ey.expandByPoint(eb);return o.traverse(function(e){if(!(e===i||!m.h.is(e)||!j(e,m.v)||j(e,ew))&&"Mesh"===(null==(r=e.dataPatched)?void 0:r.type)&&e.visible&&!e.destroyedInAction&&!(512&e.layers.mask)&&(null===s||ew.matchesTargetFilter(e,s,o))){var r,n=e.geometry,l=null==n?void 0:n.getAttribute("position");void 0===l||0===l.count||0!==n.drawRange.count&&(null===n.boundingBox&&n.computeBoundingBox(),em.copy(n.boundingBox).applyMatrix4(e.matrixWorld),ey.intersectsBox(em)&&a.push(e))}}),a}},{key:"collectSignature",value:function(e,r,n){e.length=0,e.push(n.width,n.height,n.depth,n.offset);var i=!0,a=!1,o=void 0;try{for(var s,l=this.matrixWorld.elements[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;e.push(u)}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}var c=!0,h=!1,d=void 0;try{for(var f,p=r[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;e.push(v.id,v.geometry.id);var y=v.geometry.getAttribute("position");e.push(void 0===y?-1:"version"in y?y.version:y.data.version);var m=v.geometry.getIndex();e.push(null!==m?m.version:-1),e.push(v.geometry.drawRange.count===1/0?-1:v.geometry.drawRange.count);var g=!0,b=!1,w=void 0;try{for(var x,S=v.matrixWorld.elements[Symbol.iterator]();!(g=(x=S.next()).done);g=!0){var k=x.value;e.push(k)}}catch(e){b=!0,w=e}finally{try{g||null==S.return||S.return()}finally{if(b)throw w}}}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}}},{key:"signaturesEqual",value:function(e,r){if(e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0}},{key:"updateDecal",value:function(){if(this.disposed)return!1;this.updateWorldMatrix(!0,!1);var e=this.currentParams(),r=this.scanTargets(e.width,e.height,e.depth);if(this.collectSignature(this.nextSignature,r,e),this.signaturesEqual(this.nextSignature,this.lastSignature))return!1;var n=this.lastSignature;this.lastSignature=this.nextSignature,this.nextSignature=n,this.lastParams=e,eg.copy(this.matrixWorld).invert();var i=r.map(function(e){return{geometry:e.geometry,objectToDecal:(new x.Oc).multiplyMatrices(eg,e.matrixWorld)}});return this.geometry.dispose(),this.geometry=function(e,r){var n=Math.max(Math.abs(r.width),1e-6),i=Math.max(Math.abs(r.height),1e-6),a=Math.max(Math.abs(r.depth),1e-6),o=[{axis:0,sign:1,limit:n/2},{axis:0,sign:-1,limit:n/2},{axis:1,sign:1,limit:i/2},{axis:1,sign:-1,limit:i/2},{axis:2,sign:1,limit:a/2},{axis:2,sign:-1,limit:a/2}],s=[],l=[],u=[],c=!0,h=!1,d=void 0;try{for(var f,p=e[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;if(!function(e,r,n,i,a,o,s,l,u){var c=e.geometry,h=c.getAttribute("position");if(void 0===h||0===h.count)return!0;var d=c.getAttribute("normal"),f=c.getIndex(),p=null!==f?f.count:h.count;if(p>15e5)return!0;var v=c.drawRange.start,y=v+(c.drawRange.count===1/0?p-v:Math.min(c.drawRange.count,p-v));el.copy(e.objectToDecal),eu.getNormalMatrix(el);for(var m=[],g=[],b=v;b+2<y;b+=3){var w=null!==f?f.getX(b):b,x=null!==f?f.getX(b+1):b+1,S=null!==f?f.getX(b+2):b+2;if(ec.fromBufferAttribute(h,w).applyMatrix4(el),eh.fromBufferAttribute(h,x).applyMatrix4(el),ed.fromBufferAttribute(h,S).applyMatrix4(el),(!(ec.z>n)||!(eh.z>n)||!(ed.z>n))&&(!(ec.z<-n)||!(eh.z<-n)||!(ed.z<-n))){ef.subVectors(eh,ec),ep.subVectors(ed,ec),ev.crossVectors(ef,ep);var k=ev.length();if(!(0===k||ev.z/k<=.01)){if(m.length=0,void 0!==d)ef.fromBufferAttribute(d,w).applyMatrix3(eu),m.push({px:ec.x,py:ec.y,pz:ec.z,nx:ef.x,ny:ef.y,nz:ef.z}),ef.fromBufferAttribute(d,x).applyMatrix3(eu),m.push({px:eh.x,py:eh.y,pz:eh.z,nx:ef.x,ny:ef.y,nz:ef.z}),ef.fromBufferAttribute(d,S).applyMatrix3(eu),m.push({px:ed.x,py:ed.y,pz:ed.z,nx:ef.x,ny:ef.y,nz:ef.z});else{ev.divideScalar(k);for(var M=0,A=[ec,eh,ed];M<A.length;M++){var O=A[M];m.push({px:O.x,py:O.y,pz:O.z,nx:ev.x,ny:ev.y,nz:ev.z})}}var C=!0,_=!1,P=void 0;try{for(var E,D=r[Symbol.iterator]();!(C=(E=D.next()).done);C=!0){var j=E.value;if(0===m.length)break;var T=function(e,r,n){n.length=0;for(var i=r.axis,a=r.sign,o=r.limit,s=0;s<e.length;s++){var l=e[s],u=e[(s+1)%e.length],c=(0===i?l.px:1===i?l.py:l.pz)*a-o,h=(0===i?u.px:1===i?u.py:u.pz)*a-o,d=c<=0,f=h<=0;if(d&&n.push(l),d!==f){var p=c/(c-h);n.push({px:l.px+(u.px-l.px)*p,py:l.py+(u.py-l.py)*p,pz:l.pz+(u.pz-l.pz)*p,nx:l.nx+(u.nx-l.nx)*p,ny:l.ny+(u.ny-l.ny)*p,nz:l.nz+(u.nz-l.nz)*p})}}return n}(m,j,g);g=m,m=T}}catch(e){_=!0,P=e}finally{try{C||null==D.return||D.return()}finally{if(_)throw P}}if(!(m.length<3)){if(s.length/3+3*(m.length-2)>3e5)return!1;for(var I=1;I+1<m.length;I++)for(var R=0,B=[m[0],m[I],m[I+1]];R<B.length;R++){var z=B[R];u.push(z.px*i+.5,z.py*a+.5);var L=z.nx,F=z.ny,U=z.nz,V=Math.hypot(L,F,U);V>0?(L/=V,F/=V,U/=V):(L=0,F=0,U=1),s.push(z.px+L*o,z.py+F*o,z.pz+U*o),l.push(L,F,U)}}}}}return!0}(v,o,a/2,1/n,1/i,r.offset,s,l,u))break}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}var y=new x.dd;return y.setAttribute("position",new x.bd(s,3)),y.setAttribute("normal",new x.bd(l,3)),y.setAttribute("uv",new x.bd(u,2)),0===s.length?(y.setDrawRange(0,0),y.boundingSphere=new x.cd):y.computeBoundingSphere(),y}(i,e),this.geometry.userData={type:"DecalGeometry",parameters:{width:e.width,height:e.height,depth:e.depth}},(0,f.a)(this),(0,f.b)(this),this.resetBBoxNeedsUpdate(),!0}},{key:"updateByPatchedOp",value:function(e,n,i){P(E(r.prototype),"updateByPatchedOp",this).call(this,e,n,i),(0,m.b)(e.path,["geometry"])&&this.resetBBoxNeedsUpdate()}},{key:"updateEntityBoxSize",value:function(e,r){var n=this.currentParams();e.setScalar(0),r.set(n.width,n.height,n.depth).multiplyScalar(.5)}},{key:"dispose",value:function(){P(E(r.prototype),"dispose",this).call(this),this.geometry.dispose()}}],[{key:"matchesTargetFilter",value:function(e,r,n){for(var i=e;null!==i&&i!==n;){if(r.has(i.uuid))return!0;i=i.parent}return!1}}]),r}(y.ha),ex=function(e){function r(e,n){var i;return O(this,r),(i=A(this,r)).super_Entity(e,n),i.objectHelper.update(),i.matrixAutoUpdate=!0,i}return D(r,e),_(r,[{key:"updateState",value:function(e,r){this.updateState_Entity(e,r)}}]),r}((0,v.d)(x.md,p.a)),eS=function(){try{var e=window.location.href;if(e.includes("reducesubdiv=")){var r=e.indexOf("reducesubdiv=")+13;return parseInt(e.slice(r,r+1))}}catch(e){}}();function ek(e,r,n){if(console.assert(void 0!==r.type),"Mesh"===r.type)return function(e,r,n){if(void 0!==eS&&(null==r?void 0:r.geometry)&&"subdivisions"in r.geometry&&(null!=(i=r.geometry.subdivisions)?i:0)>eS&&Object.assign(r.geometry,{subdivisions:eS}),"TextGeometry"===r.geometry.type||"InputGeometry"===r.geometry.type){var i,a,o=(0,b.g)(r.geometry.type);return o?o(e,r,n):((0,b.c)("InputGeometry"===r.geometry.type?"textinputs":"text","a Mesh with ".concat(r.geometry.type)),new y.ia(e,r,n))}if("SubdivGeometry"===r.geometry.type)a=new d.b(e,r,n);else if("PathGeometry"===r.geometry.type||"VectorGeometry"===r.geometry.type||"ShapeBlendGeometry"===r.geometry.type){var s=(0,b.g)(r.geometry.type);s?a=s(e,r,n):((0,b.c)("ShapeBlendGeometry"===r.geometry.type?"shape-blends":"PathGeometry"===r.geometry.type?"3d-paths":"vector-shapes","a Mesh with ".concat(r.geometry.type)),a=new y.ia(e,r,n))}else if("BooleanGeometry"===r.geometry.type)a=new l.b(e,r,n);else if("DecalGeometry"===r.geometry.type)a=new ew(e,r,n);else if("UIGeometry"===r.geometry.type){var u=(0,b.g)("UIGeometry");u?a=u(e,r,n):((0,b.c)("ui-2d","a Mesh with UIGeometry"),a=new y.ia(e,r,n))}else a=new y.ia(e,r,n);return a}(e,r,n);if("Empty"===r.type)return new a.a(e,r);if("Particle"===r.type){var u=(0,b.e)("Particle");return u?u(e,r,n):((0,b.c)("particles","a Particle system"),new a.a(e,r))}if("ParticleCollider"===r.type)return new h.a(e,r,n);if("Hair"===r.type){var f=(0,b.e)("Hair");return f?f(e,r,n):((0,b.c)("hair","a Hair System"),new a.a(e,r))}if("Splat"===r.type)return new a.a(e,r);if("Bone"===r.type)return new ex(e,r);if("Page"===r.type)return new o.h(e,r,n);if("PointLight"===r.type)return new i.a(e,r,n);if("SpotLight"===r.type)return new s.b(e,r,n);if("DirectionalLight"===r.type)return new s.a(e,r,n);if("Component"===r.type||"Instance"===r.type){var p=(0,b.e)(r.type);return p?p(e,r,n):((0,b.c)("components","a ".concat(r.type)),new a.a(e,r))}return w.J.is(r.type)?new c.a(e,r):(console.error(r),new a.a(e,r))}m.c.createEntity=ek,m.c.changeEntityProptotype=function(e,r,n){var i=ek(e.identity,r,n),a=e.children,o=e.attachedPaths,s=e.parent,l=e.component,u=e.instances,c=e.overrideData,h=e.uuid,d=e.stateSelection;e.dispose();var f=!0,p=!1,v=void 0;try{for(var y,m=Object.keys(e)[Symbol.iterator]();!(f=(y=m.next()).done);f=!0){var g=y.value;delete e[g]}}catch(e){p=!0,v=e}finally{try{f||null==m.return||m.return()}finally{if(p)throw v}}Object.setPrototypeOf(e,Object.getPrototypeOf(i));var b=!0,w=!1,x=void 0;try{for(var S,k=Object.keys(i)[Symbol.iterator]();!(b=(S=k.next()).done);b=!0){var M=S.value;e[M]=i[M]}}catch(e){w=!0,x=e}finally{try{b||null==k.return||k.return()}finally{if(w)throw x}}e.children=z(e.children).concat(z(a)),e.attachedPaths=o,e.parent=s,e.component=l,e.instances=u,e.uuid=h,e.overrideData=c,e.updateState(e.data,n),d&&e.changeSelectedState(d,n),e.resetBBoxNeedsUpdate()};var eM,eA=function(){function e(){O(this,e),this._constraints=new Map}return _(e,[{key:"setConstraint",value:function(e,r){null===r?this._constraints.delete(e):this._constraints.set(e,r)}},{key:"removeDependencies",value:function(e){this._constraints.delete(e)}},{key:"applyConstraints",value:function(e){var r=this,n=new Set;this._constraints.forEach(function(i,a){for(var o=[a,i],s=i;r._constraints.has(s);){if(s=r._constraints.get(s),o.includes(s)){console.warn("circular dependency detected: ".concat(o.join(" -> ")));break}n.has(s)||o.push(s)}for(var l=o.length-2;l>=0;l--)if(!n.has(o[l])){var u=e.find(o[l]);u?u.applyPathSnapping(e):console.warn("missing entity ".concat(o[l])),n.add(o[l])}})}},{key:"findDependency",value:function(e,r){for(var n=e;this._constraints.has(n);)if((n=this._constraints.get(n))===r)return!0;return!1}}]),e}(),eO=function e(){O(this,e)};(0,S.c)(eO,"DepthMapRange",65536),(0,S.c)(eO,"MemoryPageSize",65536),(0,S.c)(eO,"BytesPerFloat",4),(0,S.c)(eO,"BytesPerInt",4),ea.then(function(e){return eM=e});var eC=function(){function e(){var r,n,i,a,o,s,l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,e),(0,S.c)(this,"updateView",(r=new x.Oc,n=[],i=new x.Fc(0,0,-1),a=new x.Fc(0,0,-1),o=new x.Fc,s=new x.Fc,function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],l=arguments.length>1?arguments[1]:void 0,u=this.updateMatrixWorldsInWorkerIfNeeded(),c=this.cropsChanged();if(!e){a.set(0,0,-1).applyQuaternion(l.quaternion);var h=!1,d=!1;if(.95>=a.dot(i)&&(h=!0),s.copy(l.position).sub(o).length()>=1&&(d=!0),!(h||d||u||c||this.needsInitialRender))return}this.needsInitialRender=!1,o.copy(l.position),i.copy(a),r.copy(l.matrixWorld).invert(),r.premultiply(this.dummyPerspectiveMatrix),n[0]=l.position.x,n[1]=l.position.y,n[2]=l.position.z;var f=T({sort:{view:r.elements,cameraPosition:n,splatRenderCount:this.splatRenderCount,splatSortCount:this.splatRenderCount}},u?{newMatrixWorlds:this.meshMatrixWorlds}:{},c?{newCropsArray:this.cropsArray}:{});this.sortRunning?this.queuedMessage=f:(this.queuedMessage=null,this.sortRunning=!0,this.sortWorker.postMessage(f))})),this.scene=l.scene,this.currentPage=null,this.devicePixelRatio=window.devicePixelRatio,this.sortWorker=null,this.splatRenderCount=0,this.splatSortCount=0,this.splatMesh=null,this.sortRunning=!1,this.meshMatrixWorlds=null,this.meshMatrixWorldsOld=null,this.cropsArray=null,this.splatEntries=null,this.queuedMessage=null,this.needsInitialRender=!0,this.dummyPerspectiveMatrix=(new x.Oc).makePerspective(-1,1,-1,1,.1,1e3)}return _(e,[{key:"updateSplatMeshUniforms",value:function(e,r){var n=new x.Dc;null!==this.splatMesh&&this.splatMesh.getSplatCount()>0&&(e.getSize(n),this.cameraFocalLengthX=r.projectionMatrix.elements[0]*this.devicePixelRatio*n.x*.45,this.cameraFocalLengthY=r.projectionMatrix.elements[5]*this.devicePixelRatio*n.y*.45,this.splatMesh.updateUniforms(n,this.cameraFocalLengthX,this.cameraFocalLengthY,r.isPerspectiveCamera?-1:r.zoom*this.devicePixelRatio))}},{key:"loadSplat",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.activePage=this.scene.activePage,r.position&&(r.position=(new x.Fc).fromArray(r.position)),r.orientation&&(r.orientation=(new x.Ec).fromArray(r.orientation)),r.halfPrecisionCovariances=!!r.halfPrecisionCovariances;var n=[];if(this.splatEntries=n,this.activePage.traverseVisibleEntity(function(e){"Splat"===e.data.type&&n.push(e)}),this.splatMesh&&this.splatMesh.dispose(),0===n.length)return this.splatMesh=null,!1;this.meshMatrixWorlds=n.map(function(e){return e.matrixWorld}),this.meshMatrixWorldsOld=n.map(function(e){return e.matrixWorld.clone()}),this.cropsArray=n.map(function(e){return e.data.crops.map(function(e){return e.data})}),null!=this._splatBufferCache||(this._splatBufferCache=new WeakMap);var i=n.map(function(r){var n=e._splatBufferCache.get(r.data.buffer);return void 0===n&&(n=new eM.GSplineBuffer(new Uint8Array(r.data.buffer).buffer),e._splatBufferCache.set(r.data.buffer,n)),n}),a=0,o=[0],s=!0,l=!1,u=void 0;try{for(var c,h,d=i[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var f=h.value;a+=f.getSplatCount(),o.push(a)}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}return this.setupSplatMesh(i,a,r.position,r.orientation,r.halfPrecisionCovariances,this.devicePixelRatio,o,this.meshMatrixWorlds),this.setupSortWorker(a),!0}},{key:"updateMatrixWorldsInWorkerIfNeeded",value:function(){for(var e=this,r=this.splatDataTextures.meshMatrixWorlds.data,n=0;n<this.meshMatrixWorlds.length;n++)r.set(this.meshMatrixWorlds[n].elements,16*n);return this.splatDataTextures.meshMatrixWorlds.texture.needsUpdate=!0,!this.meshMatrixWorlds.every(function(r,n){return r.equals(e.meshMatrixWorldsOld[n])})&&(this.meshMatrixWorldsOld=this.meshMatrixWorlds.map(function(e){return e.clone()}),!0)}},{key:"cropsChanged",value:function(){var e=this,r=!1;return this.splatEntries.forEach(function(n,i){var a;n.data.crops.forEach(function(n,a){void 0===e.cropsArray[i][a]?(r=!0,e.cropsArray[i][a]=n.data):Object.entries(n.data).forEach(function(n){var o,s=B(n,2),l=s[0],u=s[1];(Array.isArray(u)&&u.some(function(r,n){return r!==e.cropsArray[i][a][l][n]})||u!==(null==(o=e.cropsArray[i][a])?void 0:o[l]))&&(r=!0,e.cropsArray[i][a][l]=u)})}),n.data.crops.length!==(null==(a=e.cropsArray[i])?void 0:a.length)&&(e.cropsArray[i].length=n.data.crops.length,r=!0)}),r}},{key:"setupSplatMesh",value:function(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new x.Fc,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new x.Ec,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,l=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0;this.splatMesh=ei.buildMesh(e,r,o,s,l,u),this.splatMesh.position.copy(i),this.splatMesh.quaternion.copy(a),this.splatMesh.frustumCulled=!1,this.splatMesh.renderOrder=99999,this.splatRenderCount=r,this.splatMesh.onBeforeRender=function(e,r,i){return n.update(e,i)}}},{key:"setupSortWorker",value:function(e){var r=this;this.sortWorker=function(e){for(var r=new Worker(URL.createObjectURL(new Blob(["(","\nfunction sortWorker(self) {\n let wasmInstance;\n let splatCount;\n let splatRC;\n let indexesOffset;\n let positionsOffset;\n let viewProjOffset;\n let frequenciesOffset;\n let indexesOutOffset;\n let sortBuffersOffset;\n let wasmMemory;\n let positions;\n\n let Constants;\n let floatPositions;\n let meshIndexIntervals;\n let meshMatrixWorlds;\n let cropsArray;\n\n function sort(viewProj) {\n // console.time('WASM SORT');\n const viewProjArray = new Float64Array(wasmMemory, viewProjOffset, 16);\n for (let i = 0; i < 16; i++) {\n viewProjArray[i] = viewProj[i];\n }\n let indexesBuffer;\n // console.timeEnd('WASM SORT');\n if (splatRC > 1) {\n wasmInstance.exports.sortIndexes(\n indexesOffset,\n positionsOffset,\n sortBuffersOffset,\n viewProjOffset,\n frequenciesOffset,\n indexesOutOffset,\n Constants.DepthMapRange,\n splatRC\n );\n const indexes = new Uint32Array(splatRC);\n indexesBuffer = indexes.buffer;\n indexes.set(new Uint32Array(wasmMemory, indexesOutOffset, splatRC));\n } else if (splatRC === 1) {\n const indexes = new Uint32Array(splatRC);\n indexes[0] = new Uint32Array(wasmMemory, indexesOffset, splatCount)[0];\n indexesBuffer = indexes.buffer;\n } else {\n indexesBuffer = new ArrayBuffer(0);\n }\n\n self.postMessage(\n {\n sortDone: true,\n indexesBuffer,\n },\n [indexesBuffer]\n );\n }\n function updateRenderedSplats(\n meshMatrixWorlds,\n cropsArray,\n meshIndexIntervals\n ) {\n const renderedPositions = new Float32Array(\n wasmMemory,\n positionsOffset,\n splatCount * 3\n );\n splatRC = 0;\n const wasmMemoryIndexes = new Uint32Array(\n wasmMemory,\n indexesOffset,\n splatCount\n );\n for (let i = 0; i < meshIndexIntervals.length - 1; i++) {\n const crops = cropsArray[i];\n const matrixWorld = meshMatrixWorlds[i].elements;\n const paramsIn = crops\n .filter((a) => a.enabled && a.mode === 'Include')\n .map((c) =>\n c.type === 'Box'\n ? computeBoundingBoxVertices(c)\n : computeEllipsoidParams(c)\n );\n const paramsOut = crops\n .filter((a) => a.enabled && a.mode === 'Exclude')\n .map((c) =>\n c.type === 'Box'\n ? computeBoundingBoxVertices(c)\n : computeEllipsoidParams(c)\n );\n for (let j = meshIndexIntervals[i]; j < meshIndexIntervals[i + 1]; j++) {\n const x = floatPositions[j * 3];\n const y = floatPositions[j * 3 + 1];\n const z = floatPositions[j * 3 + 2];\n if (\n (paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n (paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n ) {\n const w =\n 1 /\n (matrixWorld[3] * x +\n matrixWorld[7] * y +\n matrixWorld[11] * z +\n matrixWorld[15]);\n renderedPositions[splatRC * 3] =\n (matrixWorld[0] * x +\n matrixWorld[4] * y +\n matrixWorld[8] * z +\n matrixWorld[12]) *\n w;\n renderedPositions[splatRC * 3 + 1] =\n (matrixWorld[1] * x +\n matrixWorld[5] * y +\n matrixWorld[9] * z +\n matrixWorld[13]) *\n w;\n renderedPositions[splatRC * 3 + 2] =\n (matrixWorld[2] * x +\n matrixWorld[6] * y +\n matrixWorld[10] * z +\n matrixWorld[14]) *\n w;\n wasmMemoryIndexes[splatRC] = j;\n splatRC++;\n }\n }\n }\n }\n function getOutOfBoundsIndexes(floatPositions, crops) {\n const outOfBoundsIndexes = [];\n const paramsIn = crops\n .filter((a) => a.enabled && a.mode === 'Include')\n .map((c) =>\n c.type === 'Box'\n ? computeBoundingBoxVertices(c)\n : computeEllipsoidParams(c)\n );\n const paramsOut = crops\n .filter((a) => a.enabled && a.mode === 'Exclude')\n .map((c) =>\n c.type === 'Box'\n ? computeBoundingBoxVertices(c)\n : computeEllipsoidParams(c)\n );\n\n const len = floatPositions.length;\n for (let j = 0; j < len; j += 3) {\n const x = floatPositions[j];\n const y = floatPositions[j + 1];\n const z = floatPositions[j + 2];\n if (\n (paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n (paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n ) {\n // in bounds: intentionally skip\n } else {\n outOfBoundsIndexes.push(j / 3);\n }\n }\n // console.log(outOfBoundsIndexes);\n return outOfBoundsIndexes;\n }\n\n function isInBounds(x, y, z, params, mode) {\n return params[mode === 'Intersect' ? 'every' : 'some']((param) => {\n const t = applyRotationMatrix(\n x,\n y,\n z,\n param.invRotationMatrix,\n param.cropCenter\n );\n return Array.isArray(param)\n ? isVertexInsideBoundingBox(t.x, t.y, t.z, param)\n : isPointInsideEllipsoid(t.x, t.y, t.z, param);\n });\n }\n function applyRotationMatrix(_x, _y, _z, e, pivot) {\n const x = _x - pivot[0];\n const y = _y - pivot[1];\n const z = _z - pivot[2];\n const w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n return {\n x: (e[0] * x + e[4] * y + e[8] * z + e[12]) * w + pivot[0],\n y: (e[1] * x + e[5] * y + e[9] * z + e[13]) * w + pivot[1],\n z: (e[2] * x + e[6] * y + e[10] * z + e[14]) * w + pivot[2],\n };\n }\n function computeBoundingBoxVertices(box) {\n const halfSizeX = box.cropSize[0] / 2;\n const halfSizeY = box.cropSize[1] / 2;\n const halfSizeZ = box.cropSize[2] / 2;\n const bounds = [\n box.cropCenter[0] - halfSizeX,\n box.cropCenter[1] - halfSizeY,\n box.cropCenter[2] - halfSizeZ,\n box.cropCenter[0] + halfSizeX,\n box.cropCenter[1] + halfSizeY,\n box.cropCenter[2] + halfSizeZ,\n ];\n const invRotationMatrix = getInvRotationMatrix(box.cropRotation);\n return Object.assign(bounds, {\n invRotationMatrix,\n cropCenter: box.cropCenter,\n });\n }\n function getInvRotationMatrix(_rotation) {\n const te = [];\n const x = (_rotation[0] * Math.PI) / 180,\n y = (_rotation[1] * Math.PI) / 180,\n z = (_rotation[2] * Math.PI) / 180;\n const a = Math.cos(x),\n b = Math.sin(x);\n const c = Math.cos(y),\n d = Math.sin(y);\n const e = Math.cos(z),\n f = Math.sin(z);\n const ae = a * e,\n af = a * f,\n be = b * e,\n bf = b * f;\n\n te[0] = c * e;\n te[1] = -c * f;\n te[2] = d;\n\n te[4] = af + be * d;\n te[5] = ae - bf * d;\n te[6] = -b * c;\n\n te[8] = bf - ae * d;\n te[9] = be + af * d;\n te[10] = a * c;\n\n te[12] = 0;\n te[13] = 0;\n te[14] = 0;\n\n te[3] = 0;\n te[7] = 0;\n te[11] = 0;\n te[15] = 1;\n\n return te;\n }\n function isVertexInsideBoundingBox(x, y, z, bounds) {\n return (\n x >= bounds[0] &&\n x <= bounds[3] &&\n y >= bounds[1] &&\n y <= bounds[4] &&\n z >= bounds[2] &&\n z <= bounds[5]\n );\n }\n function computeEllipsoidParams(ellipsoid) {\n // Precompute the scaling factors\n const invRadiusX = 2 / ellipsoid.cropSize[0];\n const invRadiusY = 2 / ellipsoid.cropSize[1];\n const invRadiusZ = 2 / ellipsoid.cropSize[2];\n const invRotationMatrix = getInvRotationMatrix(ellipsoid.cropRotation);\n return {\n invRadiusX,\n invRadiusY,\n invRadiusZ,\n cropCenter: ellipsoid.cropCenter,\n invRotationMatrix,\n };\n }\n function isPointInsideEllipsoid(x, y, z, ellipsoidParams) {\n const _x = (x - ellipsoidParams.cropCenter[0]) * ellipsoidParams.invRadiusX;\n const _y = (y - ellipsoidParams.cropCenter[1]) * ellipsoidParams.invRadiusY;\n const _z = (z - ellipsoidParams.cropCenter[2]) * ellipsoidParams.invRadiusZ;\n return _x * _x + _y * _y + _z * _z <= 1;\n }\n\n self.onmessage = (e) => {\n if (e.data.getCroppedIndexes) {\n const outOfBoundsIndexes = new Uint32Array(\n getOutOfBoundsIndexes(new Float32Array(e.data.positions), e.data.crops)\n ).buffer;\n self.postMessage(\n {\n outOfBoundsIndexes,\n },\n [outOfBoundsIndexes]\n );\n } else if (e.data.positions) {\n positions = e.data.positions;\n floatPositions = new Float32Array(positions);\n meshMatrixWorlds = e.data.meshMatrixWorlds;\n cropsArray = e.data.cropsArray;\n meshIndexIntervals = e.data.meshIndexIntervals;\n updateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n self.postMessage({\n sortSetupComplete: true,\n });\n } else if (e.data.sort || e.data.newMatrixWorlds || e.data.newCropsArray) {\n if (e.data.newMatrixWorlds || e.data.newCropsArray) {\n cropsArray = e.data.newCropsArray || cropsArray;\n meshMatrixWorlds = e.data.newMatrixWorlds || meshMatrixWorlds;\n updateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n }\n sort(e.data.sort.view, e.data.sort.cameraPosition);\n } else if (e.data.init) {\n // Yep, this is super hacky and gross :(\n Constants = e.data.init.Constants;\n\n splatCount = e.data.init.splatCount;\n\n const INDEXES_BYTES_PER_ENTRY = Constants.BytesPerInt;\n const POSITIONS_BYTES_PER_ENTRY = Constants.BytesPerFloat * 3;\n\n const sorterWasmBytes = new Uint8Array(e.data.init.sorterWasmBytes);\n const memoryBytesPerVertex =\n INDEXES_BYTES_PER_ENTRY + POSITIONS_BYTES_PER_ENTRY;\n const memoryRequiredForVertices = splatCount * memoryBytesPerVertex;\n const memoryRequiredForSortBuffers =\n splatCount * Constants.BytesPerInt * 2 +\n Constants.DepthMapRange * Constants.BytesPerInt * 2;\n const extraMemory = Constants.MemoryPageSize * 32;\n const totalRequiredMemory =\n memoryRequiredForVertices + memoryRequiredForSortBuffers + extraMemory;\n const totalPagesRequired =\n Math.floor(totalRequiredMemory / Constants.MemoryPageSize) + 1;\n const sorterWasmImport = {\n module: {},\n env: {\n memory: new WebAssembly.Memory({\n initial: totalPagesRequired * 2,\n maximum: totalPagesRequired * 3,\n shared: true,\n }),\n },\n };\n WebAssembly.compile(sorterWasmBytes)\n .then((wasmModule) => {\n return WebAssembly.instantiate(wasmModule, sorterWasmImport);\n })\n .then((instance) => {\n wasmInstance = instance;\n indexesOffset = 0;\n positionsOffset = splatCount * INDEXES_BYTES_PER_ENTRY;\n viewProjOffset =\n positionsOffset + splatCount * POSITIONS_BYTES_PER_ENTRY;\n sortBuffersOffset = viewProjOffset + 16 * Constants.BytesPerFloat * 2;\n frequenciesOffset =\n sortBuffersOffset + splatCount * Constants.BytesPerInt;\n indexesOutOffset =\n frequenciesOffset + Constants.DepthMapRange * Constants.BytesPerInt;\n wasmMemory = sorterWasmImport.env.memory.buffer;\n self.postMessage({\n sortSetupPhase1Complete: true,\n });\n });\n }\n };\n}\n",")(self)"],{type:"application/javascript"}))),n=atob("AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAETA2AAAGAIf39/f39/f38AYAABfwISAQNlbnYGbWVtb3J5AgMAgIAEAwQDAAECBzkDEV9fd2FzbV9jYWxsX2N0b3JzAAALc29ydEluZGV4ZXMAARNlbXNjcmlwdGVuX3Rsc19pbml0AAIK3gMDAwABC9IDAwF/BnwBfgJAIAdFDQAgAysDUCEMIAMrAzAhDSADKwMQIQ5BACEDRP///////+9/IQtEAAAAAAAAEAAhCgNAIAIgA0ECdGoCfyAOIAEgA0EMbGoiCCoCALuiIA0gCCoCBLuioCAMIAgqAgi7oqBEAAAAAAAAsECiIgmZRAAAAAAAAOBBYwRAIAmqDAELQYCAgIB4CzYCACAJIAsgCSALYxshCyAJIAogCSAKZBshCiADQQFqIgMgB0cNAAsgB0UNACAGuCAKIAuhoyEJQQAhAwNAAn8gCSACIANBAnRqIgEoAgC3IAuhoiIKmUQAAAAAAADgQWMEQCAKqgwBC0GAgICAeAshCCABIAg2AgAgBCAIQQJ0aiIBIAEoAgBBAWo2AgAgA0EBaiIDIAdHDQALCyAGQQJPBEAgBCgCACEIQQEhAwNAIAQgA0ECdGoiASABKAIAIAhqIgg2AgAgA0EBaiIDIAZHDQALCyAHQQFrIgGtIQ8DQCAEIAIgD6dBAnQiA2ooAgBBAnRqIgcgBygCAEEBayIHNgIAIAUgASAHa0ECdGogACADaigCADYCACAPUCEDIA9CAX0hDyADRQ0ACyAGBEAgBEEAIAZBAnT8CwALCwQAQQAL"),i=new Uint8Array(n.length),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return r.postMessage({init:{sorterWasmBytes:i.buffer,splatCount:e,Constants:{BytesPerFloat:eO.BytesPerFloat,BytesPerInt:eO.BytesPerInt,DepthMapRange:eO.DepthMapRange,MemoryPageSize:eO.MemoryPageSize}}}),r}(e),this.sortWorker.onmessage=function(e){var n;e.data.sortDone?(r.sortRunning=!1,null==(n=r.splatMesh)||n.updateIndexes(new Uint32Array(e.data.indexesBuffer)),r.lastSortTime=e.data.sortTime,r.queuedMessage&&(r.sortWorker.postMessage(r.queuedMessage),r.queuedMessage=null)):e.data.sortCanceled?r.sortRunning=!1:e.data.sortSetupPhase1Complete?r.sortWorker.postMessage({positions:r.splatMesh.getCenters().buffer,meshMatrixWorlds:r.splatMesh.meshMatrixWorlds,meshIndexIntervals:r.splatMesh.meshIndexIntervals,cropsArray:r.cropsArray}):e.data.sortSetupComplete&&(r.splatDataTextures=r.splatMesh.getSplatDataTextures(),r.scene.activePage.add(r.splatMesh),r.needsInitialRender=!0)}}},{key:"update",value:function(e,r){null!==this.splatMesh&&(this.updateSplatMeshUniforms(e,r),this.updateView(!1,r))}},{key:"getSplatMesh",value:function(){return this.splatMesh}}]),e}(),e_=new x.kd;e_.wireframe=!0;var eP=new x.Fc,eE=function(e){function r(e,n){var i;return O(this,r),(i=A(this,r)).data=e,i.sharedAssets=n,i.enableHelpers=!1,i.wireframeState=!1,i.needsTransmissionDirty=!0,i.needsNormalDirty=!0,i.needsReflectionDirty=!0,i._needsTransmission=!1,i._needsNormal=!1,i._normalPassNeeds={outline:!1,cavity:!1},i._needsReflection=!1,i.geometryCacheChanged=!1,i.splatViewer=null,i.shapeBlendIntances=[],i.hairInstances=[],i.shadowsDirty=!0,i.instanceGroupsDirty=!0,i._autoInstancing=null,i.entityByUuid={},i.entityIdentityToEntity={},i.toExpandCloner=new Set,i.toUpdateCloner=new Set,i.pendingCommands=[],i.pathConstraints=new eA,i.invisibleObjects=new a.a("jflkdsafjasdifjaslk",I(T({},w.wa.defaultData),{visible:!1,name:"buildin invisible"})),i.needsRecomputeInstances=!1,i.init(e,n),i.matrixAutoUpdate=!1,i.errorPage=new o.h("fdasfa",I(T({},w.Ca.defaultData),{name:""}),{shared:n,scene:i}),i}return D(r,e),_(r,[{key:"markGeometryCacheDirty",value:function(){this.geometryCacheChanged=!0}},{key:"markShadowsDirty",value:function(){this.shadowsDirty=!0}},{key:"markInstanceGroupsDirty",value:function(){this.instanceGroupsDirty=!0}},{key:"autoInstancing",get:function(){return this._autoInstancing}},{key:"updateInstanceGroups",value:function(e,r){var n=this._autoInstancing;(null===n||n.minGroupSize!==r)&&(null==n||n.dispose(),n=new K(r),this._autoInstancing=n);var i=this.instanceGroupsDirty;return this.instanceGroupsDirty=!1,n.update(e,i),n.stats}},{key:"releaseInstanceGroups",value:function(){var e;null==(e=this._autoInstancing)||e.teardown(),this.instanceGroupsDirty=!0}},{key:"markNeedsUpdateRendererDirty",value:function(){this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this.needsReflectionDirty=!0,this.shadowsDirty=!0,this.instanceGroupsDirty=!0}},{key:"needsTransmission",value:function(){return this.needsTransmissionDirty&&(this._needsTransmission=(0,o.e)(this),this.needsTransmissionDirty=!1),this._needsTransmission}},{key:"needsNormal",value:function(){return this.needsNormalDirty&&(this._normalPassNeeds=(0,o.d)(this),this._needsNormal=this._normalPassNeeds.outline||this._normalPassNeeds.cavity,this.needsNormalDirty=!1),this._needsNormal}},{key:"normalPassNeeds",value:function(){return this.needsNormal(),this._normalPassNeeds}},{key:"needsReflection",value:function(){return this.needsReflectionDirty&&(this._needsReflection=(0,o.f)(this),this.needsReflectionDirty=!1),this._needsReflection}},{key:"registerInstanceAndSetUuid",value:function(e){var r=e.identity.join("-"),n=this.entityIdentityToEntity[r];n&&(e.uuid=n.uuid),this.entityIdentityToEntity[r]=e,this.entityByUuid[e.uuid]=e}},{key:"markPenumbraSizeDirty",value:function(){var e=!0,r=!1,n=void 0;try{for(var i,a=this.children[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var s=i.value;j(s,o.h)&&(s.penumbraSizeArrayCache=null)}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"findInstance",value:function(e){return this.entityIdentityToEntity[e.join("-")]}},{key:"bgColor",get:function(){return this.activePage.bgColor}},{key:"postprocessing",get:function(){return this.activePage.data.postprocessing}},{key:"getWithSortKey",value:function(e){var r=this.find(e);if(void 0!==r){for(var n=[],i=r;i!==this;){var a=i,o=(i=i.parent).children.indexOf(a);n.splice(0,0,o)}return{entity:r,sortKey:n}}}},{key:"getAllSorted",value:function(e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value,u=this.getWithSortKey(l.id);void 0!==u&&r.push(u)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r.sort(function(e,r){return(0,w.b)(e.sortKey,r.sortKey)}),r.map(function(e){return e.entity})}},{key:"nonExistOrDescendantOf",value:function(e,r){var n=this.find(e);if(void 0===n)return!0;for(;n;){if(n.uuid===r)return!0;n=n.parent}return!1}},{key:"find",value:function(e){if(this.activePage&&this.activePage.personalCamera.parent&&("f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera"===e||e===w.w))return this.activePage.personalCamera;if(""!==e&&void 0!==e){var r=this.entityByUuid[e];return void 0===r?this.getObjectByProperty("uuid",e):r}}},{key:"find2D",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,s=this.children[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(j(l,o.h)&&l.uiScene){var u=l.uiScene.find(e);if(u)return u}}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}}},{key:"findScene2DfromObject2D",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,s=this.children[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(j(l,o.h)&&l.uiScene&&l.uiScene.find(e))return l.uiScene}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}}},{key:"find2DInUIObjects",value:function(e){var r;return this.traverseEntity(function(n){void 0===r&&(0,g.f)(n)&&(r=n.uiCanvas.find(e))}),r}},{key:"traverse2D",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,s=this.children[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;j(l,o.h)&&l.uiScene&&l.uiScene.traverse(e)}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}}},{key:"debugEnsureEntity",value:function(e){var r=this.find(e);r?Array.isArray(r.identity)&&void 0===this.findInstance(r.identity)&&console.error("not found instance"):console.error("not found")}},{key:"addPendingExpandCloner",value:function(e){this.toExpandCloner.add(e)}},{key:"addPendingUpdateCloner",value:function(e){this.toUpdateCloner.add(e)}},{key:"markToExpandCloner",value:function(e){var r=this;this.toExpandCloner.add(e),e.traverseEntityAncestors(function(e){r.toExpandCloner.add(e)})}},{key:"doPendingExpandCloner",value:function(e){this.toExpandCloner.forEach(function(r){r.expandCloner(e)}),this.toExpandCloner.clear()}},{key:"doPendingUpdateCloner",value:function(e){this.toUpdateCloner.forEach(function(r){var n;null==(n=r.cloner)||n.update(e)}),this.toUpdateCloner.clear()}},{key:"doPendingUpdates",value:function(e){this.doPendingExpandCloner(e),this.doPendingUpdateCloner(e),this.applyPendingCommands()}},{key:"addPendingCommand",value:function(e){this.pendingCommands.push(e)}},{key:"applyPendingCommands",value:function(){this.pendingCommands.forEach(function(e){return e()}),this.pendingCommands.length=0}},{key:"updateByLibOp",value:function(e,r){1===e.path.length&&"components"===e.path[0]&&1===e.type&&this.createChildrenObjects([I(T({},e.data.asset),{id:e.id})],this.invisibleObjects,r)}},{key:"updateTreeByOp",value:function(e,r){var n=this;if(0===e.path.length&&7===e.type){var i=null===e.parent?this:this.find(e.parent);if(void 0===i)throw Error("scene tree add: parent ".concat(e.parent," not found for object ").concat(e.id));var a=this.createObject(e.id,e.data,e.children,i,e.localIndex,r);a.updateVisible(this),a.resetBBoxNeedsUpdate(),(0,l.e)(a)&&(0,l.f)(a.parent)&&(a.invalidateUpstreamBooleanData(),a.parent.invalidateDownstreamBooleanData().recomputeBoolean()),this.markNeedsRecomputeInstancesForAncessors(i),this.markNeedsRecomputeInstancesForChildren(a),this.markToExpandCloner(a),this.markPenumbraSizeDirty(),a.updatePathSnapping()}else if(0===e.path.length&&8===e.type){var o=this.find(e.id);if(void 0===o)throw Error("scene tree delete: object ".concat(e.id," not found"));o.traverseEntity(function(e){(0,g.c)(e)&&(n.shapeBlendIntances=n.shapeBlendIntances.filter(function(r){return r!==e})),(0,g.b)(e)&&(n.hairInstances=n.hairInstances.filter(function(r){return r!==e}))}),this.markToExpandCloner(o),o.resetBBoxNeedsUpdate(),this.unregisterObject(o);var s=o.parent;this.markNeedsRecomputeInstancesForAncessors(s),this.markNeedsRecomputeInstancesForChildren(o),this.markPenumbraSizeDirty(),o.parent.remove(o),(0,l.f)(o.parent)&&(o.parent.invalidateUpstreamBooleanData(),o.parent.invalidateDownstreamBooleanData().recomputeBoolean()),(0,l.e)(o)&&(o.freeBooleanPointer(),j(s,l.b)&&s.invalidateDownstreamBooleanData().recomputeBoolean()),(0,g.d)(o)&&o.detachShape(),this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(o),this.pathConstraints.removeDependencies(o.uuid),o.updatePathSnapping()}else if(0===e.path.length&&9===e.type){var u,c=this.find(e.id);if(void 0===c)throw Error("scene tree move: object ".concat(e.id," not found"));this.markNeedsRecomputeInstancesForChildren(c);var h=c.parent;this.markNeedsRecomputeInstancesForAncessors(h),null==(u=c.cloner)||u.resetOnMove(),this.markToExpandCloner(c);var d=null===e.parent?this:this.find(e.parent);if(void 0===d)throw Error("scene tree move: new parent ".concat(e.parent," not found for object ").concat(e.id));d.add(c),this.markNeedsRecomputeInstancesForAncessors(d),this.markToExpandCloner(c),c.invalidateClonerTransform(c),c.updateVisible(this),c.resetBBoxNeedsUpdate(),this.markPenumbraSizeDirty();var f=e.localIndex;d.children.splice(f,0,d.children.pop()),(0,l.e)(c)&&(c.invalidateUpstreamBooleanData(),(0,l.f)(c.parent)?c.parent.invalidateDownstreamBooleanData().recomputeBoolean():j(h,l.b)&&h.invalidateDownstreamBooleanData().recomputeBoolean()),c.updatePathSnapping()}this.markNeedsUpdateRendererDirty(),this.markGeometryCacheDirty()}},{key:"playPage",get:function(){var e;return null!=(e=this.find(this.data.publish.playPage))?e:this.errorPage}},{key:"updatePage",value:function(e){this.shadowsDirty=!0,this.activePage&&this.activePage.onDeactive(),this.activePage=this.errorPage;var r=!0,n=!1,i=void 0;try{for(var a,s,l=this.children[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=s.value;j(u,o.h)&&(u.visible=u.uuid===e,u.visible&&(this.activePage=u,this.activePage.onActive(this)))}}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}this.activePage!==(null==(a=this.splatViewer)?void 0:a.activePage)&&this.reloadSplats()}},{key:"updateEntityByOp",value:function(e,r,n,i){if(this.shadowsDirty=!0,0===r.type){if(("overrides"in r.props||"component"in r.props)&&this.markNeedsRecomputeInstances(),"visible"in r.props&&this.markPenumbraSizeDirty(),r.path.includes("overrides")&&"states"in r.props){var a,o=r.props.rest;r=I(T({},r),{props:o}),this.markNeedsRecomputeInstances()}"pathSnapping"===r.path[0]&&void 0!==r.props.pathId&&this.pathConstraints.setConstraint(e,r.props.pathId)}var s=this.find(e);if(s)try{a=r,s.updateByOp(a,n,{scene:this,shared:i},!1),j(s,y.ia)&&s.updateGeometryGroupsIfNeeded()}catch(e){console.error(e)}}},{key:"updateEntity2DByOp",value:function(e,r,n,i,a){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];e.updateEntityByOp(r,n,i,a),this.traverseEntity(function(e){var l;((0,g.f)(e)||j(e,o.h))&&(s.includes(null!=(l=e.frameId)?l:"")||e.frameId===r)&&e.updateEntity2DByOp(r,n,i,a)})}},{key:"activeCamera",get:function(){return this.activePage.activeCamera}},{key:"switchActiveCamera",value:function(e){this.activePage.switchActiveCamera(e)}},{key:"isInvisibleObjects",value:function(e){return e===this.invisibleObjects||e.hasAnccestor(this.invisibleObjects)}},{key:"init",value:function(e,r){var n=Object.entries(r.data.lib.components).map(function(e,r){return{data:e[1].asset.data,children:e[1].asset.children,id:e[0],fi:r}});this.invisibleObjects.updateState(this.invisibleObjects.data,{scene:this,shared:r}),this.add(this.invisibleObjects),this.createChildrenObjects(n,this.invisibleObjects,r),this.createChildrenObjects(e.objects,this,r),this.updatePage(e.publish.playPage),this.activePage.switchToPlayCamera(),this.expandInstances(r,!0),this.traverseEntity(function(e){j(e,c.a)&&e.updateUp()}),this.doPendingExpandCloner({scene:this,shared:r}),this.applyPendingCommands()}},{key:"markNeedsRecomputeInstances",value:function(){this.needsRecomputeInstances=!0}},{key:"markNeedsRecomputeInstancesForChildren",value:function(e){var r=this;e.traverseEntity(function(e){("Component"===e.data.type||"Instance"===e.data.type)&&r.markNeedsRecomputeInstances()})}},{key:"markNeedsRecomputeInstancesForAncessors",value:function(e){var r=this;m.h.is(e)&&("Component"===e.data.type&&this.markNeedsRecomputeInstances(),e.traverseAncestors(function(e){m.h.is(e)&&"Component"===e.data.type&&r.markNeedsRecomputeInstances()}))}},{key:"relativeizeInner",value:function(e,r,n,i,a,o,s){var l=this;if(e){var u=i.find(e);u&&u!==i&&a.forInstancesRec(function(i){i.data=(0,w.m)(i.data,function(a){var u=a.events.data(s.id),c=i.goUp(o);if(c){var h=z((0,w.a)(c.identity)).concat([e]).join("-"),d=l.entityIdentityToEntity[h];if(d){var f=d.uuid;w.n.zoom(u,r)[n]=f}else console.warn("cannot find instance")}}).data})}}},{key:"rewriteActions",value:function(e,r,n,i,a,o){var s=this;e.forEach(function(e){"Transition"===e.data.type||"Animation"===e.data.type&&e.data.object?s.relativeizeInner(e.data.object,z(r).concat([e.id]),"object",n,i,a,o):"Conditional"===e.data.type&&(s.rewriteActions(e.data.ifActions,z(r).concat([e.id,"ifActions"]),n,i,a,o),s.rewriteActions(e.data.elseActions,z(r).concat([e.id,"elseActions"]),n,i,a,o))})}},{key:"rewriteEventsBeforeGoToPlayMode",value:function(){var e=this;this.traverseEntity(function(r){if((0,g.j)(r)&&"string"==typeof r.identity&&"Component"===r.data.type)return r.traverseEntity(function(n,i){n.data.events.forEach(function(a){if("GameControl"===a.data.type){var o=!1,s=!0,l=!1,u=void 0;if(n.forInstancesRec(function(e){e.data=(0,w.m)(e.data,function(r){e.isInstanceRoot||(r.events.delete(a.id),o=!0)}).data}),!1===o)try{for(var c,h=w.Ma.list[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=c.value;e.rewriteActions(a.data.gameActions[d],["gameActions",d],r,n,i,a)}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}else"Conditional"===a.data.type?("Distance"===a.data.condition.type?(e.relativeizeInner(a.data.condition.fromObject,["condition"],"fromObject",r,n,i,a),e.relativeizeInner(a.data.condition.toObject,["condition"],"toObject",r,n,i,a)):"State"===a.data.condition.type?e.relativeizeInner(a.data.condition.object,["condition"],"object",r,n,i,a):"Comparison"===a.data.condition.type&&("Property"===a.data.condition.lOperand.type&&e.relativeizeInner(a.data.condition.lOperand.value[0],["condition","lOperand","value"],0,r,n,i,a),"Property"===a.data.condition.rOperand.type&&e.relativeizeInner(a.data.condition.rOperand.value[0],["condition","rOperand","value"],0,r,n,i,a)),e.rewriteActions(a.data.inActions,["inActions"],r,n,i,a),e.rewriteActions(a.data.outActions,["outActions"],r,n,i,a)):"actions"in a.data&&e.rewriteActions(a.data.actions,["actions"],r,n,i,a)})}),!0})}},{key:"expandInstances",value:function(e,r,n){var i=this,a=new Set;this.traverseEntity(function(o){if((0,g.j)(o)&&o.isInstanceRoot)return o.expandInstanceChildren({scene:i,shared:e,pendingDeletes:a}),r||o.resetBBoxNeedsUpdate(),n&&o.traverseEntity(function(e){n.addClip(e)}),!0});var o=!0,s=!1,l=void 0;try{for(var c,h=a[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=c.value;this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(d),(0,u.a)(d)}}catch(e){s=!0,l=e}finally{try{o||null==h.return||h.return()}finally{if(s)throw l}}}},{key:"recomputeInstances",value:function(e,r){this.needsRecomputeInstances&&(this.needsRecomputeInstances=!1,this.traverseEntity(function(e){(0,g.j)(e)&&e.isInstanceRoot&&(e.component=void 0)}),this.expandInstances(e,!1,r))}},{key:"disposeAndUnregisterEntityRecursivelyIfNotReregistered",value:function(e){var r=this;e.traverseEntity(function(e){var n="string"==typeof e.identity?e.identity:e.identity.join("-");r.entityIdentityToEntity[n]===e&&(delete r.entityByUuid[e.uuid],delete r.entityIdentityToEntity[n]),e.dispose()})}},{key:"clearScene",value:function(){null==(i=this._autoInstancing)||i.dispose(),this._autoInstancing=null,this.instanceGroupsDirty=!0;var e=!0,r=!1,n=void 0;try{for(var i,a,o=this.children[Symbol.iterator]();!(e=(a=o.next()).done);e=!0){var s=a.value;m.h.is(s)&&s.disposeRecursively()}}catch(e){r=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(r)throw n}}this.children.length=0}},{key:"resetAfterClear",value:function(e,r){this.init(e,r)}},{key:"raycast",value:function(e){return this.raycast1(e,!1)}},{key:"raycast1",value:function(e,r){var n=this,i=[],a=function(s){var u=!0,c=!1,h=void 0;try{for(var d,f=s.children[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){var p=d.value,v=p.cloner;if(m.h.is(p)&&!p.raycastLock&&(p.visible||(null==v?void 0:v.object.data.visible)))if(!0===r&&p.isInstanceRoot){var y=[];if(e.intersectObject(p,!0,y),y.length){var g=y[0];g.object=p,g.point.applyMatrix4(g.object.matrixWorld);var b=p.matrixWorld.clone().invert();g.point.applyMatrix4(b),i.push(g)}}else((0,l.e)(p)||(0,l.g)(p)&&n.enableHelpers&&p.objectHelper.visible)&&(e.intersectObject(p,!1,i),(0,o.g)(p,e,i)),a(p)}}catch(e){c=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw h}}};return a(this.activePage),i}},{key:"raycastWithClones",value:function(e){var r=this,n=[],i=function(a){var s=!0,u=!1,c=void 0;try{for(var h,d=a.children[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var f=h.value,p=f.cloner;m.h.is(f)&&(f.visible||(null==p?void 0:p.object.data.visible))&&(((0,l.e)(f)||(0,l.g)(f)&&r.enableHelpers&&f.objectHelper.visible)&&(e.intersectObject(f,!1,n),(0,o.g)(f,e,n,!0)),i(f))}}catch(e){u=!0,c=e}finally{try{s||null==d.return||d.return()}finally{if(u)throw c}}};return i(this),n}},{key:"forEachEntity",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;m.h.is(s)&&e(s)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"traverseConcreteEntity",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;m.h.is(s)&&s.isConcreteEntity&&s.traverseEntity(e)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"traverseEntity",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;m.h.is(s)&&s.traverseEntity(e)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"updateFont",value:function(e,r){this.traverseEntity(function(n){if(j(n,y.ia)&&"Mesh"===n.data.type&&("TextGeometry"===n.data.geometry.type||"InputGeometry"===n.data.geometry.type)&&n.data.geometry.font===e){var i=n.geometry,a=n.data.geometry;i.updateFont(e,r).then(function(){i.update(a,r);var e=n.invalidateDownstreamBooleanData();(0,l.f)(e)&&e.recomputeBoolean()})}})}},{key:"traverseObject",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;m.e.is(s)&&s.traverseObject(e)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"traverseVisibleEntity",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;m.h.is(s)&&s.visible&&s.traverseVisibleEntity(e)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"dispose",value:function(){this.clearScene()}},{key:"createChildrenObjects",value:function(e,r,n){var i=0,a=!0,o=!1,s=void 0;try{for(var l,u=e[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;this.createObject(c.id,c.data,c.children,r,i,n),i+=1}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}}},{key:"registerObjectCreatedInLegacy",value:function(e){this.entityByUuid[e.uuid]=e}},{key:"unregisterObject",value:function(e){delete this.entityByUuid[e.uuid];var r=!0,n=!1,i=void 0;try{for(var a,o=e.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.unregisterObject(s)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"createObject",value:function(e,r,n,i,a,o){var s,l=this,u={scene:this,shared:o},c=ek(e,r,u);return(0,g.c)(c)&&this.shapeBlendIntances.push(c),(0,g.b)(c)&&this.hairInstances.push(c),c&&(this.entityByUuid[e]=c,i.add(c),i.children.splice(a,0,i.children.pop()),n.length>0&&(c.isInstanceRoot?console.error("instance should not have children!"):this.createChildrenObjects(n,c,o)),c.updateState(r,u),j(c,y.ia)&&c.updateGeometryGroupsIfNeeded(),c.updateVisible(this),c.cloner&&this.toExpandCloner.add(c),(null==(s=r.pathSnapping)?void 0:s.pathId)&&this.pathConstraints.setConstraint(e,r.pathSnapping.pathId)),"Empty"===r.type&&r.animations&&c.traverseEntity(function(e){var r=e.dataPatched;if(j(e,y.ia)&&r.bones&&r.boneInverses){var n=r.bones.map(function(e){return l.find(e)}),i=r.boneInverses.map(function(e){return(new x.Oc).fromArray(e)}),a=new x.od(n,i);e.bind(a,e.bindMatrix)}else e.matrixAutoUpdate=!0}),c}},{key:"getCenter",value:function(e){for(var r=[],n=0,i=e.length;n<i;++n){var a=e[n],o=a.id,s=a.recursive,l=this.find(o),u=s?l.recursiveBBox:l.singleBBox;r.push.apply(r,z(u.vertices))}var c=new x.Xc;return c.setFromPoints(r),c.getCenter(eP),eP}},{key:"copyMatrixWorld",value:function(e,r){if(null===e)return void r.identity();var n=this.find(e);n?(n.updateWorldMatrix(!0,!1),r.copy(n.matrixWorld)):r.identity()}},{key:"copyParentMatrixWorld",value:function(e,r){if(null===e)return void r.identity();var n,i=null==(n=this.find(e))?void 0:n.parent;i?(i.updateWorldMatrix(!0,!1),r.copy(i.matrixWorld)):r.identity()}},{key:"traverseMaterial",value:function(e){this.traverseEntity(function(r){if(j(r,m.v))if(Array.isArray(r.material))for(var n=0;n<r.material.length;n++)(0,y.h)(r.material[n])&&e(r.material[n]);else(0,y.h)(r.material)&&e(r.material)})}},{key:"updateViewPlaneSize",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.traverseConcreteEntity(function(i){j(i,c.a)&&i.setViewplaneSize(e,r,n)})}},{key:"initializeSplatViewer",value:function(){this.splatViewer=new eC({scene:this}),this.reloadSplats()}},{key:"reloadSplats",value:function(){var e;null==(e=this.splatViewer)||e.loadSplat()}}]),r}(x.Vc)},8562(e,r,n){n.d(r,{a:()=>o,b:()=>s,c:()=>l});var i=Math.fround;function a(e){return Math.round(1e9*e)}function o(e,r){var n,o;return i(i(o=Math.trunc((n=a(e)-a(r))/1e9))+i(i(n-1e9*o)/i(1e9)))}function s(e,r){return(a(e)+a(r))/1e9}function l(e,r,n){return a(e)-a(r)<a(n)}},9423(e,r,n){n.d(r,{a:()=>v});var i=n(7295),a=n(909),o=n(843),s=n(5222),l=n(3486),u=n(3940);function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function h(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function d(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function f(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return c(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p=new(n(3027)).Fc;function v(e,r){var n,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],c=function(n){var i=n.data;delete n.states,n.currentState=null,n.reversibleToState=null,n.currentTransitionEvent=null;var a=!0,o=!1,s=void 0;try{for(var u,c=i.states[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var h=u.value,f=d({},h.data);n.states||(n.states={}),n.states[h.id]=l.c.patch(i,f)}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}m(e.scene,n,null,r,void 0!==i.events.find(function(e){return"Follow"===e.data.type||"LookAt"===e.data.type})),y(e)};e.scene.traverse2D(c),e.traverseChildren(function(n){if(i&&(null==(b=n.rigidBody)||b.setTranslation(n.position0,!0),null==(w=n.rigidBody)||w.setRotation(n.rotation0,!0),null==(x=n.rigidBody)||x.setLinvel(p,!0),null==(S=n.rigidBody)||S.setAngvel(p,!0)),o.h.is(n)){var l=n.uuid,h=n.data;if(delete n.states,n.uuid!==u.w){var f=!1;a.some(function(r){var n;return null==(n=e.scene.find(l))?void 0:n.isDescendantOf(r)})?f=!0:!0===(null==(k=h.physics)?void 0:k.fusedBody)&&"dynamic"===h.physics.rigidBody&&a.push(l),n.data=h,n.currentState=null,n.reversibleToState=null,n.currentTransitionEvent=null,n.transitionState={settled:!0,state:null};var v=!0,y=!1,g=void 0;try{for(var b,w,x,S,k,M,A,O=h.states[Symbol.iterator]();!(v=(A=O.next()).done);v=!0){var C=A.value,_=d({},C.data);!0===e.data.globalPhysics.usePhysics&&h.physics&&("dynamic"===h.physics.rigidBody||f)&&(void 0!==C.data.position&&delete _.position,void 0!==C.data.rotation&&delete _.rotation,void 0!==C.data.hiddenMatrix&&delete _.hiddenMatrix),n.states||(n.states={}),n.states[C.id]=u.Da.patch(h,_)}}catch(e){y=!0,g=e}finally{try{v||null==O.return||O.return()}finally{if(y)throw g}}m(e.scene,n,null,r,void 0!==h.events.find(function(e){return"Follow"===e.data.type||"LookAt"===e.data.type})),(0,s.f)(n)&&n.frame&&(n.frame.traverse(function(e){return c(e)}),null==(M=n.uiCanvas)||M.applySize())}}}),y(e),e.frame&&(e.frame.traverse(function(e){return c(e)}),null==(n=e.uiCanvas)||n.applySize())}function y(e){e.traverseEntity(function(r){var n=!0,i=!1,a=void 0;try{for(var o,s=r.data.events[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value,u=[];switch(l.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":u.push.apply(u,f(l.data.actions));break;case"GameControl":var c=!0,h=!1,d=void 0;try{for(var p,v=Object.values(l.data.gameActions)[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value;u.push.apply(u,f(y))}}catch(e){h=!0,d=e}finally{try{c||null==v.return||v.return()}finally{if(h)throw d}}break;case"DragDrop":u.push.apply(u,f(l.data.dragDropActions.drag).concat(f(l.data.dragDropActions.drop)));break;case"Conditional":u.push.apply(u,f(l.data.inActions).concat(f(l.data.outActions)))}var m=!0,g=!1,b=void 0;try{for(var w,x=u[Symbol.iterator]();!(m=(w=x.next()).done);m=!0){var S=w.value;if("Create"===S.data.type&&"Yes"===S.data.hideBase){var k=e.scene.find(S.data.object);k&&(k.visible=!1)}}}catch(e){g=!0,b=e}finally{try{m||null==x.return||x.return()}finally{if(g)throw b}}}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}})}function m(e,r,n,o){var l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e.markShadowsDirty(),h(r,a.ia)&&!(0,s.c)(r)&&r.removeInteractionGeometry(o),(0,s.e)(r)?r.changeSelectedState(n,{shared:o},l):r.changeSelectedState(n,{scene:e,shared:o},l),h(r,a.ia)&&r.updateGeometryGroupsIfNeeded(),h(r,i.a)&&r.updateCameraState(r.dataPatched,{scene:e,shared:o}),!(0,s.e)(r)){if(r.cloner){var u=!1,c=!0,d=!1,f=void 0;try{for(var p,v=r.cloner.children[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value;y.playModeVisible=void 0,void 0!==y.transformOverride&&(y.transformOverride=void 0,u=!0)}}catch(e){d=!0,f=e}finally{try{c||null==v.return||v.return()}finally{if(d)throw f}}u&&e.addPendingUpdateCloner(r),r.cloner.syncInstanceMatrices()}r.updateVisible()}}},5028(e,r,n){n.d(r,{a:()=>u,b:()=>s,c:()=>l,d:()=>f});var i=n(8562),a=n(4691),o=null;function s(e){o=e}function l(){return o}function u(e){var r=null==e?void 0:e.tracks.filter(function(e){return"vector"===e.ValueTypeName||"quaternion"===e.ValueTypeName}).map(function(e){return e.times.length});if(null==r?void 0:r.length){var n=(0,a.g)(r);return n&&n>2?n:2}return 2}var c=Math.fround;function h(e){return"pingpong"===e||"pingpong-rewind"===e}function d(e,r){return r?"start"===e?"end":"end"===e?"start":e:e}var f=function(){var e;function r(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof r))throw TypeError("Cannot call a class as a function");this.hooks=i,this.isPlaying=!1,this.playingIndex=0,this.seekIndex=-1,this.currentRepeat=0,this.isReversed=!1,this.startTime=0,this.isToggledForward=!1,this.hasPlayedOnce=!1,this.isFirstTweenAfterStart=!1,this.hasClaimed=!1,this.isUnwinding=!1,this.config=e,this.tweens=n,this.delay=c(e.delay/1e3)}return e=[{key:"currentTween",get:function(){return this.tweens[this.playingIndex]}},{key:"claimTime",get:function(){return this.claimedAt}},{key:"play",value:function(e){if(0!==this.tweens.length&&(!this.isPlaying||"Toggle"===this.config.runMode)&&(!this.hasPlayedOnce||"Once"!==this.config.runMode)){var r,n,i,a,o=this.isPlaying;this.isPlaying=!0,this.hasPlayedOnce=!0,this.isUnwinding=!1,this.currentRepeat=this.passRepeat,this.startTime=e,this.seekIndex=-1,!1===(null==(r=(n=this.hooks).isOwner)?void 0:r.call(n))&&(this.isToggledForward=!1,o||this.isReversed||null==(i=(a=this.hooks).assignCurrentState)||i.call(a)),this.hasClaimed=!1,this.claimedAt=void 0,"Toggle"===this.config.runMode?(this.toggleDirection(),o?this.openPass():this.startChain()):this.startChain()}}},{key:"stop",value:function(){var e;null==(e=this.currentTween)||e.stop(),this.isPlaying=!1,this.isReversed=!1,this.hasClaimed=!1,this.claimedAt=void 0,this.isUnwinding=!1}},{key:"unwindFromHere",value:function(){var e;this.isUnwinding=!0,this.currentRepeat=0,null==(e=this.currentTween)||e.endAfterCurrentPass()}},{key:"passRepeat",get:function(){return this.isUnwinding?0:this.config.repeat}},{key:"playDirected",value:function(e,r){if(0!==this.tweens.length){var n,i,a,o,s=this.isPlaying;s&&this.isForward===r?r||this.unwindFromHere():(this.isPlaying=!0,this.hasPlayedOnce=!0,this.isUnwinding=!r,this.currentRepeat=this.passRepeat,this.startTime=e,this.seekIndex=-1,this.isToggledForward=r,this.isReversed=!r,!1!==(null==(n=(i=this.hooks).isOwner)?void 0:n.call(i))||s||this.isReversed||null==(a=(o=this.hooks).assignCurrentState)||a.call(o),this.hasClaimed=!1,this.claimedAt=void 0,s?this.openPass():this.startChain())}}},{key:"isAnimating",get:function(){return this.isPlaying&&this.hasClaimed}},{key:"isForward",get:function(){return!this.isReversed}},{key:"seek",value:function(e){if(0!==this.tweens.length){null==(r=(n=this.hooks).claim)||r.call(n);for(var r,n,i=this.tweens.reduce(function(e,r){return e+r.duration},0)*e,a=this.tweens.length-1,o=1,s=0,l=0;l<this.tweens.length;l++){var u=this.tweens[l];if(s+u.duration>i){a=l,o=(i-s)/u.duration;break}s+=u.duration}for(-1===this.seekIndex&&(this.seekIndex=0);this.seekIndex<a;)this.tweens[this.seekIndex].seek(1),this.seekIndex+=1,this.tweens[this.seekIndex].rearm();for(;this.seekIndex>a;)this.tweens[this.seekIndex].seek(0),this.seekIndex-=1;this.tweens[a].seek(o)}}},{key:"update",value:function(e){if(this.isPlaying){if(this.claimWhenDue(e)){if(!1===(null==(a=(o=this.hooks).isOwner)?void 0:a.call(o)))return void this.stop();this.currentTween.rearm()}if(this.hasClaimed&&!1===(null==(r=(n=this.hooks).isOwner)?void 0:r.call(n)))return void this.stop();var r,n,a,o,s=d(this.config.delayDirection,this.isReversed);if(!(0,i.c)(e,this.startTime,this.leadingDelay)&&(this.currentTween.update(e),this.isPlaying)&&!this.currentTween.isPlaying){if(this.isFirstTweenAfterStart=!1,this.isReversed?this.playingIndex>0:this.playingIndex<this.tweens.length-1)return void this.advanceToNextTween();var l=0;if("end"===s||"start-end"===s){if((0,i.c)(e,this.currentTween.endTime,this.delay))return;l=this.delay}0!==this.currentRepeat?(this.currentRepeat>0&&(this.currentRepeat-=1),h(this.config.direction)&&("Toggle"===this.config.runMode?this.toggleDirection():this.isReversed=!this.isReversed),this.startTime=(0,i.b)(this.currentTween.endTime,l),this.playingIndex=this.isReversed?this.tweens.length-1:0,"normal"===this.config.direction&&this.currentTween.seek(+!!this.currentTween.isReversed),this.openPass()):this.stop()}}}},{key:"advanceToNextTween",value:function(){var e=this.currentTween;e.isPingpong&&e.config.repeat%2==1&&e.seek(+!e.isReversed);var r=e.endTime,n=this.isReversed;this.playingIndex+=n?-1:1;var i=this.currentTween;n&&i.isPingpong&&i.config.repeat%2==1&&i.seek(1),this.resume(r)}},{key:"startChain",value:function(){this.playingIndex=this.isReversed?this.tweens.length-1:0,this.isFirstTweenAfterStart=!0,this.openPass()}},{key:"openPass",value:function(){if(this.claimWhenDue(this.startTime)&&!1===(null==(e=(r=this.hooks).isOwner)?void 0:e.call(r)))return void this.stop();var e,r,n=this.tweens[0];this.hasClaimed&&!this.isReversed&&n&&0===n.duration&&(n.seek(1),!this.isPlaying)||this.resume((0,i.b)(this.startTime,this.leadingDelay))}},{key:"claimWhenDue",value:function(e){var r,n;return!this.hasClaimed&&!(0,i.c)(e,this.startTime,this.leadingDelay)&&(this.hasClaimed=!0,this.claimedAt=(0,i.b)(this.startTime,this.leadingDelay),null==(r=(n=this.hooks).claim)||r.call(n,this.claimedAt),!0)}},{key:"leadingDelay",get:function(){var e=d(this.config.delayDirection,this.isReversed);return"start-once"===e?this.isFirstTweenAfterStart?this.delay:0:"start"!==e&&"start-end"!==e||this.isReversed||0!==this.playingIndex||h(this.config.direction)&&!this.isFirstTweenAfterStart?0:this.delay}},{key:"resume",value:function(e){var r=this.currentTween;this.isReversed&&"pingpong-rewind"===this.config.direction&&(r.overrideDirection="pingpong-rewind"),r.isReversed=!(!this.isReversed||"normal"!==r.repeatDirection&&r.config.repeat%2==1),r.start(e),this.isUnwinding&&r.endAfterCurrentPass()}},{key:"toggleDirection",value:function(){this.isToggledForward=!this.isToggledForward,this.isReversed=!this.isToggledForward}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(r.prototype,e),r}()},3940(e,r,n){n.d(r,{A:()=>t9,Aa:()=>ii,B:()=>re,Ba:()=>ia,C:()=>rr,Ca:()=>io,D:()=>ri,Da:()=>il,E:()=>ro,Ea:()=>iv,Fa:()=>ig,G:()=>rk,Ga:()=>iw,H:()=>rA,Ha:()=>iA,I:()=>rI,Ia:()=>iO,J:()=>tK,Ja:()=>iD,K:()=>tQ,Ka:()=>iP,L:()=>nM,La:()=>ae,M:()=>nW,Ma:()=>ak,N:()=>nH,Na:()=>aM,O:()=>nq,Oa:()=>aW,P:()=>nY,Pa:()=>aH,Q:()=>nX,Qa:()=>aq,R:()=>nZ,Ra:()=>aY,S:()=>rE,Sa:()=>aX,Ta:()=>a5,U:()=>rG,Ua:()=>a4,V:()=>rq,a:()=>q,b:()=>Y,c:()=>X,ca:()=>no,d:()=>$,da:()=>r5,e:()=>es,ea:()=>r8,f:()=>eu,fa:()=>nf,g:()=>ec,ga:()=>np,h:()=>eb,ha:()=>nh,i:()=>ev,ia:()=>nd,j:()=>ey,ja:()=>ny,k:()=>em,ka:()=>nx,l:()=>eq,la:()=>nS,m:()=>eY,ma:()=>nm,n:()=>eN,na:()=>nb,o:()=>t0,oa:()=>nO,p:()=>ar,pa:()=>nE,q:()=>aA,qa:()=>nK,r:()=>ai,ra:()=>nT,s:()=>ac,sa:()=>nI,t:()=>ah,ta:()=>nL,u:()=>am,ua:()=>iE,v:()=>ag,va:()=>n5,w:()=>ru,wa:()=>n4,x:()=>rh,xa:()=>ie,ya:()=>it,z:()=>t8,za:()=>ir});var i,a,o,s,l,u,c,h,d,f,p,v,y,m,g,b,w=n(3027),x=n(2784);function S(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function k(e){if(Array.isArray(e))return e}function M(e,r,n){return r=E(r),function(e,r){if(r&&("object"===N(r)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,H()?Reflect.construct(r,n||[],E(e).constructor):r.apply(e,n))}function A(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function O(e,r,n){return(O=H()?Reflect.construct:function(e,r,n){var i=[null];i.push.apply(i,r);var a=new(Function.bind.apply(e,i));return n&&L(a,n.prototype),a}).apply(null,arguments)}function C(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _(e,r,n){return r&&C(e.prototype,r),n&&C(e,n),e}function P(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&L(e,r)}function j(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function T(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function I(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function R(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){P(e,r,n[r])})}return e}function B(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function z(e,r){if(null==e)return{};var n,i,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}if(o=function(e,r){if(null==e)return{};var n,i,a={},o=Object.getOwnPropertyNames(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,r),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}function L(e,r){return(L=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function F(e,r){return k(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||G(e,r)||I()}function U(e){return k(e)||T(e)||G(e)||I()}function V(e){return function(e){if(Array.isArray(e))return S(e)}(e)||T(e)||G(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function G(e,r){if(e){if("string"==typeof e)return S(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,r)}}function W(e){var r="function"==typeof Map?new Map:void 0;return(W=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return O(e,arguments,E(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),L(n,e)})(e)}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(H=function(){return!!e})()}function q(e){return Array.isArray(e)?e:[e]}function Y(e,r){for(var n=0;n<e.length&&n<r.length;){if(e[n]<r[n])return -1;if(e[n]>r[n])return 1;n+=1}return n!==r.length?-1:+(n!==e.length)}function X(e,r){return Object.setPrototypeOf(e,r),e}function Z(e){var r=R({},e);return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),r}function K(e,r,n){if(void 0===e?void 0===r?(e=0,r=10):e=r-10:void 0===r&&(r=e+10),e>r){var i=e;e=r,r=i}for(var a=[],o=1/(n+1),s=0;s<n;s++){var l=e+(r-e)*(s+.75+.5*Math.random())*o;a.push(l)}return a}function J(e){return j(e,Uint8Array)||j(e,Uint16Array)||j(e,Uint32Array)||j(e,Int8Array)||j(e,Int16Array)||j(e,Int32Array)||j(e,Float32Array)||j(e,Float64Array)}function Q(e){if(void 0!==e.deepFreeze)return void e.deepFreeze(e);var r=Object.getOwnPropertyNames(e),n=!0,i=!1,a=void 0;try{for(var o,s=r[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=e[o.value];l&&"object"==(void 0===l?"undefined":N(l))&&Q(l)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return Object.freeze(e)}function $(e){var r=!0,n=!1,i=void 0;try{for(var a,o=Object.keys(e)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;void 0===e[s]&&delete e[s]}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return e}var ee,et,er=function e(){A(this,e)},en=function(e){function r(e){var n;return A(this,r),(n=M(this,r)).id=e,n}return D(r,e),r}(er),ei=function(e){function r(e){var n;return A(this,r),(n=M(this,r)).data=e,n}return D(r,e),r}(er),ea=function(){function e(){A(this,e)}return _(e,[{key:"modifyById",value:function(e,r){if(void 0===this[e])throw Error("not expected");var n=B(R({},this),P({},e,r));return Object.setPrototypeOf(n,ea.prototype),n}},{key:"add",value:function(e,r){var n,i;return null!=(n=null==(i=this.runOp({type:1,id:e,data:r}))?void 0:i.data)?n:this}},{key:"runOp",value:function(e){if(1===e.type){var r,n=this[e.id];r=void 0===n?{type:2,id:e.id}:{type:1,id:e.id,data:n};var i=e.id,a=e.data,o=B(R({},this),P({},i,a));return Object.setPrototypeOf(o,ea.prototype),{data:o,actual:e,reverse:r}}if(2===e.type){var s=e.id,l=this[s];if(void 0===l)return null;var u=R({},this);return Object.setPrototypeOf(u,ea.prototype),delete u[s],{data:u,actual:e,reverse:{type:1,id:s,data:l}}}return null}}]),e}(),eo=function(e){function r(){return A(this,r),M(this,r,arguments)}return D(r,e),r}(W(Error)),es=function(e){function r(){for(var e,n=arguments.length,i=Array(n),a=0;a<n;a++)i[a]=arguments[a];return A(this,r),e=M(this,r,V(i)),(0,x.c)(e,"partialObjectCaches"),(0,x.c)(e,"objCaches"),(0,x.c)(e,"parentCaches"),Object.setPrototypeOf(e,es.prototype),e}return D(r,e),_(r,[{key:"deepFreeze",value:function(){for(var e=0;e<this.length;)Q(this[e]),e++}},{key:"fillCaches0",value:function(e,r){this.objCaches.set(e.id,e),this.parentCaches.set(e.id,r);var n=!0,i=!1,a=void 0;try{for(var o,s=e.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;this.fillCaches0(l,e.id)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"fillCaches",value:function(){if(void 0===this.objCaches){this.objCaches=new Map,this.parentCaches=new Map;var e=!0,r=!1,n=void 0;try{for(var i,a=this[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;this.fillCaches0(o,null)}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}}},{key:"randomId",value:function(){this.fillCaches();var e=Array.from(this.objCaches.keys());if(0!==e.length)return e[Math.max(0,Math.floor(Math.random()*e.length)-1)]}},{key:"nonExistOrDescendantOf",value:function(e,r){if(!this.has(e))return!0;for(;e;){var n=this.parent(e);if(n===r)return!0;e=n}return!1}},{key:"rootAcestor",value:function(e){for(;e;){var r=this.parent(e);if(!r)break;e=r}return e}},{key:"isDescendantOf",value:function(e,r){for(;e;){var n=this.parent(e);if(n===r)return!0;e=n}return!1}},{key:"data",value:function(e){var r;return null==(r=this.get(e))?void 0:r.data}},{key:"has",value:function(e){return void 0!==this.childrenOf(e)}},{key:"partialCache",value:function(e){void 0===this.partialObjectCaches&&(this.partialObjectCaches=new Map);var r=this.get(e);void 0!==r&&this.partialObjectCaches.set(e,r)}},{key:"get",value:function(e){if(void 0!==this.partialObjectCaches){var r=this.partialObjectCaches.get(e);if(void 0!==r)return r}return this.fillCaches(),this.objCaches.get(e)}},{key:"childrenOf",value:function(e){var r;return null===e?this:null==(r=this.get(e))?void 0:r.children}},{key:"traverseFrom",value:function(e,r){if(null===e)this.traverse(r);else{var n=this.get(e);n&&function e(r,n){var i=!0,a=!1,o=void 0;if(!0!==n(r.id,r.data))try{for(var s,l=r.children[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;e(u,n)}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}(n,r)}}},{key:"traverse",value:function(e){!function e(r,n){var i=!0,a=!1,o=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;!0!==n(u.id,u.data)&&e(u.children,n)}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}(this,e)}},{key:"totalSize",value:function(){return this.fillCaches(),this.objCaches.size}},{key:"parent",value:function(e){return this.fillCaches(),this.parentCaches.get(e)}},{key:"childrenArray",value:function(e){return null===e?this:this.get(e).children}},{key:"modifyById",value:function(e,r){if(void 0===this.get(e))throw Error("not expected");var n=this.parent(e),i=this.childrenArray(n),a=i.findIndex(function(r){return r.id===e});if(a<0)throw Error("not expected");var o=i[a];(i=V(i))[a]=B(R({},o),{data:r});var s=new Map;return s.set(e,i[a]),this.modifyArrayBy(n,i,s)}},{key:"modifyArrayBy",value:function(e,r){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=e,a=r;null!==i;)c=this,function(){var e=a,r=i;if(void 0===(i=c.parent(i)))throw Error();var o=(a=c.childrenArray(i)).findIndex(function(e){return e.id===r});if(o<0)throw Error();(a=V(a))[o]=B(R({},a[o]),{children:e}),n&&n.set(r,a[o])}();Object.setPrototypeOf(a,es.prototype);var o=a;if(n&&void 0!==this.objCaches&&void 0!==this.parentCaches){o.objCaches=this.objCaches;var s=!0,l=!1,u=void 0;try{for(var c,h,d=n[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var f=F(h.value,2),p=f[0],v=f[1];o.objCaches.set(p,v)}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}o.parentCaches=this.parentCaches,this.objCaches=void 0,this.parentCaches=void 0}else o.fillCaches();return o}},{key:"runOp",value:function(e){switch(e.type){case 7:return this.addOp(e);case 8:return this.deleteOp(e);case 9:return this.moveOp(e)}return null}},{key:"checkDuplicatedIdRec",value:function(e){var r=e.id,n=e.children;if(void 0!==this.get(r))return!0;var i=!0,a=!1,o=void 0;try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if(this.checkDuplicatedIdRec(u))return!0}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return!1}},{key:"addOp",value:function(e){var r=e.parent,n=e.fi,i=e.id,a=e.data,o=e.children;if(null!==r&&void 0===this.get(r)||this.checkDuplicatedIdRec(e))return null;var s=this.childrenArray(r),l={fi:n,id:i,data:a,children:o};return(s=V(s).concat([l])).sort(function(e,r){return e.fi-r.fi}),e.localIndex=s.indexOf(l),{data:this.modifyArrayBy(r,s),actual:e,reverse:{type:8,id:i}}}},{key:"deleteOp",value:function(e){var r=e.id;if(null===this.get(r))return null;var n=this.parent(r);if(void 0===n)return null;var i=this.childrenArray(n),a=i.findIndex(function(e){return e.id===r});e.localIndex=a;var o=(i=V(i)).splice(a,1)[0];return{data:this.modifyArrayBy(n,i),actual:e,reverse:B(R({type:7},o),{parent:n})}}},{key:"moveOp",value:function(e){var r=e.parent,n=e.fi,i=e.id;if(null!==r&&void 0===this.get(r))return this.deleteOp({type:8,id:i});if(null!==r)for(var a=r;null!==a;){if(void 0===a)throw Error();if(a===i)throw new eo("cyclic tree");a=this.parent(a)}var o=this.parent(i);if(void 0===o)return null;var s=o,l=this.childrenArray(o),u=l.findIndex(function(e){return e.id===i}),c=(l=V(l)).splice(u,1)[0],h=this.modifyArrayBy(o,l);o=r,l=h.childrenArray(o);var d=c.fi;return c=B(R({},c),{fi:n}),(l=V(l).concat([c])).sort(function(e,r){return e.fi-r.fi}),e.localIndex=l.indexOf(c),{data:h=h.modifyArrayBy(o,l),actual:e,reverse:{type:9,parent:s,fi:d,id:i}}}},{key:"previous",value:function(e,r){if(null===r){var n=this.childrenArray(e);return 0===n.length?null:n[n.length-1].id}var i=null,a=!0,o=!1,s=void 0;try{for(var l,u=this.childrenArray(e)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;if(c.id===r)return i;i=c.id}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return null}},{key:"traverseSortNext",value:function(e){var r=this.parent(e);if(void 0!==r){var n=this.childrenArray(r),i=n.findIndex(function(r){return r.id===e})+1;if(i<n.length)return n[i].id;if(r)return this.traverseSortNext(r)}}},{key:"sortNext",value:function(e){var r=this.childrenArray(e);return r.length>0?r[0].id:this.traverseSortNext(e)}},{key:"traverseSortPrevious",value:function(e){var r=this.childrenArray(e);return r.length>0?this.traverseSortPrevious(r[r.length-1].id):e}},{key:"sortPrevious",value:function(e){var r=this.parent(e);if(void 0!==r){var n=this.childrenArray(r),i=n.findIndex(function(r){return r.id===e})-1;return i>=0?this.traverseSortPrevious(n[i].id):r}}},{key:"getAllSorted",value:function(e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value,u=this.getWithSortKey(l.id);void 0!==u&&r.push(R({},l,u))}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}r.sort(function(e,r){return Y(e.sortKey,r.sortKey)});var c=!0,h=!1,d=void 0;try{for(var f,p=r[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;delete v.sortKey}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"getAllIdSorted",value:function(e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value,u=this.getWithSortKey(l);void 0!==u&&r.push(u)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}r.sort(function(e,r){return Y(e.sortKey,r.sortKey)});var c=!0,h=!1,d=void 0;try{for(var f,p=r[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;delete v.sortKey}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}return r.map(function(e){return e.id})}},{key:"getWithSortKey",value:function(e){var r=e,n=[],i=this.get(r),a=i;if(void 0!==i){for(;r;)n.splice(0,0,i.fi),null!==(r=this.parent(r))&&(i=this.get(r));return B(R({},a),{sortKey:n})}}},{key:"insertBeforeHelper",value:function(e,r,n){return this.insertAfterHelper(e,this.previous(e,r),n)}},{key:"insertAfterHelper",value:function(e,r,n){var i=this.childrenArray(e);if(null===r){if(0===i.length)return K(0,n,n);var a=i[0].fi;return K(a-n,a,n)}var o=this.get(r);if(void 0===o||this.parent(r)!==e)throw Error("illegal args");var s=i.find(function(e){return e.fi>o.fi});if(void 0===s){var l=i[i.length-1].fi;return K(l,l+n,n)}return K(o.fi,s.fi,n)}}]),r}(W(Array)),el=null;(et=ee||(ee={})).setPreservePrototype=function(e){el=e},et.tryPreservePrototype=function(e,r){return Object.getPrototypeOf(e)===el&&Object.setPrototypeOf(r,el),r},et.runOp=function(e,r){if(0!==r.type)return null;if(Array.isArray(e)||J(e)){var n=r.props,i={},a=J(e)?e.slice():V(e),o=!1,s=!0,l=!1,u=void 0;if(n)try{for(var c,h=Object.keys(n)[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=c.value,f=parseInt(d);if(isNaN(f))throw Error("wrong index");i[d]=a[f],a[f]=n[d],o=!0}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}return o?{data:a,actual:r,reverse:{type:0,props:i}}:null}var p=r.props,v={},y=R({},e),m=!1,g=!0,b=!1,w=void 0;if(p)try{for(var x,S=Object.keys(p)[Symbol.iterator]();!(g=(x=S.next()).done);g=!0){var k=x.value;v[k]=y[k];var M=p[k];void 0===M?delete y[k]:y[k]=M,m=!0}}catch(e){b=!0,w=e}finally{try{g||null==S.return||S.return()}finally{if(b)throw w}}return m?{data:et.tryPreservePrototype(e,y),actual:r,reverse:{type:0,props:v}}:null};var eu=function(e){function r(){for(var e,n=arguments.length,i=Array(n),a=0;a<n;a++)i[a]=arguments[a];return A(this,r),e=M(this,r,V(i)),(0,x.c)(e,"objCaches"),Object.setPrototypeOf(e,eu.prototype),e}return D(r,e),_(r,[{key:"deepFreeze",value:function(){for(var e=0;e<this.length;)Q(this[e]),e++}},{key:"fillCaches0",value:function(e){this.objCaches.set(e.id,e)}},{key:"fillCaches",value:function(){if(void 0===this.objCaches){this.objCaches=new Map,Object.getOwnPropertyDescriptor(this,"objCaches").enumerable=!1;var e=!0,r=!1,n=void 0;try{for(var i,a=this[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;this.fillCaches0(o)}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}}},{key:"randomId",value:function(){this.fillCaches();var e=Array.from(this.objCaches.keys());if(0!==e.length)return e[Math.max(0,Math.floor(Math.random()*e.length)-1)]}},{key:"data",value:function(e){var r;return null==(r=this.get(e))?void 0:r.data}},{key:"get",value:function(e){return this.fillCaches(),this.objCaches.get(e)}},{key:"modifyById",value:function(e,r){if(void 0===this.get(e))throw Error("not expected");var n=this,i=n.findIndex(function(r){return r.id===e});if(i<0)throw Error("not expected");var a=n[i];return(n=V(n))[i]=B(R({},a),{data:r}),this.modifyArrayBy(n)}},{key:"modifyArrayBy",value:function(e){return Object.setPrototypeOf(e,eu.prototype),("u"<typeof process?"undefined":N(process))<"u"||e.fillCaches(),e}},{key:"runOp",value:function(e){switch(e.type){case 4:return this.addOp(e);case 5:return this.deleteOp(e);case 6:return this.moveOp(e)}return null}},{key:"addOp",value:function(e){var r=e.fi,n=e.id,i=e.data,a=this,o={fi:r,id:n,data:i};return(a=V(a).concat([o])).sort(function(e,r){return e.fi-r.fi}),e.localIndex=a.indexOf(o),{data:this.modifyArrayBy(a),actual:e,reverse:{type:5,id:n}}}},{key:"deleteOp",value:function(e){var r=e.id,n=this,i=n.findIndex(function(e){return e.id===r});if(-1===i)return null;e.localIndex=i;var a=(n=V(n)).splice(i,1)[0];return{data:this.modifyArrayBy(n),actual:e,reverse:R({type:4},a)}}},{key:"moveOp",value:function(e){var r=e.fi,n=e.id,i=this,a=(i=V(i)).findIndex(function(e){return e.id===n});if(-1===a)return null;var o=i[a].fi,s=B(R({},i[a]),{fi:r});return i[a]=s,i.sort(function(e,r){return e.fi-r.fi}),e.localIndex=i.indexOf(s),{data:this.modifyArrayBy(i),actual:e,reverse:{type:6,fi:o,id:n}}}},{key:"previous",value:function(e){if(null===e)return 0===this.length?null:this[this.length-1].id;var r=null,n=!0,i=!1,a=void 0;try{for(var o,s=this[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;if(l.id===e)return r;r=l.id}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return null}},{key:"insertBeforeHelper",value:function(e,r){return this.insertAfterHelper(this.previous(e),r)}},{key:"insertAfterHelper",value:function(e,r){if(null===e){if(0===this.length)return K(0,r,r);var n=this[0].fi;return K(n-r,n,r)}var i=this.get(e);if(void 0===i)throw Error("illegal args");var a=this.find(function(e){return e.fi>i.fi});if(void 0===a){var o=this[this.length-1].fi;return K(o,o+r,r)}return K(i.fi,a.fi,r)}}]),r}(W(Array));function ec(e,r){var n;return null!=(n=ef(e,r,null))?n:e}function eh(e,r){return null===e?null:(e.cur[e.len]=r,e.len+=1,e)}function ed(e){e&&(e.len-=1)}function ef(e,r,n){if(j(e,es)){var i=function e(r,n,i){var a=!1,o=r.map(function(r){var o=r.id,s=n[o];if(void 0!==s&&"string"==typeof s&&(a=!0,o=s,null!==i))throw Error("not supported");var l=ef(r.data,n,eh(i,o));ed(i),a=a||void 0!==l,void 0===l&&(l=r.data);var u=e(r.children,n,i);return void 0!==u?a=!0:u=r.children,B(R({},r),{id:o,data:l,children:u})});if(a)return o}(e,r,n);return void 0!==i&&Object.setPrototypeOf(i,Object.getPrototypeOf(e)),i}if(j(e,eu)){var a=!1,o=e.map(function(e){var i=e.id,o=r[i];if(void 0!==o&&"string"==typeof o&&(a=!0,i=o,null!==n))throw Error("not supported");var s=ef(e.data,r,eh(n,i));return ed(n),a=a||void 0!==s,void 0===s&&(s=e.data),B(R({},e),{id:i,data:s})});return a?(Object.setPrototypeOf(o,Object.getPrototypeOf(e)),o):void 0}if(Array.isArray(e)){var s=!1,l=e.map(function(e,i){var a=ef(e,r,eh(n,i));return ed(n),s=s||void 0!==a,void 0===a&&(a=e),a});return s?(Object.setPrototypeOf(l,Object.getPrototypeOf(e)),l):void 0}if(e&&"object"==(void 0===e?"undefined":N(e))&&!J(e)){var u={},c=!1,h=!0,d=!1,f=void 0;try{for(var p,v=Object.entries(e)[Symbol.iterator]();!(h=(p=v.next()).done);h=!0){var y=F(p.value,2),m=y[0],g=y[1];if("name"!==m&&"variableId"!==m){var b=r[m];if("string"==typeof b){if(null!==n)throw Error("not supported");c=!0,m=b}var w=ef(g,r,eh(n,m));ed(n),c=c||void 0!==w,void 0===w&&(w=g),u[m]=w}else u[m]=g}}catch(e){d=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(d)throw f}}return c?(Object.setPrototypeOf(u,Object.getPrototypeOf(e)),u):void 0}if("string"==typeof e){var x=r[e];return void 0!==x&&(null===n||n.result.push(n.cur.slice(0,n.len))),x}}function ep(e){return e&&"object"==(void 0===e?"undefined":N(e))&&j(e,eb)}var ev,ey,em,eg,eb=function(){function e(){A(this,e)}return _(e,[{key:"unusedFunOverridesTable",value:function(e){}},{key:"runOp",value:function(e){for(var r=[],n=this,i=0,a={};i<e.path.length;){if(r.push(n),void 0!==(n=void 0===n?void 0:n[e.path[i]])&&!ep(n))return null;i+=1}n=n?Z(n):new eb;var o=!0,s=!1,l=void 0;try{for(var u,c=Object.entries(e.props)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var h=F(u.value,2),d=h[0],f=h[1],p=n[d];a[d]=p,void 0===f?delete n[d]:n[d]=f}}catch(e){s=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}for(;i>0;){if(0===Object.keys(n).length){var v=r[i-1];v&&(n=Z(v),delete n[e.path[i-1]])}else{var y=r[i-1];if(y){var m=Z(y);m[e.path[i-1]]=n,n=m}else{var g=new eb;g[e.path[i-1]]=n,n=g}}i-=1}return{data:Object.setPrototypeOf(n,eb.prototype),actual:e,reverse:B(R({},e),{props:a})}}}]),e}();function ew(e,r){if(void 0!==r){var n=!1,i=e.map(function(e){var i=e.id,a=ex(e.data,r[i]);if(n=n||void 0!==a,void 0===a&&(a=e.data),e.children){var o=ew(e.children,r);return void 0!==o?n=!0:o=e.children,B(R({},e),{id:i,data:a,children:o})}return B(R({},e),{id:i,data:a})});return n?i:void 0}}function ex(e,r){if(!ep(r))return r;if(j(e,es)){var n=ew(e,r);return void 0!==n&&Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}if(j(e,eu)){if(void 0!==r){var i=!1,a=e.map(function(e){var n=e.id,a=ex(e.data,r[n]);return i=i||void 0!==a,void 0===a&&(a=e.data),B(R({},e),{id:n,data:a})});return i?(Object.setPrototypeOf(a,Object.getPrototypeOf(e)),a):void 0}return}if(Array.isArray(e)){var o=!1,s=e.map(function(e,n){var i=ex(e,r[n]);return o=o||void 0!==i,void 0===i&&(i=e),i});return o?(Object.setPrototypeOf(s,Object.getPrototypeOf(e)),s):void 0}if(j(e,eb))return eS(e,r);if(e&&"object"==(void 0===e?"undefined":N(e))){var l={},u=!1,c=!0,h=!1,d=void 0;try{for(var f,p=Object.entries(e)[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=F(f.value,2),y=v[0],m=v[1],g=ex(m,r[y]);u=u||void 0!==g,void 0===g&&(g=m),l[y]=g}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}return u?(Object.setPrototypeOf(l,Object.getPrototypeOf(e)),l):void 0}}function eS(e,r){if(void 0===e)return r;if(void 0===r)return e;if(!ep(r))return r;if(!ep(e))return ev.apply(e,r);var n=new Set,i=!0,a=!1,o=void 0;try{for(var s,l=Object.keys(e)[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;n.add(u)}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}var c=!0,h=!1,d=void 0;try{for(var f,p=Object.keys(r)[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;n.add(v)}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}var y=new eb,m=!0,g=!1,b=void 0;try{for(var w,x=n[Symbol.iterator]();!(m=(w=x.next()).done);m=!0){var S=w.value,k=eS(void 0===e?void 0:e[S],void 0===r?void 0:r[S]);y[S]=k}}catch(e){g=!0,b=e}finally{try{m||null==x.return||x.return()}finally{if(g)throw b}}return y}(eR=ev||(ev={})).apply=function(e,r){var n;return null!=(n=ex(e,r))?n:e},eR.merge=function(e,r){return eS(e,r)},eR.filterOp=function(e,r){for(var n=0,i=r.path,a=e;n<i.length&&void 0!==a;){if(void 0===(a=eN.zoomOnce(a,i[n])))return r;if(!ep(a))return;n+=1}if(void 0===a)return r;if(ep(a)){if(0===r.type){var o=R({},r.props),s=!0,l=!1,u=void 0;try{for(var c,h=Object.keys(a)[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=c.value;delete o[d]}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}return B(R({},r),{props:o})}if(1===r.type||4===r.type||7===r.type){var f=ew([r],a);return f?f[0]:r}return r}},(ey||(ey={})).replaceProps=function(e,r){var n=eN.zoom(r,e.path);if("object"==(void 0===n?"undefined":N(n))){var i={},a=!0,o=!1,s=void 0;try{for(var l,u=Object.keys(e.props)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;i[c]=n[c]}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return B(R({},e),{props:i})}return B(R({},e),{props:{}})},eB=em||(em={}),ez=function(e,r){for(var n=r.path,i=[];;){var a,o,s=void 0;if(j(e,eb)&&0===r.type&&null===(s=e.runOp(B(R({},r),{path:n.slice(i.length)})))&&(s=void 0),void 0===s&&i.length===n.length&&(s=j(e,es)||j(e,eu)||j(e,ea)?e.runOp(r):ee.runOp(e,r)),void 0!==s){if(null!==s){for(var l=s.data,u=i.length-1;u>=0;u--){var c=n[u],h=i[u];if(j(h,es)){if("number"==typeof c)throw Error("illegal arg");l=h.modifyById(c,l)}else if(j(h,eu)){if("number"==typeof c)throw Error("illegal arg");l=h.modifyById(c,l)}else if(j(h,ea)){if("number"==typeof c)throw Error("illegal arg");l=h.modifyById(c,l)}else if(j(h,eb))l=Object.setPrototypeOf(B(R({},h),P({},c,l)),eb.prototype);else{if("object"!=(void 0===h?"undefined":N(h)))return null;if(Array.isArray(h)||J(h)){if("string"==typeof c&&isNaN(c=parseInt(c)))throw Error("Invalid path");var d=l;(l=J(h)?h.slice():V(h))[c]=d}else l=ee.tryPreservePrototype(h,B(R({},h),P({},c,l)))}}return{data:l,actual:B(R({},s.actual),{path:n}),reverse:B(R({},s.reverse),{path:n})}}return null}var f=void 0,p=n[i.length];if(j(e,es)){if("number"==typeof p)throw Error("");f=null==(a=e.get(p))?void 0:a.data}else if(j(e,eu)){if("number"==typeof p)throw Error("");f=null==(o=e.get(p))?void 0:o.data}else null!==e&&(f=e[p]);if(void 0===f)return null;i.push(e),e=f}},eL=function(e,r){for(var n=0;n<e.length&&n<r.length;n++)if(e[n]!==r[n])return!0;return!1},eF=function(e,r){if(e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0},eB.drop=function(e,r){return B(R({},e),{path:e.path.slice(r)})},eB.applySimple=function(e,r){var n,i;return null!=(n=null==(i=ez(e,r))?void 0:i.data)?n:e},eB.apply=ez,eB.pathDisjoint=eL,eB.pathEq=eF,eB.commutative=function(e,r){return eL(e.path,r.path)},eB.subsumed=function(e,r){return!(0!==e.type||0!==r.type||!eF(e.path,r.path))&&Object.keys(e.props).every(function(e){return void 0!==r.props[e]})},eU=eg||(eg={}),eV=function(e,r){var n=e,i=[],a=[],o=!0,s=!1,l=void 0;try{for(var u,c=r[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var h=function(){var e=u.value;try{if(3===e.type||5===e.type&&"variables"===e.path[e.path.length-1]){var r=void 0,o=void 0,s=void 0;if(3===e.type?(r=eN.zoom(n,V(e.path).concat([e.id])),s=em.apply(n,B(R({},e),{type:2}))):(r=eN.zoom(n,V(e.path).concat([e.id,"value"])),s=em.apply(n,e)),null!==s){n=s.data;var l,c,h,d,f=F((l=n,c=P({},e.id,r),d={cur:[],result:[],len:0},[l=null!=(h=ef(l,c,d))?h:l,d.result]),2),p=f[0],v=f[1];n=p;for(var y=0;y<v.length;y++)!function(s){var l=v[s],u=l.pop();if("number"==typeof u){for(var c=[u],h=s+1;h<v.length;h++){var d=v[h],f=d[d.length-1];if("number"!=typeof f||!eN.equal(l,d.slice(0,d.length-1)))break;c.push(f),v.splice(h,1)}var p=eN.zoom(n,l);o=p.map(function(r,n){return c.includes(n)?e.id:r}),r=p,u=l.pop()}else{if("alphaOverride"===u||"alpha"===u){var y=r/=100,m=eN.zoom(n,l.slice(0,l.length-2)),g=m.layers.map(function(e){return e.id===l[l.length-1]?B(R({},e),{data:B(R({},e.data),P({},u,y))}):e});Object.setPrototypeOf(g,Object.getPrototypeOf(m.layers)),m.layers=g}o=e.id}i.push({type:0,path:l,props:P({},u,r)}),a.push({type:0,path:l,props:P({},u,o)})}(y);a.push(s.reverse),i.push(s.actual)}}else{var m=em.apply(n,e);null!==m&&(i.push(m.actual),n=m.data,a.push(m.reverse))}}catch(e){if(j(e,eo))return{v:null};throw e}}();if("object"===N(h))return h.v}}catch(e){s=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}return{data:n,actual:i,reverse:a.reverse()}},eU.empty=function(){return[]},eU.removePrefix=function(e,r){var n=[],i=!0,a=!1,o=void 0;try{for(var s,l=e[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=U(u.path),h=c[0],d=c.slice(1);h===r&&n.push(B(R({},u),{path:d}))}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return n},eU.addPrefix=function(e,r){return e.map(function(e){return B(R({},e),{path:[r].concat(V(e.path))})})},eU.concat=function(e,r){return V(e).concat(V(r))},eU.compress=function(e,r){return V(e.filter(function(e){return!r.some(function(r){return em.subsumed(e,r)})})).concat(V(r))},eU.commutative=function(e,r){return e.every(function(e){return r.every(function(r){return em.commutative(e,r)})})},eU.applyAll=function(e,r){var n=!0,i=!1,a=void 0;try{for(var o,s=r[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value,u=eV(e,l);null!==u&&(e=u.data)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return e},eU.apply=eV;var ek=Symbol(),eM=Symbol(),eA=Symbol(),eO=function(){function e(){A(this,e)}return _(e,[{key:"reportOp",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=this;if(null!==r){for(i._current=r.data;!j(i,eW);){var a=i._path,o=i._current;if(""!==a&&n.splice(0,0,a),null===(i=i._parent))return;i.update(a,o)}i.push(n,e,r.actual,r.reverse)}}},{key:"deleteChildren",value:function(e){if(this._children){var r=this._children[e];if(r){var n=r[eA];n&&n(),delete this._children[e]}}}}]),e}(),eC=function(e){function r(e,n,i){var a;return A(this,r),(a=M(this,r))._parent=e,a._path=n,a._current=i,a}return D(r,e),_(r,[{key:"update",value:function(e,r){if(Array.isArray(this._current)){if("string"==typeof e&&isNaN(e=parseInt(e)))throw Error("Invalid path");this._current=V(this._current),this._current[e]=r}else this._current=ee.tryPreservePrototype(this._current,B(R({},this._current),P({},e,r)))}},{key:"runOp",value:function(e){this.reportOp(e,ee.runOp(this._current,e),e.path)}}]),r}(eO),e_=function(e){function r(e,n,i){var a;return A(this,r),(a=M(this,r))._parent=e,a._path=n,a._current=i,a}return D(r,e),_(r,[{key:"update",value:function(e,r){this._current=B(R({},this._current),P({},e,r)),Object.setPrototypeOf(this._current,ea.prototype)}},{key:"runOp",value:function(e){this.reportOp(e,this._current.runOp(e))}}]),r}(eO),eP={get:function(e,r){if(r===eA)return function(){e._parent=null};if(r===ek)return e._current;if(r===eM)return e;var n=e._current,i=e._children;if("push"===r&&Array.isArray(n))throw Error("not supported to expand array");var a=void 0===i?void 0:i[r];if(void 0!==a)return a;var o=n[r],s=eH(e,r,o);return s!==o?(void 0===i&&(e._children=i={}),i[r]=s,s):o},has:function(e,r){return r in e._current},ownKeys:function(e){return Reflect.ownKeys(e._current)},defineProperty:function(){throw Error("not supported")},getPrototypeOf:function(e){return Object.getPrototypeOf(e._current)},setPrototypeOf:function(){throw Error("not supported")},getOwnPropertyDescriptor:function(e,r){var n=e._current,i=Reflect.getOwnPropertyDescriptor(n,r);return i&&{writable:!0,configurable:!0,enumerable:i.enumerable,value:n[r]}}},eE=B(R({},eP),{set:function(e,r,n){var i,a={type:0,props:P({},r,null!=(i=eX(n))?i:n)};return e.deleteChildren(r),e.runOp(a),!0},deleteProperty:function(e,r){var n={type:0,props:P({},r,void 0)};return e.deleteChildren(r),e.runOp(n),!0}}),eD=B(R({},eP),{set:function(e,r,n){return void 0===n?this.deleteProperty(e,r):(e.deleteChildren(r),e.runOp({type:1,id:r,data:n})),!0},deleteProperty:function(e,r){return e.runOp({type:2,id:r}),!0}}),ej=function(e){function r(e,n,i){var a;return A(this,r),(a=M(this,r))._children={},a._parent=e,a._path=n,a._current=i,a[eA]=function(){a._parent=null},a}return D(r,e),_(r,[{key:"unproxy",value:function(){return this._current}},{key:"update",value:function(e,r){this._current=this._current.modifyById(e,r)}},{key:"runOp",value:function(e){this.reportOp(e,this._current.runOp(e))}},{key:"randomId",value:function(){return this._current.randomId()}},{key:"isDescendantOf",value:function(e,r){return this._current.isDescendantOf(e,r)}},{key:"childrenOf",value:function(e){return this._current.childrenOf(e)}},{key:"get",value:function(e){return this._current.get(e)}},{key:"parent",value:function(e){return this._current.parent(e)}},{key:"traverse",value:function(e){var r=this;this._current.traverse(function(n,i){e(n,r.data(n))})}},{key:"data",value:function(e){var r,n=this._current,i=this._children,a=void 0===i?void 0:i[e];if(void 0!==a)return a;var o=null==(r=n.get(e))?void 0:r.data,s=eH(this,e,o);return s!==o?(void 0===i&&(i={},this._children=i),i[e]=s,s):o}},{key:"add",value:function(e,r,n,i,a){this.runOp({type:7,parent:e,fi:r,id:n,data:i,children:a})}},{key:"move",value:function(e,r,n){this.runOp({type:9,parent:e,fi:r,id:n})}},{key:"insertAfter",value:function(e,r,n){for(var i=this._current.insertAfterHelper(e,r,n.length),a=0;a<n.length;a++){var o=n[a];this.add(e,i[a],o.id,o.data,o.children)}}},{key:"insertBefore",value:function(e,r,n){for(var i=this._current.insertBeforeHelper(e,r,n.length),a=0;a<n.length;a++){var o=n[a];this.add(e,i[a],o.id,o.data,o.children)}}},{key:"moveAfter",value:function(e,r,n){for(var i=this._current.insertAfterHelper(e,r,n.length),a=0;a<n.length;a++){var o=n[a];this.move(e,i[a],o)}}},{key:"moveBefore",value:function(e,r,n){for(var i=this._current.insertBeforeHelper(e,r,n.length),a=0;a<n.length;a++){var o=n[a];this.move(e,i[a],o)}}},{key:"delete",value:function(e){this.deleteChildren(e),this.runOp({type:8,id:e})}},{key:"sortNext",value:function(e){return this._current.sortNext(e)}},{key:"sortPrevious",value:function(e){return this._current.sortPrevious(e)}},{key:"getAllSorted",value:function(e){return this._current.getAllSorted(e)}}]),r}(eO),eT=function(e){function r(e,n,i){var a;return A(this,r),(a=M(this,r))._children={},a._parent=e,a._path=n,a._current=i,a[eA]=function(){a._parent=null},a}return D(r,e),_(r,[{key:"unproxy",value:function(){return this._current}},{key:"length",get:function(){return this._current.length}},{key:"forEach",value:function(e){for(var r=this.length,n=0;n<r;n++){var i=this._current[n].id,a=this._current[n].fi;e(this.data(this._current[n].id),i,a,n)}}},{key:"find",value:function(e){for(var r=this.length,n=0;n<r;n++){var i=this._current[n].id;if(e(this.data(i),i))return this.get(i)}}},{key:"update",value:function(e,r){this._current=this._current.modifyById(e,r)}},{key:"randomId",value:function(){return this._current.randomId()}},{key:"get",value:function(e){return B(R({},this._current.get(e)),{data:this.data(e)})}},{key:"at",value:function(e){var r=this._current.at(e),n=r.id;return{id:n,fi:r.fi,data:this.data(n)}}},{key:"data",value:function(e){var r,n=this._current,i=this._children,a=void 0===i?void 0:i[e];if(void 0!==a)return a;var o=null==(r=n.get(e))?void 0:r.data,s=eH(this,e,o);return s!==o?(void 0===i&&(i={},this._children=i),i[e]=s,s):o}},{key:"runOp",value:function(e){this.reportOp(e,this._current.runOp(e))}},{key:"add",value:function(e,r,n){this.runOp({type:4,fi:e,id:r,data:n})}},{key:"move",value:function(e,r){this.runOp({type:6,fi:e,id:r})}},{key:"insertAfter",value:function(e,r){for(var n=this._current.insertAfterHelper(e,r.length),i=0;i<r.length;i++){var a=r[i];this.add(n[i],a.id,a.data)}}},{key:"insertBefore",value:function(e,r){for(var n=this._current.insertBeforeHelper(e,r.length),i=0;i<r.length;i++){var a=r[i];this.add(n[i],a.id,a.data)}}},{key:"moveAfter",value:function(e,r){for(var n=this._current.insertAfterHelper(e,r.length),i=0;i<r.length;i++){var a=r[i];this.move(n[i],a)}}},{key:"moveBefore",value:function(e,r){for(var n=this._current.insertBeforeHelper(e,r.length),i=0;i<r.length;i++){var a=r[i];this.move(n[i],a)}}},{key:"delete",value:function(e){this.deleteChildren(e),this.runOp({type:5,id:e})}}]),r}(eO);function eI(e,r,n){if(e.length>0){var i=e[e.length-1];if(0===i.type&&0===r.type&&eN.equal(i.path,n))return void Object.assign(i.props,r.props)}e.push(B(R({},r),{path:n}))}var eR,eB,ez,eL,eF,eU,eV,eN,eG,eW=function(e){function r(e){var n;return A(this,r),(n=M(this,r)).ts=[],n.actual=[],n.reverse=[],n._current=e,n}return D(r,e),_(r,[{key:"update",value:function(e,r){if(""!==e)throw Error("");this._current=r}},{key:"push",value:function(e,r,n,i){eI(this.ts,r,e),eI(this.actual,n,e),eI(this.reverse,i,e)}},{key:"result",value:function(){return{data:this._current,ts:this.ts,actual:this.actual,reverse:this.reverse.reverse()}}}]),r}(eO);function eH(e,r,n){return j(n,es)?new ej(e,r,n):j(n,eu)?new eT(e,r,n):j(n,ea)?new Proxy(new e_(e,r,n),eD):null!==n&&"object"==(void 0===n?"undefined":N(n))?J(n)?n:new Proxy(new eC(e,r,n),eE):n}function eq(e){var r=new eW(e);return[eH(r,"",e),r]}function eY(e,r){var n=F(eq(e),2),i=n[0],a=n[1];return r(i),a.result()}function eX(e){return j(e,ej)||j(e,eT)?e._current:null!==e&&"object"==(void 0===e?"undefined":N(e))?e[ek]:e}eZ=eN||(eN={}),eK=function(e,r){return(j(e,es)||j(e,ej))&&"string"==typeof r||(j(e,eu)||j(e,eT))&&"string"==typeof r?e.data(r):"number"==typeof r&&Array.isArray(e)||"string"==typeof r&&"object"==(void 0===e?"undefined":N(e))&&null!==e?e[r]:void 0},eJ=function(e,r){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<r.length&&void 0!==e;)e=eK(e,r[n]),n+=1;return e},eZ.equal=function(e,r){if(r.length!==e.length)return!1;for(var n=0;n<e.length;){if(e[n]!==r[n])return!1;n+=1}return!0},eZ.removeOverridden=function(e,r,n){var i=eJ(n,e);if(void 0!==i&&"object"==(void 0===i?"undefined":N(i))&&null!==i){var a=R({},r);return Object.keys(i).forEach(function(e){delete a[e]}),a}return r},eZ.zoomOnce=eK,eZ.zoom=eJ,eZ.findPathes=function(e,r){var n=[];return function e(i,a){if(j(i,en)&&i.id===r.id)n.push(a);else if(j(i,eu))for(var o=0;o<i.length;o++)e(i[o].data,V(a).concat([i[o].id]));else if(j(i,es))i.traverse(function(r,n){e(n,V(a).concat([r]))});else if(Array.isArray(i)){if("number"==typeof i[0])return;for(var s=0;s<i.length;s++)e(i[s],V(a).concat([s]))}else{if(J(i))return;if("object"==(void 0===i?"undefined":N(i))&&null!==i)for(var l in i)e(i[l],V(a).concat([l]))}}(e,[]),n};try{eG=new TextDecoder}catch(e){}var eZ,eK,eJ,eQ,e$,e0,e1,e2,e3,e5,e4=0,e6=[],e8=e6,e9=0,e7={},te=0,tt=0,tr=[],tn={useRecords:!1,mapsAsObjects:!0},ti=new function e(){A(this,e)};ti.name="MessagePack 0xC1";var ta=!1,to=2,ts=function(){function e(r){A(this,e),r&&(!1===r.useRecords&&void 0===r.mapsAsObjects&&(r.mapsAsObjects=!0),r.sequential&&!1!==r.trusted&&(r.trusted=!0,!r.structures&&0!=r.useRecords&&(r.structures=[],r.maxSharedStructures||(r.maxSharedStructures=0))),r.structures?r.structures.sharedLength=r.structures.length:r.getStructures&&((r.structures=[]).uninitialized=!0,r.structures.sharedLength=0),r.int64AsNumber&&(r.int64AsType="number")),Object.assign(this,r)}return _(e,[{key:"unpack",value:function(e,r){var n=this;if(eQ)return tB(function(){return tz(),n?n.unpack(e,r):ts.prototype.unpack.call(tn,e,r)});e.buffer||e.constructor!==ArrayBuffer||(e=("u"<typeof Buffer?"undefined":N(Buffer))<"u"?Buffer.from(e):new Uint8Array(e)),"object"==(void 0===r?"undefined":N(r))?(e$=r.end||e.length,e4=r.start||0):(e4=0,e$=r>-1?r:e.length),e9=0,tt=0,e1=null,e8=e6,e2=null,eQ=e;try{e5=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(r){throw eQ=null,j(e,Uint8Array)?r:Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==(void 0===e?"undefined":N(e))?e.constructor.name:void 0===e?"undefined":N(e)))}if(j(this,ts)){if(e7=this,this.structures)return e0=this.structures,tl();(!e0||e0.length>0)&&(e0=[])}else e7=tn,(!e0||e0.length>0)&&(e0=[]);return tl()}},{key:"unpackMultiple",value:function(e,r){var n,i=0;try{ta=!0;var a=e.length,o=this?this.unpack(e,a):tU.unpack(e,a);if(!r){for(n=[o];e4<a;)i=e4,n.push(tl());return n}if(!1===r(o,i,e4))return;for(;e4<a;)if(i=e4,!1===r(tl(),i,e4))return}catch(e){throw e.lastPosition=i,e.values=n,e}finally{ta=!1,tz()}}},{key:"_mergeStructures",value:function(e,r){Object.isFrozen(e=e||[])&&(e=e.map(function(e){return e.slice(0)}));for(var n=0,i=e.length;n<i;n++){var a=e[n];a&&(a.isShared=!0,n>=32&&(a.highByte=n-32>>5))}for(var o in e.sharedLength=e.length,r||[])if(o>=0){var s=e[o],l=r[o];l&&(s&&((e.restoreStructures||(e.restoreStructures=[]))[o]=s),e[o]=l)}return this.structures=e}},{key:"decode",value:function(e,r){return this.unpack(e,r)}}]),e}();function tl(e){try{if(!e7.trusted&&!ta){var r,n,i=e0.sharedLength||0;i<e0.length&&(e0.length=i)}if(e7.randomAccessStructure&&eQ[e4]<64&&eQ[e4],r=tc(),e2&&(e4=e2.postBundlePosition,e2=null),ta&&(e0.restoreStructures=null),e4==e$)e0&&e0.restoreStructures&&tu(),e0=null,eQ=null,e3&&(e3=null);else{if(e4>e$)throw Error("Unexpected end of MessagePack data");if(!ta){try{n=JSON.stringify(r,function(e,r){return"bigint"==(void 0===r?"undefined":N(r))?"".concat(r,"n"):r}).slice(0,100)}catch(e){n="(JSON view not available "+e+")"}throw Error("Data read, but end of buffer not reached "+n)}}return r}catch(e){throw e0&&e0.restoreStructures&&tu(),tz(),(j(e,RangeError)||e.message.startsWith("Unexpected end of buffer")||e4>e$)&&(e.incomplete=!0),e}}function tu(){for(var e in e0.restoreStructures)e0[e]=e0.restoreStructures[e];e0.restoreStructures=null}function tc(){var e,r=eQ[e4++];if(r<160){if(r<128){if(r<64)return r;var n=e0[63&r]||e7.getStructures&&tp()[63&r];return n?(n.read||(n.read=td(n,63&r)),n.read()):r}if(r<144){if(r-=128,e7.mapsAsObjects){for(var i={},a=0;a<r;a++){var o=tP();"__proto__"===o&&(o="__proto_"),i[o]=tc()}return i}for(var s=new Map,l=0;l<r;l++)s.set(tc(),tc());return s}for(var u=Array(r-=144),c=0;c<r;c++)u[c]=tc();return e7.freezeData?Object.freeze(u):u}if(r<192){var h=r-160;if(tt>=e4)return e1.slice(e4-te,(e4+=h)-te);if(0==tt&&e$<140){var d=h<16?tM(h):tk(h);if(null!=d)return d}return tv(h)}switch(r){case 192:return null;case 193:return e2?(e=tc())>0?e2[1].slice(e2.position1,e2.position1+=e):e2[0].slice(e2.position0,e2.position0-=e):ti;case 194:return!1;case 195:return!0;case 196:if(void 0===(e=eQ[e4++]))throw Error("Unexpected end of buffer");return tO(e);case 197:return e=e5.getUint16(e4),e4+=2,tO(e);case 198:return e=e5.getUint32(e4),e4+=4,tO(e);case 199:return tC(eQ[e4++]);case 200:return e=e5.getUint16(e4),e4+=2,tC(e);case 201:return e=e5.getUint32(e4),e4+=4,tC(e);case 202:if(e=e5.getFloat32(e4),e7.useFloat32>2){var f=tL[(127&eQ[e4])<<1|eQ[e4+1]>>7];return e4+=4,(f*e+(e>0?.5:-.5)|0)/f}return e4+=4,e;case 203:return e=e5.getFloat64(e4),e4+=8,e;case 204:return eQ[e4++];case 205:return e=e5.getUint16(e4),e4+=2,e;case 206:return e=e5.getUint32(e4),e4+=4,e;case 207:return"number"===e7.int64AsType?e=0x100000000*e5.getUint32(e4)+e5.getUint32(e4+4):"string"===e7.int64AsType?e=e5.getBigUint64(e4).toString():"auto"===e7.int64AsType?(e=e5.getBigUint64(e4))<=BigInt(2)<<BigInt(52)&&(e=Number(e)):e=e5.getBigUint64(e4),e4+=8,e;case 208:return e5.getInt8(e4++);case 209:return e=e5.getInt16(e4),e4+=2,e;case 210:return e=e5.getInt32(e4),e4+=4,e;case 211:return"number"===e7.int64AsType?e=0x100000000*e5.getInt32(e4)+e5.getUint32(e4+4):"string"===e7.int64AsType?e=e5.getBigInt64(e4).toString():"auto"===e7.int64AsType?(e=e5.getBigInt64(e4))>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e)):e=e5.getBigInt64(e4),e4+=8,e;case 212:if(114==(e=eQ[e4++]))return tD(63&eQ[e4++]);var p=tr[e];if(p)return p.read?(e4++,p.read(tc())):p.noBuffer?(e4++,p()):p(eQ.subarray(e4,++e4));throw Error("Unknown extension "+e);case 213:return 114==(e=eQ[e4])?(e4++,tD(63&eQ[e4++],eQ[e4++])):tC(2);case 214:return tC(4);case 215:return tC(8);case 216:return tC(16);case 217:return e=eQ[e4++],tt>=e4?e1.slice(e4-te,(e4+=e)-te):ty(e);case 218:return e=e5.getUint16(e4),tt>=(e4+=2)?e1.slice(e4-te,(e4+=e)-te):tm(e);case 219:return e=e5.getUint32(e4),tt>=(e4+=4)?e1.slice(e4-te,(e4+=e)-te):tg(e);case 220:return e=e5.getUint16(e4),e4+=2,tw(e);case 221:return e=e5.getUint32(e4),e4+=4,tw(e);case 222:return e=e5.getUint16(e4),e4+=2,tx(e);case 223:return e=e5.getUint32(e4),e4+=4,tx(e);default:if(r>=224)return r-256;if(void 0===r){var v=Error("Unexpected end of MessagePack data");throw v.incomplete=!0,v}throw Error("Unknown MessagePack token "+r)}}var th=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function td(e,r){function n(){if(n.count++>to){var i;try{i=e.read=Function("r","return function(){return "+(e7.freezeData?"Object.freeze":"")+"({"+e.map(function(e){return"__proto__"===e?"__proto_:r()":th.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()"}).join(",")+"})}")(tc)}catch(e){return to=1/0,n()}return e.read0=i,0===e.highByte&&(e.read=tf(r,e.read)),i()}for(var a={},o=0,s=e.length;o<s;o++){var l=e[o];"__proto__"===l&&(l="__proto_"),a[l]=tc()}return e7.freezeData?Object.freeze(a):a}return n.count=0,e.read0=n,0===e.highByte?tf(r,n):n}var tf=function(e,r){return function(){var n=eQ[e4++];if(0===n)return r();var i=e<32?-(e+(n<<5)):e+(n<<5),a=e0[i]||tp()[i];if(!a)throw Error("Record id is not defined for "+i);return a.read||(a.read=td(a,e)),a.read()}};function tp(){var e=tB(function(){return eQ=null,e7.getStructures()});return e0=e7._mergeStructures(e,e0)}var tv=tb,ty=tb,tm=tb,tg=tb;function tb(e){if(e<16&&(r=tM(e)))return r;if(e>64&&eG)return eG.decode(eQ.subarray(e4,e4+=e));var r,n=e4+e,i=[];for(r="";e4<n;){var a=eQ[e4++];if(128&a)if(192==(224&a)){var o=(31&a)<<6|63&eQ[e4++];o<128?i.push(65533):i.push(o)}else if(224==(240&a)){var s=(31&a)<<12|(63&eQ[e4++])<<6|63&eQ[e4++];s<2048||s>=55296&&s<=57343?i.push(65533):i.push(s)}else if(240==(248&a)){var l=(7&a)<<18|(63&eQ[e4++])<<12|(63&eQ[e4++])<<6|63&eQ[e4++];l<65536||l>1114111?i.push(65533):(l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l))}else i.push(65533);else i.push(a);i.length>=4096&&(r+=tS.apply(String,i),i.length=0)}return i.length>0&&(r+=tS.apply(String,i)),r}function tw(e){for(var r=Array(e),n=0;n<e;n++)r[n]=tc();return e7.freezeData?Object.freeze(r):r}function tx(e){if(e7.mapsAsObjects){for(var r={},n=0;n<e;n++){var i=tP();"__proto__"===i&&(i="__proto_"),r[i]=tc()}return r}for(var a=new Map,o=0;o<e;o++)a.set(tc(),tc());return a}var tS=String.fromCharCode;function tk(e){for(var r=e4,n=Array(e),i=0;i<e;i++){var a=eQ[e4++];if((128&a)>0)return void(e4=r);n[i]=a}return tS.apply(String,n)}function tM(e){if(e<4){if(e<2){if(0===e)return"";var r=eQ[e4++];return(128&r)>1?void(e4-=1):tS(r)}var n=eQ[e4++],i=eQ[e4++];if((128&n)>0||(128&i)>0)return void(e4-=2);if(e<3)return tS(n,i);var a=eQ[e4++];return(128&a)>0?void(e4-=3):tS(n,i,a)}var o=eQ[e4++],s=eQ[e4++],l=eQ[e4++],u=eQ[e4++];if((128&o)>0||(128&s)>0||(128&l)>0||(128&u)>0)return void(e4-=4);if(e<6){if(4===e)return tS(o,s,l,u);var c=eQ[e4++];return(128&c)>0?void(e4-=5):tS(o,s,l,u,c)}if(e<8){var h=eQ[e4++],d=eQ[e4++];if((128&h)>0||(128&d)>0)return void(e4-=6);if(e<7)return tS(o,s,l,u,h,d);var f=eQ[e4++];return(128&f)>0?void(e4-=7):tS(o,s,l,u,h,d,f)}var p=eQ[e4++],v=eQ[e4++],y=eQ[e4++],m=eQ[e4++];if((128&p)>0||(128&v)>0||(128&y)>0||(128&m)>0)return void(e4-=8);if(e<10){if(8===e)return tS(o,s,l,u,p,v,y,m);var g=eQ[e4++];return(128&g)>0?void(e4-=9):tS(o,s,l,u,p,v,y,m,g)}if(e<12){var b=eQ[e4++],w=eQ[e4++];if((128&b)>0||(128&w)>0)return void(e4-=10);if(e<11)return tS(o,s,l,u,p,v,y,m,b,w);var x=eQ[e4++];return(128&x)>0?void(e4-=11):tS(o,s,l,u,p,v,y,m,b,w,x)}var S=eQ[e4++],k=eQ[e4++],M=eQ[e4++],A=eQ[e4++];if((128&S)>0||(128&k)>0||(128&M)>0||(128&A)>0)return void(e4-=12);if(e<14){if(12===e)return tS(o,s,l,u,p,v,y,m,S,k,M,A);var O=eQ[e4++];return(128&O)>0?void(e4-=13):tS(o,s,l,u,p,v,y,m,S,k,M,A,O)}var C=eQ[e4++],_=eQ[e4++];if((128&C)>0||(128&_)>0)return void(e4-=14);if(e<15)return tS(o,s,l,u,p,v,y,m,S,k,M,A,C,_);var P=eQ[e4++];return(128&P)>0?void(e4-=15):tS(o,s,l,u,p,v,y,m,S,k,M,A,C,_,P)}function tA(){var e,r=eQ[e4++];if(r<192)e=r-160;else switch(r){case 217:e=eQ[e4++];break;case 218:e=e5.getUint16(e4),e4+=2;break;case 219:e=e5.getUint32(e4),e4+=4;break;default:throw Error("Expected string")}return tb(e)}function tO(e){return e7.copyBuffers?Uint8Array.prototype.slice.call(eQ,e4,e4+=e):eQ.subarray(e4,e4+=e)}function tC(e){var r,n=eQ[e4++];if(tr[n])return tr[n](eQ.subarray(e4,r=e4+=e),function(e){e4=e;try{return tc()}finally{e4=r}});throw Error("Unknown extension type "+n)}var t_=Array(4096);function tP(){var e=eQ[e4++];if(!(e>=160&&e<192))return e4--,tE(tc());if(e-=160,tt>=e4)return e1.slice(e4-te,(e4+=e)-te);if(!(0==tt&&e$<180))return tv(e);var r,n=4095&(e<<5^(e>1?e5.getUint16(e4):e>0?eQ[e4]:0)),i=t_[n],a=e4,o=e4+e-3,s=0;if(i&&i.bytes==e){for(;a<o;){if((r=e5.getUint32(a))!=i[s++]){a=0x70000000;break}a+=4}for(o+=3;a<o;)if((r=eQ[a++])!=i[s++]){a=0x70000000;break}if(a===o)return e4=a,i.string;o-=3,a=e4}for(i=[],t_[n]=i,i.bytes=e;a<o;)r=e5.getUint32(a),i.push(r),a+=4;for(o+=3;a<o;)r=eQ[a++],i.push(r);var l=e<16?tM(e):tk(e);return i.string=null!=l?l:tv(e)}function tE(e){if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e||"bigint"==(void 0===e?"undefined":N(e)))return e.toString();if(null==e)return e+"";if(e7.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(function(e){return["string","number","boolean","bigint"].includes(void 0===e?"undefined":N(e))}))return e.flat().toString();throw Error("Invalid property type for record: "+(void 0===e?"undefined":N(e)))}var tD=function(e,r){var n=tc().map(tE),i=e;void 0!==r&&(e=e<32?-((r<<5)+e):(r<<5)+e,n.highByte=r);var a=e0[e];return a&&(a.isShared||ta)&&((e0.restoreStructures||(e0.restoreStructures=[]))[e]=a),e0[e]=n,n.read=td(n,i),(n.read0||n.read)()};tr[0]=function(){},tr[0].noBuffer=!0,tr[66]=function(e){for(var r=e.byteLength%8||8,n=BigInt(128&e[0]?e[0]-256:e[0]),i=1;i<r;i++)n<<=BigInt(8),n+=BigInt(e[i]);if(e.byteLength!==r){var a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=function(e,r){var n=r-e;if(n<=40){for(var i=a.getBigUint64(e),s=e+8;s<r;s+=8)i<<=BigInt(64),i|=a.getBigUint64(s);return i}var l=e+(n>>4<<3),u=o(e,l),c=o(l,r);return u<<BigInt(8*(r-l))|c};n=n<<BigInt(8*(a.byteLength-r))|o(r,a.byteLength)}return n};var tj={Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError,AggregateError:"function"==typeof AggregateError?AggregateError:null};tr[101]=function(){var e=tc();if(!tj[e[0]]){var r=Error(e[1],{cause:e[2]});return r.name=e[0],r}return tj[e[0]](e[1],{cause:e[2]})},tr[105]=function(e){if(!1===e7.structuredClone)throw Error("Structured clone extension is disabled");var r=e5.getUint32(e4-4);e3||(e3=new Map);var n,i=eQ[e4],a={target:n=i>=144&&i<160||220==i||221==i?[]:i>=128&&i<144||222==i||223==i?new Map:(i>=199&&i<=201||i>=212&&i<=216)&&115===eQ[e4+1]?new Set:{}};e3.set(r,a);var o=tc();if(!a.used)return a.target=o;var s=!0,l=!1,u=void 0;if(Object.assign(n,o),j(n,Map))try{for(var c,h=o.entries()[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=F(c.value,2),f=d[0],p=d[1];n.set(f,p)}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}var v=!0,y=!1,m=void 0;if(j(n,Set))try{for(var g,b=Array.from(o)[Symbol.iterator]();!(v=(g=b.next()).done);v=!0){var w=g.value;n.add(w)}}catch(e){y=!0,m=e}finally{try{v||null==b.return||b.return()}finally{if(y)throw m}}return n},tr[112]=function(e){if(!1===e7.structuredClone)throw Error("Structured clone extension is disabled");var r=e5.getUint32(e4-4),n=e3.get(r);return n.used=!0,n.target},tr[115]=function(){return new Set(tc())};var tT=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(function(e){return e+"Array"}),tI="object"==("u"<typeof globalThis?"undefined":N(globalThis))?globalThis:window;tr[116]=function(e){var r=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,i=tT[r];if(!i){if(16===r)return n;if(17===r)return new DataView(n);throw Error("Could not find typed array for code "+r)}return new tI[i](n)},tr[120]=function(){var e=tc();return new RegExp(e[0],e[1])};var tR=[];function tB(e){var r,n=e$,i=e4,a=e9,o=te,s=tt,l=e1,u=e8,c=e3,h=e2,d=new Uint8Array(eQ.slice(0,e$)),f=e0,p=e0.slice(0,e0.length),v=e7,y=ta,m=e();return e$=n,e4=i,e9=a,te=o,tt=s,e1=l,e8=u,e3=c,e2=h,eQ=d,ta=y,(r=e0=f).splice.apply(r,[0,e0.length].concat(V(p))),e7=v,e5=new DataView(eQ.buffer,eQ.byteOffset,eQ.byteLength),m}function tz(){eQ=null,e3=null,e0=null}tr[98]=function(e){var r=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=e4;return e4+=r-e.length,e2=tR,(e2=[tA(),tA()]).position0=0,e2.position1=0,e2.postBundlePosition=e4,e4=n,tc()},tr[255]=function(e){return new Date(4==e.length?1e3*(0x1000000*e[0]+(e[1]<<16)+(e[2]<<8)+e[3]):8==e.length?((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(0x100000000*(3&e[3])+0x1000000*e[4]+(e[5]<<16)+(e[6]<<8)+e[7]):12==e.length?((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-0x1000000000000:0)+0x10000000000*e[6]+0x100000000*e[7]+0x1000000*e[8]+(e[9]<<16)+(e[10]<<8)+e[11]):"invalid")};for(var tL=Array(147),tF=0;tF<256;tF++)tL[tF]=+("1e"+Math.floor(45.15-.30103*tF));var tU=new ts({useRecords:!1}),tV=(new Uint8Array((tU.unpack,tU.unpackMultiple,tU.unpack,new Float32Array(1)).buffer,0,4),[{Class:ea.prototype.constructor,type:1,write:function(e){return R({},e)},read:function(e){return Object.setPrototypeOf(e,ea.prototype),e}},{Class:eu.prototype.constructor,type:2,write:function(e){return V(e)},read:function(e){return Object.setPrototypeOf(e,eu.prototype),e}},{Class:es.prototype.constructor,type:3,write:function(e){return V(e)},read:function(e){return Object.setPrototypeOf(e,es.prototype),e}},{Class:en.prototype.constructor,type:4,write:function(e){return e.id},read:function(e){return new en(e)}},{Class:ei.prototype.constructor,type:5,write:function(e){return e.data},read:function(e){return new ei(e)}},{Class:eb.prototype.constructor,type:6,write:function(e){return R({},e)},read:function(e){return Object.setPrototypeOf(e,eb.prototype),e}}]),tN=!0,tG=!1,tW=void 0;try{for(var tH,tq,tY=tV[Symbol.iterator]();!(tN=(tq=tY.next()).done);tN=!0)(tH=tq.value).unpack?tr[tH.type]=tH.unpack:tr[tH.type]=tH}catch(e){tG=!0,tW=e}finally{try{tN||null==tY.return||tY.return()}finally{if(tG)throw tW}}var tX,tZ=new ts({structuredClone:!0});(tX||(tX={})).deserialize=function(e){return tZ.unpack(e)};var tK,tJ,tQ,t$=function(e){return function(){throw Error(e+" is not available in the runtime build (decode-only CollabSerialize)")}},t0={deserialize:tX.deserialize,serialize:t$("CollabSerialize.serialize"),checksum:t$("CollabSerialize.checksum")};function t1(e){var r=void 0===e?"undefined":N(e);return null!==e&&("object"===r||"function"===r)}(tJ=tK||(tK={})).all=["PerspectiveCamera","OrthographicCamera"],tJ.is=function(e){return tJ.all.includes(e)},(t2=tQ||(tQ={})).DefaultUp=[0,1,0],t2.DefaultTargetOffset=1e3,t2.MinTargetOffset=.001,t2.sanitizeTargetOffset=function(e){return void 0===e||!Number.isFinite(e)||e<t2.MinTargetOffset?t2.DefaultTargetOffset:e},t2.DefaultAzimuth=-24,t2.DefaultElevation=15,t3=t2.DefaultAzimuth*Math.PI/180,t5=t2.DefaultElevation*Math.PI/180,t4=180/Math.PI,t2.DefaultPosition=[t2.DefaultTargetOffset*Math.sin(t3)*Math.cos(t5),t2.DefaultTargetOffset*Math.sin(t5),t2.DefaultTargetOffset*Math.cos(t3)*Math.cos(t5)],t2.DefaultRotation=[Math.atan2(-Math.sin(t5),Math.cos(t3)*Math.cos(t5))*t4,Math.asin(Math.sin(t3)*Math.cos(t5))*t4,Math.atan2(Math.sin(t3)*Math.sin(t5),Math.cos(t3))*t4],t2.defaultData={far:1e5,type:"PerspectiveCamera",perspective:{near:70,fov:45,zoom:1},orthographic:{near:-1e5,zoom:1},up:t2.DefaultUp,isUpVectorFlipped:!1,targetOffset:t2.DefaultTargetOffset},t2.getZoom=function(e){var r,n,i,a;return"PerspectiveCamera"===e.type?null!=(r=null==(i=e.perspective)?void 0:i.zoom)?r:1:null!=(n=null==(a=e.orthographic)?void 0:a.zoom)?n:1};var t2,t3,t5,t4,t6,t8,t9,t7,re,rt,rr,rn,ri,ra,ro,rs,rl,ru="personal camera",rc="a218fcc3-276b-49b9-b485-49037fd14f5f",rh=5526619,rd=((t6=rd||{}).x="x",t6.y="y",t6.z="z",t6);rf=t8||(t8={}),rp=function(e,r){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)},rv=function(e,r){return Math.sqrt(rp(e,r))},ry=function(e,r,n){var i=rf.sub(r,e),a=rf.sub(n,e),o=rf.dot(i,a)/rf.dot(i,i),s=rf.scalarMultiply(i,o);return rf.add(e,s)},rf.isEqual=function(e,r){return e[0]===r[0]&&e[1]===r[1]},rf.lerp=function(e,r,n){return[e[0]+(r[0]-e[0])*n,e[1]+(r[1]-e[1])*n]},rf.add=function(e,r){return[e[0]+r[0],e[1]+r[1]]},rf.sub=function(e,r){return[e[0]-r[0],e[1]-r[1]]},rf.multiply=function(e,r){return[e[0]*r[0],e[1]*r[1]]},rf.divide=function(e,r){return[e[0]/r[0],e[1]/r[1]]},rf.distanceSquared=rp,rf.distance=rv,rf.dot=function(e,r){return e[0]*r[0]+e[1]*r[1]},rf.scalarMultiply=function(e,r){return[e[0]*r,e[1]*r]},rf.projectionOnto=ry,rf.projectionOntoDistance=function(e,r,n){return rv(e,ry(e,r,n))},rf.center=function(e,r){return[.5*(e[0]+r[0]),.5*(e[1]+r[1])]},(t7=t9||(t9={})).isEqual=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]},t7.add=function(e,r){return[e[0]+r[0],e[1]+r[1],e[2]+r[2]]},t7.sub=function(e,r){return[e[0]-r[0],e[1]-r[1],e[2]-r[2]]},t7.div=function(e,r){return[e[0]/r[0],e[1]/r[1],e[2]/r[2]]},t7.mul=function(e,r){return[e[0]*r[0],e[1]*r[1],e[2]*r[2]]},t7.dist=function(e,r){return Math.hypot(e[0]-r[0],e[1]-r[1],e[2]-r[2])},t7.lerp=function(e,r,n){return[e[0]+(r[0]-e[0])*n,e[1]+(r[1]-e[1])*n,e[2]+(r[2]-e[2])*n]},(rm=re||(re={})).isEqual=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]},rm.lerp=function(e,r,n){return[e[0]+(r[0]-e[0])*n,e[1]+(r[1]-e[1])*n,e[2]+(r[2]-e[2])*n,e[3]+(r[3]-e[3])*n]},rg=rt||(rt={}),rb=function(e){return"number"==typeof e?e*rx:e},rw=function(e){return"number"==typeof e?e*rS:e},rx=180/Math.PI,rS=Math.PI/180,rg.radToDeg=function(e){return[rb(e[0]),rb(e[1]),rb(e[2])]},rg.degToRad=function(e){return[rw(e[0]),rw(e[1]),rw(e[2])]},(rn=rr||(rr={})).identity=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],rn.isEqual=function(e,r){for(var n=0;n<16;n++)if(e[n]!==r[n])return!1;return!0},rn.simplify=function(e){return null!=e?e:rn.identity},rn.applyMatrix4=function(e,r){for(var n=r.slice(0),i=0,a=r.length;i<a;i+=3){var o=e[3]*r[i]+e[7]*r[i+1]+e[11]*r[i+2]+e[15];n[i]=(e[0]*r[i]+e[4]*r[i+1]+e[8]*r[i+2]+e[12])/o,n[i+1]=(e[1]*r[i]+e[5]*r[i+1]+e[9]*r[i+2]+e[13])/o,n[i+2]=(e[2]*r[i]+e[6]*r[i+1]+e[10]*r[i+2]+e[14])/o}return n},(ra=ri||(ri={})).isRGB=function(e){return"object"==(void 0===e?"undefined":N(e))&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b},ra.white={r:1,g:1,b:1},ra.red={r:1,g:0,b:0},ra.black={r:0,g:0,b:0},ra.toRgb255a1=function(e){return{r:Math.round(255*e.r),g:Math.round(255*e.g),b:Math.round(255*e.b),a:1}},ra.clone=function(e){return{r:e.r,g:e.g,b:e.b}},ra.fromHex=function(e){return{r:((e=Math.floor(e))>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255}},ra.toHex=function(e){return 65536*Math.round(255*e.r)+256*Math.round(255*e.g)+Math.round(255*e.b)},ra.equals=function(e,r){return e.r===r.r&&e.g===r.g&&e.b===r.b},ra.equalsFixed=function(e,r){return e.r.toFixed(2)===r.r.toFixed(2)&&e.g.toFixed(2)===r.g.toFixed(2)&&e.b.toFixed(2)===r.b.toFixed(2)},ra.lerp=function(e,r,n){return{r:e.r+(r.r-e.r)*n,g:e.g+(r.g-e.g)*n,b:e.b+(r.b-e.b)*n}},ra.is=function(e){return!!t1(e)&&"r"in e&&"g"in e&&"b"in e&&!("a"in e)},(rs=ro||(ro={})).white=B(R({},ri.white),{a:1}),rs.is=function(e){return!!t1(e)&&"r"in e&&"g"in e&&"b"in e&&"a"in e},rs.transparent=B(R({},ri.white),{a:0}),rs.from0to1=function(e){return{r:e[0],g:e[1],b:e[2],a:e[3]}},rs.fromHexAndA=function(e,r){return B(R({},ri.fromHex(e)),{a:r})},rs.toRgb255a1=function(e){return{r:Math.round(255*e.r),g:Math.round(255*e.g),b:Math.round(255*e.b),a:e.a}},rs.equals=function(e,r){return ri.equals(e,r)&&e.a===r.a},rs.equalsFixed=function(e,r){return ri.equalsFixed(e,r)&&e.a.toFixed(2)===r.a.toFixed(2)},rs.lerp=function(e,r,n){return{r:e.r+(r.r-e.r)*n,g:e.g+(r.g-e.g)*n,b:e.b+(r.b-e.b)*n,a:e.a+(r.a-e.a)*n}},rs.toStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rs.white,r=e.r,n=e.g,i=e.b,a=e.a;return"rgba(".concat(255*r,", ").concat(255*n,", ").concat(255*i,", ").concat(a,")")},(rl||(rl={})).identity={position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],pivot:[0,0,0],pivotRotation:[0,0,0]};var rf,rp,rv,ry,rm,rg,rb,rw,rx,rS,rk,rM,rA,rO,rC,r_,rP,rE,rD,rj,rT=((rM=rT||{})[rM.LINEAR=0]="LINEAR",rM[rM.EASE=1]="EASE",rM[rM.EASE_IN=2]="EASE_IN",rM[rM.EASE_OUT=3]="EASE_OUT",rM[rM.EASE_IN_OUT=4]="EASE_IN_OUT",rM[rM.CUBIC=5]="CUBIC",rM[rM.SPRING=6]="SPRING",rM[rM.ARC=7]="ARC",rM[rM.NONE=8]="NONE",rM);function rI(e){return"string"==typeof e&&36===e.length&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}(rk||(rk={})).defaultData={mass:1,stiffness:80,damping:10,velocity:0},(rA||(rA={})).defaultData={control1:[.5,0],control2:[.5,1]},(rC=rO||(rO={})).linear=[0,0,1,1],rC.ease=[.25,.1,.25,1],rC.easeIn=[.42,0,1,1],rC.easeOut=[0,0,.58,1],rC.easeInOut=[.42,0,.58,1],(rR=r_||(r_={})).all=["PointLight","SpotLight","DirectionalLight","HemisphereLight"],rR.is=function(e){return rR.all.includes(e)},(rP||(rP={})).defaultData=function(e){if("PointLight"===e)return{type:e,color:ro.white,intensity:1,distance:2e3,decay:1,shadows:!0,shadowResolution:1024,shadowRadius:1,penumbraSize:.5,depth:1e5};if("SpotLight"===e)return{type:e,color:ro.white,intensity:1,distance:2e3,decay:1,shadows:!0,penumbra:0,angle:30/180*Math.PI,depth:1e5,penumbraSize:.5,shadowResolution:1024,shadowRadius:1};if("DirectionalLight"===e)return{type:e,color:ro.white,intensity:1,shadows:!0,size:2e3,depth:1e5,penumbraSize:.5,shadowResolution:1024,shadowRadius:1};throw Error("not implemented")},(rB=rE||(rE={})).defaultShapeData={type:"PlaneEmitterShape",size:[100,100,100]},rB.defaultCollisionData={colliderEntityId:null,collisionBounce:.75},rB.defaultData=R({renderMaterial:{type:"particleMaterial",color:{r:1,g:.2,b:.545,a:1},color2:{r:.945,g:.714,b:.184,a:1},coloring:"gradient",ease:"linearFadeOut",easeSize:"linearFadeOut",transparent:!0,size:[40,40],texture:"pt_default_particle",spriteRotation:[0,0]},birthRatePerSec:50,gravity:1,noiseStrength:0,noiseScale:0,noiseSeed:1,noiseType:"curl",randomRotation:0,randomScale:.2,randomMass:.5,rootObjectType:"instancedMesh",life:1,direction:[0,0,0],directionMode:"axis",speed:10,shape:rB.defaultShapeData,autoPlay:!0,emitTimeDelay:0,emitTimeCycle:"infinity",emitTimeDuration:1},rB.defaultCollisionData),(rz=rD||(rD={})).defaultData={gravity:10,damping:.03,localStiffness:.67,globalStiffness:.5,globalRange:.15,stiffnessFalloff:.1,windStrength:0,vspCoefficient:.01,elasticity:.15,hairLength:.75,tipSeparation:.8,kink:0,kinkFrequency:0,clumpStrength:0,clumpSize:32,clumpTipScale:1.5,spreadRadius:.03,guideStrands:8192,headShape:"sphere",baseObjectId:null,hairColorSource:"custom",hairShadeRoot:.6,hairShadeTip:1.15,hairRootColor:{r:.29,g:.102,b:.039,a:1},hairMidColor:{r:.8,g:.267,b:.133,a:1},hairTipColor:{r:.545,g:.18,b:.18,a:1},headColor:{r:.325,g:.137,b:.114,a:1},noiseEnabled:!1,noiseColorA:{r:.545,g:.184,b:.788,a:1},noiseColorB:{r:.914,g:.188,b:.914,a:1},noiseColorC:{r:.2,g:.4,b:1,a:1},noiseColorD:{r:.2,g:1,b:.6,a:1},noiseScale:1.8,noiseMixHair:.75,noiseMixHead:.8,castShadow:!0,receiveShadow:!0,hairWidth:1.75,specularPower:40,specularIntensity:.4,diffuseIntensity:.6,ambientIntensity:.25,opacity:1,tipFade:.4,autoPlay:!0},rz.regenProps=["hairLength","spreadRadius","guideStrands","headShape","baseObjectId"],(rj||(rj={})).defaultData={enabled:"visibility",fusedBody:!0,rigidBody:"positioned",density:1,pointMass:0,gravityScale:1,friction:.5,damping:0,restitution:.2,colliderType:"convex",enabledRotation:[!0,!0,!0],enabledTranslation:[!0,!0,!0]};var rR,rB,rz,rL,rF,rU,rV,rN,rG,rW,rH,rq,rY,rX=((rL=rX||{})[rL.Front=0]="Front",rL[rL.Back=1]="Back",rL[rL.Double=2]="Double",rL);(rZ=rF||(rF={})).defaultData={castShadow:!0,receiveShadow:!0},rZ.equals=function(e,r){return e.castShadow===r.castShadow&&e.receiveShadow===r.receiveShadow},(rK=rU||(rU={})).defaultData={flatShading:!1,wireframe:!1,side:0},rK.equals=function(e,r){var n,i;return e.flatShading===r.flatShading&&e.side===r.side&&e.wireframe===r.wireframe&&(null!=(n=e.shadowCatcher)&&n)===(null!=(i=r.shadowCatcher)&&i)},(rV||(rV={})).defaultData=R({},rU.defaultData,rF.defaultData),(rN||(rN={})).getMaterialData=function(e,r){var n=[],i=!0,a=!1,o=void 0;if("material"in e){var s,l,u="string"==typeof e.material?null!=(s=r.materials[e.material])?s:null==(l=r.lib.materials[e.material])?void 0:l.asset:e.material;u&&n.push(u)}else if("materials"in e)try{for(var c,h=e.materials[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d,f,p=c.value,v="string"==typeof p?null!=(d=r.materials[p])?d:null==(f=r.lib.materials[p])?void 0:f.asset:p;v&&n.push(v)}}catch(e){a=!0,o=e}finally{try{i||null==h.return||h.return()}finally{if(a)throw o}}return n},(rJ=rG||(rG={})).defaultVideo={data:"",thumb:"/_assets/_videos/catThumb.png",type:"video",name:"Cat video"},rJ.maxSize=3e7,(rW||(rW={})).is=function(e){return"texture"===e||"video"===e||"color"===e||"depth"===e||"normal"===e||"gradient"===e||"noise"===e||"fresnel"===e||"cavity"===e||"dust"===e||"rainbow"===e||"toon"===e||"outline"===e||"particle"===e||"transmission"===e||"reflection"===e||"matcap"===e||"displace"===e||"pattern"===e||"vertexColor"===e||"light"===e},(rH||(rH={})).is=function(e){return"luminance"===e||"r"===e||"g"===e||"b"===e||"a"===e},(rq||(rq={})).is=function(e){return"object"==(void 0===e?"undefined":N(e))&&null!==e&&null!=e.image},(rY||(rY={})).is=function(e){return"phong"===e||"toon"===e||"lambert"===e||"physical"===e};var rZ,rK,rJ,rQ,r$,r0,r1,r2,r3,r5,r4,r6,r8,r9=((rQ=r9||{})[rQ.Linear=0]="Linear",rQ[rQ.Radial=1]="Radial",rQ[rQ.Polar=2]="Polar",rQ),r7=((r$=r7||{})[r$.RepeatWrapping=1e3]="RepeatWrapping",r$[r$.ClampToEdgeWrapping=1001]="ClampToEdgeWrapping",r$[r$.MirroredRepeatWrapping=1002]="MirroredRepeatWrapping",r$),ne=((r0=ne||{})[r0.NearestFilter=1003]="NearestFilter",r0[r0.LinearFilter=1006]="LinearFilter",r0[r0.LinearMipmapLinearFilter=1008]="LinearMipmapLinearFilter",r0),nt=((r1=nt||{})[r1.UV=0]="UV",r1[r1.Planar=1]="Planar",r1[r1.Spherical=2]="Spherical",r1[r1.Cylindrical=3]="Cylindrical",r1[r1.Triplanar=4]="Triplanar",r1),nr=((r6=nr||{})[r6.Simplex=0]="Simplex",r6[r6.SimplexFractal=1]="SimplexFractal",r6[r6.Ashima=2]="Ashima",r6[r6.Fbm=3]="Fbm",r6[r6.Perlin=4]="Perlin",r6[r6.Voronoi=5]="Voronoi",r6),nn=((r4=nn||{})[r4.F1=0]="F1",r4[r4.F2=1]="F2",r4[r4.F2MinusF1=2]="F2MinusF1",r4[r4.SmoothBlend=3]="SmoothBlend",r4[r4.Edge=4]="Edge",r4[r4.Power=5]="Power",r4[r4.Lines=6]="Lines",r4[r4.Cells=7]="Cells",r4),ni=((r2=ni||{})[r2.Lights=0]="Lights",r2[r2.Static=1]="Static",r2[r2.Camera=2]="Camera",r2),na=((r3=na||{})[r3.Circle=0]="Circle",r3[r3.Ring=1]="Ring",r3[r3.Polygon=2]="Polygon",r3[r3.Cross=3]="Cross",r3[r3.Diamond=4]="Diamond",r3[r3.Checkerboard=5]="Checkerboard",r3[r3.Line=6]="Line",r3[r3.Wave=7]="Wave",r3),no=["mode","gradientType","noiseType","tracingMode","mirror","displacementType","projection","cnormal","crop","axis","side","roughnessMapChannel","metalnessMap","metalnessMapChannel","normalMap","aoMap","aoMapChannel","emissiveMap","style"],ns=["wrapping","image","video","name","minFilter","magFilter"];(nl=r5||(r5={})).patch=function(e,r){var n=r.texture;if(Object.assign(e,z(r,["texture"])),n){var i=e.texture;i&&Object.assign(i,n)}},nl.defaultColorLayer=function(e){return B(R({},nl.defaultData("color")),{color:e})},nl.defaultData=function(e,r){return"light"===e&&r?function(e){var r={mode:0,isMask:!1,visible:!0,bumpMap:void 0,bumpMapIntensity:5,roughnessMap:void 0,alphaOverride:1};switch(e){case"phong":return B(R({},r),{category:"phong",specular:{r:.2,g:.2,b:.2},shininess:5,type:"light",visible:!0,mode:0,occlusion:!0,alpha:.6});case"toon":return B(R({},r),{category:"toon",specular:{r:.2,g:.2,b:.2},shininess:10,type:"light",alpha:1});case"lambert":return B(R({},r),{category:"lambert",emissive:{r:0,g:0,b:0},type:"light",alpha:1,visible:!0,mode:0,occlusion:!0});case"physical":return B(R({},r),{category:"physical",roughness:.6,metalness:.2,reflectivity:.2,type:"light",alpha:.6,visible:!0,mode:0,occlusion:!0})}}(r):function(e){var r={alpha:1,mode:0,isMask:!1,visible:!0};switch(e){case"texture":return B(R({},r),{type:"texture",size:[128,128],blending:0,axis:"x",side:2,projection:0,texture:{image:"image_0",wrapping:1e3,repeat:[1,1],offset:[0,0],rotation:0,minFilter:1008,magFilter:1006},crop:!1});case"video":return B(R({},r),{type:"video",size:[128,128],blending:0,axis:"x",side:2,projection:0,texture:{video:rG.defaultVideo,wrapping:1001,repeat:[1,1],offset:[0,0],rotation:0,minFilter:1008,magFilter:1006},crop:!1});case"color":return B(R({},r),{type:"color",color:ri.fromHex(rh)});case"vertexColor":return B(R({},r),{type:"vertexColor"});case"depth":return B(R({},r),{type:"depth",gradientType:1,smooth:!1,isVector:!0,isWorldSpace:!1,origin:[0,0,0],direction:[1,0,0],colors:[[1,1,1,1],[0,0,0,1]],steps:[0,1],near:50,far:200});case"normal":return B(R({},r),{type:"normal",cnormal:[1,1,1]});case"gradient":return B(R({},r),{type:"gradient",gradientType:0,smooth:!1,colors:[[0,0,0,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,1,1,1,1,1,1,1,1,1],num:2,angle:0,offset:[0,0],morph:[0,0]});case"noise":return B(R({},r),{type:"noise",size:[100,100,100],noiseType:0,scale:1,move:1,colorA:B(R({},ri.fromHex(6710886)),{a:1}),colorB:B(R({},ri.fromHex(6710886)),{a:1}),colorC:B(R({},ri.fromHex(0xffffff)),{a:1}),colorD:B(R({},ri.fromHex(0xffffff)),{a:1}),distortion:[1,1],fA:[1.7,9.2],fB:[8.3,2.8],voronoiStyle:0,highCut:1,lowCut:0,smoothness:.3,seed:0,quality:1});case"cavity":return B(R({},r),{type:"cavity",mode:3,ridge:1,valley:1});case"fresnel":return B(R({},r),{type:"fresnel",color:ro.fromHexAndA(0xffffff,1),bias:.1,scale:1,intensity:2,factor:1});case"dust":return B(R({},r),{type:"dust",color:ro.fromHexAndA(0x9d8765,1),coverage:.2,softness:.2,noiseStrength:.2,noiseScale:1});case"rainbow":return B(R({},r),{type:"rainbow",filmThickness:30,movement:0,wavelengths:[0,0,0],noiseStrength:0,noiseScale:1,offset:[0,0,0]});case"toon":return B(R({},r),{type:"toon",positioning:2,colors:[[0,0,0,1],[.5,.5,.5,1],[.5,.5,.5,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,.475,.525,1,1,1,1,1,1,1],num:4,source:[0,1e3,0],isWorldSpace:!0,noiseStrength:0,noiseScale:1,shadowColor:ro.fromHexAndA(0,0),offset:[0,0,0]});case"outline":return B(R({},r),{type:"outline",outlineColor:ro.fromHexAndA(0,1),contourColor:ro.fromHexAndA(0,1),outlineWidth:2,contourWidth:5,outlineThreshold:.4,contourThreshold:0,outlineSmoothing:0,contourFrequency:10,contourDirection:[0,1,0],positionalLines:!1,compensation:!0});case"matcap":return B(R({},r),{type:"matcap",texture:{image:"matcap_0",wrapping:1001,repeat:[1,1],offset:[0,0],rotation:0,minFilter:1008,magFilter:1006}});case"transmission":return B(R({},r),{type:"transmission",thickness:10,ior:1.5,roughness:1});case"reflection":return B(R({},r),{type:"reflection",blur:0,thickness:.001,steps:60,stepSize:.005,tracingMode:1,mirror:0});case"displace":return{visible:!0,type:"displace",displacementType:"noise",noiseType:0,scale:10,movement:1,offset:[0,0,0],intensity:8,voronoiStyle:0,smoothness:.3,seed:0,highCut:1,lowCut:0,quality:1};case"pattern":return B(R({},r),{type:"pattern",style:0,projection:0,axis:"y",blending:0,offset:[0,0],colorA:B(R({},ri.fromHex(0)),{a:1}),colorB:B(R({},ri.fromHex(0xffffff)),{a:1}),frequency:[10,10],size:.5,variation:0,smoothness:.5,zigzag:0,rotation:0,vertical:[0,1],horizontal:[0,1],sides:6})}}(e)},nu=r8||(r8={}),nc=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"layer1",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"layer2";arguments.length>3&&void 0!==arguments[3]?arguments[3]:ri.fromHex(0xffffff);var i=new eu;return i.push({fi:0,data:r5.defaultData("light",e),id:r}),i.push({fi:1,data:r5.defaultData("color"),id:n}),{layers:i}},nu.isMergable=function(e){return!e.layers.some(function(e){return"texture"===e.data.type&&0!==e.data.projection||"depth"===e.data.type&&!e.data.isWorldSpace||"noise"===e.data.type||"dust"===e.data.type&&0!==e.data.noiseStrength||"displace"===e.data.type})},nu.getHash=function(e){var r="";return e.layers.forEach(function(e){Object.entries(e.data).forEach(function(e){var n=F(e,2),i=n[0],a=n[1];r+="".concat(i).concat(a),Array.isArray(a)?a.forEach(function(e){return r+="".concat(e)}):"object"==(void 0===a?"undefined":N(a))?Object.values(a).forEach(function(e){r+="number"==typeof e?"".concat(e.toFixed(4)):"".concat(e)}):r+="".concat(a)})}),r},nu.defaultEmptyData=function(){return{layers:new eu}},nu.defaultData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"layer1",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"layer2";return nc("physical",e,r)},nu.withName=function(e,r){return B(R({},e),{name:r})},nu.defaultTwoLayerData=nc,nu.defaultColorMaterial=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"layer1",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"layer2",a=new eu;return a.push({fi:0,data:r5.defaultData("light",r),id:n}),a.push({fi:1,data:r5.defaultColorLayer(e),id:i}),{layers:a}},nu.defaultUIObjectMaterial=function(e){var r=r5.defaultData("texture");e&&Object.assign(r.texture,{image:e});var n=new eu;return n.push({fi:0,data:r,id:"layer1"}),n.push({fi:1,data:B(R({},r5.defaultData("transmission")),{alpha:1}),id:"layer2"}),n.push({fi:2,data:B(R({},r5.defaultData("light","lambert")),{alpha:0}),id:"layer3"}),{layers:n}},nu.defaultTwoLayerTextureData=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"physical",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"layer1",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"layer2",a=r5.defaultData("texture");Object.assign(a.texture,{image:e});var o=new eu;return o.push({fi:0,data:a,id:n}),o.push({fi:1,data:r5.defaultData("light",r),id:i}),{layers:o}},nu.defaultTwoLayerVideoTextureData=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"physical",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"layer1",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"layer2",a=r5.defaultData("video");Object.assign(a.texture,{video:e});var o=new eu;return o.push({fi:0,data:a,id:n}),o.push({fi:1,data:r5.defaultData("light",r),id:i}),{layers:o}};var nl,nu,nc,nh,nd,nf="Roboto_regular",np="https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf";(nh||(nh={})).defaultData=function(){return{points:new eu,roundness:0,shapeHoles:[],isClosed:!1}},(nd||(nd={})).defaultData=function(){return{points:new eu,lastInsertionPlane:null,subdivisions:12,isClosed:!1,subdivisionMode:"parametric"}};var nv,ny={type:"Ellipse",width:50,height:50,spikes:16,angle:360,innerRadius:0};(nv||(nv={})).merge=function(e,r){var n=R({},e);return nS.forEach(function(i){var a;Object.assign(n,P({},i,null!=(a=r[i])?a:e[i]))}),n};var nm,ng,nb,nw,nx={shape:ny,depth:1,offset:0,bevel:50,bevelSides:6,angle:0,twist:0,startScale:1,endScale:1,capType:"flat"},nS=["depth","offset","angle","twist","startScale","endScale"];(nk=nm||(nm={})).is2DParametricMesh=function(e){return"PolygonGeometry"===e||"RectangleGeometry"===e||"StarGeometry"===e||"TriangleGeometry"===e||"EllipseGeometry"===e||"UIGeometry"===e},nk.isParametricMesh=function(e){return"PolygonGeometry"===e||"RectangleGeometry"===e||"StarGeometry"===e||"TriangleGeometry"===e||"EllipseGeometry"===e||"PathGeometry"===e||"VectorGeometry"===e||"ConeGeometry"===e||"CubeGeometry"===e||"CylinderGeometry"===e||"DodecahedronGeometry"===e||"HelixGeometry"===e||"IcosahedronGeometry"===e||"LatheGeometry"===e||"PyramidGeometry"===e||"SphereGeometry"===e||"PlaneGeometry"===e||"BackdropGeometry"===e||"TorusGeometry"===e||"TorusKnotGeometry"===e||"BooleanGeometry"===e||"TextGeometry"===e||"InputGeometry"===e||"DecalGeometry"===e},nk.isSwappableGeometry=function(e){return"PolygonGeometry"===e||"RectangleGeometry"===e||"StarGeometry"===e||"TriangleGeometry"===e||"EllipseGeometry"===e||"PathGeometry"===e||"VectorGeometry"===e||"ConeGeometry"===e||"CubeGeometry"===e||"CylinderGeometry"===e||"DodecahedronGeometry"===e||"HelixGeometry"===e||"IcosahedronGeometry"===e||"LatheGeometry"===e||"PyramidGeometry"===e||"SphereGeometry"===e||"PlaneGeometry"===e||"BackdropGeometry"===e||"TorusGeometry"===e||"TorusKnotGeometry"===e||"TextGeometry"===e||"SubdivGeometry"===e||"NonParametricGeometry"===e},(ng||(ng={})).merge=function(e,r){var n=R({},e);return Object.assign(n,r),"PathGeometry"===n.type&&"extrusion"in r&&r.extrusion&&(n.extrusion=R({},e.extrusion),Object.assign(n.extrusion,nv.merge(n.extrusion,r.extrusion))),n},(nw=nb||(nb={})).defaultData=function(e){if("RectangleGeometry"===e)return{width:320,height:320,type:e,cornerRadius:[0,0,0,0],cornerType:0,depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if("UIGeometry"===e)return{type:e,frame:"",cornerRadius:[0,0,0,0],cornerType:0,width:1,height:1};if("PathGeometry"===e)return{type:e,width:1,height:1,depth:1,path:nd.defaultData(),extrusion:nx};if("VectorGeometry"===e)return{width:1,height:1,type:e,subdivisions:12,shape:nh.defaultData(),depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if("BooleanGeometry"===e)return{type:e,operation:2,width:0,height:0,depth:0,phongAngle:35};if("ShapeBlendGeometry"===e)return{type:e,width:0,height:0,depth:0,resolutionLevel:6,blendRange:100,useChildrenColors:!1};if("DecalGeometry"===e)return{type:e,width:200,height:200,depth:200,offset:1,projection:"all",projectionTargets:[]};if("TextGeometry"===e)return{type:e,width:100,height:100,depth:0,horizontalAlign:1,verticalAlign:1,fontSize:16,lineHeight:1.2,letterSpacing:0,text:{textValue:""},textTransform:1,font:"Roboto_regular",editable:!1,extrudeBevelSize:0,extrudeBevelSegments:1};if("InputGeometry"===e)return B(R({},nw.defaultData("TextGeometry")),{type:e,editable:!0});if("SphereGeometry"===e)return{type:"SphereGeometry",width:100,height:100,depth:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:180};throw Error("not implemented")};var nk,nM,nA,nO=["width","height","depth"];(nC=nM||(nM={})).defaultData=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1;return{disabled:!1,type:"linear",hideBase:!1,instanced:!1,count:3,radial:{radius:2*Math.max("number"==typeof e[0]?e[0]:1,"number"==typeof e[1]?e[1]:1),start:0,end:360,alignment:!1,axis:"y",scale:[1,1,1],rotation:[0,0,0],position:[0,0,0],pivot:[0,0,0],pivotRotation:[0,0,0]},toObject:{object:"",spreadType:"random",scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],axis:"x",seed:0,count:99,align:"normal",pivot:[0,0,0],pivotRotation:[0,0,0]},linear:{scale:[1,1,1],rotation:[0,0,0],position:[("number"==typeof e[0]?e[0]+e[0]:1)*r,0,0],pivot:[0,0,0],pivotRotation:[0,0,0]},grid:{count:[2,2,2],size:e.map(function(e){return("number"==typeof e?e:1)*(1+r)}),useCenter:!0},randomness:!1,randomnessObject:{strength:100,scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],movement:1,seed:0,freqScale:10,noiseType:"perlin"}}},nC.merge=function(e,r){var n=R({},e);if(nW.forEach(function(i){var a;Object.assign(n,P({},i,null!=(a=r[i])?a:e[i]))}),n.radial=R({},e.radial),r.radial){var i=e.radial,a=r.radial;nH.forEach(function(e){var r;Object.assign(n.radial,P({},e,null!=(r=a[e])?r:i[e]))})}if(n.linear=R({},e.linear),r.linear){var o=e.linear,s=r.linear;nq.forEach(function(e){var r;Object.assign(n.linear,P({},e,null!=(r=s[e])?r:o[e]))})}if(n.grid=R({},e.grid),r.grid){var l=e.grid,u=r.grid;nY.forEach(function(e){var r;Object.assign(n.grid,P({},e,null!=(r=u[e])?r:l[e]))})}if(n.toObject=R({},e.toObject),r.toObject){var c=e.toObject,h=r.toObject;nX.forEach(function(e){var r;Object.assign(n.toObject,P({},e,null!=(r=h[e])?r:c[e]))})}if(n.randomnessObject=R({},e.randomnessObject),r.randomnessObject){var d=e.randomnessObject,f=r.randomnessObject;nZ.forEach(function(e){var r;Object.assign(n.randomnessObject,P({},e,null!=(r=f[e])?r:d[e]))})}return n},nC.isPartial=function(e){return!(!e.randomnessObject&&!e.toObject)},(n_=nA||(nA={})).defaultData={radial:{},linear:{},grid:{},toObject:{},randomnessObject:{}},nP=["radial","linear","grid","toObject","randomnessObject"],n_.toOps=function(e,r){var n=[];void 0!==e.count&&n.push({type:0,path:r,props:{count:e.count}});var i=!0,a=!1,o=void 0;try{for(var s,l=nP[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=e[u];c&&Object.keys(c).length>0&&n.push({type:0,path:V(r).concat([u]),props:c})}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return n};var nC,n_,nP,nE,nD,nj,nT,nI,nR,nB,nz,nL,nF,nU,nV,nN,nG,nW=["count"],nH=["radius","start","end","position","scale","rotation"],nq=["position","scale","rotation"],nY=["count","size"],nX=["count","position","scale","rotation"],nZ=["strength","scale","rotation","position","movement","seed","freqScale"];function nK(e){var r="string"==typeof e?Number.parseInt(e,10):e;return"number"==typeof r&&Number.isFinite(r)?Math.min(5,Math.max(0,Math.round(r))):3}nJ=nE||(nE={}),nQ=function(e){var r;return null!=(r=e.mode)?r:"linear"},nJ.defaultData={enabled:!1,useBackgroundColor:!1,color:ri.white,near:.1,far:2e3,mode:"linear",density:.005,heightFalloff:.01,heightBase:0},nJ.getMode=nQ,nJ.getModeIndex=function(e){var r=nQ(e);return"height"===r?1:2*("both"===r)},nJ.getDensity=function(e){var r;return null!=(r=e.density)?r:nJ.defaultData.density},nJ.getHeightFalloff=function(e){var r;return null!=(r=e.heightFalloff)?r:nJ.defaultData.heightFalloff},nJ.getHeightBase=function(e){var r;return null!=(r=e.heightBase)?r:nJ.defaultData.heightBase},(nD||(nD={})).defaultData={image:null,rotation:0,blur:32,showBackground:!0},(nj||(nj={})).defaultData={enabled:!1,mode:"hdri",hdri:nD.defaultData,timeOfDay:10,weather:"partlyCloudy",lighting:!0,lightingIntensity:1,lightingQuality:"full",clouds:!0,windSpeed:2,animateWind:!0,exposure:1,seed:2},n$={opacity:1,blendFunction:13,enabled:!1},(nT||(nT={})).defaultData={enabled:!1,pixelation:B(R({},n$),{blendFunction:16,granularity:15}),bloom:B(R({},n$),{blendFunction:16,intensity:1,blurScale:1,luminanceThreshold:.25,luminanceSmoothing:.025,kernelSize:3}),chromaticAberration:B(R({},n$),{offset:[2,2]}),vignette:B(R({},n$),{darkness:1,offset:0}),hueSaturation:B(R({},n$),{hue:3,saturation:0}),brightnessContrast:B(R({},n$),{brightness:.25,contrast:0}),depthOfField:B(R({},n$),{focusDistance:100,focalLength:20,bokehScale:5}),noise:B(R({},n$),{blendFunction:16})},(n0=nI||(nI={})).defaultData={type:"normal",softShadowQuality:"low"},n0.isSoft=function(e){return null!=e&&(void 0===e.type||"soft"===e.type)},(nR||(nR={})).defaultData={enabled:!0,color:{r:.8274509803921568,g:.8274509803921568,b:.8274509803921568},intensity:.75},(nB||(nB={})).defaultData={occlusion:!1,aoFullRes:!1,radius:256,bias:.5,aoColor:{r:.19607843137254902,g:.19607843137254902,b:.19607843137254902}},(n1=nz||(nz={})).defaultData={pipeline:"classic",toneMapping:"aces",exposure:1},n1.isUntouched=function(e){return void 0===e||"classic"===e.pipeline&&("none"===e.toneMapping||"aces"===e.toneMapping)&&1===e.exposure},(nL||(nL={})).defaultData={usePhysics:!1,gravity:-10},(nF||(nF={})).defaultData={playCamera:ru,gameControlObject:null},(nU||(nU={})).defaultData={backgroundColor:ro.fromHexAndA(2500134,1),postprocessing:nT.defaultData,fog:nE.defaultData,sky:nj.defaultData,globalPhysics:nL.defaultData,ambient:nR.defaultData,ao:nB.defaultData,shadow:nI.defaultData,publish:nF.defaultData,grading:nz.defaultData},(nV||(nV={})).defaultData={colliderType:"box",size:[100,100,100],colliderHelperVisible:!0,forceType:"collider",forceRange:"global",forceIntensity:.5,forceDambing:.95},(n2=nN||(nN={})).isComponentRelated=function(e){return"Component"===e||"Instance"===e},n2.isEmptyOrComponent=function(e){return"Empty"===e||"Instance"===e},(n3=nG||(nG={})).identity=B(R({},rl.identity),{hiddenMatrix:rr.identity}),n3.fromObject=function(e){return{position:e.position,rotation:e.rotation,scale:e.scale,pivot:e.pivot,pivotRotation:e.pivotRotation,hiddenMatrix:e.hiddenMatrix}},n3.merge=function(e,r){return{position:(null==r?void 0:r.position)||e.position,rotation:(null==r?void 0:r.rotation)||e.rotation,pivot:(null==r?void 0:r.pivot)||e.pivot,pivotRotation:(null==r?void 0:r.pivotRotation)||e.pivotRotation,scale:(null==r?void 0:r.scale)||e.scale,hiddenMatrix:(null==r?void 0:r.hiddenMatrix)||e.hiddenMatrix}},n3.diff=function(e,r){return $({position:t9.isEqual(e.position,r.position)?void 0:r.position,rotation:t9.isEqual(e.rotation,r.rotation)?void 0:r.rotation,scale:t9.isEqual(e.scale,r.scale)?null:r.scale,hiddenMatrix:rr.isEqual(e.hiddenMatrix,r.hiddenMatrix)?void 0:r.hiddenMatrix})};var nJ,nQ,n$,n0,n1,n2,n3,n5,n4,n6,n8,n9,n7,ie,it,ir,ii,ia,io,is,il,iu,ic,ih,id,ip,iv,iy,im,ig,ib,iw,ix,iS,ik,iM,iA,iO,iC,i_,iP,iE=["slide","offset"];function iD(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0];return[e&&!isNaN(e[0])?e[0]:r[0],e&&!isNaN(e[1])?e[1]:r[1]]}function ij(e,r,n){switch(e){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 7:return"cubicBezier( .25, 1, .5, 1 )";case 5:var i=null!=r?r:R({},rA.defaultData),a=i.control1,o=i.control2;return"cubicBezier( ".concat(a[0],", ").concat(a[1],", ").concat(o[0],", ").concat(o[1]," )");case 6:var s=null!=n?n:R({},rk.defaultData),l=new at(s.mass,s.stiffness,s.damping,s.velocity),u=l.solve(1);return function(){return function(e){return l.solve(e)/u}};case 8:return function(){return function(e){return Math.floor(e)}}}}(n5||(n5={})).defaultData=B(R({states:new eu,events:new eu,visible:!0,raycastLock:!1,physics:rj.defaultData,pathSnapping:{pathId:null,slide:0,offset:0,orientation:"tangential"}},nG.identity),{cloner:null}),(n4||(n4={})).defaultData=R({type:"Empty"},n5.defaultData),(n6||(n6={})).defaultData=R({type:"ParticleCollider"},nV.defaultData,n5.defaultData),(n8||(n8={})).defaultData=R({type:"Component"},n5.defaultData),(n9||(n9={})).defaultData=R({type:"Particle"},n5.defaultData,rE.defaultData),(n7||(n7={})).defaultData=R({type:"Hair"},n5.defaultData,rD.defaultData),(ie||(ie={})).defaultData=R({type:"Mesh"},n5.defaultData,rV.defaultData),(it||(it={})).defaultData=R(B(R({},n5.defaultData,nG.identity),{position:tQ.DefaultPosition,rotation:tQ.DefaultRotation}),tQ.defaultData),(iT=ir||(ir={})).defaultData=function(e){return R({},n5.defaultData,rP.defaultData(e))},iT.defaultDirectionalLightData=B(R({},iT.defaultData("DirectionalLight")),{position:[200,300,300],name:"Directional Light",intensity:.7}),(iI=ii||(ii={})).resolveWithDes=iR=function(e,r){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<r.length;){var i=e?e[r[n]]:void 0;if(r.length===n+1)return i;if(!i)return;e=i.descendants,n+=1}},iI.resolve=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=iR(e,r,n);if(i){var a=Object.keys(i);if(1===a.length&&"descendants"===a[0])return}return i},iB=ia||(ia={}),iz=function(e,r){return B(R({},n5.defaultData,r),{component:e,overrides:new eb,physics:void 0,events:void 0,type:"Instance"})},iB.rootOverrideProps=["physics","events"],iB.compositeNonOptionalOverrideProps=["geometry"],iB.compositeEntireOverrideOverrideProps=["material"],iB.ofComponent=iz,iB.fromComponentData=function(e){var r=nG.fromObject(e.data);return iz(e.id,r)},(iL=io||(io={})).defaultData=B(R(B(R({type:"Page"},n5.defaultData),{physics:B(R({},rj.defaultData),{fusedBody:!1})}),nU.defaultData),{camera:it.defaultData,timelines:new ea}),iL.isUIPage=function(e){return void 0!==e.uiScene},(iF=is||(is={})).defaultCamera=R({position:[0,0,1e3],scale:[1,1,1],rotation:[0,0,0],pivot:[0,0,0],pivotRotation:[0,0,0],hiddenMatrix:rr.identity,name:"Play Camera",visible:!0,raycastLock:!1,physics:rj.defaultData,states:new eu,events:new eu,cloner:null,pathSnapping:{pathId:null,orientation:"tangential",slide:0,offset:0}},tQ.defaultData),iF.KeysByResetCategory={States:["states"],Events:["events"],Material:["material","materials"],Geometry:["geometry"],Position:["position"],Rotation:["rotation"],Scale:["scale"],Transform:["position","scale","rotation","hiddenMatrix"],Name:["name"],Visibility:["visible","raycastLock","flatShading","wireframe","side","shadowCatcher"],Shadows:["castShadow","receiveShadow"],Cloner:["cloner"],Physics:["physics"]},iF.defaultMeshObject=B(R({name:"Rectangle"},n5.defaultData,ie.defaultData),{geometry:nb.defaultData("RectangleGeometry"),material:r8.defaultTwoLayerData("physical","layer1","layer2")}),iF.defaultBooleanObject=B(R({name:"Boolean"},n5.defaultData,ie.defaultData),{geometry:nb.defaultData("BooleanGeometry"),material:r8.defaultTwoLayerData("physical","layer1","layer2")}),iF.defaultShapeBlendObject=B(R({name:"Shape Blend"},n5.defaultData,ie.defaultData),{geometry:nb.defaultData("ShapeBlendGeometry"),material:r8.defaultTwoLayerData("physical","layer1","layer2")}),iF.defaultTextObject=B(R({name:"Text"},n5.defaultData,ie.defaultData),{geometry:nb.defaultData("TextGeometry"),material:r8.defaultTwoLayerData("physical","layer1","layer2")}),iF.defaultInputObject=B(R({name:"Input"},n5.defaultData,ie.defaultData),{geometry:nb.defaultData("InputGeometry"),material:r8.defaultTwoLayerData("physical","layer1","layer2")}),(iU=il||(il={})).newEmpty=function(e,r){var n={name:r};return"Mesh"===e.type?(n.geometry={},"material"in e&&(n.material={layers:new eb}),"materials"in e&&(n.materials=e.materials.map(function(e){return{layers:new eb}}))):tK.is(e.type)&&(n.perspective={},n.orthographic={}),n},iU.toOps=function(e,r){var n,i=[],a={orthographic:0,perspective:0,geometry:0};function o(e,r){var n=!0,a=!1,o=void 0;try{for(var s,l=Object.entries(r.layers)[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=F(s.value,2),c=u[0],h=u[1],d=h.texture,f=z(h,["texture"]);if(void 0!==d&&Object.keys(d).length>0){var p={path:V(e).concat(["layers",c,"texture"]),props:d,type:0};i.push(p)}if(Object.keys(f).length>0){var v={path:V(e).concat(["layers",c]),props:f,type:0};i.push(v)}}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}}var s=!0,l=!1,u=void 0;try{for(var c,h=Object.entries(r)[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=F(c.value,2),f=d[0],p=d[1],v=!0,y=!1,m=void 0;if("name"!==f)if("cloner"===f)i.push.apply(i,V(nA.toOps(p,["cloner"])));else if("pathSnapping"===f)i.push({path:[f],props:{slide:p.slide,offset:p.offset},type:0});else if("material"===f)o(["material"],p);else if("materials"===f)try{for(var g,b=Object.entries(p)[Symbol.iterator]();!(v=(g=b.next()).done);v=!0){var w=F(g.value,2),x=w[0],S=w[1];o(["materials",x],S)}}catch(e){y=!0,m=e}finally{try{v||null==b.return||b.return()}finally{if(y)throw m}}else if(0===a[f]){if("geometry"===f&&void 0!==p.extrusion){var k={path:[f,"extrusion"],props:p.extrusion,type:0};i.push(k),p=R({},p),delete p.extrusion}if(Object.keys(p).length>0){var M={path:[f],props:p,type:0};i.push(M)}}else void 0===n&&(n={path:[],props:{},type:0},i.push(n)),n.props[f]=p}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}return i},iU.patch=function(e,r){if(void 0===r)return e;var n,i,a,o,s,l,u,c,h,d,f=R({},e);return(Object.assign(f,nG.merge(f,r)),Object.assign(f,{pathSnapping:Object.assign({},f.pathSnapping,{slide:null!=(n=null!=(i=null==(s=r.pathSnapping)?void 0:s.slide)?i:null==(l=f.pathSnapping)?void 0:l.slide)?n:0,offset:null!=(a=null!=(o=null==(u=r.pathSnapping)?void 0:u.offset)?o:null==(c=f.pathSnapping)?void 0:c.offset)?a:0})}),tK.is(e.type))?(f.orthographic=R({},f.orthographic),f.perspective=R({},f.perspective),void 0!==(null==(h=r.orthographic)?void 0:h.zoom)&&(f.orthographic.zoom=r.orthographic.zoom),void 0!==(null==(d=r.perspective)?void 0:d.zoom)&&(f.perspective.zoom=r.perspective.zoom),void 0!==r.isUpVectorFlipped&&(f.isUpVectorFlipped=r.isUpVectorFlipped),void 0!==r.targetOffset&&(f.targetOffset=r.targetOffset)):"Mesh"===e.type?("geometry"in r&&Object.assign(f,{geometry:ng.merge(f.geometry,r.geometry)}),(r.material||r.materials)&&(f=function(e,r){if(void 0===r)return e;var n=R({},e);return"material"in n&&"material"in r&&r.material&&(n.material=eY(n.material,function(e){var n=!0,i=!1,a=void 0;if("string"!=typeof e)try{for(var o,s=Object.entries(r.material.layers)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=F(o.value,2),u=l[0],c=l[1],h=e.layers.data(u);h&&r5.patch(h,c)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}).data),n.materials&&r.materials&&(n.materials=eY(n.materials,function(e){for(var i=0;i<n.materials.length;i++){var a=r.materials[i],o=!0,s=!1,l=void 0;if("string"!=typeof a)try{for(var u,c=Object.entries(a.layers)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var h,d,f=F(u.value,2),p=f[0],v=f[1],y=null==(d=e[i])||null==(h=d.layers)?void 0:h.data(p);y&&r5.patch(y,v)}}catch(e){s=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}}}).data),n}(f,r)),f.cloner&&"cloner"in r&&Object.assign(f,{cloner:nM.merge(f.cloner,r.cloner)})):"Empty"===e.type?f.cloner&&"cloner"in r&&Object.assign(f,{cloner:nM.merge(f.cloner,r.cloner)}):r_.is(e.type)&&(void 0!==r.intensity&&(f.intensity=r.intensity),void 0!==r.color&&("string"==typeof r.color?f.color=r.color:f.color=ri.clone(r.color))),f},(iu||(iu={})).defaultData={enablePan:!0,enableZoom:!0,enableRotate:!0,enableDamping:!0,rotationLimitsMode:0,rotationVerticalOffset:{min:Math.PI/4,max:Math.PI/4},rotationHorizontalOffset:{min:Math.PI/4,max:Math.PI/4},rotationSoftLimit:2,rotationSpeed:1,panLimitsMode:0,panVerticalOffset:{min:250,max:250},panHorizontalOffset:{min:250,max:250},panSoftLimit:2,zoomLimitsEnabled:!1,zoomLimits:{min:.1,max:2},autoRotate:!1,autoRotateSpeed:2,autoRotateClockwise:!0,hoverRotatePanMode:0,hoverRotatePanStrength:20,hoverRotateDamping:.125,isTouchZoom:!0,orbitTouches:2,panTouches:3,resetHoverEffectOnPointerLeave:!0},(ic||(ic={})).defaultData={orbitControls:iu.defaultData,playPage:rc,withBackground:!0,preventScroll:!1,preventTouchScroll:!1,hideCursor:!1,mouseEventTarget:"canvas",joystickSizeAndXYOffset:Array(12).fill(0).map(function(e,r){var n=0,i=0;return r<5?i=-30:r<10&&(i=30),0===r||10===r||5===r?n=30:(4===r||11===r||9===r)&&(n=-30),[120,[n,i],"show"]}),settings:{image:{format:"jpg",ratio:1,colorSpace:"display-p3"},videoStatic:{fps:60,mbps:150,ratio:1,duration:1e3,format:"mp4",imageFormat:"jpg",activeTimeline:null,colorSpace:"display-p3"},web:{logo:!0,compress:!0,preset:1,preload:!0,hint:!1,imageQuality:70,pixelRatioMobile:0,pixelRatioDesktop:0}},stopRaycast:!0,hdTransmission:!1,renderer:"webgpu",asyncShaderCompilation:!0},(ih||(ih={})).defaultData={id:"basic",label:"Basic",style:"None",prompt:""},(id||(id={})).defaultData={weather:0,shadows:0,lightOrigin:0,temperature:0,sun:0,camera:0,environment:0,particles:0,nature:0,floor:0},(iV=ip||(ip={})).defaultData=function(){return{mode:"line-art-both",prompt:"",negativePrompt:"",style:R({},ih.defaultData),isRandomSeed:!0,seed:iV.generateSeed(),guessMode:!1,advanced:!1,steps:20,guidanceScale:7.5,controlNetScale:1,modifiers:id.defaultData}},iV.generateSeed=function(){return Math.round(1e5*Math.random())},iN=iv||(iv={}),iG=function(e,r){var n=e.scene.objects.get(r);if(n&&"Component"===n.data.type)return n;var i=e.shared.lib.components[r];if(i)return B(R({},i.asset),{id:r})},iN.physicsEnabled=function(e){return void 0!==e.find(function(e){return"Page"===e.data.type&&e.data.globalPhysics.usePhysics})},iN.findTimeline=function(e,r){var n,i=e.find(function(e){var n;return"Page"===e.data.type&&void 0!==(null==(n=e.data.timelines)?void 0:n[r])});return i&&(null==(n=i.data.timelines)?void 0:n[r])},iN.getComponentData=iG,iN.traverseModuleInstances=function(e,r,n){e.scene.objects.traverseFrom(r,function(r,i){if("Instance"===i.type){var a,o=null==(a=iG(e,i.component))?void 0:a.data;o&&n(r,i,o.events)}else n(r,i,i.events)})},iW=iy||(iy={}),iH=function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];e&&n.push(R({},iW.defaultLight)),n.push.apply(n,V(r));var i=new es;return i.push({fi:1,id:rc,data:B(R({},io.defaultData),{name:"Scene 1"}),children:n}),i},iq=function(e){return B(R({},iW.defaultData),{objects:X(e,es.prototype)})},iW.TRASH_CAN_ID="830a2708-8ed9-49cf-a68e-085299892222",iW.defaultLight={fi:-1,data:ir.defaultDirectionalLightData,id:"830a2708-8ed9-49cf-a68e-085299899103",children:[]},iW.createDefaultObjectTreeWithPage=iH,iW.defaultData={objects:iH(),publish:ic.defaultData,styles:ip.defaultData()},iW.emptyDataWithoutPage=function(){return{objects:new es,publish:ic.defaultData,styles:ip.defaultData()}},iW.emptyDataWithPage=function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return{objects:iH(e),publish:ic.defaultData,styles:ip.defaultData()}},iW.emptyData=function(){return{objects:new es,publish:R({},ic.defaultData),styles:ip.defaultData()}},iW.withObjs=iq,iW.withObj=function(e,r){return iq([{id:e,data:r,children:[],fi:0}])},(im||(im={})).defaultData={preset:"fullscreen",allowResponsive:!1,size:[512,512],coords:[0,0],sceneScale:1,color:{r:0,g:0,b:0,a:.5}},(iY=ig||(ig={})).defaultData=function(e){return{url:e,name:"New Webhook",parametersSchemas:new eu}},iY.defaultParameterValueByType=function(e){return"number"===e?0:"boolean"!==e&&""},(ib||(ib={})).defaultData=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET";return{url:e,method:r,name:"New API",headers:new eu,queries:new eu,autoStart:!0}},iX=iw||(iw={}),iZ=function(e){return void 0!==e.textValue},iK=function(e){return"boolean"==typeof e},iX.isTextValue=iZ,iX.isNumber=function(e){return"number"==typeof e},iX.isBoolean=iK,iX.typeOfVariable=function(e){return iZ(e)?"string":iK(e)?"boolean":"number"},iX.getDisplayedValue=function(e){var r;return iX.isTextValue(e)?Array.isArray(e.textValue)?e.textValue.map(function(r){var n;return r.toString().padStart(null!=(n=e.padding)?n:2,"0")}).join(null!=(r=e.deliminator)?r:":")+(void 0!==e.suffix?" "+e.suffix:""):e.textValue.toString():iX.isBoolean(e)?e?"True":"False":iX.isNumber(e)?parseFloat(e.toFixed(3)).toString():e.toString()},(ix||(ix={})).all=["images","videos","colors","audios","particles","fonts","materials","variables"],(iS||(iS={})).all=V(ix.all).concat(["components"]),(ik||(ik={})).defaultData=function(){return{images:new ea,videos:new ea,colors:new ea,audios:new ea,particles:new ea,fonts:new ea,materials:new ea,components:new ea,variables:new ea,userAPIs:new ea,userWebhooks:new ea}},(iM||(iM={})).defaultData=function(){return{images:new ea,videos:new ea,colors:new ea,audios:new ea,particles:new ea,fonts:new ea,materials:new ea,components:new ea,variables:new ea,userAPIs:new ea,userWebhooks:new ea}},(iJ=iA||(iA={})).defaultColors=function(){return X({"89b10010-844c-11ec-a8a3-0242ac120002":{r:.5,g:.5,b:.5,a:1,name:"Default Color"}},ea.prototype)},iJ.defaultImages=function(){return X({},ea.prototype)},iJ.emptyData=function(){return{catelogs:new ea,materials:new ea,images:new ea,videos:new ea,colors:new ea,audios:new ea,particles:new ea,fonts:new ea,variables:new eu,userAPIs:new ea,userWebhooks:new ea,lib:iM.defaultData()}},iJ.defaultVariables=function(e){switch(e){case"number":return{value:0,name:"Number"};case"boolean":return{value:!1,name:"Boolean"};case"string":return{value:{textValue:"String value"},name:"String"};case"time":var r=[0,0,0];return{name:"Time",value:{textValue:r,deliminator:":",padding:2,suffix:"AM"},dynamicVariableType:"time",format:"HH:mm:ss",format12h24h:"12ampm",timeZone:null,hasEnd:!1,endValue:{textValue:r,deliminator:":",padding:2,suffix:"AM"},autoStart:!0,repeat:!1};case"counter":return{name:"Counter",value:0,dynamicVariableType:"counter",updateInterval:1e3,increment:1,autoStart:!0,hasEnd:!0,endValue:60,repeat:!0,randomStart:!1,range:[0,100],decimals:0};case"random":return{name:"Random",value:0,dynamicVariableType:"random",updateInterval:1e3,increment:1,autoStart:!0,isStatic:!1,hasEnd:!0,endValue:60,repeat:!0,min:0,max:100,decimals:0};default:console.error("Unknown variable type",e)}},iJ.getFormattedTimerTime=function(e,r){if("HH:mm:ss"===r.format){var n=Math.floor(e/3600),i=Math.floor((e-3600*n)/60);return{textValue:[n,i,Math.round(e-3600*n-60*i)]}}if("mm:ss"===r.format){var a=Math.floor(e/60);return{textValue:[a,Math.round(e-60*a)]}}return"number"===r.format?Math.round(e):Math.round(1e3*e)/1e3},(iQ=iO||(iO={})).defaultData={schema:131,scene:iy.defaultData,frames:(new ea).add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",im.defaultData),shared:B(R({},iA.emptyData()),{colors:iA.defaultColors()})},iQ.createDefaultData=function(){return t0.deserialize(t0.serialize(iQ.defaultData))},iQ.emptyDataForImports=function(){return{schema:131,scene:iy.emptyDataWithPage(),frames:(new ea).add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",im.defaultData),shared:B(R({},iA.emptyData()),{colors:iA.defaultColors(),images:iA.defaultImages()})}},iQ.emptyData=function(){return{schema:131,scene:iy.emptyDataWithPage(),frames:(new ea).add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",im.defaultData),shared:iA.emptyData()}},iQ.clipboard2dData=function(){return{schema:131,scene:iy.emptyData(),frames:new ea,shared:iA.emptyData()}},iQ.withoutLib=function(e){return B(R({},e),{shared:B(R({},e.shared),{lib:iM.defaultData()})})},iQ.getComponentData=function(e,r){return iv.getComponentData(e,r)},iQ.hasSensitiveData=function(e){var r=Object.values(e.shared.userAPIs),n=!0,i=!1,a=void 0;try{for(var o,s=r[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value.headers,u=!0,c=!1,h=void 0;try{for(var d,f=l[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){var p=d.value;if("authorization"===p.data.key.toLowerCase()&&""!==p.data.value)return!0}}catch(e){c=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw h}}}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return!1},(iC||(iC={})).defaultData=function(e,r){return{id:e,name:r,duration:5,objectTimelines:new ea}},(i_||(i_={})).is=function(e){return e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z},i$=iP||(iP={}),i0=function(e,r){var n=[0,0],i=[1,1];if(null==e?void 0:e.cubicControls)n=iD(e.cubicControls.control1,n);else switch(null==e?void 0:e.type){case 2:case 4:n=[.42,0];break;case 3:case 0:n=[0,0];break;case 1:n=[.25,.1];break;case 7:n=[.25,1]}if(null==r?void 0:r.cubicControls)i=iD(r.cubicControls.control2,i);else switch(null==r?void 0:r.type){case 2:case 0:i=[1,1];break;case 3:case 4:i=[.58,1];break;case 1:i=[.25,1];break;case 7:i=[.5,1]}return{control1:n,control2:i}},i1=function(e){if(i$.BEZIER_PRESETS.includes(e)){var r={type:e};return{control1:i0(r).control1,control2:i0(void 0,r).control2}}},i2=function(e,r){return .001>Math.abs(e[0]-r[0])&&.001>Math.abs(e[1]-r[1])},i3=function(e){var r=i$.ROOT_PROPERTY_ORDER.indexOf(e[0]);return -1===r?i$.ROOT_PROPERTY_ORDER.length:r},i5=function(e){var r;return null!=(r=e.layerId)?r:e.path.join(".")},i4=function(e){var r=e[e.length-1];return ae.includes(r)?r:void 0},i6=function(e){return e.layerId?e.layerId:(i4(e.path)?e.path.slice(0,-1):e.path).join(".")},i8=function(e){return["material","light"===e.type?"".concat(e.category," lighting"):e.type]},i9=function(e,r,n){var i;return{id:e,data:{id:e,time:null!=(i=null==n?void 0:n.time)?i:0,path:r,value:{},layerId:null==n?void 0:n.layerId,index:null==n?void 0:n.index,isPlaceholder:!0,easing:{type:5,cubicControls:{control1:[.42,0],control2:[.58,1]}}}}},i$.getControlsWithDefault=i0,i$.BEZIER_PRESETS=[0,1,2,3,4,7],i$.presetHandles=i1,i$.presetForHandles=function(e){return i$.BEZIER_PRESETS.find(function(r){var n=i1(r);return void 0!==n&&i2(n.control1,e.control1)&&i2(n.control2,e.control2)})},i$.defaultData=function(e){return{id:e,keyframes:new eu}},i$.ROOT_PROPERTY_ORDER=["position","rotation","scale","shape size","material","opacity","camera","light","cloner","path extrusion","path snapping"],i$.rowOrder=i3,i$.propertyKey=i5,i$.groupKeyframes=function(e,r){var n=new Map,i=!0,a=!1,o=void 0;try{for(var s,l=e[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=u.data;if(null==r||!r(c)){var h=i5(c),d=n.get(h);d||(d={id:h,path:c.path,keyframes:[],layerId:c.layerId,index:c.index},n.set(h,d)),c.isPlaceholder?d.placeholder=u.id:d.keyframes.push(u)}}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return V(n.values()).sort(function(e,r){var n,i,a=i3(e.path)-i3(r.path);return 0!==a?a:(null!=(n=e.index)?n:0)-(null!=(i=r.index)?i:0)})},i$.rowAxis=i4,i$.drawnRowKey=i6,i$.drawnRows=function(e){var r=new Map,n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value,u=i4(l.path),c=u?l.path.slice(0,-1):l.path,h=i6(l),d=r.get(h);d||(d={id:h,path:c,layerId:l.layerId,index:l.index,tracks:[]},r.set(h,d)),d.tracks.push({axis:u,property:l})}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return V(r.values())},i$.sortedKeyframes=function(e){return V(e).sort(function(e,r){return e.data.time-r.data.time})},i$.materialLayerPath=i8,i$.createMaterialGroup=function(e,r){return e.map(function(e,n){var i=e.data,a=e.id;return i9(r(),i8(i),{layerId:a,index:n})})},i$.placeholderKeyframe=i9,i$.createName=function(e){return Object.entries(e).reduce(function(e,r){var n=F(r,2),i=(n[0],n[1]);return"string"!=typeof i&&e.push({name:i.name}),e},[])},i$.Presets=[{name:"Slide in",animationParams:{translateX:{value:[-20,0],easing:ij(3),duration:1e3},opacity:{value:[0,1],easing:ij(3),duration:1e3},endDelay:250,loop:!0}},{name:"Rotate",animationParams:{rotate:{value:[0,"1turn"],easing:ij(5),duration:700},endDelay:250,loop:!0}},{name:"Scale Out",animationParams:{scale:{value:[1,1.5],easing:ij(4),duration:1e3},endDelay:250,loop:!0}},{name:"Jump",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],endDelay:500,loop:!0}},{name:"Jump Rotate",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],rotate:{value:[0,"1turn"],easing:ij(5),duration:500},endDelay:500,loop:!0}},{name:"Bounce",animationParams:{translateY:{value:["20px","-20px"],duration:575,easing:"easeOutQuad"},direction:"alternate",loop:!0}}];var iT,iI,iR,iB,iz,iL,iF,iU,iV,iN,iG,iW,iH,iq,iY,iX,iZ,iK,iJ,iQ,i$,i0,i1,i2,i3,i5,i4,i6,i8,i9,i7,ae=["x","y","z"],at=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;A(this,e),this.mass=r,this.stiffness=n,this.damping=i,this.initialVelocity=a,this.m_w0=Math.sqrt(n/r),this.m_zeta=i/(2*Math.sqrt(n*r)),this.m_zeta<1?(this.m_wd=this.m_w0*Math.sqrt(1-this.m_zeta*this.m_zeta),this.m_A=1,this.m_B=(this.m_zeta*this.m_w0-a)/this.m_wd):(this.m_wd=0,this.m_A=1,this.m_B=-a+this.m_w0)}return _(e,[{key:"solve",value:function(e){return 1-(this.m_zeta<1?Math.exp(-e*this.m_zeta*this.m_w0)*(this.m_A*Math.cos(this.m_wd*e)+this.m_B*Math.sin(this.m_wd*e)):(this.m_A+this.m_B*e)*Math.exp(-e*this.m_w0))}},{key:"getDuration",value:function(){for(var e=0,r=0;;)if(e+=.16666666666666666,1===this.solve(e)){if(++r>=16)break}else r=0;return .16666666666666666*e*1e3}}]),e}();function ar(e){return"MouseDown"===e||"MouseUp"===e||"KeyDown"===e||"KeyUp"===e||"Collision"===e||"Trigger"===e}(an=i7||(i7={})).toEventUIType=function(e){return"Conditional"===e.type?"Distance"===e.condition.type?"Distance":"StateChange":e.type},an.fromEventUIType=function(e){return"Distance"===e||"StateChange"===e?"Conditional":e};var an,ai,aa,ao,as,al,au,ac,ah,ad,af,ap,av,ay,am,ag,ab,aw,ax,aS,ak,aM,aA={LookAt:[],Follow:["Create"],DragDrop:["Transition","Animation","Audio","Particles","Create","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MouseHover:["Transition","Animation","TimelineAnimation","Particles","Create","Destroy","SwitchCamera","SceneTransition","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Scroll:["Transition","Animation","TimelineAnimation","Create","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Start:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Conditional:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MouseDown:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MouseUp:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MousePress:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Link","Create","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],KeyDown:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],KeyUp:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],KeyPress:["Transition","Animation","Audio","Particles","Video","Link","Create","SwitchCamera","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],GameControl:["Transition","Animation","TimelineAnimation","Audio","Particles","Create","Conditional"],Collision:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Create","Destroy","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Trigger:["Transition","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Resize:["Transition","Animation","Audio","Particles","Video","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],VariableChange:["Transition","Animation","TimelineAnimation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],API:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],WEBHOOK:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],AIAssistantListener:["SetVariable"],AIAssistantTrigger:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"]};function aO(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var a={},o=!0,s=!1,l=void 0;try{for(var u,c=n.flat()[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var h=u.value;null!=e&&h in e&&(a[h]=e[h])}}catch(e){s=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}return a}function aC(e){e.layers.forEach(function(e){if("depth"===e.type&&void 0!==e.colorA){for(var r=e.colorA,n=e.colorB,i=[[r.r,r.g,r.b,r.a],[n.r,n.g,n.b,n.a]],a=[0,1],o=2;o<10;o++)i.push(i[1]),a.push(1);var s=B(R({},aO(eX(e),"type","visible","isVector","isWorldSpace","origin","alpha","mode")),{near:Math.max(0,e.near),far:Math.max(0,e.far),colors:i,steps:a,num:2,direction:[1,0,0],smooth:!1,gradientType:1});Object.assign(e,s)}else if("depth"===e.type&&1===e.gradientType&&(e.near<0||e.far<0)){var l=B(R({},eX(e)),{near:Math.max(e.near,0),far:Math.max(e.far,0)});Object.assign(e,l)}})}function a_(e,r){Object.values(e.shared.materials).forEach(function(e){return r(e)})}function aP(e,r){e.scene.objects.traverse(function(e,n){"materials"in n?n.materials.forEach(function(e,i){void 0===e&&(n.materials[i]=r8.defaultTwoLayerData("phong"),e=n.materials[i]),"string"!=typeof e&&r(e)}):"material"in n?"string"!=typeof n.material&&(void 0===n.material&&(n.material=r8.defaultTwoLayerData("phong")),r(n.material)):"Mesh"===n.type&&(void 0===n.material&&(n.material=r8.defaultTwoLayerData("phong")),r(n.material)),"overrides"in n&&Object.values(n.overrides).forEach(function(e){e.material&&"string"!=typeof e.material&&Object.getPrototypeOf(e.material)!==eb.prototype&&r(e.material)})})}function aE(e){void 0===e.layers&&Object.assign(e,r8.defaultTwoLayerData("lambert"))}function aD(e){e.layers&&e.layers.forEach(function(e){if("depth"===e.type&&10===e.colors.length){var r=V(e.colors);r.push(e.colors[9]);var n=V(e.steps);n.push(e.steps[9]);var i=B(R({},eX(e)),{colors:r,steps:n});Object.assign(e,i)}})}function aj(e){e.scene.objects.traverse(function(e,r){"materials"in r?r.materials.forEach(function(e){"string"!=typeof e&&aD(e)}):"material"in r&&"string"!=typeof r.material&&aD(r.material)}),Object.values(e.shared.materials).forEach(function(e){return aD(e)})}function aT(e){e.layers&&e.layers.forEach(function(e){"depth"===e.type&&void 0!==e.num&&(e.colors=e.colors.slice(0,e.num),e.steps=e.steps.slice(0,e.num),delete e.num)})}function aI(e){e.layers&&e.layers.forEach(function(e){"displace"!==e.type&&void 0===e.isMask&&(e.isMask=!1),("texture"===e.type||"video"===e.type)&&void 0===e.blending&&(e.blending=0),("noise"===e.type||"displace"===e.type&&"noise"===e.displacementType)&&(void 0===e.voronoiStyle&&(e.voronoiStyle=0),void 0===e.highCut&&(e.highCut=1),void 0===e.lowCut&&(e.lowCut=0),void 0===e.smoothness&&(e.smoothness=.3),void 0===e.seed&&(e.seed=0),void 0===e.quality&&(e.quality=1))})}function aR(e){var r,n=null==(r=e.layers.find(function(e){return"light"===e.type}))?void 0:r.data;"basic"===(null==n?void 0:n.category)&&(Object.assign(n,r5.defaultData("light","phong")),n.visible=!1)}function aB(e){a_(e,aR),aP(e,aR)}function az(e){e.layers.forEach(function(e){"light"===e.type&&"toon"!==e.category&&void 0===e.occlusion&&(e.occlusion=!0)})}function aL(e){e.layers&&e.layers.forEach(function(e){"light"===e.type&&void 0===e.bumpMapIntensity&&(e.bumpMapIntensity=5)})}function aF(e){e.layers&&e.layers.forEach(function(e){"light"===e.type&&void 0===e.alphaOverride&&(e.alphaOverride=1)})}(i=ai||(ai={})).is=function(e){return"MouseDown"===e.type||"MouseUp"===e.type||"MousePress"===e.type||"KeyDown"===e.type||"KeyUp"===e.type||"KeyPress"===e.type},i.defaultData=function(e){return"MouseDown"===e||"MouseUp"===e||"MousePress"===e?{type:e,mode:"Object",disabled:!1,name:"",actions:new eu}:{type:e,disabled:!1,name:"",key:void 0,actions:new eu}},(a=aa||(aa={})).propertyDefaultData=function(e){return{type:"Property",value:[null!=e?e:null,"position","x"]}},a.valueDefaultData={type:"Literal",value:0},(o=ao||(ao={})).comparisonDefaultData=function(e){return{type:"Comparison",operator:"==",lOperand:aa.propertyDefaultData(e),rOperand:R({},aa.valueDefaultData)}},o.distanceDefaultData=function(e){return{type:"Distance",toObject:null!=e?e:null,fromObject:null!=e?e:null,distance:200}},o.stateDefaultData=function(e,r){return{type:"State",object:null!=e?e:null,state:null!=r?r:null}},(as||(as={})).isConditionalSubActions=function(e){return void 0!==e.find(function(e){return"ifActions"===e||"elseActions"===e})},(s=al||(al={})).is=function(e){return"Conditional"===e.type},s.defaultData=function(e){return{type:"Conditional",disabled:!1,name:"",inActions:new eu,outActions:new eu,condition:ao.distanceDefaultData(e)}},(au||(au={})).defaultData={type:"DragDrop",name:"",cursor:"hand",disabled:!1,dampingFactor:1,objects:[],snapTo:"center",snapSurfaceMode:"bbox",snapSurfaceOffset:0,dropOn:"all",autoOrient:!0,dropDestinations:[],plane:"adaptive",planeMode:"locked",referenceFrame:"global",limits:[-1/0,1/0,-1/0,1/0,-1/0,1/0],drop:!1,resetOnSnapFail:!1,snapSpeed:20,resetSpeed:20,dragDropActions:{drag:new eu,drop:new eu}},(ac||(ac={})).defaultData={type:"Follow",disabled:!1,name:"",maxDelta:0,dampingFactor:1,target:"cursor",plane:"custom",resetOnPointerLeave:!0,resetAfterDistanceLimit:!0,enabledTranslation:[!0,!0,!0],limitDistanceEnabled:!1,limitDistance:1e3,snapDelay:0,resetSpeed:5,actions:new eu},(ah||(ah={})).defaultData={type:"LookAt",disabled:!1,name:"",distance:1e3,dampingFactor:1,target:"cursor",tilt:"up",axis:"z",plane:"custom",resetOnPointerLeave:!0,resetAfterDistanceLimit:!0,enabledRotation:[!0,!0,!0],limitDistanceEnabled:!1,limitDistance:1e3,snapDelay:0,resetSpeed:5},(l=ad||(ad={})).is=function(e){return"MouseHover"===e.type},l.defaultData=function(){return{type:"MouseHover",disabled:!1,name:"",actions:new eu}},(u=af||(af={})).is=function(e){return"Scroll"===e.type},u.defaultData=function(){return{type:"Scroll",disabled:!1,name:"",steps:100,trigger:"load",startFrom:"enter",enterAnchor:"top",startOffset:0,endAfter:400,actions:new eu}},(c=ap||(ap={})).is=function(e){return"Start"===e.type},c.defaultData=function(){return{type:"Start",disabled:!1,name:"",actions:new eu}},(h=av||(av={})).is=function(e){return"Collision"===e.type},h.defaultData=function(){return{type:"Collision",disabled:!1,name:"",target:"character",actions:new eu}},(d=ay||(ay={})).is=function(e){return"Trigger"===e.type},d.defaultData=function(e,r){return{type:"Trigger",name:"",disabled:!1,target:"all",triggeringObjects:[],actions:new eu,triggerZone:"box",position:r.toArray(),rotation:[0,0,0],size:e.toArray(),radius:e.length()/2,helperVisible:!0}},(f=am||(am={})).defaultSizes={mobile:[480,480],tablet:[768,768],desktop:[1200,1200],custom:[769,1200]},f.is=function(e){return"Resize"===e.type},f.sizeToDevice=function(e){return"string"==typeof e?e:"custom"},f.deviceToSize=function(e){return"string"==typeof e?V(f.defaultSizes[e]):V(e)},f.defaultData=function(){var e={size:"mobile",operator:"<",actions:new eu},r={size:"tablet",operator:"<",actions:new eu},n={size:V(f.defaultSizes.custom),operator:"<>",actions:new eu},i=new eu;return i.push({id:w.Cc.generateUUID(),fi:0,data:e},{id:w.Cc.generateUUID(),fi:1,data:r},{id:w.Cc.generateUUID(),fi:2,data:n}),{type:"Resize",disabled:!1,name:"",orientation:"horizontal",breakpoints:i}},f.defaultBreakpointData=function(){return{size:V(f.defaultSizes.custom),operator:"<>",actions:new eu}},(p=ag||(ag={})).propertyPaths={Position:["position"],"Position X":["position","x"],"Position Y":["position","y"],"Position Z":["position","z"],Rotation:["rotation"],"Rotation X":["rotation","x"],"Rotation Y":["rotation","y"],"Rotation Z":["rotation","z"],Scale:["scale"],"Scale X":["scale","x"],"Scale Y":["scale","y"],"Scale Z":["scale","z"],Width:["width"],Height:["height"],Depth:["depth"],"Mouse Position X":["mouse","x"],"Mouse Position Y":["mouse","y"],"Mouse Pressed":["mouse","pressed"],"Screen Width":["mouse","width"],"Screen Height":["mouse","height"],"Hit Position X":["raycast","x"],"Hit Position Y":["raycast","y"],"Hit Position Z":["raycast","z"],"Hit Object Position X":["raycast","objX"],"Hit Object Position Y":["raycast","objY"],"Hit Object Position Z":["raycast","objZ"]},p.is=function(e){return"VariableChange"===e.type},p.defaultData=function(){return{disabled:!1,type:"VariableChange",name:"",actions:new eu,variableId:"",objectId:null,property:"Position X"}},(v=ab||(ab={})).is=function(e){return"API"===e.type},v.defaultData=function(){return{disabled:!1,type:"API",name:"",successActions:new eu,errorActions:new eu,userAPIId:""}},(y=aw||(aw={})).is=function(e){return"WEBHOOK"===e.type},y.defaultData=function(){return{disabled:!1,type:"WEBHOOK",name:"",actions:new eu,userWebhookId:""}},(m=ax||(ax={})).is=function(e){return"AIAssistantListener"===e.type},m.defaultData=function(){return{disabled:!1,type:"AIAssistantListener",name:"",actions:new eu,analysis:"average",analysisRange:[0,71],analysisSingle:0}},(g=aS||(aS={})).is=function(e){return"AIAssistantTrigger"===e.type},g.defaultData=function(){return{disabled:!1,description:"",name:"",type:"AIAssistantTrigger",actions:new eu}},(ak||(ak={})).list=["idle","move","jump","run"],(b=aM||(aM={})).defaultColliderData={type:"capsule",height:200,radius:50,position:[0,0,0],rotation:[0,0,0]},b.defaultDataThirdPerson={moveMode:"walk",forwardDirection:"+z",speedTranslate:1e3,speedRotate:100,runMultiplier:2,rotationMode:"normal",rotBy:"keys",rotByTouch:"drag",delayPos:[.3,.3],delayRot:[.3,.3],keyAssignments:[["moveNegZ","W"],["moveNegX","A"],["movePosZ","S"],["movePosX","D"],["rotPosX","▲"],["rotPosY","◀"],["rotNegX","▼"],["rotNegY","▶"],["jump","Space"],["run","⇧"],["none","Ctrl"]],touchControl:!0,joystickPosLoc:5,joystickRotLoc:11,jumpTouchButtonLoc:9,collider:b.defaultColliderData,colliderHelperVisible:!0,collisionEnabled:!0,jumpPower:100,resetYPosition:3e3,alignToGround:!1,autoOrientMove:!0,orientWith:"camera",orientMode:"radial",delayPosCamera:.3,delayRotCamera:.3,camera:"",cameraXAxis:"Limit",cameraYAxis:"Free",cameraRotXLimits:[0,Math.PI/2],cameraRotYLimits:[-Math.PI/2,Math.PI/2],gameActions:{idle:new eu,move:new eu,jump:new eu,run:new eu},navmesh:{enabled:!1,ch:6,cs:6,walkableClimb:5,walkableHeight:1,walkableRadius:0,zones:"all",objects:[],helperVisible:!0,destinationHelperRadius:0,destinationHelperColor:ro.fromHexAndA(3728051,1)}};var aU=180/Math.PI,aV=Math.PI/180;function aN(e,r){var n=F(e,3),i=n[0],a=n[1],o=n[2],s=Math.cos(i),l=Math.sin(i),u=Math.cos(a),c=Math.sin(a),h=Math.cos(o),d=Math.sin(o),f=[u*h,s*d+l*h*c,l*d-s*h*c],p=Math.hypot(r[0],r[1],r[2])||1;return Math.abs((f[0]*r[0]+f[1]*r[1]+f[2]*r[2])/p)}function aG(e){e.rotation=e.rotation.slice(0,3).map(function(e){return e*aU}),"Page"===e.type&&((1e-6>Math.abs((s=aN(i=n=(r=e.camera).rotation.slice(0,3),o=Array.isArray(a=r.up)&&a.length>=3&&a.every(function(e){return"number"==typeof e&&Number.isFinite(e)})?a:[0,1,0]))-(l=aN(i.map(function(e){return e*aV}),o)))?i.some(function(e){return Math.abs(e)>Math.PI}):l<s)?r.rotation=n:r.rotation=n.map(function(e){return e*aU})),null==(c=e.states)||c.forEach(function(e){void 0===e.rotation||null===e.rotation||(e.rotation=e.rotation.slice(0,3).map(function(e){return e*aU}))});var r,n,i,a,o,s,l,u,c,h,d=e.geometry;d&&"SphereGeometry"===d.type&&(d.thetaLength=(null!=(u=d.thetaLength)?u:180)*aU),d&&"TorusGeometry"===d.type&&(d.arc=d.arc*aU),d&&"PathGeometry"===d.type&&(d.extrusion.angle*=aU,d.extrusion.twist*=aU),"Mesh"===e.type&&"TextGeometry"===e.geometry.type&&(e.geometry.text={textValue:e.geometry.text}),Array.isArray(eX(e.events))&&(null==(h=e.events)||h.forEach(function(e){("MouseDown"===e.type||"MouseUp"===e.type||"MousePress"===e.type||"KeyDown"===e.type||"KeyUp"===e.type||"KeyPress"===e.type||"Collision"===e.type||"Trigger"===e.type)&&(e.runMode=e.toggle?"Toggle":"Repeat")}))}function aW(e){e.scene.objects.traverse(function(e,r){})}function aH(e){var r,n=null!=(r=e.schema)?r:104;131!==n&&n<130&&(aZ(e.asset),e.schema=130)}function aq(e,r){r(e.data);var n=!0,i=!1,a=void 0;try{for(var o,s=e.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;aq(l,r)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}function aY(e){var r,n=null!=(r=e.schema)?r:104;131!==n&&(n<105&&(aq(e.asset,aG),e.schema=105),n<118&&(aq(e.asset,aJ),e.schema=118),n<121&&(aq(e.asset,a3),e.schema=121),n<130&&(aq(e.asset,aK),e.schema=130))}function aX(e,r){aP(e,r),a_(e,r),Object.values(e.shared.lib.materials).forEach(function(e){return r(e.asset)})}function aZ(e){void 0===e.layers&&Object.assign(e,r8.defaultTwoLayerData("phong"))}function aK(e){"materials"in e?e.materials.forEach(function(e){void 0!==e&&"string"!=typeof e&&aZ(e)}):"material"in e&&void 0!==e.material&&"string"!=typeof e.material&&aZ(e.material)}function aJ(e){e.timelineAnimations=X({},ea.prototype)}var aQ=["position","rotation","scale","shape size"];function a$(e){var r=!0,n=!1,i=void 0;try{for(var a,o=V(e.unproxy())[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value,l=s.id,u=s.data,c=null==(x=u.path)?void 0:x[0];if(c&&aQ.includes(c)){var h=a0(u.value);if(h.length){var d=e.data(l);if(d){var f=u.value,p=U(h),v=p[0],y=p.slice(1),m=!0,g=!1,b=void 0;try{for(var x,S,k=y[Symbol.iterator]();!(m=(S=k.next()).done);m=!0){var M=S.value,A=w.Cc.generateUUID();e.insertBefore(null,[{id:A,data:B(R({},u),{id:A,path:[c,M],value:f[M],easing:function(e){var r,n,i=null==e?void 0:e.cubicControls;return R(B(R({},e),{cubicControls:{control1:V(null!=(r=null==i?void 0:i.control1)?r:[0,0]),control2:V(null!=(n=null==i?void 0:i.control2)?n:[1,1])}}),(null==e?void 0:e.springParameters)?{springParameters:R({},e.springParameters)}:{})}(u.easing)})}])}}catch(e){g=!0,b=e}finally{try{m||null==k.return||k.return()}finally{if(g)throw b}}d.path=[c,v],d.value=f[v]}}}}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}function a0(e){return null===e||"object"!=(void 0===e?"undefined":N(e))?[]:ae.filter(function(r){return r in e})}function a1(e){var r=function(e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=iP.groupKeyframes(e)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0)!function(){var e=o.value,n=new Set(e.keyframes.flatMap(function(e){return a0(e.data.value)})),i=n.size?V(n).map(function(r){return e.keyframes.filter(function(e){return a0(e.data.value).includes(r)})}):[e.keyframes],a=!0,s=!1,l=void 0;try{for(var u,c=i[Symbol.iterator]();!(a=(u=c.next()).done);a=!0)for(var h=u.value,d=V(h).sort(function(e,r){return e.data.time-r.data.time}),f=0;f+1<d.length;f++)r.push({left:d[f],right:d[f+1]})}catch(e){s=!0,l=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}}()}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(V(e.unproxy())),n=new Map,i=new Set,a=!0,o=!1,s=void 0;try{for(var l,u=r[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c,h,d,f,p,v=l.value,y=v.left,m=v.right,g=null==(h=y.data.easing)?void 0:h.type,b=null!=(c=null==(d=void 0===g?void 0:iP.presetHandles(g))?void 0:d.control2)?c:5===g?iD(null==(p=m.data.easing)||null==(f=p.cubicControls)?void 0:f.control2,[1,1]):void 0;if(b){var w=n.get(m.id);w?1e-6>Math.abs(w[0]-b[0])&&1e-6>Math.abs(w[1]-b[1])||i.add(m.id):n.set(m.id,b)}}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}var x=new Map,S=!0,k=!1,M=void 0;try{for(var A,O=e.unproxy()[Symbol.iterator]();!(S=(A=O.next()).done);S=!0){var C,_=A.value,P=_.id,E=null==(C=_.data.easing)?void 0:C.type,D=void 0===E?void 0:iP.presetHandles(E);D&&x.set(P,D.control1)}}catch(e){k=!0,M=e}finally{try{S||null==O.return||O.return()}finally{if(k)throw M}}var j=!0,T=!1,I=void 0;try{for(var R,B=r[Symbol.iterator]();!(j=(R=B.next()).done);j=!0){var z=R.value,L=z.left,U=z.right;i.has(U.id)&&x.delete(L.id)}}catch(e){T=!0,I=e}finally{try{j||null==B.return||B.return()}finally{if(T)throw I}}var N=!0,G=!1,W=void 0;try{for(var H,q=x[Symbol.iterator]();!(N=(H=q.next()).done);N=!0){var Y,X=F(H.value,2),Z=X[0],K=X[1],J=e.data(Z);(null==J?void 0:J.easing)&&(J.easing.cubicControls={control1:K,control2:iD(null==(Y=J.easing.cubicControls)?void 0:Y.control2,[1,1])},J.easing.type=5)}}catch(e){G=!0,W=e}finally{try{N||null==q.return||q.return()}finally{if(G)throw W}}var Q=!0,$=!1,ee=void 0;try{for(var et,er=r[Symbol.iterator]();!(Q=(et=er.next()).done);Q=!0){var en,ei=et.value,ea=ei.left,eo=ei.right;if(x.has(ea.id)){var es=e.data(eo.id),el=n.get(eo.id);(null==es?void 0:es.easing)&&el&&(es.easing.cubicControls={control1:iD(null==(en=es.easing.cubicControls)?void 0:en.control1,[0,0]),control2:el})}}}catch(e){$=!0,ee=e}finally{try{Q||null==er.return||er.return()}finally{if($)throw ee}}}function a2(e,r){e.scene.objects.traverse(function(e,n){var i=!0,a=!1,o=void 0,s=!0,l=!1,u=void 0;if("Page"===n.type&&n.timelines)try{for(var c,h,d=Object.values(n.timelines)[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var f=h.value;try{for(var p,v=Object.values(null!=(c=f.objectTimelines)?c:{})[Symbol.iterator]();!(i=(p=v.next()).done);i=!0){var y=p.value;r(y.keyframes)}}catch(e){a=!0,o=e}finally{try{i||null==v.return||v.return()}finally{if(a)throw o}}}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}})}function a3(e){e.pivot=[0,0,0],e.pivotRotation=[0,0,0]}function a5(e){}function a4(e){var r=null!=(s=e.schema)?s:0;if(131!==r){if(r>131)return void console.error("This scene was created with a newer version of Spline (file format ".concat(r,", this runtime reads 131). Update @splinetool/runtime to the latest version to load it correctly."));console.warn("updating from ",r,"to ",131),function(e,r){if(r<1&&(aP(e,aC),a_(e,aC),e.schema=1),r<2&&(Object.assign(e.scene.publish,{orbitControls:R({},iu.defaultData,eX(e.scene.publish.orbitControls))}),e.schema=2),r<3&&(function(e){function r(e){if(e.layers){var r=!0,n=!1,i=void 0;try{for(var a,o=Object.values(e.layers)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(s){var l=!0,u=!1,c=void 0,h=!0,d=!1,f=void 0;try{for(var p,v=Object.entries(s)[Symbol.iterator]();!(h=(p=v.next()).done);h=!0){var y=F(p.value,2),m=y[0],g=y[1];if((no.includes(m)||"boolean"==typeof g)&&delete s[m],"texture"===m)try{for(var b,w=Object.entries(g)[Symbol.iterator]();!(l=(b=w.next()).done);l=!0){var x=F(b.value,2),S=x[0],k=x[1];(ns.includes(S)||"boolean"==typeof k)&&delete g[S]}}catch(e){u=!0,c=e}finally{try{l||null==w.return||w.return()}finally{if(u)throw c}}}}catch(e){d=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(d)throw f}}}}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}}e.scene.objects.traverse(function(e,n){n.states.forEach(function(e){e.material?r(e.material):e.materials&&e.materials.forEach(function(e){r(e)})})})}(e),e.schema=3),r<4&&(e.scene.publish.withBackground=!0,e.schema=4),r<5&&(e.scene.publish.settings.web={compress:!0,preload:!0,preset:1,logo:!0,hint:!1},e.schema=5),r<6&&(e.scene.objects.traverse(function(e,r){var n=r.cloner;n&&(n.radial.scale=n.radial.scale.map(function(e){return e+1}),n.linear.scale=n.linear.scale.map(function(e){return e+1}))}),e.schema=6),r<7&&(e.scene.objects.traverse(function(e,r){var n=r.geometry;n&&("DodecahedronGeometry"===n.type||"IcosahedronGeometry"===n.type)&&(n.detail=Math.round(n.detail))}),e.schema=7),r<8&&(e.schema=8),r<9&&(aj(e),e.schema=9),r<10&&(e.scene.objects.traverse(function(e,r){"Mesh"===r.type&&("BooleanGeometry"===r.geometry.type||"SubdivGeometry"===r.geometry.type)&&(r.geometry.phongAngle=35)}),e.schema=10),r<11&&(e.scene.environment.ambientLight.softShadows=!1,e.scene.environment.ambientLight.softShadowQuality="low",e.scene.objects.traverse(function(e,r){("DirectionalLight"===r.type||"SpotLight"===r.type)&&(r.shadowResolution=1024,r.shadowRadius=1,r.depth=1e5)}),e.shared.penumbraSize=[,,,,,].fill(.5),e.schema=11),r<12&&(aj(e),e.schema=12),r<13&&(e.shared.audios=X({},ea.prototype),e.schema=13),r<14&&(Object.entries(l=e.shared.materials).forEach(function(e){var r=F(e,2),n=r[0];r[1].layers||Object.assign(l,P({},n,{name:"Untitled Material",layers:[{fi:0,data:{type:"light",category:"phong",alpha:.6,visible:!0,mode:0,specular:{r:.2,g:.2,b:.2},shininess:5},id:"layer1"},{fi:1,data:{type:"color",alpha:1,visible:!0,mode:0,color:{r:.2823529411764706,g:.2823529411764706,b:.30196078431372547}},id:"layer2"}]}))}),e.schema=14),r<15&&(Object.entries(eX(e.shared.images)).filter(function(e){return!1===e[1].asset}).map(function(e){return e[0]}).forEach(function(r){delete e.shared.images[r]}),Object.entries(eX(e.shared.audios)).filter(function(e){return!1===e[1].asset}).map(function(e){return e[0]}).forEach(function(r){delete e.shared.audios[r]}),e.schema=15),r<16&&(e.scene.publish.settings.web.preload=!1,e.schema=16),r<17&&(aP(e,aT),a_(e,aT),e.schema=17),r<18&&(aP(e,aE),a_(e,aE),e.schema=18),r<19&&(Object.assign(e.scene.publish.settings,{video:R({},ic.defaultData.settings.video,eX(e.scene.publish.settings.video))}),e.schema=19),r<20&&(e.shared.fonts=X({},ea.prototype),u=[],e.scene.objects.traverse(function(r,n){if("TextFrame"===n.type){var i=r8.defaultTwoLayerData("phong"),a="string"==typeof n.color?e.shared.colors[n.color]:n.color;i.layers[1].data.color={r:a.r,g:a.g,b:a.b},i.layers[1].data.alpha=n.alpha;var o=n.font.replace(".typeface","").replace(/optimer/gi,"open sans").replace("space_mono","space mono").replace(/alma_mono/gi,"varela round").replace(/droid_sans_mono/gi,"noto sans mono").replace(/droid_sans|gentilis|gnomon_(simple|foreground)|helvetiker/gi,"roboto").replace(/droid_serif/gi,"roboto slab").replace("_sans"," sans").replace("crimson_text","crimson text").replace("medium_medium","medium").replace("fatface_fatface","fatface").replace("100hairline","thin").replace("200thin","extralight").replace("300light","light").replace("500medium","medium").replace("600semi","semibold").replace("800heavy","extrabold").replace("900black","black").replace(/bodoni_(11|16|24|36|48|72|96)([^_])/gi,"bodoni_$1_$2").replace(/bodoni_(11|16|24|36|48|72|96)/gi,"bodoni moda").replace(/(thin|hairline)(_regular)?/gi,"100").replace(/(extra|ultra)light(_regular)?/gi,"200").replace(/light(_regular)?/gi,"300").replace(/_book|_normal|_roman/gi,"_regular").replace(/medium(_regular)?/gi,"500").replace(/(semi|demi)bold(_regular)?/gi,"600").replace(/(extra|ultra)bold(_regular)?/gi,"800").replace(/bold(_regular)?/gi,"700").replace(/(black|heavy|fatface)(_regular)?/gi,"900").replace(/([1-9]00)_italic/gi,"$1italic").replace(/regularitalic/gi,"italic").replace(/regularitalic/gi,"italic").split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ");void 0===e.shared.fonts[o]&&(e.shared.fonts[o]={name:o});var s=B(R({name:n.name},n5.defaultData,ie.defaultData),{flatShading:!1,wireframe:!1,geometry:B(R({},nb.defaultData("TextGeometry")),{width:n.width,height:n.height,font:o,depth:0,horizontalAlign:n.horizontalAlign,verticalAlign:n.verticalAlign,fontSize:1.40625*n.fontSize,lineHeight:n.lineHeight/1.40625,letterSpacing:n.letterSpacing-1,text:n.text,textTransform:n.textTransform,extrudeBevelSize:0,extrudeBevelSegments:1}),material:i,states:eX(n.states),events:eX(n.events),visible:n.visible,raycastLock:n.raycastLock,position:n.position,rotation:n.rotation,scale:n.scale,hiddenMatrix:n.hiddenMatrix}),l=eX(e.scene.objects).parent(r);e.scene.objects.insertAfter(null!=l?l:null,r,[{id:r+"new",data:s,children:[]}]),u.push(r)}}),u.forEach(function(r){e.scene.objects.delete(r)}),e.schema=20),r<21&&(c={0:"MouseDown",1:"MouseUp",2:"MouseHover",5:"KeyDown",6:"KeyUp",7:"Start",9:"LookAt",10:"Follow",11:"Scroll",12:"Audio",13:"GameControl"},e.scene.objects.traverse(function(e,r){r.events.forEach(function(e){if(c[Number(e.type)])if(Object.assign(e,{type:c[Number(e.type)]}),"Audio"===e.type&&"audioEvent"in e&&(Object.assign(e,{playAudio:e.audioEvent}),delete e.audioEvent),"GameControl"===e.type)Object.assign(e,{gameActions:{idle:new eu,move:new eu,jump:new eu}});else{var r=new eu;Object.assign(e,{actions:r}),("MouseDown"===e.type||"MouseUp"===e.type||"KeyDown"===e.type||"KeyUp"===e.type)&&"url"in e&&r.push({fi:0,id:w.Cc.generateUUID(),data:{type:"Link",url:e.url,delay:0}}),"targets"in e&&(e.targets.forEach(function(e,n,i){var a={easing:e.easing,duration:e.duration};6===e.easing?Object.assign(a,aO(e,"mass","stiffness","damping","velocity")):5===e.easing&&Object.assign(a,{control1:R({},e.control1),control2:R({},e.control2)});var o={repeat:e.repeat?-1:0,delay:e.delay,delayDirection:e.delayDirection,direction:e.cycle&&e.rewind?"pingpong-rewind":e.cycle?"pingpong":"normal"},s=R({state:e.state},o,a),l={allowSlerp:!0,type:"Transition",object:e.object,repeat:0,delay:0,delayDirection:void 0,direction:"normal",tweens:new eu({fi:0,id:w.Cc.generateUUID(),data:{state:void 0,repeat:0,delay:0,delayDirection:void 0,direction:"normal",duration:0,easing:4}},{fi:1,id:w.Cc.generateUUID(),data:s})};r.push({fi:i,id:n,data:l})}),delete e.targets)}})}),e.scene.objects.traverse(function(e,r){var n=function(e,n){var i=new eu,a=[];if(r.events.forEach(function(e,r,o){if("Audio"===e.type&&e.trigger===n){var s;a.push(r),"play"===e.interaction?s=B(R({},aO(e,"interaction","audio","delay","volume","loop")),{triggerAfter:"after"in e?e.after:void 0,toggle:"after"in e?e.toggle:void 0,type:"Audio"}):("pause"===e.interaction||"stop"===e.interaction)&&(s=B(R({},aO(e,"interaction","delay","object","playAudio")),{type:"Audio"})),s&&i.push({fi:o,id:r,data:s})}}),a.forEach(function(e){return r.events.delete(e)}),i.length){var o,s=null==(o=r.events.find(function(r){return r.type===e}))?void 0:o.data;s?"actions"in s&&s.actions.insertBefore(null,i):r.events.insertBefore(null,[{id:w.Cc.generateUUID(),data:{type:e,actions:i}}])}};n("Start","start"),n("MouseDown","mouseDown"),n("MouseUp","mouseUp"),n("KeyDown","keyDown"),n("KeyUp","keyUp")}),e.schema=21),r<22&&(aB(e),e.schema=22),r<23&&(e.scene.objects.traverse(function(e,r){"Mesh"===r.type&&"SubdivGeometry"===r.geometry.type&&(r.geometry.scaleBaked||(r.geometry.scaleBaked=[1,1,1]))}),e.schema=23),r<24&&(e.scene.objects.traverse(function(e,r){"Empty"!==r.type&&"Mesh"!==r.type||!r.cloner||r.cloner.randomnessObject||r.cloner.toObject||r.cloner.randomness||(r.cloner=B(R({},r.cloner),{toObject:{object:"",spreadType:"random",scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],axis:"x",seed:0,count:99,align:"normal"},randomness:!1,randomnessObject:{strength:100,scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],movement:1,seed:0,freqScale:10,noiseType:"perlin"}}))}),e.schema=24),(r<25||void 0===e.shared.videos)&&(e.shared.videos=X({},ea.prototype),r<25&&(e.schema=25)),r<26&&(e.scene.objects.traverse(function(r,n){var i=e.scene.objects.unproxy().parent(r);if(i){var a=eX(e.scene.objects.data(i));a&&"Mesh"===a.type&&"BooleanGeometry"===a.geometry.type&&"Mesh"===n.type&&(n.visible=!0!==eX(n).booleanExclude)}}),e.schema=26),r<27&&(e.scene.objects.traverse(function(e,r){"Mesh"===r.type&&("NonParametricGeometry"===r.geometry.type?void 0!==r.material&&delete r.material:void 0!==r.materials&&delete r.materials)}),e.schema=27),r<28&&(aB(e),e.schema=28),r<29&&(function(e){function r(e){for(var r in Object.setPrototypeOf(e,eb.prototype),e){var n;Object.setPrototypeOf(n=e[r],eb.prototype),n.texture&&Object.setPrototypeOf(n.texture,eb.prototype)}}e.scene.objects.traverse(function(e,n){n.states.forEach(function(e){if(e.material){var n=eX(e.material).layers;r(n),e.material.layers=n}if(e.materials)for(var i=0;i<e.materials.length;i++){var a=e.materials[i],o=eX(a).layers;r(o),a.layers=o}})})}(e),e.schema=29),r<30&&(e.scene.objects.traverse(function(e,r){"Mesh"!==r.type||"NonParametricGeometry"!==r.geometry.type||"material"in r||"materials"in r||(r.material=r8.defaultTwoLayerData("phong"))}),e.schema=30),r<31&&(void 0===e.scene.publish.orbitControls.autoZoom&&(e.scene.publish.orbitControls.autoZoom=!1),e.scene.objects.traverse(function(e,r){("OrthographicCamera"===r.type||"PerspectiveCamera"===r.type)&&(void 0===r.orthographic.autoZoom&&(r.orthographic.autoZoom=!1),void 0===r.orthographic.autoZoomFrustumSize&&(r.orthographic.autoZoomFrustumSize=790))}),e.schema=31),r<33&&(e.scene.objects.traverse(function(e,r){void 0===r.pathSnapping&&(r.pathSnapping={pathId:null,slide:0,offset:0,orientation:"tangential"}),void 0===r.pathSnapping.offset&&(r.pathSnapping.offset=0)}),e.schema=33),r<34&&(void 0===e.scene.publish.mouseEventTarget&&(e.scene.publish.mouseEventTarget="canvas"),void 0===e.scene.publish.settings.web.hint&&(e.scene.publish.settings.web.hint=!1),e.schema=34),r<35&&("gif"===(h=e.scene.publish.settings.video).format&&h.fps>48&&(h.fps=15),e.schema=35),r<36&&(e.scene.objects.traverse(function(e,r){r.events.forEach(function(e){"GameControl"===e.type&&(e.resetYPosition=Math.abs(e.resetYPosition-r.position[1]))})}),e.schema=36),r<37&&(d=e.scene.environment.usePhysics,e.scene.objects.traverse(function(e,r){d&&null===r.physics?r.collision=!1:r.collision="visibility"}),e.schema=37),r<38&&(aP(e,aI),a_(e,aI),e.schema=38),r<39&&(e.scene.objects.traverse(function(e,r){r.events.forEach(function(e){"GameControl"===e.type&&(e.navmesh=aM.defaultDataThirdPerson.navmesh)})}),e.schema=39),r<40&&(e.scene.styles||(e.scene.styles=ip.defaultData()),e.schema=40),r<41&&(void 0===e.scene.environment.ambientLight.occlusion&&(e.scene.environment.ambientLight.occlusion=!1),void 0===e.scene.environment.ambientLight.aoFullRes&&(e.scene.environment.ambientLight.aoFullRes=!1),void 0===e.scene.environment.ambientLight.radius&&(e.scene.environment.ambientLight.radius=256),void 0===e.scene.environment.ambientLight.bias&&(e.scene.environment.ambientLight.bias=.5),void 0===e.scene.environment.ambientLight.aoColor&&(e.scene.environment.ambientLight.aoColor={r:.19607843137254902,g:.19607843137254902,b:.19607843137254902}),aP(e,az),a_(e,az),e.schema=41),r<42&&(e.scene.objects.traverse(function(e,r){r.events.forEach(function(e){"GameControl"===e.type&&Object.assign(e.gameActions,{run:new eu})})}),e.schema=42),r<43&&(e.scene.objects.traverse(function(e,r){r.events.forEach(function(e){"GameControl"===e.type&&(e.keyAssignments=V(e.keyAssignments).concat([["run","⇧"],["none","Ctrl"]]))})}),e.schema=43),r<99){aP(e,aL),a_(e,aL),null===e.scene.publish.playCamera&&(e.scene.publish.playCamera=ru);var n=eX(e.scene.objects),i=e.scene.objects;e.scene.publish.playPage=rc,i.insertBefore(null,null,[{id:rc,data:B(R({},io.defaultData),{backgroundColor:e.scene.backgroundColor,fog:e.scene.fog,postprocessing:e.scene.postprocessing,ao:aO(e.scene.environment.ambientLight,"occlusion","aoFullRes","radius","bias","aoColor"),publish:{playCamera:e.scene.publish.playCamera,gameControlObject:e.scene.publish.gameControlObject},shadow:aO(e.scene.environment.ambientLight,"softShadowQuality"),globalPhysics:R({},nL.defaultData,aO(e.scene.environment,"usePhysics","gravity")),camera:null!=(f=eX(e.scene.ownerCamera))?f:io.defaultData.camera,name:"Scene"}),children:[]}]);var a=!0,o=!1,s=void 0;try{for(var l,u,c,h,d,f,p,v=n[Symbol.iterator]();!(a=(p=v.next()).done);a=!0){var y=p.value;y.id!==iy.TRASH_CAN_ID&&i.move(rc,y.fi,y.id)}}catch(e){o=!0,s=e}finally{try{a||null==v.return||v.return()}finally{if(o)throw s}}var m=0,g=0;e.shared.penumbraSize&&e.scene.objects.traverse(function(r,n){var i;"DirectionalLight"===n.type?(n.penumbraSize=e.shared.penumbraSize[Math.min(m,2)],m+=1):"SpotLight"===n.type&&(n.penumbraSize=e.shared.penumbraSize[3+Math.min(g,1)],g+=1),(void 0===n.physics||null===n.physics)&&"Instance"!==n.type&&(n.physics={},Object.assign(n.physics,rj.defaultData)),void 0!==n.physics&&null!==n.physics&&(n.physics.enabled=null!=(i=n.collision)?i:"visibility",delete n.collision)}),e.schema=99}}(e,r),r<100&&(void 0===e.scene.publish.joystickSizeAndXYOffset&&(e.scene.publish.joystickSizeAndXYOffset=ic.defaultData.joystickSizeAndXYOffset),e.schema=100),r<101&&(aP(e,aF),a_(e,aF),e.schema=101),r<102&&(e.scene.objects.traverse(function(e,r){var n=r.geometry;n&&"PathGeometry"===n.type&&(n.extrusion.capType="flat",n.extrusion.bevel=50,n.extrusion.bevelSides=6,"Custom"===n.extrusion.shape.type&&(n.extrusion.shape.shapeQuality="low"))}),e.schema=102),r<104&&(e.shared.catelogs=new ea,e.shared.lib=iM.defaultData(),e.schema=104),r<105&&(e.shared.variables=X({},ea.prototype),e.scene.objects.traverse(function(e,r){aG(r)}),e.schema=105);var n,i=!0,a=!1,o=void 0;try{for(var s,l,u=Object.values(e.shared.lib.components)[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;aY(c)}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}r<106&&(n=eX(e.shared.variables),e.shared.variables=X(Object.entries(null!=n?n:{}).map(function(e,r){var n=F(e,2);return{fi:r,id:n[0],data:n[1]}}),eu.prototype),e.schema=106),r<107&&(e.shared.lib.variables=iM.defaultData().variables,e.schema=107),r<109&&(e.shared.particles=X({},ea.prototype),e.shared.lib&&(e.shared.lib.particles=iM.defaultData().particles),e.schema=109),r<110&&(e.scene.objects.traverse(function(e,r){"Particle"===r.type&&"number"==typeof r.renderMaterial.size&&Object.assign(r.renderMaterial,{size:[r.renderMaterial.size,r.renderMaterial.size]})}),e.schema=110),r<111&&(e.scene.objects.traverse(function(e,r){var n;Array.isArray(eX(r.events))&&(null==(n=r.events)||n.forEach(function(e){"disabled"in e||(e.disabled=!1),("MouseDown"===e.type||"MouseUp"===e.type||"MousePress"===e.type)&&(e.mode=e.mode||"Object")}))}),e.schema=111),r<112&&(e.scene.objects.traverse(function(e,r){"Page"===r.type&&(r.postprocessing.depthOfField.focusDistance=100,r.postprocessing.depthOfField.focalLength=20,r.postprocessing.depthOfField.bokehScale=5)}),e.schema=112),r<113&&(e.scene.objects.traverse(function(e,r){var n;!1!==Array.isArray(eX(r.events))&&(null==(n=r.events)||n.forEach(function(e){var r,n,i,a,o,s,l,u,c,h,d,f=e.runMode;"MouseDown"===e.type||"MouseUp"===e.type||"KeyDown"===e.type||"KeyUp"===e.type||"Collision"===e.type||"Trigger"===e.type?null==(r=e.actions)||r.forEach(function(e){"Transition"===e.type&&(e.runMode=null!=f?f:"Repeat"),("Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Toggle"===f?"Toggle":"Normal")}):"MouseHover"===e.type||"MousePress"===e.type||"KeyPress"===e.type?null==(n=e.actions)||n.forEach(function(e){("Transition"===e.type||"Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Toggle")}):"GameControl"===e.type?(delete e.actions,Object.keys(e.gameActions).forEach(function(r){var n;null==(n=e.gameActions[r])||n.forEach(function(e){"Transition"===e.type&&(e.runMode="Repeat"),"Animation"===e.type&&"runMode"in e&&(e.runMode="Normal")})})):"DragDrop"===e.type?(delete e.actions,null==(a=e.dragDropActions)||null==(i=a.drag)||i.forEach(function(e){("Transition"===e.type||"Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Toggle")}),null==(s=e.dragDropActions)||null==(o=s.drop)||o.forEach(function(e){("Transition"===e.type||"Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Toggle")})):"Resize"===e.type?(delete e.actions,null==(l=e.breakpoints)||l.forEach(function(e){var r;null==(r=e.actions)||r.forEach(function(e){("Transition"===e.type||"Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Toggle")})})):"Start"===e.type?null==(u=e.actions)||u.forEach(function(e){"Transition"===e.type&&(e.runMode="Once"),("Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Normal")}):"VariableChange"===e.type||"Scroll"===e.type?null==(c=e.actions)||c.forEach(function(e){"Transition"===e.type&&(e.runMode="Repeat"),("Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Normal")}):"Conditional"===e.type&&(delete e.actions,null==(h=e.inActions)||h.forEach(function(e){"Transition"===e.type&&(e.runMode="Repeat"),("Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Normal")}),null==(d=e.outActions)||d.forEach(function(e){"Transition"===e.type&&(e.runMode="Repeat"),("Animation"===e.type&&"runMode"in e||"SwitchCamera"===e.type)&&(e.runMode="Normal")}))}))}),e.schema=113),r<114&&(void 0===e.scene.publish.settings.web.imageQuality&&(e.scene.publish.settings.web.imageQuality=70),e.schema=114),r<115&&(e.shared.userAPIs=X({},ea.prototype),e.shared.userWebhooks=X({},ea.prototype),e.shared.lib&&(e.shared.lib.userAPIs=iM.defaultData().userAPIs,e.shared.lib.userWebhooks=iM.defaultData().userWebhooks),e.schema=115),r<116&&(void 0===e.scene.publish.settings.videoStatic&&(e.scene.publish.settings.videoStatic=ic.defaultData.settings.videoStatic),e.schema=116),r<117&&(void 0===e.scene.publish.settings.web.pixelRatioMobile&&(e.scene.publish.settings.web.pixelRatioMobile=0),void 0===e.scene.publish.settings.web.pixelRatioDesktop&&(e.scene.publish.settings.web.pixelRatioDesktop=0),e.schema=117),r<118&&(e.shared.timelineAnimations=X({},ea.prototype),e.scene.objects.traverse(function(e,r){aJ(r)}),e.schema=118),r<119&&(e.scene.publish.settings.videoStatic.format=iO.defaultData.scene.publish.settings.videoStatic.format,e.scene.publish.settings.videoStatic.imageFormat=iO.defaultData.scene.publish.settings.videoStatic.imageFormat,e.schema=119),r<120&&(e.scene.publish.settings.image.colorSpace="display-p3",e.scene.publish.settings.videoStatic.colorSpace="display-p3",e.schema=120),r<121&&(e.scene.objects.traverse(function(e,r){a3(r),"Page"===r.type&&void 0!==r.camera&&a3(r.camera)}),e.schema=121),r<122&&(delete e.scene.publish.settings.video,e.scene.publish.orbitControls.rotationSpeed=iO.defaultData.scene.publish.orbitControls.rotationSpeed,e.schema=122),r<123&&(e.scene.objects.traverse(function(e,r){"Page"===r.type&&void 0===r.sky&&(r.sky=nj.defaultData)}),e.schema=123),r<124&&(r>=123&&e.scene.objects.traverse(function(e,r){var n=r.sky;"Page"===r.type&&void 0!==n&&("number"==typeof n.exposure&&(n.exposure=Math.round(n.exposure/5e-4*1e4)/1e4),void 0===n.lighting&&(n.lighting=nj.defaultData.lighting))}),e.schema=124),r<125&&(e.scene.objects.traverse(function(e,r){var n=r.sky;"Page"===r.type&&void 0!==n&&void 0===n.lightingIntensity&&(n.lightingIntensity=nj.defaultData.lightingIntensity)}),e.schema=125),r<126&&(e.scene.objects.traverse(function(e,r){var n,i=r.sky;"Page"===r.type&&void 0!==i&&(void 0===i.mode&&(i.mode="physical"),void 0===i.hdri?i.hdri=R({},nj.defaultData.hdri):(void 0===i.hdri.blur&&(i.hdri.blur=nj.defaultData.hdri.blur),Array.isArray(i.hdri.rotation)&&(i.hdri.rotation=null!=(n=i.hdri.rotation[1])?n:0)))}),e.schema=126),r<127&&(e.scene.objects.traverse(function(e,r){var n=r.sky;"Page"===r.type&&void 0!==(null==n?void 0:n.hdri)&&void 0===n.hdri.showBackground&&(n.hdri.showBackground=!0)}),e.schema=127),r<128&&(e.scene.objects.traverse(function(e,r){var n=r.sky;"Page"===r.type&&void 0!==n&&void 0===n.lightingQuality&&(n.lightingQuality="full")}),e.schema=128),r<129&&(e.scene.objects.traverse(function(e,r){if("Page"===r.type){void 0===r.camera&&(r.camera=io.defaultData.camera);var n=r.camera;n.far=1e5,n.perspective?n.perspective.near=70:n.perspective={near:70,fov:45,zoom:1}}}),e.schema=129),r<130&&(aX(e,aZ),e.schema=130),r<131&&(e.scene.objects.traverse(function(e,r){var n=r.states;if(n){var i=r.timelineAnimations,a=[];n.forEach(function(e,r){(e.isAnimation||(null==i?void 0:i[r]))&&a.push(r)}),a.forEach(function(e){return n.delete(e)})}}),function(e){var r=e.shared,n=r.timelineAnimations;if(n){var i=e.scene.objects,a=null==(u=i.unproxy().find(function(e){return"Page"===e.data.type}))?void 0:u.id,o=!0,s=!1,l=void 0;try{for(var u,c,h=Object.entries(n)[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=F(c.value,2),f=d[0],p=d[1],v=X({},ea.prototype),y=0,m=!!p.loop,g=!0,b=!1,w=void 0;try{for(var x,S,k,M,A=Object.entries(null!=(x=p.mapping)?x:{})[Symbol.iterator]();!(g=(M=A.next()).done);g=!0){var C,_,P,E,D=F(M.value,2),j=D[0],T=D[1],I=null==(P=i.data(j))||null==(_=P.timelineAnimations)?void 0:_[T];I&&(y=Math.max(y,null!=(C=I.to)?C:0),m=m||!!I.loop,v[j]={id:j,keyframes:function(e){var r=[];return e?(e.forEach(function(e,n){var i=e.data,a=i.path,o=i.keyframes,s="material"===a[0]?e.id:void 0;(null==o?void 0:o.length)?o.forEach(function(e){var i=e.id,o=e.data;r.push({id:i,data:B(R({},o),{path:a,layerId:s,index:n})})}):r.push(iP.placeholderKeyframe(e.id,a,{layerId:s,index:n}))}),r.sort(function(e,r){return e.data.time-r.data.time}),O(eu,V(r.map(function(e,r){return B(R({},e),{fi:r})})))):new eu}(null==(E=I.properties)?void 0:E.unproxy())})}}catch(e){b=!0,w=e}finally{try{g||null==A.return||A.return()}finally{if(b)throw w}}var z=null!=(S=p.page)?S:a,L=z?i.data(z):void 0;L&&"Page"===L.type&&((null!=(k=L.timelines)?k:L.timelines=X({},ea.prototype))[f]=B(R({id:f,name:p.name,duration:y||5},m?{loop:m}:{}),{objectTimelines:v}))}}catch(e){s=!0,l=e}finally{try{o||null==h.return||h.return()}finally{if(s)throw l}}delete r.timelineAnimations,i.traverse(function(e,r){delete r.timelineAnimations})}}(e),a2(e,a$),a2(e,a1),e.schema=131)}}},909(e,r,n){n.d(r,{$:()=>rB,A:()=>e1,B:()=>tN,C:()=>tJ,D:()=>tQ,E:()=>t$,F:()=>tr,G:()=>t0,H:()=>t2,I:()=>rO,J:()=>rC,K:()=>r_,L:()=>rc,M:()=>rf,N:()=>ta,O:()=>to,P:()=>ts,Q:()=>tl,R:()=>tc,S:()=>tf,T:()=>tp,U:()=>tv,V:()=>ty,W:()=>tm,X:()=>tg,Y:()=>rT,Z:()=>rI,_:()=>rR,a:()=>I,aa:()=>rz,b:()=>B,ba:()=>rL,c:()=>tw,ca:()=>rF,d:()=>tS,da:()=>rU,e:()=>tk,ea:()=>rW,f:()=>tM,fa:()=>r$,g:()=>tA,ga:()=>r1,h:()=>r0,ha:()=>r2,i:()=>tO,ia:()=>r9,j:()=>rV,k:()=>t_,l:()=>tT,m:()=>tI,n:()=>tz,o:()=>V,p:()=>N,q:()=>t3,r:()=>z,s:()=>F,t:()=>en,u:()=>ez,v:()=>eL,w:()=>eF,x:()=>eN,y:()=>eW,z:()=>eY});var i=n(1091),a=n(6259),o=n(843),s=n(4691),l=n(3486),u=n(461),c=n(3940),h=n(3027);function d(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function f(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}function p(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function s(e){f(o,i,a,s,l,"next",e)}function l(e){f(o,i,a,s,l,"throw",e)}s(void 0)})}}function v(e,r,n){return r=x(r),O(e,j()?Reflect.construct(r,n||[],x(e).constructor):r.apply(e,n))}function y(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function m(e,r,n){return(m=j()?Reflect.construct:function(e,r,n){var i=[null];i.push.apply(i,r);var a=new(Function.bind.apply(e,i));return n&&C(a,n.prototype),a}).apply(null,arguments)}function g(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function b(e,r,n){return r&&g(e.prototype,r),n&&g(e,n),e}function w(e,r,n){return(w="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=x(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&C(e,r)}function k(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function M(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function A(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function O(e,r){if(r&&("object"===E(r)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e,r){return(C=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function _(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||D(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||D(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function D(e,r){if(e){if("string"==typeof e)return d(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,r)}}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function T(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function I(e){for(var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),a=new Set(Object.keys(e[0].morphAttributes)),o={},s={},l=e[0].morphTargetsRelative,u=new h.dd,c=0,d=0;d<e.length;++d){var f=e[d],p=0;if(n!==(null!==f.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var v in f.attributes){if(!i.has(v))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+v+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[v]&&(o[v]=[]),o[v].push(f.attributes[v]),p++}if(p!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(l!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var y in f.morphAttributes){if(!a.has(y))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;void 0===s[y]&&(s[y]=[]),s[y].push(f.morphAttributes[y])}if(r){var m=void 0;if(n)m=f.index.count;else{if(void 0===f.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;m=f.attributes.position.count}u.addGroup(c,m,d),c+=m}}if(n){for(var g=0,b=[],w=0;w<e.length;++w){for(var x=e[w].index,S=0;S<x.count;++S)b.push(x.getX(S)+g);g+=e[w].attributes.position.count}u.setIndex(b)}for(var k in o){var M=R(o[k]);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+k+" attribute."),null;u.setAttribute(k,M)}for(var A in s){var O=s[A][0].length;if(0!==O){u.morphAttributes=u.morphAttributes||{},u.morphAttributes[A]=[];for(var C=0;C<O;++C){for(var _=[],P=0;P<s[A].length;++P)_.push(s[A][P][C]);var E=R(_);if(!E)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+A+" morphAttribute."),null;u.morphAttributes[A].push(E)}}}return u}function R(e){for(var r,n,i,a=-1,o=0,s=0;s<e.length;++s){var l=e[s];if(void 0===r&&(r=l.array.constructor),r!==l.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=l.itemSize),n!==l.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=l.normalized),i!==l.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===a&&(a=l.gpuType),a!==l.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;o+=l.count*n}for(var u=new r(o),c=new h.Zc(u,n,i),d=0,f=0;f<e.length;++f){var p=e[f];if(p.isInterleavedBufferAttribute)for(var v=d/n,y=0,m=p.count;y<m;y++)for(var g=0;g<n;g++){var b=p.getComponent(y,g);c.setComponent(y+v,g,b)}else u.set(p.array,d);d+=p.count*n}return void 0!==a&&(c.gpuType=a),c}function B(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-4;r=Math.max(r,Number.EPSILON);for(var n={},i=e.getIndex(),a=e.getAttribute("position"),o=i?i.count:a.count,s=0,l=Object.keys(e.attributes),u={},c={},h=[],d=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],p=0,v=l.length;p<v;p++)!function(r){var n=l[r],i=e.attributes[n];u[n]=new i.constructor(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized);var a=e.morphAttributes[n];a&&(c[n]||(c[n]=[]),a.forEach(function(e,r){var i=new e.array.constructor(e.count*e.itemSize);c[n][r]=new e.constructor(i,e.itemSize,e.normalized)}))}(p);for(var y=.5*r,m=Math.pow(10,Math.log10(1/r)),g=y*m,b=0;b<o;b++){for(var w=i?i.getX(b):b,x="",S=0,k=l.length;S<k;S++)for(var M=l[S],A=e.getAttribute(M),O=A.itemSize,C=0;C<O;C++)x+=~~(A[d[C]](w)*m+g)+",";if(x in n)h.push(n[x]);else{for(var _=0,P=l.length;_<P;_++)for(var E=l[_],D=e.getAttribute(E),j=e.morphAttributes[E],T=D.itemSize,I=u[E],R=c[E],B=0;B<T;B++){var z=d[B],L=f[B];if(I[L](s,D[z](w)),j)for(var F=0,U=j.length;F<U;F++)R[F][L](s,j[F][z](w))}n[x]=s,h.push(s),s++}}var V=e.clone();for(var N in e.attributes){var G=u[N];if(V.setAttribute(N,new G.constructor(G.array.slice(0,s*G.itemSize),G.itemSize,G.normalized)),N in c)for(var W=0;W<c[N].length;W++){var H=c[N][W];V.morphAttributes[N][W]=new H.constructor(H.array.slice(0,s*H.itemSize),H.itemSize,H.normalized)}}return V.setIndex(h),V}var z,L,F,U=null;function V(e){U=e}function N(e){var r=!1;return e.scene.objects.traverse(function(e,n){"Mesh"===n.type&&("TextGeometry"===n.geometry.type||"InputGeometry"===n.geometry.type)&&(r=!0)}),r}function G(e,r){if(!e)throw r||"Assertion Failed!"}(L=z||(z={}))[L.ODD=0]="ODD",L[L.NONZERO=1]="NONZERO",L[L.POSITIVE=2]="POSITIVE",L[L.NEGATIVE=3]="NEGATIVE",L[L.ABS_GEQ_TWO=4]="ABS_GEQ_TWO",(eI=F||(F={}))[eI.POLYGONS=0]="POLYGONS",eI[eI.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",eI[eI.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS";var W=function(){function e(){}return e.vertEq=function(e,r){return e.s===r.s&&e.t===r.t},e.vertLeq=function(e,r){return e.s<r.s||e.s===r.s&&e.t<=r.t},e.transLeq=function(e,r){return e.t<r.t||e.t===r.t&&e.s<=r.s},e.edgeGoesLeft=function(r){return e.vertLeq(r.Dst,r.Org)},e.edgeGoesRight=function(r){return e.vertLeq(r.Org,r.Dst)},e.vertL1dist=function(e,r){return Math.abs(e.s-r.s)+Math.abs(e.t-r.t)},e.edgeEval=function(r,n,i){G(e.vertLeq(r,n)&&e.vertLeq(n,i));var a=n.s-r.s,o=i.s-n.s;return a+o>0?a<o?n.t-r.t+(r.t-i.t)*(a/(a+o)):n.t-i.t+(i.t-r.t)*(o/(a+o)):0},e.edgeSign=function(r,n,i){G(e.vertLeq(r,n)&&e.vertLeq(n,i));var a=n.s-r.s,o=i.s-n.s;return a+o>0?(n.t-i.t)*a+(n.t-r.t)*o:0},e.transEval=function(r,n,i){G(e.transLeq(r,n)&&e.transLeq(n,i));var a=n.t-r.t,o=i.t-n.t;return a+o>0?a<o?n.s-r.s+(r.s-i.s)*(a/(a+o)):n.s-i.s+(i.s-r.s)*(o/(a+o)):0},e.transSign=function(r,n,i){G(e.transLeq(r,n)&&e.transLeq(n,i));var a=n.t-r.t,o=i.t-n.t;return a+o>0?(n.s-i.s)*a+(n.s-r.s)*o:0},e.vertCCW=function(e,r,n){return e.s*(r.t-n.t)+r.s*(n.t-e.t)+n.s*(e.t-r.t)>=0},e.interpolate=function(e,r,n,i){return(e=e<0?0:e)<=(n=n<0?0:n)?0===n?(r+i)/2:r+e/(e+n)*(i-r):i+n/(e+n)*(r-i)},e.intersect=function(r,n,i,a,o){var s,l,u;e.vertLeq(r,n)||(u=r,r=n,n=u),e.vertLeq(i,a)||(u=i,i=a,a=u),e.vertLeq(r,i)||(u=r,r=i,i=u,u=n,n=a,a=u),e.vertLeq(i,n)?e.vertLeq(n,a)?((s=e.edgeEval(r,i,n))+(l=e.edgeEval(i,n,a))<0&&(s=-s,l=-l),o.s=e.interpolate(s,i.s,l,n.s)):((s=e.edgeSign(r,i,n))+(l=-e.edgeSign(r,a,n))<0&&(s=-s,l=-l),o.s=e.interpolate(s,i.s,l,a.s)):o.s=(i.s+n.s)/2,e.transLeq(r,n)||(u=r,r=n,n=u),e.transLeq(i,a)||(u=i,i=a,a=u),e.transLeq(r,i)||(u=r,r=i,i=u,u=n,n=a,a=u),e.transLeq(i,n)?e.transLeq(n,a)?((s=e.transEval(r,i,n))+(l=e.transEval(i,n,a))<0&&(s=-s,l=-l),o.t=e.interpolate(s,i.t,l,n.t)):((s=e.transSign(r,i,n))+(l=-e.transSign(r,a,n))<0&&(s=-s,l=-l),o.t=e.interpolate(s,i.t,l,a.t)):o.t=(i.t+n.t)/2},e}(),H=function(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1},q=function(){function e(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(e.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),e}(),Y=function(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0},X=function(){function e(){var e=new Y,r=new H,n=new q(0),i=new q(1);e.next=e.prev=e,e.anEdge=null,r.next=r.prev=r,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=r,this.eHead=n,this.eHeadSym=i}return e.prototype.makeEdge_=function(e){var r=new q(0),n=new q(1);e.Sym.side<e.side&&(e=e.Sym);var i=e.Sym.next;return n.next=i,i.Sym.next=r,r.next=e,e.Sym.next=n,r.Sym=n,r.Onext=r,r.Lnext=n,r.Org=null,r.Lface=null,r.winding=0,r.activeRegion=null,n.Sym=r,n.Onext=n,n.Lnext=r,n.Org=null,n.Lface=null,n.winding=0,n.activeRegion=null,r},e.prototype.splice_=function(e,r){var n=e.Onext,i=r.Onext;n.Sym.Lnext=r,i.Sym.Lnext=e,e.Onext=i,r.Onext=n},e.prototype.makeVertex_=function(e,r,n){G(e,"Vertex can't be null!");var i=n.prev;e.prev=i,i.next=e,e.next=n,n.prev=e,e.anEdge=r;var a=r;do a.Org=e,a=a.Onext;while(a!==r)},e.prototype.makeFace_=function(e,r,n){G(e,"Face can't be null");var i=n.prev;e.prev=i,i.next=e,e.next=n,n.prev=e,e.anEdge=r,e.trail=null,e.marked=!1,e.inside=n.inside;var a=r;do a.Lface=e,a=a.Lnext;while(a!==r)},e.prototype.killEdge_=function(e){e.Sym.side<e.side&&(e=e.Sym);var r=e.next,n=e.Sym.next;r.Sym.next=n,n.Sym.next=r},e.prototype.killVertex_=function(e,r){var n=e.anEdge,i=n;do i.Org=r,i=i.Onext;while(i!==n);var a=e.prev,o=e.next;o.prev=a,a.next=o},e.prototype.killFace_=function(e,r){var n=e.anEdge,i=n;do i.Lface=r,i=i.Lnext;while(i!==n);var a=e.prev,o=e.next;o.prev=a,a.next=o},e.prototype.makeEdge=function(){var e=new Y,r=new Y,n=new H,i=this.makeEdge_(this.eHead);return this.makeVertex_(e,i,this.vHead),this.makeVertex_(r,i.Sym,this.vHead),this.makeFace_(n,i,this.fHead),i},e.prototype.splice=function(e,r){var n=!1,i=!1;if(e!==r){if(r.Org!==e.Org&&(i=!0,this.killVertex_(r.Org,e.Org)),r.Lface!==e.Lface&&(n=!0,this.killFace_(r.Lface,e.Lface)),this.splice_(r,e),!i){var a=new Y;this.makeVertex_(a,r,e.Org),e.Org.anEdge=e}if(!n){var o=new H;this.makeFace_(o,r,e.Lface),e.Lface.anEdge=e}}},e.prototype.delete=function(e){var r=e.Sym,n=!1;if(e.Lface!==e.Rface&&(n=!0,this.killFace_(e.Lface,e.Rface)),e.Onext===e)this.killVertex_(e.Org,null);else if(e.Rface.anEdge=e.Oprev,e.Org.anEdge=e.Onext,this.splice_(e,e.Oprev),!n){var i=new H;this.makeFace_(i,e,e.Lface)}r.Onext===r?(this.killVertex_(r.Org,null),this.killFace_(r.Lface,null)):(e.Lface.anEdge=r.Oprev,r.Org.anEdge=r.Onext,this.splice_(r,r.Oprev)),this.killEdge_(e)},e.prototype.addEdgeVertex=function(e){var r=this.makeEdge_(e),n=r.Sym;this.splice_(r,e.Lnext),r.Org=e.Dst;var i=new Y;return this.makeVertex_(i,n,r.Org),r.Lface=n.Lface=e.Lface,r},e.prototype.splitEdge=function(e){var r=this.addEdgeVertex(e).Sym;return this.splice_(e.Sym,e.Sym.Oprev),this.splice_(e.Sym,r),e.Dst=r.Org,r.Dst.anEdge=r.Sym,r.Rface=e.Rface,r.winding=e.winding,r.Sym.winding=e.Sym.winding,r.idx=e.idx,r.Sym.idx=e.Sym.idx,r},e.prototype.connect=function(e,r){var n=!1,i=this.makeEdge_(e),a=i.Sym;if(r.Lface!==e.Lface&&(n=!0,this.killFace_(r.Lface,e.Lface)),this.splice_(i,e.Lnext),this.splice_(a,r),i.Org=e.Dst,a.Org=r.Org,i.Lface=a.Lface=e.Lface,e.Lface.anEdge=a,!n){var o=new H;this.makeFace_(o,i,e.Lface)}return i},e.prototype.zapFace=function(e){var r,n,i,a,o,s=e.anEdge;n=s.Lnext;do n=(r=n).Lnext,r.Lface=null,null===r.Rface&&(r.Onext===r?this.killVertex_(r.Org,null):(r.Org.anEdge=r.Onext,this.splice_(r,r.Oprev)),(i=r.Sym).Onext===i?this.killVertex_(i.Org,null):(i.Org.anEdge=i.Onext,this.splice_(i,i.Oprev)),this.killEdge_(r));while(r!=s);a=e.prev,(o=e.next).prev=a,a.next=o},e.prototype.countFaceVerts_=function(e){var r=e.anEdge,n=0;do n++,r=r.Lnext;while(r!==e.anEdge);return n},e.prototype.mergeConvexFaces=function(e){var r,n,i,a,o;for(r=this.fHead.next;r!==this.fHead;r=r.next)if(r.inside)for(o=(n=r.anEdge).Org;i=n.Lnext,(a=n.Sym)&&a.Lface&&a.Lface.inside&&this.countFaceVerts_(r)+this.countFaceVerts_(a.Lface)-2<=e&&W.vertCCW(n.Lprev.Org,n.Org,a.Lnext.Lnext.Org)&&W.vertCCW(a.Lprev.Org,a.Org,n.Lnext.Lnext.Org)&&(i=a.Lnext,this.delete(a),n=null,a=null),!n||n.Lnext.Org!==o;)n=i;return!0},e.prototype.check=function(){var e,r,n,i,a,o,s=this.fHead,l=this.vHead,u=this.eHead;for(r=s,r=s;(e=r.next)!==s;r=e){G(e.prev===r),a=e.anEdge;do G(a.Sym!==a),G(a.Sym.Sym===a),G(a.Lnext.Onext.Sym===a),G(a.Onext.Sym.Lnext===a),G(a.Lface===e),a=a.Lnext;while(a!==e.anEdge)}for(G(e.prev===r&&null===e.anEdge),i=l,i=l;(n=i.next)!==l;i=n){G(n.prev===i),a=n.anEdge;do G(a.Sym!==a),G(a.Sym.Sym===a),G(a.Lnext.Onext.Sym===a),G(a.Onext.Sym.Lnext===a),G(a.Org===n),a=a.Onext;while(a!==n.anEdge)}for(G(n.prev===i&&null===n.anEdge),o=u,o=u;(a=o.next)!==u;o=a)G(a.Sym.next===o.Sym),G(a.Sym!==a),G(a.Sym.Sym===a),G(null!==a.Org),G(null!==a.Dst),G(a.Lnext.Onext.Sym===a),G(a.Onext.Sym.Lnext===a);G(a.Sym.next===o.Sym&&a.Sym===this.eHeadSym&&a.Sym.Sym===a&&null===a.Org&&null===a.Dst&&null===a.Lface&&null===a.Rface)},e}(),Z=function(){this.handle=null},K=function(){this.key=null,this.node=0},J=function(){function e(e,r){this.leq=r,this.max=0,this.nodes=[],this.handles=[],this.initialized=!1,this.freeList=0,this.size=0,this.max=e,this.nodes=[],this.handles=[];for(var n=0;n<e+1;n++)this.nodes[n]=new Z,this.handles[n]=new K;this.initialized=!1,this.nodes[1].handle=1,this.handles[1].key=null}return e.prototype.floatDown_=function(e){var r,n,i,a=this.nodes,o=this.handles;for(r=a[e].handle;;){if((i=e<<1)<this.size&&this.leq(o[a[i+1].handle].key,o[a[i].handle].key)&&++i,G(i<=this.max),n=a[i].handle,i>this.size||this.leq(o[r].key,o[n].key)){a[e].handle=r,o[r].node=e;break}a[e].handle=n,o[n].node=e,e=i}},e.prototype.floatUp_=function(e){var r,n,i,a=this.nodes,o=this.handles;for(r=a[e].handle;;){if(n=a[i=e>>1].handle,0===i||this.leq(o[n].key,o[r].key)){a[e].handle=r,o[r].node=e;break}a[e].handle=n,o[n].node=e,e=i}},e.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},e.prototype.min=function(){return this.handles[this.nodes[1].handle].key},e.prototype.insert=function(e){var r,n,i,a;if(2*(r=++this.size)>this.max){for(this.max*=2,a=this.nodes.length,this.nodes.length=this.max+1,i=a;i<this.nodes.length;i++)this.nodes[i]=new Z;for(a=this.handles.length,this.handles.length=this.max+1,i=a;i<this.handles.length;i++)this.handles[i]=new K}return 0===this.freeList?n=r:(n=this.freeList,this.freeList=this.handles[n].node),this.nodes[r].handle=n,this.handles[n].node=r,this.handles[n].key=e,this.initialized&&this.floatUp_(r),n},e.prototype.extractMin=function(){var e=this.nodes,r=this.handles,n=e[1].handle,i=r[n].key;return this.size>0&&(e[1].handle=e[this.size].handle,r[e[1].handle].node=1,r[n].key=null,r[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},e.prototype.delete=function(e){var r,n=this.nodes,i=this.handles;G(e>=1&&e<=this.max&&null!==i[e].key),n[r=i[e].node].handle=n[this.size].handle,i[n[r].handle].node=r,--this.size,r<=this.size&&(r<=1||this.leq(i[n[r>>1].handle].key,i[n[r].handle].key)?this.floatDown_(r):this.floatUp_(r)),i[e].key=null,i[e].node=this.freeList,this.freeList=e},e}(),Q=function(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1},$=function(){this.key=null,this.next=null,this.prev=null},ee=function(){function e(e,r){this.frame=e,this.leq=r,this.head=new $,this.head.next=this.head,this.head.prev=this.head}return e.prototype.min=function(){return this.head.next},e.prototype.max=function(){return this.head.prev},e.prototype.insert=function(e){return this.insertBefore(this.head,e)},e.prototype.search=function(e){var r=this.head;do r=r.next;while(null!==r.key&&!this.leq(this.frame,e,r.key));return r},e.prototype.insertBefore=function(e,r){do e=e.prev;while(null!==e.key&&!this.leq(this.frame,e.key,r));var n=new $;return n.key=r,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},e.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},e}(),et=function(){function e(){}return e.regionBelow=function(e){return e.nodeUp.prev.key},e.regionAbove=function(e){return e.nodeUp.next.key},e.debugEvent=function(e){},e.addWinding=function(e,r){e.winding+=r.winding,e.Sym.winding+=r.Sym.winding},e.edgeLeq=function(e,r,n){var i=e.event,a=r.eUp,o=n.eUp;return a.Dst===i?o.Dst===i?W.vertLeq(a.Org,o.Org)?0>=W.edgeSign(o.Dst,a.Org,o.Org):W.edgeSign(a.Dst,o.Org,a.Org)>=0:0>=W.edgeSign(o.Dst,i,o.Org):o.Dst===i?W.edgeSign(a.Dst,i,a.Org)>=0:W.edgeEval(a.Dst,i,a.Org)>=W.edgeEval(o.Dst,i,o.Org)},e.deleteRegion=function(e,r){r.fixUpperEdge&&G(0===r.eUp.winding),r.eUp.activeRegion=null,e.dict.delete(r.nodeUp)},e.fixUpperEdge=function(e,r,n){G(r.fixUpperEdge),e.mesh.delete(r.eUp),r.fixUpperEdge=!1,r.eUp=n,n.activeRegion=r},e.topLeftRegion=function(r,n){var i,a=n.eUp.Org;do n=e.regionAbove(n);while(n.eUp.Org===a);if(n.fixUpperEdge){if(null===(i=r.mesh.connect(e.regionBelow(n).eUp.Sym,n.eUp.Lnext)))return null;e.fixUpperEdge(r,n,i),n=e.regionAbove(n)}return n},e.topRightRegion=function(r){var n=r.eUp.Dst;do r=e.regionAbove(r);while(r.eUp.Dst===n);return r},e.addRegionBelow=function(e,r,n){var i=new Q;return i.eUp=n,i.nodeUp=e.dict.insertBefore(r.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},e.isWindingInside=function(e,r){switch(e.windingRule){case z.ODD:return!!(1&r);case z.NONZERO:return 0!==r;case z.POSITIVE:return r>0;case z.NEGATIVE:return r<0;case z.ABS_GEQ_TWO:return r>=2||r<=-2}throw Error("Invalid winding rulle")},e.computeWinding=function(r,n){n.windingNumber=e.regionAbove(n).windingNumber+n.eUp.winding,n.inside=e.isWindingInside(r,n.windingNumber)},e.finishRegion=function(r,n){var i=n.eUp,a=i.Lface;a.inside=n.inside,a.anEdge=i,e.deleteRegion(r,n)},e.finishLeftRegions=function(r,n,i){for(var a,o=null,s=n,l=n.eUp;s!==i;){if(s.fixUpperEdge=!1,(a=(o=e.regionBelow(s)).eUp).Org!=l.Org){if(!o.fixUpperEdge){e.finishRegion(r,s);break}a=r.mesh.connect(l.Lprev,a.Sym),e.fixUpperEdge(r,o,a)}l.Onext!==a&&(r.mesh.splice(a.Oprev,a),r.mesh.splice(l,a)),e.finishRegion(r,s),l=o.eUp,s=o}return l},e.addRightEdges=function(r,n,i,a,o,s){var l,u,c,h,d=!0;c=i;do G(W.vertLeq(c.Org,c.Dst)),e.addRegionBelow(r,n,c.Sym),c=c.Onext;while(c!==a);for(null===o&&(o=e.regionBelow(n).eUp.Rprev),u=n,h=o;(c=(l=e.regionBelow(u)).eUp.Sym).Org===h.Org;)c.Onext!==h&&(r.mesh.splice(c.Oprev,c),r.mesh.splice(h.Oprev,c)),l.windingNumber=u.windingNumber-c.winding,l.inside=e.isWindingInside(r,l.windingNumber),u.dirty=!0,!d&&e.checkForRightSplice(r,u)&&(e.addWinding(c,h),e.deleteRegion(r,u),r.mesh.delete(h)),d=!1,u=l,h=c;u.dirty=!0,G(u.windingNumber-c.winding===l.windingNumber),s&&e.walkDirtyRegions(r,u)},e.spliceMergeVertices=function(e,r,n){e.mesh.splice(r,n)},e.vertexWeights=function(e,r,n){var i=W.vertL1dist(r,e),a=W.vertL1dist(n,e),o=.5*a/(i+a),s=.5*i/(i+a);e.coords[0]+=o*r.coords[0]+s*n.coords[0],e.coords[1]+=o*r.coords[1]+s*n.coords[1],e.coords[2]+=o*r.coords[2]+s*n.coords[2]},e.getIntersectData=function(r,n,i,a,o,s){n.coords[0]=n.coords[1]=n.coords[2]=0,n.idx=-1,e.vertexWeights(n,i,a),e.vertexWeights(n,o,s)},e.checkForRightSplice=function(r,n){var i=e.regionBelow(n),a=n.eUp,o=i.eUp;if(W.vertLeq(a.Org,o.Org)){if(W.edgeSign(o.Dst,a.Org,o.Org)>0)return!1;W.vertEq(a.Org,o.Org)?a.Org!==o.Org&&(r.pq.delete(a.Org.pqHandle),e.spliceMergeVertices(r,o.Oprev,a)):(r.mesh.splitEdge(o.Sym),r.mesh.splice(a,o.Oprev),n.dirty=i.dirty=!0)}else{if(0>W.edgeSign(a.Dst,o.Org,a.Org))return!1;e.regionAbove(n).dirty=n.dirty=!0,r.mesh.splitEdge(a.Sym),r.mesh.splice(o.Oprev,a)}return!0},e.checkForLeftSplice=function(r,n){var i,a=e.regionBelow(n),o=n.eUp,s=a.eUp;if(G(!W.vertEq(o.Dst,s.Dst)),W.vertLeq(o.Dst,s.Dst)){if(0>W.edgeSign(o.Dst,s.Dst,o.Org))return!1;e.regionAbove(n).dirty=n.dirty=!0,i=r.mesh.splitEdge(o),r.mesh.splice(s.Sym,i),i.Lface.inside=n.inside}else{if(W.edgeSign(s.Dst,o.Dst,s.Org)>0)return!1;n.dirty=a.dirty=!0,i=r.mesh.splitEdge(s),r.mesh.splice(o.Lnext,s.Sym),i.Rface.inside=n.inside}return!0},e.checkForIntersect=function(r,n){var i,a,o=e.regionBelow(n),s=n.eUp,l=o.eUp,u=s.Org,c=l.Org,h=s.Dst,d=l.Dst,f=new Y;if(G(!W.vertEq(d,h)),G(0>=W.edgeSign(h,r.event,u)),G(W.edgeSign(d,r.event,c)>=0),G(u!==r.event&&c!==r.event),G(!n.fixUpperEdge&&!o.fixUpperEdge),u===c||Math.min(u.t,h.t)>Math.max(c.t,d.t))return!1;if(W.vertLeq(u,c)){if(W.edgeSign(d,u,c)>0)return!1}else if(0>W.edgeSign(h,c,u))return!1;return e.debugEvent(r),W.intersect(h,u,d,c,f),G(Math.min(u.t,h.t)<=f.t),G(f.t<=Math.max(c.t,d.t)),G(Math.min(d.s,h.s)<=f.s),G(f.s<=Math.max(c.s,u.s)),W.vertLeq(f,r.event)&&(f.s=r.event.s,f.t=r.event.t),i=W.vertLeq(u,c)?u:c,W.vertLeq(i,f)&&(f.s=i.s,f.t=i.t),W.vertEq(f,u)||W.vertEq(f,c)?(e.checkForRightSplice(r,n),!1):!W.vertEq(h,r.event)&&W.edgeSign(h,r.event,f)>=0||!W.vertEq(d,r.event)&&0>=W.edgeSign(d,r.event,f)?d===r.event?(r.mesh.splitEdge(s.Sym),r.mesh.splice(l.Sym,s),n=e.topLeftRegion(r,n),s=e.regionBelow(n).eUp,e.finishLeftRegions(r,e.regionBelow(n),o),e.addRightEdges(r,n,s.Oprev,s,s,!0),!0):h===r.event?(r.mesh.splitEdge(l.Sym),r.mesh.splice(s.Lnext,l.Oprev),o=n,n=e.topRightRegion(n),a=e.regionBelow(n).eUp.Rprev,o.eUp=l.Oprev,l=e.finishLeftRegions(r,o,null),e.addRightEdges(r,n,l.Onext,s.Rprev,a,!0),!0):(W.edgeSign(h,r.event,f)>=0&&(e.regionAbove(n).dirty=n.dirty=!0,r.mesh.splitEdge(s.Sym),s.Org.s=r.event.s,s.Org.t=r.event.t),0>=W.edgeSign(d,r.event,f)&&(n.dirty=o.dirty=!0,r.mesh.splitEdge(l.Sym),l.Org.s=r.event.s,l.Org.t=r.event.t),!1):(r.mesh.splitEdge(s.Sym),r.mesh.splitEdge(l.Sym),r.mesh.splice(l.Oprev,s),s.Org.s=f.s,s.Org.t=f.t,s.Org.pqHandle=r.pq.insert(s.Org),e.getIntersectData(r,s.Org,u,h,c,d),e.regionAbove(n).dirty=n.dirty=o.dirty=!0,!1)},e.walkDirtyRegions=function(r,n){for(var i,a,o=e.regionBelow(n);;){for(;o.dirty;)n=o,o=e.regionBelow(o);if(!n.dirty&&(o=n,null===(n=e.regionAbove(n))||!n.dirty))return;if(n.dirty=!1,i=n.eUp,a=o.eUp,i.Dst!==a.Dst&&e.checkForLeftSplice(r,n)&&(o.fixUpperEdge?(e.deleteRegion(r,o),r.mesh.delete(a),a=(o=e.regionBelow(n)).eUp):n.fixUpperEdge&&(e.deleteRegion(r,n),r.mesh.delete(i),i=(n=e.regionAbove(o)).eUp)),i.Org!==a.Org){if(i.Dst===a.Dst||n.fixUpperEdge||o.fixUpperEdge||i.Dst!==r.event&&a.Dst!==r.event)e.checkForRightSplice(r,n);else if(e.checkForIntersect(r,n))return}i.Org===a.Org&&i.Dst===a.Dst&&(e.addWinding(a,i),e.deleteRegion(r,n),r.mesh.delete(i),n=e.regionAbove(o))}},e.connectRightVertex=function(r,n,i){var a,o=i.Onext,s=e.regionBelow(n),l=n.eUp,u=s.eUp,c=!1;l.Dst!==u.Dst&&e.checkForIntersect(r,n),W.vertEq(l.Org,r.event)&&(r.mesh.splice(o.Oprev,l),n=e.topLeftRegion(r,n),o=e.regionBelow(n).eUp,e.finishLeftRegions(r,e.regionBelow(n),s),c=!0),W.vertEq(u.Org,r.event)&&(r.mesh.splice(i,u.Oprev),i=e.finishLeftRegions(r,s,null),c=!0),c?e.addRightEdges(r,n,i.Onext,o,o,!0):(a=W.vertLeq(u.Org,l.Org)?u.Oprev:l,a=r.mesh.connect(i.Lprev,a),e.addRightEdges(r,n,a,a.Onext,a.Onext,!1),a.Sym.activeRegion.fixUpperEdge=!0,e.walkDirtyRegions(r,n))},e.connectLeftDegenerate=function(r,n,i){var a,o,s,l,u;return a=n.eUp,W.vertEq(a.Org,i)?(G(!1),void e.spliceMergeVertices(r,a,i.anEdge)):W.vertEq(a.Dst,i)?(G(!1),n=e.topRightRegion(n),o=l=(s=(u=e.regionBelow(n)).eUp.Sym).Onext,u.fixUpperEdge&&(G(o!==s),e.deleteRegion(r,u),r.mesh.delete(s),s=o.Oprev),r.mesh.splice(i.anEdge,s),W.edgeGoesLeft(o)||(o=null),void e.addRightEdges(r,n,s.Onext,l,o,!0)):(r.mesh.splitEdge(a.Sym),n.fixUpperEdge&&(r.mesh.delete(a.Onext),n.fixUpperEdge=!1),r.mesh.splice(i.anEdge,a),void e.sweepEvent(r,i))},e.connectLeftVertex=function(r,n){var i,a,o,s,l,u,c=new Q;if(c.eUp=n.anEdge.Sym,i=r.dict.search(c).key,a=e.regionBelow(i)){if(s=i.eUp,l=a.eUp,0===W.edgeSign(s.Dst,n,s.Org))return void e.connectLeftDegenerate(r,i,n);o=W.vertLeq(l.Dst,s.Dst)?i:a,i.inside||o.fixUpperEdge?(u=o===i?r.mesh.connect(n.anEdge.Sym,s.Lnext):r.mesh.connect(l.Dnext,n.anEdge).Sym,o.fixUpperEdge?e.fixUpperEdge(r,o,u):e.computeWinding(r,e.addRegionBelow(r,i,u)),e.sweepEvent(r,n)):e.addRightEdges(r,i,n.anEdge,n.anEdge,null,!0)}},e.sweepEvent=function(r,n){r.event=n,e.debugEvent(r);for(var i=n.anEdge;null===i.activeRegion;)if((i=i.Onext)===n.anEdge)return void e.connectLeftVertex(r,n);var a=e.topLeftRegion(r,i.activeRegion);G(null!==a);var o=e.regionBelow(a),s=o.eUp,l=e.finishLeftRegions(r,o,null);l.Onext===s?e.connectRightVertex(r,a,l):e.addRightEdges(r,a,l.Onext,s,s,!0)},e.addSentinel=function(e,r,n,i){var a=new Q,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=r,o.Dst.t=i,e.event=o.Dst,a.eUp=o,a.windingNumber=0,a.inside=!1,a.fixUpperEdge=!1,a.sentinel=!0,a.dirty=!1,a.nodeUp=e.dict.insert(a)},e.initEdgeDict=function(r){r.dict=new ee(r,e.edgeLeq);var n=r.bmax[0]-r.bmin[0],i=r.bmax[1]-r.bmin[1],a=r.bmin[0]-n,o=r.bmax[0]+n,s=r.bmin[1]-i,l=r.bmax[1]+i;e.addSentinel(r,a,o,s),e.addSentinel(r,a,o,l)},e.doneEdgeDict=function(r){for(var n,i=0;null!==(n=r.dict.min().key);)n.sentinel||(G(n.fixUpperEdge),G(1==++i)),G(0===n.windingNumber),e.deleteRegion(r,n)},e.removeDegenerateEdges=function(r){var n,i,a,o=r.mesh.eHead;for(n=o.next;n!==o;n=i)i=n.next,a=n.Lnext,W.vertEq(n.Org,n.Dst)&&n.Lnext.Lnext!==n&&(e.spliceMergeVertices(r,a,n),r.mesh.delete(n),a=(n=a).Lnext),a.Lnext===n&&(a!==n&&((a===i||a===i.Sym)&&(i=i.next),r.mesh.delete(a)),(n===i||n===i.Sym)&&(i=i.next),r.mesh.delete(n))},e.initPriorityQ=function(e){var r,n,i,a=0;for(n=(i=e.mesh.vHead).next;n!==i;n=n.next)a++;for(a+=8,r=e.pq=new J(a,W.vertLeq),n=(i=e.mesh.vHead).next;n!==i;n=n.next)n.pqHandle=r.insert(n);return n===i&&(r.init(),!0)},e.donePriorityQ=function(e){e.pq=null},e.removeDegenerateFaces=function(r,n){var i,a,o;for(i=n.fHead.next;i!==n.fHead;i=a)a=i.next,G((o=i.anEdge).Lnext!==o),o.Lnext.Lnext===o&&(e.addWinding(o.Onext,o),r.mesh.delete(o));return!0},e.computeInterior=function(r,n){var i,a;if(void 0===n&&(n=!0),e.removeDegenerateEdges(r),!e.initPriorityQ(r))return!1;for(e.initEdgeDict(r);null!==(i=r.pq.extractMin());){for(;null!==(a=r.pq.min())&&W.vertEq(a,i);)a=r.pq.extractMin(),e.spliceMergeVertices(r,i.anEdge,a.anEdge);e.sweepEvent(r,i)}return r.event=r.dict.min().key.eUp.Org,e.debugEvent(r),e.doneEdgeDict(r),e.donePriorityQ(r),!!e.removeDegenerateFaces(r,r.mesh)&&(n&&r.mesh.check(),!0)},e}(),er=function(){function e(){this.mesh=new X,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=z.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return e.prototype.dot_=function(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]},e.prototype.normalize_=function(e){var r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!r)throw"Zero-size vector!";r=Math.sqrt(r),e[0]/=r,e[1]/=r,e[2]/=r},e.prototype.longAxis_=function(e){var r=0;return Math.abs(e[1])>Math.abs(e[0])&&(r=1),Math.abs(e[2])>Math.abs(e[r])&&(r=2),r},e.prototype.computeNormal_=function(e){var r,n,i,a,o,s,l=[0,0,0],u=[0,0,0],c=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],v=this.mesh.vHead;r=v.next;for(var y=0;y<3;++y)a=r.coords[y],u[y]=a,p[y]=r,l[y]=a,f[y]=r;for(r=v.next;r!==v;r=r.next)for(var m=0;m<3;++m)(a=r.coords[m])<u[m]&&(u[m]=a,p[m]=r),a>l[m]&&(l[m]=a,f[m]=r);var g=0;if(l[1]-u[1]>l[0]-u[0]&&(g=1),l[2]-u[2]>l[g]-u[g]&&(g=2),u[g]>=l[g])return e[0]=0,e[1]=0,void(e[2]=1);for(s=0,n=p[g],i=f[g],c[0]=n.coords[0]-i.coords[0],c[1]=n.coords[1]-i.coords[1],c[2]=n.coords[2]-i.coords[2],r=v.next;r!==v;r=r.next)h[0]=r.coords[0]-i.coords[0],h[1]=r.coords[1]-i.coords[1],h[2]=r.coords[2]-i.coords[2],d[0]=c[1]*h[2]-c[2]*h[1],d[1]=c[2]*h[0]-c[0]*h[2],d[2]=c[0]*h[1]-c[1]*h[0],(o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2])>s&&(s=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);s<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(c)]=1)},e.prototype.checkOrientation_=function(){for(var e,r,n=this.mesh.fHead,i=this.mesh.vHead,a=0,o=n.next;o!==n;o=o.next)if(!((r=o.anEdge).winding<=0))do a+=(r.Org.s-r.Dst.s)*(r.Org.t+r.Dst.t),r=r.Lnext;while(r!==o.anEdge);if(a<0){for(e=i.next;e!==i;e=e.next)e.t=-e.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},e.prototype.projectPolygon_=function(){var e,r,n=this.mesh.vHead,i=[0,0,0],a=!1;i[0]=this.normal[0],i[1]=this.normal[1],i[2]=this.normal[2],i[0]||i[1]||i[2]||(this.computeNormal_(i),a=!0),e=this.sUnit,r=this.tUnit;var o=this.longAxis_(i);e[o]=0,e[(o+1)%3]=1,e[(o+2)%3]=0,r[o]=0,r[(o+1)%3]=0,r[(o+2)%3]=i[o]>0?1:-1;for(var s=n.next;s!==n;s=s.next)s.s=this.dot_(s.coords,e),s.t=this.dot_(s.coords,r);a&&this.checkOrientation_();for(var l=!0,u=n.next;u!==n;u=u.next)l?(this.bmin[0]=this.bmax[0]=u.s,this.bmin[1]=this.bmax[1]=u.t,l=!1):(u.s<this.bmin[0]&&(this.bmin[0]=u.s),u.s>this.bmax[0]&&(this.bmax[0]=u.s),u.t<this.bmin[1]&&(this.bmin[1]=u.t),u.t>this.bmax[1]&&(this.bmax[1]=u.t))},e.prototype.addWinding_=function(e,r){e.winding+=r.winding,e.Sym.winding+=r.Sym.winding},e.prototype.tessellateMonoRegion_=function(e,r){var n,i;if((n=r.anEdge).Lnext===n||n.Lnext.Lnext===n)throw"Mono region invalid";for(;W.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;W.vertLeq(n.Org,n.Dst);n=n.Lnext);for(i=n.Lprev;n.Lnext!==i;)if(W.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(W.edgeGoesLeft(i.Lnext)||0>=W.edgeSign(i.Org,i.Dst,i.Lnext.Dst));)i=e.connect(i.Lnext,i).Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(W.edgeGoesRight(n.Lprev)||W.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)n=e.connect(n,n.Lprev).Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)i=e.connect(i.Lnext,i).Sym;return!0},e.prototype.tessellateInterior_=function(e){for(var r,n=e.fHead.next;n!==e.fHead;n=r)if(r=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},e.prototype.discardExterior_=function(e){for(var r,n=e.fHead.next;n!==e.fHead;n=r)r=n.next,n.inside||e.zapFace(n)},e.prototype.setWindingNumber_=function(e,r,n){for(var i,a=e.eHead.next;a!==e.eHead;a=i)i=a.next,a.Rface.inside!==a.Lface.inside?a.winding=a.Lface.inside?r:-r:n?e.delete(a):a.winding=0},e.prototype.getNeighbourFace_=function(e){return e.Rface&&e.Rface.inside?e.Rface.n:-1},e.prototype.outputPolymesh_=function(e,r,n,i){var a,o,s=0,l=0;n>3&&e.mergeConvexFaces(n);for(var u=e.vHead.next;u!==e.vHead;u=u.next)u.n=-1;for(var c=e.fHead.next;c!==e.fHead;c=c.next)if(c.n=-1,c.inside){a=c.anEdge,o=0;do -1===(u=a.Org).n&&(u.n=l,l++),o++,a=a.Lnext;while(a!==c.anEdge);if(o>n)throw"Face vertex greater that support polygon";c.n=s,++s}for(this.elementCount=s,r===F.CONNECTED_POLYGONS&&(s*=2),this.elements=[],this.elements.length=s*n,this.vertexCount=l,this.vertices=[],this.vertices.length=l*i,this.vertexIndices=[],this.vertexIndices.length=l,u=e.vHead.next;u!==e.vHead;u=u.next)if(-1!==u.n){var h=u.n*i;this.vertices[h+0]=u.coords[0],this.vertices[h+1]=u.coords[1],i>2&&(this.vertices[h+2]=u.coords[2]),this.vertexIndices[u.n]=u.idx}var d=0;for(c=e.fHead.next;c!==e.fHead;c=c.next)if(c.inside){a=c.anEdge,o=0;do u=a.Org,this.elements[d++]=u.n,o++,a=a.Lnext;while(a!==c.anEdge);for(var f=o;f<n;++f)this.elements[d++]=-1;if(r===F.CONNECTED_POLYGONS){a=c.anEdge;do this.elements[d++]=this.getNeighbourFace_(a),a=a.Lnext;while(a!==c.anEdge);for(var p=o;p<n;++p)this.elements[d++]=-1}}},e.prototype.outputContours_=function(e,r){var n,i,a=0,o=0;this.vertexCount=0,this.elementCount=0;for(var s=e.fHead.next;s!==e.fHead;s=s.next)if(s.inside){i=n=s.anEdge;do this.vertexCount++,n=n.Lnext;while(n!==i);this.elementCount++}this.elements=[],this.elements.length=2*this.elementCount,this.vertices=[],this.vertices.length=this.vertexCount*r,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var l=0,u=0,c=0;for(a=0,s=e.fHead.next;s!==e.fHead;s=s.next)if(s.inside){o=0,i=n=s.anEdge;do this.vertices[l++]=n.Org.coords[0],this.vertices[l++]=n.Org.coords[1],r>2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[u++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[c++]=a,this.elements[c++]=o,a+=o}},e.prototype.addContour=function(e,r){null===this.mesh&&(this.mesh=new X),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i<r.length;i+=e)null===n?(n=this.mesh.makeEdge(),this.mesh.splice(n,n.Sym)):(this.mesh.splitEdge(n),n=n.Lnext),n.Org.coords[0]=r[i+0],n.Org.coords[1]=r[i+1],n.Org.coords[2]=e>2?r[i+2]:0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},e.prototype.tesselate=function(e,r,n,i,a,o){if(void 0===e&&(e=z.ODD),void 0===r&&(r=F.POLYGONS),void 0===o&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,a&&(this.normal[0]=a[0],this.normal[1]=a[1],this.normal[2]=a[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),et.computeInterior(this,o);var s=this.mesh;return r===F.BOUNDARY_CONTOURS?this.setWindingNumber_(s,1,!0):this.tessellateInterior_(s),o&&s.check(),r===F.BOUNDARY_CONTOURS?this.outputContours_(s,i):this.outputPolymesh_(s,r,n,i),!0},e}();function en(e){var r=e.windingRule,n=void 0===r?z.ODD:r,i=e.elementType,a=void 0===i?F.POLYGONS:i,o=e.polySize,s=e.vertexSize,l=void 0===s?2:s,u=e.normal,c=e.contours,h=void 0===c?[]:c,d=e.strict,f=void 0===d||d,p=e.debug;if(!h&&f)throw Error("Contours can't be empty");if(h){var v=new er;e.edgeCreateCallback&&(v.edgeCreateCallback=e.edgeCreateCallback),e.vertexIdCallback&&(v.vertexIdCallback=e.vertexIdCallback);for(var y=0;y<h.length;y++)v.addContour(l||2,h[y]);return v.tesselate(n,a,void 0===o?3:o,l,void 0===u?[0,0,1]:u,f),{vertices:v.vertices,vertexIndices:v.vertexIndices,vertexCount:v.vertexCount,elements:v.elements,elementCount:v.elementCount,mesh:void 0!==p&&p?v.mesh:void 0}}}z.ODD,z.NONZERO,z.POSITIVE,z.NEGATIVE,z.ABS_GEQ_TWO,F.POLYGONS,F.CONNECTED_POLYGONS,F.BOUNDARY_CONTOURS;var ei=function(){function e(r){y(this,e),this.position=new h.Dc,this.startPosition=new h.Dc,this.uuid=h.Cc.generateUUID(),this.position=r.clone()}return b(e,[{key:"start",value:function(){this.reset()}},{key:"reset",value:function(){this.startPosition.copy(this.position)}},{key:"applyOffset",value:function(e){this.position.copy(this.startPosition).add(e)}},{key:"copy",value:function(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}},{key:"clone",value:function(){return new ei(this.position).copy(this)}},{key:"toJSON",value:function(){return[this.position.x,this.position.y]}}]),e}(),ea=function(e){function r(e){var n;return y(this,r),(n=v(this,r,[e.position])).parent=e,n}return S(r,e),b(r,[{key:"copy",value:function(e){return w(x(r.prototype),"copy",this).call(this,e),this}},{key:"clone",value:function(){return new ea(this.parent).copy(this)}}]),r}(ei),eo=function(e){function r(e,n){var i;return y(this,r),(i=v(this,r,[n])).controls=[],i.roundness=0,i.areControlsDirectionsMirrored=!0,i.uuid=e,i.controls.push(new ea(i),new ea(i)),i}return S(r,e),b(r,[{key:"getOppositeControl",value:function(e){var r=this.controls.indexOf(e);return 0===r?this.controls[1]:1===r?this.controls[0]:null}},{key:"applyOffsetToControls",value:function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,i=this.controls.length;n<i;n++){var a=this.controls[n];this.position.distanceTo(a.position)<=r?a.position.copy(this.position):a.applyOffset(e)}}},{key:"controlsMoved",value:function(){return!(this.position.equals(this.controls[0].position)&&this.position.equals(this.controls[1].position))}},{key:"copy",value:function(e){return w(x(r.prototype),"copy",this).call(this,e),this.controls[0].copy(e.controls[0]),this.controls[1].copy(e.controls[1]),this.roundness=e.roundness,this.uuid=e.uuid,this}},{key:"clone",value:function(){return new eo(this.uuid,this.position).copy(this)}},{key:"toJSON",value:function(){return w(x(r.prototype),"toJSON",this).call(this).concat(this.controls[0].toJSON(),this.controls[1].toJSON(),[this.roundness])}},{key:"computeTangents",value:function(){var e,r;return[null==(e=this.curveBefore)?void 0:e.getTangentAt(1),null==(r=this.curveAfter)?void 0:r.getTangentAt(0)]}},{key:"computeNormals",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new h.Dc,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new h.Dc,n=_(this.computeTangents(),2),i=n[0],a=n[1];return i&&a&&(es(i,e),es(a,r)),[e,r]}},{key:"computeTangent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new h.Dc,r=_(this.computeTangents(),2),n=r[0],i=r[1];return n&&i&&e.copy(n).add(i).normalize(),e}},{key:"computeNormal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new h.Dc,r=_(this.computeNormals(),2),n=r[0],i=r[1];return e.copy(n).add(i).normalize(),e}}],[{key:"create",value:function(e,r){var n,i,a=new eo(e,m(h.Dc,P(r.position)));return(n=a.controls[0].position).set.apply(n,P(r.controlPrevious.position)),(i=a.controls[1].position).set.apply(i,P(r.controlNext.position)),a.roundness=r.roundness,a.areControlsDirectionsMirrored=r.areControlsDirectionsMirrored,a}}]),r}(ei);function es(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new h.Dc,n=e.length();return r.set(-e.y/n,e.x/n)}var el=function(e){return e},eu=new h.Dc,ec=new h.Dc,eh=new h.Dc,ed=new h.Dc,ef=new h.Dc,ep=new h.Dc,ev=new h.Fc,ey=new h.Fc;function em(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.EPSILON;return Math.abs(e-r)<n}function eg(e,r,n){var i=Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2)),a=Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2)),o=Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));return Math.acos((a*a+i*i-o*o)/(2*a*i))}function eb(e,r,n){return 0===eu.copy(r).sub(e).cross(ec.copy(n).sub(e))}function ew(e,r){return e.position.equals(e.controls[1].position)&&r.position.equals(r.controls[0].position)}function ex(e,r){return eb(e.position,e.controls[1].position,r.position)&&eb(e.position,r.controls[0].position,r.position)}function eS(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[],a=0,o=e.length;a<o;a++){var s=e[a],l=0;if(n&&void 0!==s.roundedCurveCorner){var u=.5*ek(s.roundedCurveCorner,r);a>0&&(i[a-1]+=u),l+=u}void 0!==s.curveAfter&&(l+=ek(s.curveAfter,r)),i.push(l)}return e.length>0&&n&&void 0!==e[0].roundedCurveCorner&&(i[e.length-1]+=.5*ek(e[0].roundedCurveCorner,r)),i}function ek(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;return e&&k(e,h.Id)?2*r:e&&(k(e,h.Ld)||k(e,h.Md))?1:e&&k(e,h.Od)?r*e.points.length:r}var eM=new h.Dc,eA=new h.Dc,eO=new h.Dc,eC=new h.Dc,e_=new h.Dc,eP=new h.Dc,eE=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return y(this,r),(e=v(this,r)).points=[],e.shapeHoles=[],e.plane=new h.rd(new h.Fc(0,0,-1)),e.subdivision=0,e.controlSnapDistance=4,e.pointIDs=0,e.isMesh2D=!1,e.isText=!1,e._roundness=0,e.isClosed=!1,e.useCubicForRoundedCorners=!0,e.uuid=h.Cc.generateUUID(),e.needsUpdate=!1,e.roundedCurves=[],e._width=n,e._height=i,e}return S(r,e),b(r,[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"roundness",get:function(){return this._roundness},set:function(e){if(this._roundness!==e){this._roundness=e;for(var r=0,n=this.points.length;r<n;r++)this.points[r].roundness=e;this.needsUpdate=!0}}},{key:"getPointsIndexesByIds",value:function(e){var r=this;return e.map(function(e){return r.getPointIndexById(e)}).filter(function(e){return e>=0})}},{key:"getPointIndexById",value:function(e){var r=this.points.length,n=this.points.findIndex(function(r){return r.uuid===e});if(n<0)for(var i=r,a=0,o=this.shapeHoles.length;a<o;a++){var s=this.shapeHoles[a],l=s.points.length,u=s.getPointIndexById(e);if(!(u<0))return u+i;i+=l}return n}},{key:"getLineIndexById",value:function(e){return this.getPointIndexById(e)}},{key:"getBezierPoint",value:function(e){if(e<=this.points.length-1)return this.points[e];if(this.shapeHoles.length>0)for(var r=this.points.length,n=0,i=this.shapeHoles.length;n<i;n++){var a=this.shapeHoles[n],o=e-r;if(o<=a.points.length-1)return a.points[o];r+=a.points.length}throw Error("This shape does not have a point for this index: "+e)}},{key:"getBezierPointIndex",value:function(e){var r=this.points.indexOf(e);if(r>=0)return r;if(r=this.points.length,this.shapeHoles.length>0)for(var n=0,i=this.shapeHoles.length;n<i;n++){var a=this.shapeHoles[n],o=a.points.indexOf(e);if(o>=0)return r+o;r+=a.points.length}return -1}},{key:"getAllPoints",value:function(){var e,r=(e=[]).concat.apply(e,P(this.shapeHoles.map(function(e){return e.points})));return P(this.points).concat(P(r))}},{key:"applySize",value:function(e,r){0===e&&(e=.001),0===r&&(r=.001),this._width=e,this._height=r}},{key:"applyScale",value:function(e,r){for(var n=eM.set(e,r),i=0,a=this.points.length;i<a;i++){var o=this.points[i];o.position.multiply(n),o.controls[0].position.multiply(n),o.controls[1].position.multiply(n)}for(var s=0,l=this.shapeHoles.length;s<l;s++)this.shapeHoles[s].applyScale(e,r);this._update()}},{key:"createPoint",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.Cc.generateUUID(),i=new eo(n,k(e,h.Dc)?e:new h.Dc(e,r));return i.roundness=this.roundness,i}},{key:"addPoint",value:function(e){this.points.push(e),this.needsUpdate=!0}},{key:"addPointAt",value:function(e,r){this.points.splice(r,0,e),this.needsUpdate=!0}},{key:"getPointByUuid",value:function(e){for(var r=0,n=this.points.length;r<n;r++){var i=this.points[r];if(i.uuid===e)return i}for(var a=0,o=this.shapeHoles.length;a<o;a++){var s=this.shapeHoles[a].getPointByUuid(e);if(s)return s}}},{key:"getFirstPoint",value:function(){return this.points[0]}},{key:"getLastPoint",value:function(){return this.points[this.points.length-1]}},{key:"removePoint",value:function(e){var r=this.points.indexOf(e);r>=0&&this.points.splice(r,1),this.needsUpdate=!0}},{key:"removePointById",value:function(e){var r=this.points.find(function(r){return r.uuid===e});r&&this.removePoint(r)}},{key:"update",value:function(){for(var e=0,r=this.shapeHoles.length;e<r;e++)this.shapeHoles[e].update();this._update()}},{key:"extractShapePointsToBuffer",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.subdivision=r,void 0===this.curveDivisions&&this.computeCurveDivisions(r);var i=n?this.roundedCurveDivisions:this.curveDivisions;return function(e,r){for(var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,a=!(arguments.length>3)||void 0===arguments[3]||arguments[3],o=ey.set(0,0,0),s=0,l=[],u=0;u<r.length;u++){var c=el(r[u]),d=ek(c,i);l.push(d);for(var f=0;f<=d;f++)if(k(c,h.Jd)||k(c,h.Nd)||k(c,h.Ld)){if(c.getPoint(f/d,eu),o.set(eu.x,eu.y,0),void 0!==n&&function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.EPSILON;return e.distanceTo(r)<n}(n,o))continue;void 0===n&&(n=ev),n.copy(o),e.setXYZ(s,o.x,o.y,o.z),s++}}a&&s>1&&(e.getX(s-1)!==e.getX(0)||e.getY(s-1)!==e.getY(0)||e.getZ(s-1)!==e.getZ(0))&&(e.setXYZ(s,e.getX(0),e.getY(0),e.getZ(0)),s++)}(e,n?this.roundedCurves:this.curves,r,this.autoClose),i.reduce(function(e,r){return e+r},0)+1}},{key:"computeCurveDivisions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;return this.curveDivisions=eS(this.points,e,!1),this.roundedCurveDivisions=eS(this.points,e,!0),this.curveDivisions}},{key:"extractFilteredShapePointsToBuffer",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12;return 2*(function(e,r,n){for(var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:12,a=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=ey.set(0,0,0),s=0,l=[],u=0;u<r.length;u++)if(!1!==n[u]){var c=void 0,d=el(r[u]),f=ek(d,i);l.push(f);for(var p=0;p<=f;p++)if(k(d,h.Jd)||k(d,h.Nd)||k(d,h.Ld)){if(d.getPoint(p/f,eu),o.set(eu.x,eu.y,0),null==c?void 0:c.equals(o))continue;void 0===c?c=ev:(e.setXYZ(s,c.x,c.y,c.z),s++,e.setXYZ(s,o.x,o.y,o.z),s++),c.copy(o)}}return a&&s>1&&(e.getX(s-1)!==e.getX(0)||e.getY(s-1)!==e.getY(0)||e.getZ(s-1)!==e.getZ(0))&&(e.setXYZ(s,e.getX(0),e.getY(0),e.getZ(0)),s++),l})(e,this.curves,r,n,this.autoClose).reduce(function(e,r){return e+r},0)}},{key:"extractShapePointsToFlatArray",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;return this.subdivision=r,void 0===this.curveDivisions&&this.computeCurveDivisions(r),function(e,r){for(var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,a=!(arguments.length>3)||void 0===arguments[3]||arguments[3],o=0,s=0;s<r.length;s++)for(var l=el(r[s]),u=ek(l,i),c=0;c<=u;c++)if(k(l,h.Jd)||k(l,h.Nd)||k(l,h.Ld)){if(l.getPoint(c/u,eu),void 0!==n&&function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.EPSILON;return e.distanceTo(r)<n}(n,eu,1e-12))continue;void 0===n&&(n=ec),n.copy(eu),e.push(eu.x,eu.y),o++}return em(e[0],e[e.length-2],1e-12)&&em(e[1],e[e.length-1],1e-12)&&(e.pop(),e.pop()),a&&o>1&&!(em(e[o-1],e[1],1e-12)&&em(e[o-2],e[0],1e-12))&&(e.push(e[0],e[1]),o++),e}(e,this.roundedCurves,r,this.autoClose)}},{key:"getCurveIndexFromVertexId",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0;void 0===this.curveDivisions&&this.computeCurveDivisions(this.subdivision);var i=r?this.roundedCurveDivisions:this.curveDivisions,a=0;r&&void 0!==this.points[0].roundedCurveCorner&&(a=.5*ek(this.points[0].roundedCurveCorner,this.subdivision));var o=e-a;o<0&&(o+=i.reduce(function(e,r){return e+r},0));for(var s=0,l=i.length;s<l;s++){var u=i[s];if(o<n+u)return[s,(o-n+1)/u];n+=u}return[0,1]}},{key:"getCurveT",value:function(e,r,n){var i=this.points[e],a=this.points[e>=this.points.length-1?0:e+1],o=this.curveDivisions,s=o[e];if(ew(i,a)){var l=i.position.distanceTo(a.position);return i.position.distanceTo(eM.set(n.x,n.y))/l}for(var u=0,c=0;c<e;c++)u+=o[c];return(r-u)/s}},{key:"dispose",value:function(){}},{key:"_applyCurveForPoint",value:function(e,r){ew(r,e)?this.lineTo(e.position.x,e.position.y):this.bezierCurveTo(r.controls[1].position.x,r.controls[1].position.y,e.controls[0].position.x,e.controls[0].position.y,e.position.x,e.position.y);var n=this.curves[this.curves.length-1];e.curveBefore=n,r.curveAfter=n;var i=n.clone();e.roundedCurveBefore=i,r.roundedCurveAfter=i,e.roundedCurveCorner=void 0,this.roundedCurves.push(i)}},{key:"_update",value:function(){if(this.curves=[],this.roundedCurves=[],this.points.length){for(var e=0,r=this.points.length;e<r;e++){var n=this.points[e];if(0===e)this.moveTo(n.position.x,n.position.y);else{var i=this.points[e-1];this._applyCurveForPoint(n,i)}}var a=this.getLastPoint();if((null==a?void 0:a.curveAfter)&&(a.curveAfter=void 0),this.isClosed){var o=this.points[0],s=this.points[this.points.length-1];this._applyCurveForPoint(o,s)}if(this.points.length>2)for(var l=0,u=0,c=this.points.length;u<c;u++){var d,f,p=this.points[u],v=null!=(d=this.points[u-1])?d:this.points[this.points.length-1],y=null!=(f=this.points[u+1])?f:this.points[0],m=p.roundness,g=v&&y&&ex(v,p)&&ex(p,y)&&eb(v.position,p.position,y.position);if(!p.controlsMoved()&&m>0&&!g){var b=p.curveBefore,w=p.curveAfter;if(void 0===b||void 0===w)continue;var x=void 0,S=p.roundedCurveBefore,M=p.roundedCurveAfter,A=k(b,h.Ld)?b.v1.distanceTo(b.v2):b.getLength(),O=k(w,h.Ld)?w.v1.distanceTo(w.v2):w.getLength(),C=Math.min(Math.min(m,.499*A),Math.min(m,.499*O)),P=1-C/A,E=C/O,D=b.getPointAt(P,eM),j=w.getPointAt(E,eA);if(this._subSplitCurve(b,S,P,D,void 0),this._subSplitCurve(w,M,E,void 0,j),this.useCubicForRoundedCorners){var T,I=Math.tan(eg(D,p.position,j)/2)*D.distanceTo(p.position),R=_(function(e,r,n,i,a){var o=Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2)),s=(e.y+r.y)/2,l=(e.x+r.x)/2,u=Math.sqrt(Math.pow(n,2)-Math.pow(o/2,2))*(e.y-r.y)/o,c=Math.sqrt(Math.pow(n,2)-Math.pow(o/2,2))*(r.x-e.x)/o;return i.set(l+u,s+c),a.set(l-u,s-c),[i,a]}(D,j,I,eO,eC),2),B=R[0],z=R[1],L=_(function(e,r,n,i,a,o){var s,l=r.x-e.x,u=r.y-e.y,c=n.x-e.x,h=n.y-e.y,d=Math.sqrt((l+c)*(l+c)+(u+h)*(u+h));return eg(r,e,n)>Math.PI&&(d*=-1),s=em(h,u)?(u+h)*(i/d-.5)*8/3/(l-c):(l+c)*(i/d-.5)*8/3/(h-u),a.set(r.x-s*u,r.y+s*l),o.set(n.x+s*h,n.y-s*c),[a,o]}((T=p.position,B.distanceTo(T)<z.distanceTo(T)?z:B),D,j,I,e_,eP),2),F=L[0],U=L[1];x=new h.Jd(D.clone(),F.clone(),U.clone(),j.clone())}else x=new h.Nd(D.clone(),p.position.clone(),j.clone());p.roundedCurveCorner=x,this.roundedCurves.splice(u+l,0,x),l++}}}}},{key:"_subSplitCurve",value:function(e,r,n,i,a){if(!k(e,h.Ld)){var o=e.getUtoTmapping(n,0),s=function(e,r,n,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,o=eu.subVectors(r,e).multiplyScalar(a).add(e),s=ec.subVectors(n,r).multiplyScalar(a).add(r),l=eh.subVectors(i,n).multiplyScalar(a).add(n),u=ed.subVectors(s,o).multiplyScalar(a).add(o),c=ef.subVectors(l,s).multiplyScalar(a).add(s),h=ep.subVectors(c,u).multiplyScalar(a).add(u);return[e.x,e.y,o.x,o.y,u.x,u.y,h.x,h.y,c.x,c.y,l.x,l.y,i.x,i.y]}(e.v0,e.v1,e.v2,e.v3,o);return void 0!==i&&(r.v0.set(s[0],s[1]),r.v1.set(s[2],s[3]),r.v2.set(s[4],s[5]),r.v3.set(s[6],s[7])),void 0!==a&&(r.v0.set(s[6],s[7]),r.v1.set(s[8],s[9]),r.v2.set(s[10],s[11]),r.v3.set(s[12],s[13])),r}return void 0!==i&&r.v2.copy(i),void 0!==a&&r.v1.copy(a),r}},{key:"clone",value:function(){var e=new eE(this._width,this._height);return e.points=this.points.map(function(e){return e.clone()}),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(function(e){return e.clone()}),e}},{key:"toJSON",value:function(){return{points:this.points.reduce(function(e,r){return e.concat(r.toJSON())},[]),shapeHoles:this.shapeHoles.map(function(e){return e.toJSON()}),isClosed:this.isClosed,roundness:this.roundness}}},{key:"fromJSON",value:function(e){this.points=[],this.pointIDs=0;for(var r,n=e.points.length/7,i=0;i<n;i++){var a=7*i,o=e.points[a+0],s=e.points[a+1],l=e.points[a+2],u=e.points[a+3],c=e.points[a+4],d=e.points[a+5],f=e.points[a+6],p=new eo(h.Cc.generateUUID(),new h.Dc(o,s));p.controls[0].position.set(l,u),p.controls[1].position.set(c,d),p.roundness=f,this.points.push(p)}return this.shapeHoles=(null==(r=e.shapeHoles)?void 0:r.length)?e.shapeHoles.map(function(e){var r=new eE;return r.fromJSON(e),r}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}},{key:"fromShape",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.isText=n;var i=function(e,r){k(r,h.Jd)&&r.v3.equals(e.position)&&e.controls[0].position.copy(r.v2)};return this.points=function(e){var n,a,o=[];for(n=0,a=e.length;n<a;n++)k(e[n],h.Nd)&&(e[n]=function(e){var r=new h.Dc;r.addVectors(e.v0,eu.subVectors(e.v1,e.v0).multiplyScalar(2/3));var n=new h.Dc;return n.addVectors(e.v2,ec.subVectors(e.v1,e.v2).multiplyScalar(2/3)),new h.Jd(e.v0,r,n,e.v2)}(e[n]));for(n=0,a=e.length;n<a;n++){var s=void 0,l=e[n],u=n>0?e[n-1]:null;k(l,h.Jd)?(s=r.createPoint(l.v0)).controls[1].position.copy(l.v1):k(l,h.Ld)&&(s=r.createPoint(l.v1)),void 0!==s&&(null!==u&&i(s,u),o.push(s))}var c=e[e.length-1],d=!1;return k(c,h.Jd)?c.v3.equals(o[0].position)&&(o[0].controls[0].position.copy(c.v2),d=!0):k(c,h.Ld)&&c.v2.equals(o[0].position)&&(d=!0),r.isClosed=d,o}(e.curves),k(e,h.Rd)&&(this.shapeHoles=e.holes.map(function(e){var r=new eE;return r.fromShape(e),r})),this.update(),this}},{key:"updatePoint",value:function(e,r){var n=this.getPointByUuid(e);n&&(void 0!==r.position&&n.position.fromArray(r.position),void 0!==r.roundness&&(n.roundness=r.roundness),void 0!==r.areControlsDirectionsMirrored&&(n.areControlsDirectionsMirrored=r.areControlsDirectionsMirrored),this.needsUpdate=!0)}},{key:"updatePreviousControl",value:function(e,r){var n,i=null==(n=this.getPointByUuid(e))?void 0:n.controls[0];i&&(r.position&&i.position.fromArray(r.position),this.needsUpdate=!0)}},{key:"updateNextControl",value:function(e,r){var n,i=null==(n=this.getPointByUuid(e))?void 0:n.controls[1];i&&(r.position&&i.position.fromArray(r.position),this.needsUpdate=!0)}}],[{key:"createFromState",value:function(e,r,n){var i=new eE;return i.isClosed=e.isClosed,i.points=e.points.map(function(e){return eo.create(e.id,e.data)}),"number"==typeof e.roundness&&(i.roundness=e.roundness),i.shapeHoles=e.shapeHoles.map(function(e){return eE.createFromState(e)}),void 0!==r&&void 0!==n&&i.applySize(r,n),i.update(),i}}]),r}(h.Rd);function eD(e,r){var n=e.length/2;if(n<2)return[];for(var i=0,a=0;a<n;a++){var o=(a+1)%n;i+=e[2*a]*e[2*o+1]-e[2*o]*e[2*a+1]}for(var s=i>0!==r?1:-1,l=[],u=0;u<n;u++){var c=(u+1)%n,h=e[2*c]-e[2*u],d=e[2*c+1]-e[2*u+1],f=Math.hypot(h,d);l.push(f>0?[s*d/f,-s*h/f]:[0,0])}var p=Math.cos(40*Math.PI/180),v=function(e,r){if(e[0]*r[0]+e[1]*r[1]<=p)return e;var n=[e[0]+r[0],e[1]+r[1]],i=n[0],a=n[1],o=Math.hypot(i,a);return o>0?[i/o,a/o]:e};return l.map(function(e,r){return[v(e,l[(r+n-1)%n]),v(e,l[(r+1)%n])]})}function ej(e,r,n){var i=e.length/2,a=new Float32Array(i+1);if(!(r>0)||!(n>0)||i<2)return{u:a,vScale:0};for(var o=0,s=0;s<i;s++){var l=(s+1)%i;o+=Math.hypot((e[2*l]-e[2*s])/r,(e[2*l+1]-e[2*s+1])/n),a[s+1]=o}return{u:a,vScale:Math.sqrt(r*n)}}function eT(e,r,n){for(var i=0;i<n.length;i+=3){var a=3*n[i],o=3*n[i+1],s=3*n[i+2],l=e[o]-e[a],u=e[o+1]-e[a+1],c=e[o+2]-e[a+2],h=e[s]-e[a],d=e[s+1]-e[a+1],f=e[s+2]-e[a+2],p=c*h-l*f,v=l*d-u*h;if((u*f-c*d)*(r[a]+r[o]+r[s])+p*(r[a+1]+r[o+1]+r[s+1])+v*(r[a+2]+r[o+2]+r[s+2])<0){var y=n[i+1];n[i+1]=n[i+2],n[i+2]=y}}}var eI,eR,eB,ez={vertices:[160,160,-160,160,-160,-160,160,-160],vertexIndices:[1,0,3,2],vertexCount:4,elements:[0,4],elementCount:1,mesh:void 0},eL={vertices:[],vertexIndices:[],vertexCount:0,elements:[],elementCount:0,mesh:void 0},eF={vertices:[-160,160,160,-160,160,160,-160,-160],vertexIndices:[1,3,0,2],vertexCount:4,elements:[0,1,2,1,0,3],elementCount:2,mesh:void 0},eU=function(e){function r(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:z.ODD,o=arguments.length>4?arguments[4]:void 0;y(this,r),(s=v(this,r)).type="FlatExtrusionGeometry",s._nearSide=new Uint8Array(0),s._vScale=0,s._shape=e,s._depth=n,s._curveSegments=i,s._windingRule=a,s._uvPitch=o;var s,l,u,c,d=[e.extractShapePointsToFlatArray([],i)].concat(P(e.shapeHoles.map(function(e){return e.extractShapePointsToFlatArray([],i)})));try{c=en({contours:d,windingRule:a,elementType:F.POLYGONS,polySize:3,vertexSize:2,strict:!0})}catch(e){c=eF}var f=null!=(l=null==c?void 0:c.vertexCount)?l:0,p=null!=(u=null==c?void 0:c.elementCount)?u:0,m=1/0,g=1/0,b=-1/0,w=-1/0,x=!0,S=!1,k=void 0;try{for(var M,A=d[Symbol.iterator]();!(x=(M=A.next()).done);x=!0)for(var O=M.value,C=0;C<O.length;C+=2)O[C]<m&&(m=O[C]),O[C]>b&&(b=O[C]),O[C+1]<g&&(g=O[C+1]),O[C+1]>w&&(w=O[C+1])}catch(e){S=!0,k=e}finally{try{x||null==A.return||A.return()}finally{if(S)throw k}}var E=s._uvPitch,D=null!=E?E:b-m||1,j=null!=E?E:w-g||1,T=void 0===E?m:0,I=void 0===E?g:0,R=d.map(function(e,r){return eD(e,r>0)}),B=0,L=!0,U=!1,V=void 0;try{for(var N,G=R[Symbol.iterator]();!(L=(N=G.next()).done);L=!0){var W=N.value;B+=W.length}}catch(e){U=!0,V=e}finally{try{L||null==G.return||G.return()}finally{if(U)throw V}}var H=2*f+4*B,q=3*p*2+6*B,Y=new Float32Array(3*H),X=new Float32Array(3*H),Z=new Float32Array(2*H),K=new Uint32Array(q),J=new Uint8Array(H),Q=0,$=0,ee=0,et=!1,er=function(e,r,i,a,o,s){var l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:(e-T)/D,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:(r-I)/j,c=3*$;Y[c]=e,Y[c+1]=r,Y[c+2]=i,X[c]=a,X[c+1]=o,X[c+2]=s,J[$]=i===n?et?2:1:0,Z[2*$]=l,Z[2*$+1]=u,$++};if(void 0!==c)for(var ei=0,ea=[[n,1],[0,-1]];ei<ea.length;ei++){for(var eo=_(ea[ei],2),es=eo[0],el=eo[1],eu=$,ec=0;ec<f;ec++)er(c.vertices[2*ec],c.vertices[2*ec+1],es,0,0,el);for(var eh=0;eh<p;eh++){var ed=[c.elements[3*eh],c.elements[3*eh+1],c.elements[3*eh+2]],ef=ed[0],ep=ed[1],ev=ed[2];K[ee++]=eu+ef,K[ee++]=eu+(el>0?ep:ev),K[ee++]=eu+(el>0?ev:ep)}}et=!0;for(var ey=0;ey<d.length;ey++){var em=d[ey],eg=R[ey],eb=em.length/2,ew=ej(em,D,j),ex=ew.u,eS=ew.vScale;Q=eS;for(var ek=0===eS?0:n/eS,eM=0;eM<eg.length;eM++){var eA=(eM+1)%eb,eO=_(eg[eM],2),eC=eO[0],e_=eO[1],eP=[ex[eM],ex[eM+1]],eE=eP[0],eI=eP[1],eR=$;er(em[2*eM],em[2*eM+1],n,eC[0],eC[1],0,eE,ek),er(em[2*eM],em[2*eM+1],0,eC[0],eC[1],0,eE,0),er(em[2*eA],em[2*eA+1],n,e_[0],e_[1],0,eI,ek),er(em[2*eA],em[2*eA+1],0,e_[0],e_[1],0,eI,0),K[ee++]=eR,K[ee++]=eR+1,K[ee++]=eR+2,K[ee++]=eR+3,K[ee++]=eR+2,K[ee++]=eR+1}}return eT(Y,X,K),s.setAttribute("position",new h.Zc(Y,3)),s.setAttribute("normal",new h.Zc(X,3)),s.setAttribute("uv",new h.Zc(Z,2)),s.setIndex(new h.Zc(K,1)),s._nearSide=J,s._vScale=Q,s}return S(r,e),b(r,[{key:"takeDepthStateFrom",value:function(e){var r,n;void 0!==e._nearSide&&(this._depth=null!=(r=e._depth)?r:this._depth,this._nearSide=e._nearSide,this._vScale=null!=(n=e._vScale)?n:this._vScale)}},{key:"canShiftDepthTo",value:function(e){return this._nearSide.length>0&&this._depth>0&&e>0}},{key:"shiftDepthTo",value:function(e){if(!this.canShiftDepthTo(e))return!1;var r=e-this._depth;if(this._depth=e,0===r)return!0;var n=this.getAttribute("position");if(void 0===n)return!1;for(var i=n.array,a=this.getAttribute("uv"),o=null==a?void 0:a.array,s=this._vScale>0?r/this._vScale:0,l=this._nearSide,u=0;u<l.length;u++){var c=l[u];0!==c&&(i[3*u+2]+=r,2===c&&void 0!==o&&(o[2*u+1]+=s))}return n.needsUpdate=!0,void 0!==a&&0!==s&&(a.needsUpdate=!0),this.refreshDepthBounds(e),!0}},{key:"refreshDepthBounds",value:function(e){if(null!==this.boundingBox||null!==this.boundingSphere){null===this.boundingBox&&this.computeBoundingBox();var r=this.boundingBox;r.min.z=Math.min(0,e),r.max.z=Math.max(0,e),null!==this.boundingSphere&&r.getBoundingSphere(this.boundingSphere)}}},{key:"clone",value:function(){var e=new eU(this._shape,this._depth,this._curveSegments,this._windingRule);return e.userData=(0,s.c)(this.userData),e}}]),r}(h.dd),eV=function(e){function r(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};y(this,r),(a=v(this,r)).type="ShapeGeometry",a.windingRule=z.ODD,a.elementType=F.POLYGONS,a.polySize=3,a.vertexSize=2,a.strict=!0,a._shape=e,a._curveSegments=n,a._triangulationOptions=Object.assign({windingRule:z.ODD,elementType:F.POLYGONS,polySize:3,vertexSize:2,strict:!0},i);for(var a,o,s,l,u,c,d,f=a._shape.extractShapePointsToFlatArray([],a._curveSegments),p=a._shape.shapeHoles.map(function(e){return e.extractShapePointsToFlatArray([],a._curveSegments)}),m=!0,g=!0,b=0,w=f.length/2;b<w;b++){var x=2*b,S=f[x+0],k=f[x+1];if(void 0!==c&&S!==c&&(m=!1),void 0!==d&&k!==d&&(g=!1),c=S,d=k,!m&&!g)break}if(!m&&!g)try{u=en({contours:[f].concat(P(p)),windingRule:a._triangulationOptions.windingRule,elementType:a._triangulationOptions.elementType,polySize:a._triangulationOptions.polySize,vertexSize:a._triangulationOptions.vertexSize,strict:a._triangulationOptions.strict})}catch(e){u=ez}var M=null!=(o=null==u?void 0:u.vertexCount)?o:1,A=null!=(s=null==u?void 0:u.elementCount)?s:1;if(a._positionAttribute=new h.Zc(new Float32Array(3*M),3),a._normalAttribute=new h.Zc(new Float32Array(3*M),3),a._uvAttribute=new h.Zc(new Float32Array(2*M),2),a._indexAttribute=new h.Zc(new Uint32Array(3*A),1),u){for(var O=1/0,C=-1/0,_=1/0,E=-1/0,D=0;D<M;D++){var j=2*D,T=u.vertices[j+0],I=u.vertices[j+1];T<O&&(O=T),T>C&&(C=T),I<_&&(_=I),I>E&&(E=I)}for(var R=C-O,B=E-_,L=0;L<M;L++){var U=2*L,V=u.vertices[U+0],N=u.vertices[U+1],G=(V-O)/R,W=(N-_)/B;a._positionAttribute.setXYZ(L,V,N,0),a._normalAttribute.setXYZ(L,0,0,1),a._uvAttribute.setXY(L,G,W)}for(var H=0;H<A;H++){var q=3*H,Y=u.elements[q+0],X=u.elements[q+1],Z=u.elements[q+2];a._indexAttribute.setX(q+0,Y),a._indexAttribute.setX(q+1,X),a._indexAttribute.setX(q+2,Z)}}return a.setAttribute("position",a._positionAttribute),a.setAttribute("normal",a._normalAttribute),a.setAttribute("uv",a._uvAttribute),a.setIndex(a._indexAttribute),a.setDrawRange(0,3*(null!=(l=null==u?void 0:u.elementCount)?l:1)),a}return S(r,e),b(r,[{key:"clone",value:function(){var e=new eV(this._shape,this._curveSegments);return e.userData=(0,s.c)(this.userData),e}}]),r}(h.dd);function eN(e){return eB||(eB=p(function(){var r,i,a,o;return T(this,function(s){switch(s.label){case 0:return r=null!=e?e:"https://unpkg.com/@splinetool/runtime@2.0.60/build",[4,Promise.all([n.e("2381").then(n.bind(n,1644)),fetch("".concat(r,"/bevel.wasm")).then(function(e){return e.arrayBuffer()})])];case 1:return a=(i=_.apply(void 0,[s.sent(),2]))[0],o=i[1],[4,a.default({module_or_path:o})];case 2:return s.sent(),eR=a,[2]}})})())}var eG=new Set(["VectorGeometry","TextGeometry","InputGeometry","PolygonGeometry","RectangleGeometry","StarGeometry","TriangleGeometry","EllipseGeometry"]);function eW(e){var r=!1;return e.scene.objects.traverse(function(e,n){var i=n.geometry;if(void 0!==i&&(eG.has(i.type)&&void 0!==i.depth&&i.depth>0&&(null!=(a=i.extrudeBevelSize)?a:0)>0&&(r=!0),"PathGeometry"===i.type)){var a,o,s=i.extrusion;void 0!==s&&"round"===s.capType&&(null!=(o=s.bevel)?o:0)>0&&(r=!0)}}),r}function eH(e,r){var n=[e.extractShapePointsToFlatArray([],r)],i=!0,a=!1,o=void 0;try{for(var s,l=e.shapeHoles[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;n.push(u.extractShapePointsToFlatArray([],r))}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}var c=0,h=!0,d=!1,f=void 0;try{for(var p,v=n[Symbol.iterator]();!(h=(p=v.next()).done);h=!0){var y=p.value;c+=y.length>>1}}catch(e){d=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(d)throw f}}for(var m=new Float64Array(2*c),g=new Uint32Array(n.length),b=0,w=0;w<n.length;w++)m.set(n[w],2*b),b+=n[w].length>>1,g[w]=b;return{points:m,ends:g}}var eq=new h.Gc;function eY(e,r,n,i,a,o){for(var s=e.positions.length/3,l=a.elements,u=eq.getNormalMatrix(a).elements,c=0;c<s;c++){var h=3*c,d=3*(n+c),f=e.positions[h],p=e.positions[h+1],v=e.positions[h+2];r.positions[d]=l[0]*f+l[4]*p+l[8]*v+l[12],r.positions[d+1]=l[1]*f+l[5]*p+l[9]*v+l[13],r.positions[d+2]=l[2]*f+l[6]*p+l[10]*v+l[14];var y=e.normals[h],m=e.normals[h+1],g=e.normals[h+2];r.normals[d]=u[0]*y+u[3]*m+u[6]*g,r.normals[d+1]=u[1]*y+u[4]*m+u[7]*g,r.normals[d+2]=u[2]*y+u[5]*m+u[8]*g;var b=2*(n+c);if(void 0===o)r.uvs[b]=e.uvs[2*c],r.uvs[b+1]=e.uvs[2*c+1];else{var w=_(o(f,p,e.uvs[2*c],e.uvs[2*c+1]),2),x=w[0],S=w[1];r.uvs[b]=x,r.uvs[b+1]=S}}for(var k=0>a.determinant(),M=0;M<e.indices.length;M+=3)r.indices[i+M]=e.indices[M]+n,r.indices[i+M+1]=e.indices[M+(k?2:1)]+n,r.indices[i+M+2]=e.indices[M+(k?1:2)]+n}var eX=new h.Oc,eZ=new h.Oc,eK=(new h.Oc).makeScale(1,1,-1),eJ=new Map,eQ={assemblies:0,placements:0};function e$(e){var r,n,i,a,o=e.owner,s=e.shape,l=e.curveSegments,u=e.assembledAt,c=e.bevel,h=e.bevelSegments,d=(r=[l],(n=function(e){r.push(e.points.length,+!!e.isClosed,null!=(s=e.roundness)?s:0);var i=!0,a=!1,o=void 0;try{for(var s,l,u=e.points[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;r.push(null!=(p=c.roundness)?p:0,c.position.x,c.position.y);var h=!0,d=!1,f=void 0;try{for(var p,v,y=c.controls[Symbol.iterator]();!(h=(v=y.next()).done);h=!0){var m=v.value;r.push(m.position.x,m.position.y)}}catch(e){d=!0,f=e}finally{try{h||null==y.return||y.return()}finally{if(d)throw f}}}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}r.push(e.shapeHoles.length);var g=!0,b=!1,w=void 0;try{for(var x,S=e.shapeHoles[Symbol.iterator]();!(g=(x=S.next()).done);g=!0){var k=x.value;n(k)}}catch(e){b=!0,w=e}finally{try{g||null==S.return||S.return()}finally{if(b)throw w}}})(s),function(e){for(var r=0x811c9dc5,n=0;n<e.length;n++)r^=e[n],r=Math.imul(r,0x1000193)>>>0;return r}(new Uint8Array(new Float64Array(r).buffer))),f=null!=o?o:"outline:".concat(d),p="".concat(c,"/").concat(h),v=eJ.get(f);if(void 0!==v&&v.outlineVersion===d&&v.capKey===p&&(null!=(i=null==(a=e.stillServes)?void 0:a.call(e,v))?i:1))return eQ.placements++,v.cap;var y=(g=(m=eH(s,l)).points,b=m.ends,eR.assemble_cap(g,b,u,c,0,Math.max(1,Math.floor(h)),.4,40));eQ.assemblies++;try{var m,g,b,w=function(e,r,n,i,a){for(var o=1/0,s=2;s<e.length;s+=3)e[s]<o&&(o=e[s]);if(o===1/0&&(o=0),0!==o)for(var l=2;l<e.length;l+=3)e[l]-=o;return{positions:e,normals:r,uvs:n,indices:i,rise:a-o}}(y.positions(),y.normals(),y.uvs(),y.indices(),u);return eJ.set(f,{outlineVersion:d,capKey:p,assembledAt:u,cap:w}),w}finally{y.free()}}var e0=function(e){function r(e,n){var i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:12,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:3,l=arguments.length>5?arguments[5]:void 0,u=arguments.length>6?arguments[6]:void 0;if(y(this,r),(i=v(this,r)).type="ShapeGeometry",i._nearSide=new Uint8Array(0),i._effectiveBevel=0,i._vScale=0,void 0===eR)throw Error("bevel-wasm is not loaded");return i._shape=e,i._uvPitch=u,i._depth=n,i._bevel=a,i._curveSegments=o,i._bevelSegments=s,i._ownerId=l,i.rebuild(),i}return S(r,e),b(r,[{key:"takeDepthStateFrom",value:function(e){var r,n,i;void 0!==e._nearSide&&(this._depth=null!=(r=e._depth)?r:this._depth,this._nearSide=e._nearSide,this._vScale=null!=(n=e._vScale)?n:this._vScale,this._effectiveBevel=null!=(i=e._effectiveBevel)?i:this._effectiveBevel)}},{key:"canShiftDepthTo",value:function(e){return this._nearSide.length>0&&e2(this._effectiveBevel,e)&&e2(this._effectiveBevel,this._depth)}},{key:"shiftDepthTo",value:function(e){if(!this.canShiftDepthTo(e))return!1;var r=e-this._depth;if(this._depth=e,0===r)return!0;var n=this.getAttribute("position");if(void 0===n)return!1;for(var i=n.array,a=this.getAttribute("uv"),o=null==a?void 0:a.array,s=this._vScale>0?r/this._vScale:0,l=this._nearSide,u=0;u<l.length;u++){var c=l[u];0!==c&&(i[3*u+2]+=r,2===c&&void 0!==o&&(o[2*u+1]+=s))}return n.needsUpdate=!0,void 0!==a&&0!==s&&(a.needsUpdate=!0),this.refreshDepthBounds(e),!0}},{key:"refreshDepthBounds",value:function(e){if(null!==this.boundingBox||null!==this.boundingSphere){null===this.boundingBox&&this.computeBoundingBox();var r=this.boundingBox;r.min.z=Math.min(0,e),r.max.z=Math.max(0,e),null!==this.boundingSphere&&r.getBoundingSphere(this.boundingSphere)}}},{key:"setDepth",value:function(e){e!==this._depth&&(this._depth=e,this.rebuild(),this.computeBoundingSphere(),this.computeBoundingBox())}},{key:"rebuild",value:function(){var e=this,r=e$({owner:this._ownerId,shape:this._shape,curveSegments:this._curveSegments,assembledAt:this._depth,bevel:this._bevel,bevelSegments:this._bevelSegments,stillServes:function(r){return e2(r.cap.rise,e._depth)&&e2(r.cap.rise,r.assembledAt)}}),n=function(e,r,n,i,a){for(var o=i.positions.length/3,s=n-i.rise,l=i.rise,u=eH(e,r),c=u.points,h=u.ends,d=1/0,f=1/0,p=-1/0,v=-1/0,y=0;y<c.length;y+=2)c[y]<d&&(d=c[y]),c[y]>p&&(p=c[y]),c[y+1]<f&&(f=c[y+1]),c[y+1]>v&&(v=c[y+1]);var m=null!=a?a:p-d,g=null!=a?a:v-f,b=[],w=0,x=!0,S=!1,k=void 0;try{for(var M,A=h[Symbol.iterator]();!(x=(M=A.next()).done);x=!0){var O=M.value;b.push({at:w,count:O-w}),w=O}}catch(e){S=!0,k=e}finally{try{x||null==A.return||A.return()}finally{if(S)throw k}}var C=0,P=!0,E=!1,D=void 0;try{for(var j,T=b[Symbol.iterator]();!(P=(j=T.next()).done);P=!0){var I=j.value;C+=I.count}}catch(e){E=!0,D=e}finally{try{P||null==T.return||T.return()}finally{if(E)throw D}}var R=2*o+4*C,B=new Float32Array(3*R),z=new Float32Array(3*R),L=new Float32Array(2*R),F=new Uint32Array(2*i.indices.length+6*C),U=new Uint8Array(R),V=0,N=void 0===a?void 0:function(e,r){return[e/a,r/a]},G={positions:B,normals:z,uvs:L,indices:F};eY(i,G,0,0,eX.makeTranslation(0,0,s),N),eY(i,G,o,i.indices.length,eZ.makeTranslation(0,0,l).multiply(eK),N),U.fill(1,0,o);for(var W=2*o,H=2*i.indices.length,q=0;q<b.length;q++){var Y=b[q],X=Y.at,Z=Y.count,K=c.subarray(2*X,2*(X+Z)),J=eD(K,q>0),Q=ej(K,m,g),$=Q.u;V=Q.vScale;for(var ee=0;ee<Z;ee++){for(var et=(ee+1)%Z,er=_(J[ee],2),en=er[0],ei=er[1],ea=W,eo=0,es=[[K[2*ee],K[2*ee+1],en,s,$[ee],2],[K[2*et],K[2*et+1],ei,s,$[ee+1],2],[K[2*et],K[2*et+1],ei,l,$[ee+1],0],[K[2*ee],K[2*ee+1],en,l,$[ee],0]];eo<es.length;eo++){var el=_(es[eo],6),eu=el[0],ec=el[1],eh=el[2],ed=el[3],ef=el[4],ep=el[5],ev=3*W;B[ev]=eu,B[ev+1]=ec,B[ev+2]=ed,z[ev]=eh[0],z[ev+1]=eh[1],z[ev+2]=0,L[2*W]=ef,L[2*W+1]=0===V?0:(ed-l)/V,U[W]=ep,W++}F[H++]=ea,F[H++]=ea+1,F[H++]=ea+2,F[H++]=ea,F[H++]=ea+2,F[H++]=ea+3}}return eT(B,z,F),{positions:B,normals:z,uvs:L,indices:F,nearSide:U,vScale:V}}(this._shape,this._curveSegments,this._depth,r,this._uvPitch);this._nearSide=n.nearSide,this._vScale=n.vScale,this._effectiveBevel=r.rise;var i=this.getAttribute("position"),a=this.getAttribute("normal"),o=this.getAttribute("uv"),s=this.getIndex();void 0!==i&&void 0!==a&&void 0!==o&&null!==s&&i.array.length===n.positions.length&&a.array.length===n.normals.length&&o.array.length===n.uvs.length&&s.array.length===n.indices.length?(i.array.set(n.positions),a.array.set(n.normals),o.array.set(n.uvs),s.array.set(n.indices),i.needsUpdate=!0,a.needsUpdate=!0,o.needsUpdate=!0,s.needsUpdate=!0):(this.setAttribute("position",new h.Zc(n.positions,3)),this.setAttribute("normal",new h.Zc(n.normals,3)),this.setAttribute("uv",new h.Zc(n.uvs,2)),this.setIndex(new h.Zc(n.indices,1)))}},{key:"clone",value:function(){var e=new e0(this._shape,this._depth,this._bevel,this._curveSegments,this._bevelSegments,this._ownerId);return e.userData=(0,s.c)(this.userData),e}}]),r}(h.dd);function e1(e,r,n,i,a){if(void 0!==eR&&r>0)return e$({owner:a,shape:e,curveSegments:i,assembledAt:2*r,bevel:r,bevelSegments:n})}function e2(e,r){return .5*r>1.001*e}var e3=function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o,s,l,u,c,h,d=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,subdivisions:40,roundness:0,extrudeBevelSize:0,extrudeBevelSegments:3,windingRule:z.ODD},e.parameters),f=Math.abs(d.width),p=Math.abs(null!=(i=d.height)?i:d.width),v=Math.abs(null!=(a=d.depth)?a:0),y=null!=(o=e.shape)?o:null==r?void 0:r.shape,m=null!=(s=null==y?void 0:y.roundness)?s:d.roundness;void 0!==y&&(k(y,eE)?((h=y).width!==f||h.height!==p)&&h.applySize(f,p):h=new eE(f,p).fromJSON(y),void 0!==(null==(u=e.parameters)?void 0:u.roundness)&&(null==(c=e.parameters)?void 0:c.roundness)>0&&h.update());var g=null!=h?h:new eE(f,p);return{parameters:Object.assign(d,{width:f,height:p,depth:v,roundness:m}),shape:g,ownerId:null!=(l=e.ownerId)?l:null==r?void 0:r.ownerId}}},{key:"build",value:function(e){var r,n=e.parameters,i=n.depth,a=n.extrudeBevelSize,o=n.extrudeBevelSegments,s=n.subdivisions,l=n.roundness,u=n.windingRule,c=n.uvPitch;return e.shape.roundness=l,i<=0?r=new eV(e.shape,s,{windingRule:u}):a<=0?r=new eU(e.shape,i,s,u,c):void 0!==eR?r=new e0(e.shape,i,a,s,o,e.ownerId,c):(console.error("[extrude] engine not loaded — extruding without a bevel"),r=new eU(e.shape,i,s,u,c)),Object.assign(r,{userData:A(M({},e),{type:"VectorGeometry"})})}}]),e}();function e5(){var e=new h.dd;return e.setAttribute("position",new h.Zc(new Float32Array([]),3)),e.setIndex(new h.Zc(new Uint16Array([]),1)),e}var e4,e6,e8,e9,e7,te,tt=e5().attributes,tr=function(e){function r(e,n){y(this,r),(i=v(this,r)).isTextGeometry=!0,i.charWidths=[],i.charCoords=[],i.wrappedText=[],i.isLowResolution=!1,i.vectorShapes=[],i._nearSide=new Uint8Array(0),i._depth=0,i._effectiveBevel=0,i._vScale=0,Object.assign(i.attributes,tt),i.userData={parameters:e,type:"TextGeometry"};var i,a=n.getFont(e.font);return(null==a?void 0:a.isLoaded)?(i.font=a,i.update(e,n)):i.updateFont(e.font,n).then(function(){i.update(e,n),null==n||n.requestRender()}),i}return S(r,e),b(r,[{key:"updateFont",value:function(e,r){return p(function(){var n;return T(this,function(i){switch(i.label){case 0:if(!(n=r.getFont(e)))return[3,2];return this.font=n,[4,n.loadingPromise];case 1:i.sent(),i.label=2;case 2:return[2]}})}).call(this)}},{key:"update",value:function(e,r){var n=this,i=this.font;if(this.userData={parameters:e,type:"TextGeometry"},!(null==i?void 0:i.isLoaded))return void console.warn("Cannot update text because its font is not loaded");var a=e.width,o=e.height,s=e.depth,l=e.extrudeBevelSize,u=e.extrudeBevelSegments,h=e.text,d=e.textTransform,f=e.fontSize,p=c.Ga.getDisplayedValue(h),v=function(e,r,n,i){var a="string"==typeof e.width?Number(i.getVariable(e.width)):e.width,o=[""],s="",l=!0,u=!1,c=void 0;try{for(var h,d=n[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;s+=f," "===f||"\n"===f?(o[o.length-1]+=s,s="","\n"===f&&o.push("")):r.getTextWidth(o[o.length-1]+s,e)>a&&(o[o.length-1].length&&o.push(""),r.getTextWidth(o[o.length-1]+s,e)>a&&(1===s.length?(o[o.length-1]+=s,s=""):(o[o.length-1]+=s.slice(0,-1),s=s[s.length-1],o.push(""))))}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}return o[o.length-1]+=s,o}(e,i,2===d?p.toUpperCase():3===d?p.toLowerCase():p,r),y=i.generateShapes(v,e,r),m=y.shapes,g=y.charWidths,b=y.charCoords,w=.5*("number"==typeof a?a:Number(r.getVariable(a))),x=.5*("number"==typeof o?o:Number(r.getVariable(o))),S=m.map(function(e){return(new eE).fromShape(e,!0)});this.vectorShapes=S;var k=S.map(function(e){return e3.create({shape:e,parameters:{depth:s,extrudeBevelSegments:u,extrudeBevelSize:l,uvPitch:f,windingRule:s<=0?z.NONZERO:z.ODD,subdivisions:n.isLowResolution&&s>0?1:12}})}),M=k.length?I(k):e5();M.translate(-w,x,0),this.dispose(),this.wrappedText=v,this.charCoords=b,this.charWidths=g,this.deleteAttribute("extrudeNormal"),Object.entries(M.attributes).forEach(function(e){var r=_(e,2),i=r[0],a=r[1];n.setAttribute(i,a)}),this.setIndex(M.index),this.adoptNearSide(k,s),this.computeBoundingSphere()}},{key:"adoptNearSide",value:function(e,r){this._depth=r;var n=0,i=0,a=0,o=!0,s=!1,l=void 0;try{for(var u,c=e[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var h,d,f=u.value,p=f._nearSide;if(void 0===p||0===p.length)return this._nearSide=new Uint8Array(0),this._effectiveBevel=0,void(this._vScale=0);n+=p.length,i=Math.max(i,null!=(h=f._effectiveBevel)?h:0),a=null!=(d=f._vScale)?d:a}}catch(e){s=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}this._effectiveBevel=i,this._vScale=a;var v=new Uint8Array(n),y=0,m=!0,g=!1,b=void 0;try{for(var w,x=e[Symbol.iterator]();!(m=(w=x.next()).done);m=!0){var S=w.value._nearSide;v.set(S,y),y+=S.length}}catch(e){g=!0,b=e}finally{try{m||null==x.return||x.return()}finally{if(g)throw b}}this._nearSide=v}},{key:"takeDepthStateFrom",value:function(e){var r,n,i;void 0!==e._nearSide&&(this._depth=null!=(r=e._depth)?r:this._depth,this._nearSide=e._nearSide,this._vScale=null!=(n=e._vScale)?n:this._vScale,this._effectiveBevel=null!=(i=e._effectiveBevel)?i:this._effectiveBevel)}},{key:"canShiftDepthTo",value:function(e){var r;return this._nearSide.length===(null==(r=this.getAttribute("position"))?void 0:r.count)&&e2(this._effectiveBevel,e)&&e2(this._effectiveBevel,this._depth)}},{key:"shiftDepthTo",value:function(e){if(!this.canShiftDepthTo(e))return!1;var r=e-this._depth;if(this._depth=e,0===r)return!0;for(var n=this.getAttribute("position"),i=n.array,a=this.getAttribute("uv"),o=null==a?void 0:a.array,s=this._vScale>0?r/this._vScale:0,l=this._nearSide,u=0;u<l.length;u++){var c=l[u];0!==c&&(i[3*u+2]+=r,2===c&&void 0!==o&&(o[2*u+1]+=s))}return n.needsUpdate=!0,void 0!==a&&0!==s&&(a.needsUpdate=!0),this.refreshDepthBounds(e),!0}},{key:"refreshDepthBounds",value:function(e){if(null!==this.boundingBox||null!==this.boundingSphere){null===this.boundingBox&&this.computeBoundingBox();var r=this.boundingBox;r.min.z=Math.min(0,e),r.max.z=Math.max(0,e),null!==this.boundingSphere&&r.getBoundingSphere(this.boundingSphere)}}},{key:"clone",value:function(){var e=(0,c.c)(new h.dd,tr.prototype);return e.copy(this),console.log("CloneGeometry",this,e),e}},{key:"copy",value:function(e){var r=this;return Object.entries(e.attributes).forEach(function(e){var n=_(e,2),i=n[0],a=n[1];r.setAttribute(i,a)}),this.setIndex(e.index),this.userData={parameters:M({},e.userData.parameters),type:"TextGeometry"},this}},{key:"setText",value:function(e,r){return p(function(){return T(this,function(n){switch(n.label){case 0:if(!this.font)return[3,2];return[4,this.font.loadingPromise];case 1:n.sent(),n.label=2;case 2:return[4,this.update(A(M({},this.userData.parameters),{text:{textValue:e}}),r)];case 3:return n.sent(),[2]}})}).call(this)}},{key:"text",get:function(){var e;return null!=(e=this.userData.parameters.text)?e:""}}]),r}(h.dd),tn="webgl",ti=!1;function ta(e){tn=e}function to(){return tn}function ts(e){e4=e}function tl(e){e6=e}function tu(){if("webgpu"===tn){if(void 0!==e4)return e4;ti||(ti=!0,console.warn('[spe] Material backend is "webgpu" but no TSL material factory is registered — import spe/src/renderer/webgpu before creating materials. Falling back to WebGL materials.'))}if(void 0===e6)throw Error('[spe] Classic (WebGL) materials are not available in this build — it was compiled WebGPU-only. Re-export the scene with renderer "Both" or "WebGL 2", or load the full runtime.');return e6}function tc(e,r){return tu().createRootMaterial(e,r)}function th(e,r,n){return tu().createSharedMaterial(e,r,n)}function td(e){return void 0===e.getLayersOfType&&Object.assign(e,{layers:[],getLayersOfType:function(){return[]},hasAO:!1,assetsLoaded:function(){return!0}}),e}function tf(e){e8=e}function tp(e){e9=e}function tv(e){e7=e}function ty(){return e7}function tm(e){te=e}function tg(e,r){return void 0!==te&&te(e,r)}var tb=[3,4,8,9];function tw(e){var r=!0,n=!1,i=void 0;try{for(var a,o=tb[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;e.enable(s)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}var tx,tS=5,tk=3,tM=32,tA=.98,tO=function(e){function r(e,n,i,a){var o;return y(this,r),(o=v(this,r,[e,n,i])).isColorA=!0,o.a=a,o}return S(r,e),b(r,[{key:"setRGBA",value:function(e,n,i,a){w(x(r.prototype),"setRGB",this).call(this,e,n,i),this.a=a}},{key:"copy",value:function(e){return w(x(r.prototype),"copy",this).call(this,e),this.a="a"in e?e.a:1,this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b,this.a)}},{key:"equals",value:function(e){return w(x(r.prototype),"equals",this).call(this,e)&&this.a===e.a}},{key:"setStyle",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"srgb";if("transparent"===e)return this.setRGBA(0,0,0,0),this;if(i=/^((?:rgb|hsl)a?)\(([^)]*)\)/.exec(e)){var i,a,o=i[1],s=i[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.a="rgba"===o?parseFloat(a[4]):1,w(x(r.prototype),"setStyle",this).call(this,e,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.a="hsla"===o?parseFloat(a[4]):1,w(x(r.prototype),"setStyle",this).call(this,e,n)}}return w(x(r.prototype),"setStyle",this).call(this,e,n)}},{key:"x",get:function(){return this.r},set:function(e){this.r=e}},{key:"y",get:function(){return this.g},set:function(e){this.g=e}},{key:"z",get:function(){return this.b},set:function(e){this.b=e}},{key:"w",get:function(){return this.a},set:function(e){this.a=e}}]),r}(h.Tc),tC=function(e){function r(){return y(this,r),v(this,r,arguments)}return S(r,e),b(r,[{key:"create",value:function(e){return URL.createObjectURL(new Blob([e]))}},{key:"dispose",value:function(e,r){URL.revokeObjectURL(r)}}]),r}(function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;y(this,e),this.timeout=r,this.cache=new Map,this.head={data:null,time:0,src:null,next:null,prev:null},this.tail={data:null,time:1/0,src:null,next:null,prev:null},this.hasClean=!1,this.cleanupTimer=null,this.head.next=this.tail,this.tail.prev=this.head}return b(e,[{key:"log",value:function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n]}},{key:"remove",value:function(e){var r=this.cache.get(e);r&&(this.dispose(e,r.data),this.cache.delete(e),r.prev.next=r.next,r.next.prev=r.prev,r.next=null,r.prev=null,r.data=null)}},{key:"scheduleCleanup",value:function(){var e=this;this.hasClean||(this.log("scheduled cleanup"),this.hasClean=!0,this.cleanupTimer=setTimeout(function(){e.hasClean=!1,e.cleanupTimer=null,e.log("cleaning");for(var r=Date.now(),n=e.head.next;n.time<r-e.timeout;){e.dispose(n.src,n.data),e.cache.delete(n.src);var i=n;(n=n.next).prev=e.head,e.head.next=n,i.next=null,i.prev=null,i.data=null}e.head.next!==e.tail?e.scheduleCleanup():e.log("no more cleanup")},this.timeout+1e3))}},{key:"has",value:function(e){var r;return null==(r=this.cache.get(e))?void 0:r.data}},{key:"load",value:function(e){var r=Date.now(),n=this.cache.get(e);return void 0===n?(n={data:this.create(e),src:e,time:r,next:null,prev:null},this.cache.set(e,n)):(n.time=r,n.prev.next=n.next,n.next.prev=n.prev),n.prev=this.tail.prev,n.next=this.tail,this.tail.prev.next=n,this.tail.prev=n,this.scheduleCleanup(),n.data}},{key:"disposeAll",value:function(){var e=this;null!==this.cleanupTimer&&(clearTimeout(this.cleanupTimer),this.cleanupTimer=null),this.hasClean=!1,this.cache.forEach(function(r,n){e.dispose(n,r.data),r.next=null,r.prev=null,r.data=null}),this.cache.clear(),this.head.next=this.tail,this.tail.prev=this.head}},{key:"destroy",value:function(){this.disposeAll(),this.head=null,this.tail=null}}]),e}());function t_(){tx&&tx.disposeAll()}var tP=function(){function e(r,n){y(this,e),this.data=r,this.cache=n,this.refCount=0}return b(e,[{key:"deref",value:function(){this.refCount,this.refCount-=1,0===this.refCount&&(this.cache.remove(this),this.dispose())}},{key:"dispose",value:function(){this.refCount}}]),e}(),tE=function(){function e(){y(this,e),this.cache=new Map}return b(e,[{key:"remove",value:function(e){this.cache.delete(e.data)}},{key:"load",value:function(e){var r=this.cache.get(e);return void 0===r&&(r=this.create(e),this.cache.set(e,r)),r.refCount+=1,r}}]),e}(),tD=function(e){function r(e){var n;return y(this,r),(n=v(this,r,[e])).type=h.Ba,n}return S(r,e),b(r,[{key:"parse",value:function(e){var r=function(e,r){switch(e){case 1:throw Error("THREE.HDRLoader: Read Error: "+(r||""));case 2:throw Error("THREE.HDRLoader: Write Error: "+(r||""));case 3:throw Error("THREE.HDRLoader: Bad File Format: "+(r||""));default:throw Error("THREE.HDRLoader: Memory Error: "+(r||""))}},n=function(e,r,n){r=r||1024;for(var i=e.pos,a=-1,o=0,s="",l=String.fromCharCode.apply(null,new Uint16Array(e.subarray(i,i+128)));0>(a=l.indexOf("\n"))&&o<r&&i<e.byteLength;)s+=l,o+=l.length,i+=128,l=String.fromCharCode.apply(null,new Uint16Array(e.subarray(i,i+128)));return -1<a&&(!1!==n&&(e.pos+=o+a+1),s+l.slice(0,a))},i=new Uint8Array(e);i.pos=0;var a,o,s,l=function(e){var i,a,o=/^#\?(\S+)/,s=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,l=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,u=/^\s*FORMAT=(\S+)\s*$/,c=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,h={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};for(!(e.pos>=e.byteLength)&&(i=n(e))||r(1,"no header found"),(a=i.match(o))||r(3,"bad initial token"),h.valid|=1,h.programtype=a[1],h.string+=i+"\n";!1!==(i=n(e));)if(h.string+=i+"\n","#"!==i.charAt(0)){if((a=i.match(s))&&(h.gamma=parseFloat(a[1])),(a=i.match(l))&&(h.exposure=parseFloat(a[1])),(a=i.match(u))&&(h.valid|=2,h.format=a[1]),(a=i.match(c))&&(h.valid|=4,h.height=parseInt(a[1],10),h.width=parseInt(a[2],10)),2&h.valid&&4&h.valid)break}else h.comments+=i+"\n";return 2&h.valid||r(3,"missing format specifier"),4&h.valid||r(3,"missing image size specifier"),h}(i),u=l.width,c=l.height,d=function(e,n,i){if(n<8||n>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);n!==(e[2]<<8|e[3])&&r(3,"wrong scanline width");var a=new Uint8Array(4*n*i);a.length||r(4,"unable to allocate buffer space");for(var o=0,s=0,l=4*n,u=new Uint8Array(4),c=new Uint8Array(l),h=i;h>0&&s<e.byteLength;){s+4>e.byteLength&&r(1),u[0]=e[s++],u[1]=e[s++],u[2]=e[s++],u[3]=e[s++],(2!=u[0]||2!=u[1]||(u[2]<<8|u[3])!=n)&&r(3,"bad rgbe scanline format");for(var d=void 0,f=0;f<l&&s<e.byteLength;){var p=(d=e[s++])>128;if(p&&(d-=128),(0===d||f+d>l)&&r(3,"bad scanline data"),p)for(var v=e[s++],y=0;y<d;y++)c[f++]=v;else c.set(e.subarray(s,s+d),f),f+=d,s+=d}for(var m=0;m<n;m++){var g=0;a[o]=c[m+g],g+=n,a[o+1]=c[m+g],g+=n,a[o+2]=c[m+g],g+=n,a[o+3]=c[m+g],o+=4}h--}return a}(i.subarray(i.pos),u,c);switch(this.type){case h.Aa:for(var f=new Float32Array(4*(s=d.length/4)),p=0;p<s;p++)!function(e,r,n,i){var a=Math.pow(2,e[r+3]-128)/255;n[i+0]=e[r+0]*a,n[i+1]=e[r+1]*a,n[i+2]=e[r+2]*a,n[i+3]=1}(d,4*p,f,4*p);a=f,o=h.Aa;break;case h.Ba:for(var v=new Uint16Array(4*(s=d.length/4)),y=0;y<s;y++)!function(e,r,n,i){var a=Math.pow(2,e[r+3]-128)/255;n[i+0]=h.Yc.toHalfFloat(Math.min(e[r+0]*a,65504)),n[i+1]=h.Yc.toHalfFloat(Math.min(e[r+1]*a,65504)),n[i+2]=h.Yc.toHalfFloat(Math.min(e[r+2]*a,65504)),n[i+3]=h.Yc.toHalfFloat(1)}(d,4*y,v,4*y);a=v,o=h.Ba;break;default:throw Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:u,height:c,data:a,header:l.string,gamma:l.gamma,exposure:l.exposure,type:o,colorSpace:h.Jb,minFilter:h.qa,magFilter:h.qa,generateMipmaps:!1,flipY:!0}}},{key:"setDataType",value:function(e){return this.type=e,this}}]),r}(h.se);function tj(e){return e.length>2&&35===e[0]&&63===e[1]}function tT(e){return"object"==(void 0===e?"undefined":E(e))&&null!==e&&!0===e.isSplineHdr}function tI(e){var r=new h.nd(e.data,e.width,e.height,h.Ja,h.Ba);return r.flipY=!1,r.image.isSplineHdr=!0,r.needsUpdate=!0,r}var tR=0,tB=function(e){function r(e,n){var i;return y(this,r),(i=v(this,r,[e,n.imageHolderCache])).data=e,i.shared=n,i.instanceId=++tR,i.loaded=!1,i.isVideo=!1,i.isBuffer=!1,i.isHdr=!1,i._cache={1e3:{},1001:{},1002:{}},i.isVideo="video"===e.type,i.isBuffer=!0===e.isWebGLRenderTarget,i.loadPromise=i.updateSrc(i.isBuffer?e:e.data),i}return S(r,e),b(r,[{key:"updateSrc",value:function(e){return p(function(){var r,n,i,a,o,s,l;return T(this,function(u){switch(u.label){case 0:if(r=this,("u"<typeof document?"undefined":E(document))>"u")return[2];if(this.disposeTextures(),this.loaded=!1,this.isHdr=!1,n=function(){r.loaded=!0;var e=!0,n=!1,i=void 0,a=!0,o=!1,s=void 0,l=!0,u=!1,c=void 0;try{for(var h,d=Object.values(r._cache)[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;try{for(var p,v=Object.values(f)[Symbol.iterator]();!(a=(p=v.next()).done);a=!0){var y=p.value;try{for(var m,g=Object.values(y)[Symbol.iterator]();!(e=(m=g.next()).done);e=!0){var b=m.value;b&&(b.image=r.img,b.needsUpdate=!0)}}catch(e){n=!0,i=e}finally{try{e||null==g.return||g.return()}finally{if(n)throw i}}}}catch(e){o=!0,s=e}finally{try{a||null==v.return||v.return()}finally{if(o)throw s}}}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}r.shared.requestRender()},!this.isBuffer)return[3,1];return this.img=e,this.loaded=!0,[3,13];case 1:if(!this.isVideo)return[3,5];if(this.img=document.createElement("video"),this.img.preload="auto",this.img.playsInline=!0,this.img.currentTime=.01,"string"==typeof e)return[3,3];return(a=new FileReader).readAsDataURL(new Blob([e],{type:"video/mp4"})),[4,new Promise(function(e){a.onloadend=function(r){var n;i=null==(n=r.target)?void 0:n.result,e(null)}})];case 2:return u.sent(),this.img.src=i,[3,4];case 3:this.img.src=e,u.label=4;case 4:return this.img.onloadeddata=function(){n()},[3,13];case 5:if(!(k(e,Uint8Array)?tj(e):"string"==typeof e&&/\.hdr($|[?#])/i.test(e)))return[3,11];if(null!==(o=k(e,Uint8Array)?e:null))return[3,10];u.label=6;case 6:return u.trys.push([6,9,,10]),s=Uint8Array.bind,[4,fetch(e)];case 7:return[4,u.sent().arrayBuffer()];case 8:return o=new(s.apply(Uint8Array,[void 0,u.sent()])),[3,10];case 9:return u.sent(),o=null,[3,10];case 10:return null!==(l=null!==o&&tj(o)?function(e){try{var r=(new tD).parse(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));if(!r||!r.width||!r.height)return null;for(var n=r.width,i=r.height,a=r.data,o=new Uint16Array(a.length),s=4*n,l=new Map,u=function(e){var r=l.get(e);return void 0===r&&(r=h.Yc.toHalfFloat(Math.pow(Math.max(h.Yc.fromHalfFloat(e),0),1/2.2)),l.set(e,r)),r},c=0;c<i;c++)for(var d=c*s,f=(i-1-c)*s,p=0;p<s;p+=4)o[f+p]=u(a[d+p]),o[f+p+1]=u(a[d+p+1]),o[f+p+2]=u(a[d+p+2]),o[f+p+3]=a[d+p+3];return{isSplineHdr:!0,data:o,width:n,height:i}}catch(e){return null}}(o):null)&&(this.isHdr=!0,this.img=l,n()),[3,13];case 11:return this.img=new Image,this.img.src="string"==typeof e?e:(tx||(tx=new tC),tx.load(e)),this.img.onload=n,[4,new Promise(function(e){r.img.onload=function(){n(),e(null)}})];case 12:u.sent(),u.label=13;case 13:return[2]}})}).call(this)}},{key:"getTexture",value:function(e){var r,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1008,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1006,s=null==(n=this._cache[e])||null==(r=n[a])?void 0:r[o];return s||(this.isBuffer?i=this.img.texture:this.isVideo?i=new h.yd(this.img,void 0,e,e):this.isHdr?((i=tI(this.img)).wrapS=e,i.wrapT=e,i.magFilter=o,i.minFilter=a):i=new h.Ic(this.img,void 0,e,e,o,a),this.isBuffer||(i.anisotropy=8,i.generateMipmaps=1008===a),this.loaded&&(i.needsUpdate=!0),void 0===this._cache[e]&&(this._cache[e]={}),void 0===this._cache[e][a]&&(this._cache[e][a]={}),this._cache[e][a][o]=i,i)}},{key:"setNeedsUpdate",value:function(e){var r=!0,n=!1,i=void 0,a=!0,o=!1,s=void 0,l=!0,u=!1,c=void 0;if(!this.isBuffer)try{for(var h,d=Object.values(this._cache)[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;try{for(var p,v=Object.values(f)[Symbol.iterator]();!(a=(p=v.next()).done);a=!0){var y=p.value;try{for(var m,g=Object.values(y)[Symbol.iterator]();!(r=(m=g.next()).done);r=!0){var b=m.value;b&&(b.needsUpdate=e)}}catch(e){n=!0,i=e}finally{try{r||null==g.return||g.return()}finally{if(n)throw i}}}}catch(e){o=!0,s=e}finally{try{a||null==v.return||v.return()}finally{if(o)throw s}}}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}},{key:"disposeTextures",value:function(){var e=!0,r=!1,n=void 0,i=!0,a=!1,o=void 0,s=!0,l=!1,u=void 0;try{for(var c,h=Object.entries(this._cache)[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=_(c.value,2),f=d[0],p=d[1];try{for(var v,y=Object.entries(p)[Symbol.iterator]();!(i=(v=y.next()).done);i=!0){var m=_(v.value,2),g=m[0],b=m[1];try{for(var w,x=Object.entries(b)[Symbol.iterator]();!(e=(w=x.next()).done);e=!0){var S=_(w.value,2),k=S[0],M=S[1];null==M||M.dispose(),void 0!==this._cache[f]&&void 0!==this._cache[f][g]&&(this._cache[f][g][k]=void 0)}}catch(e){r=!0,n=e}finally{try{e||null==x.return||x.return()}finally{if(r)throw n}}}}catch(e){a=!0,o=e}finally{try{i||null==y.return||y.return()}finally{if(a)throw o}}}}catch(e){l=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}},{key:"dispose",value:function(){w(x(r.prototype),"dispose",this).call(this),this.disposeTextures()}}]),r}(tP),tz=function(e){function r(){return y(this,r),v(this,r,arguments)}return S(r,e),r}(tB),tL=2*Math.PI;function tF(e,r,n,i,a){return{x:e.x*r+i,y:e.y*n+a}}function tU(e,r,n,i){var a=Math.min(1,Math.max(-1,e*n+r*i));return(e*i-r*n<0?-1:1)*Math.acos(a)}var tV=2*Math.PI,tN=function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,depth:0,spikes:64,angle:360,innerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1},e.parameters);return o.angle=h.Cc.clamp(o.angle,0,360),{shape:e.shape&&k(e.shape,eE)?e.shape:new eE,parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:0)})}}},{key:"build",value:function(e){var r,n=e.parameters,i=n.width,a=n.height,o=n.spikes,s=n.angle,l=n.innerRadius,u=n.depth,c=n.extrudeBevelSize,d=n.extrudeBevelSegments,f=e.shape,p=function(e,r,n,i,a,o){if(i>=tV)return a>30||a%4==0?(function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=.5522847498*r,l=.5522847498*n;e.addPoint(tH(a-r,o,a-r,o-l,a-r,o+l)),e.addPoint(tH(a,o+n,a-s,o+n,a+s,o+n)),e.addPoint(tH(a+r,o,a+r,o+l,a+r,o-l)),e.addPoint(tH(a,o-n,a+s,o-n,a-s,o-n)),i>0&&tY(e,r,n,i)}(e,r,n,o),Math.round(a/4)):tG(e,i,a,r,n,o);var s=(i=Math.max(i,.001))+.5*Math.PI,l={x:Math.cos(s)*r,y:Math.sin(s)*n},u=function(e){var r,n,i,a,o,s,l,u,c,h,d,f,p,v=e.px,y=e.py,m=e.cx,g=e.cy,b=e.rx,w=e.ry,x=e.largeArcFlag,S=e.sweepFlag,k=[];if(0===b||0===w)return[];var M=(v-m)/2,A=(y-g)/2;if(0===M&&0===A)return[];var O=Math.pow(M,2)/Math.pow(b=Math.abs(b),2)+Math.pow(A,2)/Math.pow(w=Math.abs(w),2);O>1&&(b*=Math.sqrt(O),w*=Math.sqrt(O));var C=(r=b,n=w,i=Math.pow(r,2),a=Math.pow(n,2),o=Math.pow(M,2),(l=i*a-i*(s=Math.pow(A,2))-a*o)<0&&(l=0),l/=i*s+a*o,u=(l=Math.sqrt(l)*(x===S?-1:1))*r/n*A,c=-(l*n)/r*M,f=tU(1,0,h=(M-u)/r,d=(A-c)/n),p=tU(h,d,(-M-u)/r,(-A-c)/n),!S&&p>0&&(p-=tL),S&&p<0&&(p+=tL),{centerx:u+(v+m)/2,centery:c+(y+g)/2,ang1:f,ang2:p}),_=C.ang1,P=C.ang2,E=C.centerx,D=C.centery,j=Math.abs(P)/(tL/4);1e-7>Math.abs(1-j)&&(j=1);var T=Math.max(Math.ceil(j),1);P/=T;for(var I=0;I<T;I++)k.push(function(e,r){var n=1.5707963267948966===r?.551915024494:-1.5707963267948966===r?-.551915024494:1.3333333333333333*Math.tan(r/4),i=Math.cos(e),a=Math.sin(e),o=Math.cos(e+r),s=Math.sin(e+r);return[{x:i-a*n,y:a+i*n},{x:o+s*n,y:s-o*n},{x:o,y:s}]}(_,P)),_+=P;return k.map(function(e){var r=tF(e[0],b,w,E,D),n=r.x,i=r.y,a=tF(e[1],b,w,E,D),o=a.x,s=a.y,l=tF(e[2],b,w,E,D);return{x1:n,y1:i,x2:o,y2:s,x:l.x,y:l.y}})}({px:0,py:n,cx:l.x,cy:l.y,rx:r,ry:n,largeArcFlag:i>Math.PI,sweepFlag:!0});return a>30||a%u.length==0?function(e,r,n,i,a,o,s){var l=Math.round(i/n.length);e.addPoint(tW(0,r));for(var u=0,c=n.length;u<c;u++){var h=n[u],d=e.points[u],f=tW(h.x,h.y);d.controls[1].position.set(h.x1,h.y1),f.controls[0].position.set(h.x2,h.y2),e.addPoint(f)}return s>0?tq(e,a,o,s):e.addPoint(tW(0,0)),l}(e,n,u,a,r,n,o):tG(e,i,a,r,n,o)}(f,.5*i,.5*a,s*Math.PI/180,o,l);return f.isClosed=!0,f.update(),0===s?(r=new h.dd).setAttribute("position",new h.bd([],3)):r=e3.create({shape:f,parameters:{subdivisions:p,depth:u,extrudeBevelSize:c,extrudeBevelSegments:d}}),Object.assign(r,{userData:A(M({},e),{type:"EllipseGeometry"})})}}]),e}();function tG(e,r,n,i,a,o){for(var s=-r/n,l=0;l<=n;l++){var u=s*l,c=Math.sin(u)*i,h=Math.cos(u)*a;e.addPoint(tW(c,h))}return r<tV?o>0?tq(e,i,a,o):e.addPoint(tW(0,0)):(e.removePoint(e.points[e.points.length-1]),o>0&&tY(e,i,a,o)),1}function tW(e,r){return new eo(h.Cc.generateUUID(),new h.Dc(e,r))}function tH(e,r,n,i,a,o){var s=tW(e,r);return s.controls[0].position.set(n,i),s.controls[1].position.set(a,o),s}function tq(e,r,n,i){tX(e,r,n,i).forEach(function(r){return e.addPoint(r)})}function tY(e,r,n,i){var a=tX(e,r,n,i),o=new eE;a.forEach(function(e){return o.addPoint(e)}),o.isClosed=!0,e.shapeHoles.push(o)}function tX(e,r,n,i){var a=i*r/100,o=Math.abs(n)/Math.abs(r)*a,s=new h.Dc(a/r,o/n),l=e.points.map(function(e){var r=e.clone();return r.uuid=h.Cc.generateUUID(),r}).reverse();return l.forEach(function(e){e.position.multiply(s);var r=e.controls[0].position.clone().multiply(s),n=e.controls[1].position.clone().multiply(s);e.controls[0].position.copy(n),e.controls[1].position.copy(r)}),l}var tZ,tK,tJ=function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:3},e.parameters);return{shape:e.shape&&k(e.shape,eE)?e.shape:new eE,parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:0)})}}},{key:"build",value:function(e){for(var r=e.parameters,n=r.width,i=r.height,a=r.spikes,o=r.cornerRadius,s=r.depth,l=r.extrudeBevelSize,u=r.extrudeBevelSegments,c=e.shape,h=.5*n,d=.5*i,f=2*Math.PI/a,p=0;p<a;p++){var v=f*p,y=0+Math.sin(v)*h,m=0+Math.cos(v)*d;c.addPoint(c.createPoint(y,m))}c.isClosed=!0;for(var g=0,b=c.points.length;g<b;g++)c.points[g].roundness=o;return c.roundness=o,c.update(),Object.assign(e3.create({shape:c,parameters:{roundness:o,depth:s,extrudeBevelSize:l,extrudeBevelSegments:u}}),{userData:A(M({},e),{type:"PolygonGeometry"})})}}]),e}(),tQ=function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o,s=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,depth:0,cornerRadius:[0,0,0,0],cornerType:1,extrudeBevelSize:0,extrudeBevelSegments:1},e.parameters),l=Object.assign(null!=(i=null==r?void 0:r.ui)?i:{enabledIndieCorners:!1},e.ui);return{shape:e.shape&&k(e.shape,eE)?e.shape:new eE,parameters:Object.assign(s,{width:Math.abs(s.width),height:Math.abs(null!=(a=s.height)?a:s.width),depth:Math.abs(null!=(o=s.depth)?o:0)}),ui:l}}},{key:"build",value:function(e){var r=e.shape,n=e.parameters,i=n.width,a=n.height,o=n.cornerRadius,s=n.cornerType,l=n.depth,u=n.extrudeBevelSize,c=n.extrudeBevelSegments,h={x:.5*i,y:.5*a},d={x:-h.x,y:-h.y},f={x:h.x,y:h.y};function p(e,r,n){return r>i&&n>a?Math.min(e*i/r,e*a/n):r>i?e*i/r:n>a?e*a/n:e}var v=[];v[0]=0===o[0]?0:p(o[0],o[0]+o[3],o[0]+o[1]),v[1]=0===o[1]?0:p(o[1],o[1]+o[2],o[1]+o[0]),v[2]=0===o[2]?0:p(o[2],o[2]+o[1],o[2]+o[3]),v[3]=0===o[3]?0:p(o[3],o[3]+o[0],o[3]+o[2]);var y=d.x,m=f.x,g=f.y,b=d.y;r.addPoint(r.createPoint(y,g)),r.addPoint(r.createPoint(m,g)),r.addPoint(r.createPoint(m,b)),r.addPoint(r.createPoint(y,b)),r.isClosed=!0;for(var w=!0,x=0,S=r.points.length;x<S;x++)r.points[x].roundness=v[x],x>0&&v[x]!==v[x-1]&&(w=!1);return w&&(r.roundness=v[0]),r.useCubicForRoundedCorners=1!==s,r.update(),Object.assign(e3.create({shape:r,parameters:{depth:l,extrudeBevelSize:u,extrudeBevelSegments:c}}),{userData:A(M({},e),{type:"RectangleGeometry"})})}}]),e}(),t$=function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeBevelSize:0,extrudeBevelSegments:1},e.parameters);return{shape:e.shape&&k(e.shape,eE)?e.shape:new eE,parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:0)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height,a=r.innerRadiusPercent,o=r.spikes,s=r.cornerRadius,l=r.angle,u=r.depth,c=r.extrudeBevelSize,h=r.extrudeBevelSegments,d=e.shape,f=.5*n,p=.5*i,v=l*Math.PI/360/o,y=-(Math.PI/2*3),m=f*a/100,g=p*a/100;if(3===o&&50===a){v=2*Math.PI/o;for(var b=0;b<o;b++){var w=v*b,x=0+Math.sin(w)*f,S=0+Math.cos(w)*p;d.addPoint(d.createPoint(x,S))}}else for(var k=0;k<o;k++){var O=0+Math.cos(y)*f,C=0+Math.sin(y)*p;d.addPoint(d.createPoint(O,C)),y+=v,O=0+Math.cos(y)*m,C=0+Math.sin(y)*g,d.addPoint(d.createPoint(O,C)),y+=v}d.isClosed=!0;for(var _=0,P=d.points.length;_<P;_++)d.points[_].roundness=s;return d.roundness=s,d.update(),Object.assign(e3.create({shape:d,parameters:{roundness:s,depth:u,extrudeBevelSize:c,extrudeBevelSegments:h}}),{userData:A(M({},e),{type:"StarGeometry"})})}}]),e}(),t0=new Promise(function(e){tZ=e}),t1=!1;function t2(e){if(!t1)return tK||(tK=p(function(){var r,i,a,o,s;return T(this,function(l){switch(l.label){case 0:return r=null!=e?e:"https://cdn.spline.design/@splinetool/runtime@2.0.60/build",[4,Promise.all([n.e("2194").then(n.bind(n,6073)),fetch("".concat(r,"/process.wasm")).then(function(e){return e.arrayBuffer()})])];case 1:return a=(i=_.apply(void 0,[l.sent(),2]))[0],o=i[1],[4,(0,a.default)({wasmBinary:o})];case 2:return s=l.sent(),tZ(s),t1=!0,[2]}})})())}var t3=function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o,s,l,u,c,d=null==(u=e.parameters)?void 0:u.radiusTop,f=null==(c=e.parameters)?void 0:c.radiusBottom,p=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:8,cornerSegments:8,hollow:0},e.parameters);p.thetaLength=h.Cc.clamp(p.thetaLength,0,360),p.hollow=h.Cc.clamp(null!=(i=p.hollow)?i:0,0,1);var v=p.width/2,y=null!=(a=p.radiusTop)?a:v,m=null!=(o=p.radiusBottom)?o:v;if(y===m?(y=v,m=v):y>m?(y=v,m=m*v/y):(y=y*v/m,m=v),p.shapeBlendNode){var g=2*Math.max(y=null!=d?d:v,m=null!=f?f:v);p.width=g,p.depth=g}return{parameters:Object.assign(p,{width:Math.abs(p.width),height:Math.abs(null!=(s=p.height)?s:p.width),depth:Math.abs(null!=(l=p.depth)?l:p.width),radiusTop:y,radiusBottom:m})}}},{key:"build",value:function(e){var r,n=e.parameters,i=n.width,a=n.depth,o=n.height,s=n.radialSegments,l=n.heightSegments,u=n.openEnded,c=n.thetaStart,d=n.thetaLength,f=n.radiusTop,p=n.radiusBottom,v=n.cornerRadius,y=n.cornerSegments,m=n.hollow;0===d?(r=new h.dd).setAttribute("position",new h.bd([],3)):r=v||m?new t4(f,p,o,s,l,u,c,d*Math.PI/180,v,v,y,m):new h.Fd(f,p,o,s,l,u,c,d*Math.PI/180);var g=a/i;return 1!==g&&r.scale(1,1,g),Object.assign(r,{userData:A(M({},e),{type:"CylinderGeometry"})})}}]),e}();function t5(e){return new h.Dc(e.y,-e.x)}var t4=function(e){function r(e,n,i,a,o,s,l,u,c,d,f,p){var m,g=arguments.length>12&&void 0!==arguments[12]&&arguments[12];y(this,r);var b=function(r,i,a){var o=Math.sin(a),s=Math.cos(a),l=-s,u=r<0?function(e,r,n){ec[eh++]=e,ec[eh++]=r,ec[eh++]=n}:function(e,r,n){ec[eh++]=e,ec[eh++]=n,ec[eh++]=r},c=(e+n+P+E)/4,h=3*ed,d=2*ed;es[h]=c*o,es[h+1]=0,es[h+2]=c*s,el[h]=l,el[h+1]=0,el[h+2]=o,eu[d]=.5,eu[d+1]=.5;for(var f=ed++,p=0;p<en;p++){var v=3*(i+(p===er?0:p));h=3*ed,d=2*ed,es[h]=es[v],es[h+1]=es[v+1],es[h+2]=es[v+2],el[h]=l,el[h+1]=0,el[h+2]=o;var y=v/3*2|0;eu[d]=eu[y],eu[d+1]=eu[y+1],ed++}for(var m=f+1;m<ed-1;m++)u(f,m,m+1);u(f,ed-1,f+1)};(m=v(this,r)).type="RoundedCylinderBufferGeometry",e=void 0!==e?e:1,n=void 0!==n?n:1,i=i||1,a=Math.floor(a)||8,o=Math.floor(o)||1,s=void 0!==s&&s,l=void 0!==l?l:0,u=void 0!==u?u:2*Math.PI,s&&(c=0,d=0);var w=i/2;g&&0==e&&(e=c),g&&0==n&&(n=d);var x=new h.Dc(e,w),S=new h.Dc(n,-w),k=null,M=null,A=null,O=null,C=x.clone().sub(S),_=0,P=0,E=0;p>0&&(_=Math.min(e,n)*(1-p),P=e-_,E=n-_);var D=x.clone();D.x-=_;var j=Math.PI-C.angle(),T=C.angle(),I=Math.tan(T/2),R=Math.tan(j/2),B=I+R;if(c=Math.min(c,(e-P)/(p?B:R),C.length()/B),d=Math.min(d,(n-E)/(p?B:I),C.length()/B),c>0){var z=c/I;k=x.clone().sub(new h.Dc(z,c)),p&&(A=k.clone(),A.x-=_-B*c),x.sub(C.clone().setLength(z))}if(d>0){var L=d/R;M=S.clone().sub(new h.Dc(L,-d)),S.add(C.clone().setLength(L)),p&&(O=M.clone(),O.x-=_-B*d,D.sub(C.clone().setLength(L)))}var F=.5>(C=x.clone().sub(S)).length(),U=[],V=[],N=[],G=[],W=[],H=[],q=function(e,r,n,a,o){for(var s=0;s<f+1;s++){var l=s/f,u=a<0?l:1-l;o&&(u-=1);var c=Math.sin(u*=e),h=Math.cos(u)*a,d=h*r+n.y;U.push(c*r+n.x),V.push(d),N.push(c),G.push(h),W.push(.5+d/i),H.push(!1)}},Y=function(e,r,n){var i=[e,r];n<0&&i.reverse();var a=!0,o=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;U.push(c),V.push(w*n),N.push(0),G.push(n),W.push(.5),H.push(!0)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}};if(O&&M?(q(j,d,O,-1,!0),q(T,d,M,-1,!1)):M?(Y(M.x,0,-1),q(T,d,M,-1,!1)):s||Y(n,E,-1),!F)for(var X=t5(C).normalize(),Z=0;Z<=o;Z++){var K=Z/o,J=C.y*K+S.y;U.push(C.x*K+S.x),V.push(J),N.push(X.x),G.push(X.y),W.push(.5+J/i),H.push(!1)}if(A&&k?(q(j,c,k,1,!1),q(T,c,A,1,!0)):k?(q(j,c,k,1,!1),Y(k.x,0,1)):s||Y(e,P,1),p&&!F)for(var Q=t5(C).multiplyScalar(-1).normalize(),$=0;$<=o;$++){var ee=$/o,et=-(C.y*ee)+D.y;U.push(-(C.x*ee)+D.x),V.push(et),N.push(Q.x),G.push(Q.y),W.push(.5+et/i),H.push(!1)}for(var er=U.length,en=er+(p&&!s?1:0),ei=function(e,r){return e*er+(r===er?0:r)},ea=u<2*Math.PI,eo=(a+1)*er+(ea?2*(1+en):0),es=new Float32Array(3*eo),el=new Float32Array(3*eo),eu=new Float32Array(2*eo),ec=eo-1>65535?new Uint32Array(a*Math.max(0,en-1)*6+(ea?2*(en+1)*3:0)):new Uint16Array(a*Math.max(0,en-1)*6+(ea?2*(en+1)*3:0)),eh=0,ed=0,ef=0;ef<=a;ef++)for(var ep=ef/a,ev=ep*u+l,ey=Math.sin(ev),em=Math.cos(ev),eg=0;eg<er;eg++){var eb=3*ed,ew=2*ed,ex=U[eg],eS=N[eg];es[eb]=ex*ey,es[eb+1]=V[eg],es[eb+2]=ex*em,el[eb]=eS*ey,el[eb+1]=G[eg],el[eb+2]=eS*em,H[eg]?(eu[ew]=.5,eu[ew+1]=.5):(eu[ew]=ep,eu[ew+1]=W[eg]),ed++}for(var ek=0;ek<a;ek++)for(var eM=0;eM<en-1;eM++)if(!s||!p||eM!=o){var eA=ei(ek,eM),eO=ei(ek+1,eM),eC=ei(ek+1,eM+1),e_=ei(ek,eM+1),eP=es[3*eC+0],eE=es[3*eC+2];ec[eh++]=eA,ec[eh++]=eO,ec[eh++]=e_,(0!=eP||0!=eE)&&(ec[eh++]=eO,ec[eh++]=eC,ec[eh++]=e_)}return ea&&(b(-1,0,l),b(1,a*er,l+u)),m.setIndex(new h.Zc(ec.slice(0,eh),1)),m.setAttribute("position",new h.Zc(es,3)),m.setAttribute("normal",new h.Zc(el,3)),m.setAttribute("uv",new h.Zc(eu,2)),m}return S(r,e),r}(h.dd),t6=Math.PI/2,t8=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:4;y(this,r);var d=function(e,r,n,i,a,o,s,l,c,d){for(var f=(o-2*u)/c,p=(s-2*u)/d,v=o/2-u,y=s/2-u,m=l/2,g=c+1,b=d+1,w=0,x=new h.Fc,_=0;_<b;_++)for(var P=_*p-y,E=0;E<g;E++){var D=E*f-v,j=3*(O+w),T=2*(O+w);x[e]=D*i,x[r]=P*a,x[n]=m,S[j]=x.x,S[j+1]=x.y,S[j+2]=x.z,x[e]=0,x[r]=0,x[n]=l>0?1:-1,k[j]=x.x,k[j+1]=x.y,k[j+2]=x.z,M[T]=E/c,M[T+1]=1-_/d,w+=1}for(var I=0;I<d;I++)for(var R=0;R<c;R++){var B=O+R+g*I,z=O+R+g*(I+1),L=O+(R+1)+g*(I+1),F=O+(R+1)+g*I;A[C++]=B,A[C++]=z,A[C++]=F,A[C++]=z,A[C++]=L,A[C++]=F}O+=w},f=function(e,r,n,i,a,o,s,l,d,f){for(var p=(s-2*u)/f,v=s/2-u,y=l/2-u,m=d/2,g=f+1,b=0,w=new h.Fc,x=new h.Fc,j=0;j<c+1;j++){w[r]=(y+_[j])*a,w[n]=(m-P[j])*o,x[e]=0,x[r]=E[j]*Math.sign(w[r]),x[n]=D[j]*Math.sign(w[n]);for(var T=0;T<g;T++){var I=T*p-v;w[e]=I*i;var R=3*(O+b),B=2*(O+b);S[R]=w.x,S[R+1]=w.y,S[R+2]=w.z,k[R]=x.x,k[R+1]=x.y,k[R+2]=x.z,M[B]=T/f,M[B+1]=0,b+=1}}for(var z=0;z<c;z++)for(var L=0;L<f;L++){var F=O+L+g*z,U=O+L+g*(z+1),V=O+(L+1)+g*(z+1),N=O+(L+1)+g*z;A[C++]=F,A[C++]=U,A[C++]=N,A[C++]=U,A[C++]=V,A[C++]=N}O+=b},p=function(e,r,n){for(var i=e*r*n>0?function(e,r,n){A[C++]=e,A[C++]=r,A[C++]=n}:function(e,r,n){A[C++]=e,A[C++]=n,A[C++]=r},a=O,o=0;o<I;o++){var s=3*o,l=3*O,u=2*O;S[l]=e*B[s],S[l+1]=r*B[s+1],S[l+2]=n*B[s+2],k[l]=e*R[s],k[l+1]=r*R[s+1],k[l+2]=n*R[s+2],M[u]=0,M[u+1]=0,O++}for(var h=0;h<c;h++){var d=a+h*(h+1)/2,f=a+(h+1)*(h+2)/2;i(d,f+1,f);for(var p=1;p<=h;p++)i(d+p-1,d+p,f+p),i(d+p,f+p+1,f+p)}};(e=v(this,r)).type="BoxGeometry",o=Math.floor(o),s=Math.floor(s),l=Math.floor(l),c=Math.floor(c);for(var m=(u=Math.min(u,n/2,i/2,a/2))>0,g=c+1,b=2*((l+1)*(s+1)+(o+1)*(l+1)+(o+1)*(s+1))+(m?4*g*(l+1+(o+1)+(s+1))+g*(g+1)/2*8:0),w=2*(l*s+o*l+o*s)+(m?4*c*(l+o+s):0),x=m?8*c*c:0,S=new Float32Array(3*b),k=new Float32Array(3*b),M=new Float32Array(2*b),A=b-1>65535?new Uint32Array(6*w+3*x):new Uint16Array(6*w+3*x),O=0,C=0,_=new Float64Array(g),P=new Float64Array(g),E=new Float64Array(g),D=new Float64Array(g),j=0;j<g;j++){var T=j/c*t6;_[j]=Math.sin(T)*u,P[j]=(1-Math.cos(T))*u,E[j]=Math.sin(T),D[j]=Math.cos(T)}var I=g*(g+1)/2,R=new Float64Array(3*I),B=new Float64Array(3*I),z=new h.Fc(n/2,i/2,a/2);z.subScalar(u);for(var L=0,F=0;F<=c;F++)for(var U=t6*(1-F/c),V=Math.cos(U),N=Math.sin(U),G=0,W=0;W<=F;W++){var H=V*Math.cos(G),q=V*Math.sin(G);R[3*L]=H,R[3*L+1]=N,R[3*L+2]=q,B[3*L]=z.x+H*u,B[3*L+1]=z.y+N*u,B[3*L+2]=z.z+q*u,L++,G+=t6/F}return d("z","y","x",-1,-1,a,i,n,l,s),d("z","y","x",1,-1,a,i,-n,l,s),d("x","z","y",1,1,n,a,i,o,l),d("x","z","y",1,-1,n,a,-i,o,l),d("x","y","z",1,-1,n,i,a,o,s),d("x","y","z",-1,-1,n,i,-a,o,s),u>0&&(f("z","y","x",-1,-1,1,a,i,n,l),f("z","y","x",1,-1,-1,a,i,n,l),f("z","y","x",-1,1,-1,a,i,n,l),f("z","y","x",1,1,1,a,i,n,l),f("x","y","z",-1,-1,-1,n,i,a,o),f("x","y","z",1,-1,1,n,i,a,o),f("x","y","z",-1,1,1,n,i,a,o),f("x","y","z",1,1,-1,n,i,a,o),f("y","x","z",-1,-1,1,i,n,a,s),f("y","x","z",1,-1,-1,i,n,a,s),f("y","x","z",1,1,1,i,n,a,s),f("y","x","z",-1,1,-1,i,n,a,s),p(1,1,1),p(-1,1,1),p(1,-1,1),p(-1,-1,1),p(1,1,-1),p(-1,1,-1),p(1,-1,-1),p(-1,-1,-1)),e.setIndex(new h.Zc(A,1)),e.setAttribute("position",new h.Zc(S,3)),e.setAttribute("normal",new h.Zc(k,3)),e.setAttribute("uv",new h.Zc(M,2)),e}return S(r,e),r}(h.dd),t9=function(e){function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:4;y(this,r),(l=v(this,r)).type="PolyhedronGeometryRound";var l,u,c,d,f=0;return O(l,(function(){var r=function(e){for(var r=0;r<l;r++){var n=M[e][r];if(n<A){for(var i=M[n].findIndex(function(r){return r%A==e}),a=en[e][r],o=en[n][i],s=0;s<b;s++){var u=a[s],c=o[b-s],h=a[s+1],d=o[b-(s+1)];H(u),H(c),H(h),H(h),H(c),H(d)}eK.push(a[0][0],o[b][0],a[b][0],o[0][0])}}};0==(o=Math.min(.99999,o))&&(s=0);for(var l={IcosahedronGeometry:5,DodecahedronGeometry:3,HexahedronGeometry:3,OctahedronGeometry:4,TetrahedronGeometry:3}[i],p=new h.Fc,v=p.clone(),y=new h.Wc,m=o*a,g=a-m,b=s+1,w=new h.Fc,x=function(e,r){return w.subVectors(e,r).normalize()},S=function(e,r){return Array(e).fill(void 0).map(r)},k=S(e.length/3,function(r,n){return(new h.Fc).fromArray(e,3*n).setLength(a)}),M=[],A=1e6,O=0;O<k.length;O++)!function(e){for(var r=void 0,i=void 0,a=void 0,o=k[e],s=[],l=1e10,u=-1;-1!=(u=n.indexOf(e,u+1));){var c=u-u%3;r=n[c+(u+1)%3],i=n[c+(u+2)%3],l=Math.min(l,a=o.distanceToSquared(k[r])),s.push([r,i,a])}l+=1e-6;for(var h=[],d=0,f=s.length,p=0;p<f;p++){r=(y=_(s[d],3))[0],i=y[1],a=y[2];var v,y,m=1==(null==(v=M[r])?void 0:v.includes(e));a<=l&&h.push(r+m*A),d=s.findIndex(function(e){return e[0]==i})}M.push(h)}(O);for(var C,E,D=[],j=0,T=0,I=3==l,R=0;R<=s;R++){C=R*(R+1)/2,E=(R+1)*(R+2)/2;for(var B,z,L=0;L<s-R;L++)j=(B=[C+L+R+2,E+L+R+3])[0],T=B[1],D.push.apply(D,[C,E].concat(P(I?[T,C]:[j,E]),[T,j])),C=(z=[j,T])[0],E=z[1];D.push(C,E,C+s+2)}for(var F=0,U=0;U<M.length;U++)for(var V=0;V<l;V++)M[U][V]<A&&F++;var N=k.length*l*D.length*3+F*b*18+2*F*9;u=new Float64Array(N),c=new Float64Array(N),d=new Float64Array(N/3*2);for(var G=function(e,r,n){var i=f/3*2;d[i]=Math.atan2(n,-e)/2/Math.PI+.5,d[i+1]=1-(Math.atan2(-r,Math.sqrt(e*e+n*n))/Math.PI+.5)},W=function(e){u[f]=e.x,u[f+1]=e.y,u[f+2]=e.z,c[f]=w.x,c[f+1]=w.y,c[f+2]=w.z,G(e.x,e.y,e.z),f+=3},H=function(e){u[f]=e[0].x,u[f+1]=e[0].y,u[f+2]=e[0].z,c[f]=e[1].x,c[f+1]=e[1].y,c[f+2]=e[1].z,G(e[0].x,e[0].y,e[0].z),f+=3},q=(s+2)*(s+3)/2,Y=new Float64Array(3*q),X=new Float64Array(3*q),Z=new Float64Array(2*q),K=S(2*l*b,function(){return new h.Fc}),J=S(s*Math.max(0,s-1)/2,function(){return new h.Fc}),Q=p.clone(),$=p.clone(),ee=p.clone(),et=p.clone(),er=p.clone(),en=[],ei=S(k.length,function(){return S(l,function(){return p.clone()})}),ea=0;ea<k.length;ea++){p.copy(k[ea]).normalize(),Q.copy(p).multiplyScalar(g);for(var eo=M[ea],es=0;es<eo.length;es++){var el=eo[es],eu=eo[(es+1)%l];y.setFromPointsAndIndices(k,ea,el%A,eu%A),y.b.sub(y.a).setLength(1e10).add(y.a),y.c.sub(y.a).setLength(1e10).add(y.a),y.closestPointToPoint(Q,ei[ea][es])}var ec=0,eh=[],ed=[],ef=new h.Fc;0==s&&P(ei[ea]).reduce(function(e,r){return e.add(r)},ef).multiplyScalar(1/l);for(var ep=0;ep<l;ep++){var ev=[],ey=(ep-1+l)%l,em=ei[ea][ey],eg=ei[ea][ep];p.copy(em).sub(Q),v.copy(eg).sub(Q);var eb=Q.angleTo(p),ew=p.angleTo(v),ex=Math.cos(eb)*m;0==s?$.copy(ef):$.copy(Q).setLength(g+ex),eh.push(ex);for(var eS=[$,em,eg],ek=0;ek<2;ek++){var eM=eS[ek],eA=eS[ek+1];et.subVectors(eM,Q),er.subVectors(eA,Q),ee.crossVectors(et,er).normalize();for(var eO=0;eO<b;eO++){var eC=[eb,ew][ek]*eO/b;p.copy(et).applyAxisAngle(ee,eC).add(Q),K[ec++].copy(p),ek&&(x(p,Q),ev.push([0==eO?eM:p.clone(),w.clone()]))}ek&&(x(eA,Q),ev.push([eA,w.clone()]))}ed.push(ev)}en.push(ed);for(var e_=2*b,eP=0;eP<l;eP++){for(var eE=e_*eP,eD=(eP+1)%l*e_,ej=0,eT=[K[eE]],eI=1;eI<b;eI++){var eR=K[eE+eI],eB=K[eD+eI];eT.push(eR);for(var ez=1,eL=eI-2+1;ez<=eL;ez++)p.lerpVectors(eR,eB,ez/(eL+1)),p.sub(Q).setLength(eh[eP]).add(Q),eT.push(J[ej++].copy(p));eT.push(eB)}for(var eF=0;eF<b;eF++)eT.push(K[eF+b+eE]);eT.push(K[eD+b]);for(var eU=0,eV=eT.length;eU<eV;eU++){var eN=eT[eU],eG=3*eU,eW=2*eU;Y[eG]=eN.x,Y[eG+1]=eN.y,Y[eG+2]=eN.z,x(eN,Q),X[eG]=w.x,X[eG+1]=w.y,X[eG+2]=w.z,Z[eW]=Math.atan2(eN.z,-eN.x)/2/Math.PI+.5,Z[eW+1]=1-(Math.atan2(-eN.y,Math.sqrt(eN.x*eN.x+eN.z*eN.z))/Math.PI+.5)}for(var eH=0,eq=D.length;eH<eq;eH++){var eY=3*D[eH],eX=2*D[eH],eZ=f/3*2;u[f]=Y[eY],u[f+1]=Y[eY+1],u[f+2]=Y[eY+2],c[f]=X[eY],c[f+1]=X[eY+1],c[f+2]=X[eY+2],d[eZ]=Z[eX],d[eZ+1]=Z[eX+1],f+=3}}}for(var eK=[],eJ=0;eJ<M.length;eJ++)r(eJ);for(;eK.length;){var eQ=void 0,e$=void 0,e0=void 0,e1=_(eK.splice(0,2),2),e2=e1[0];eQ=e1[1];for(var e3=[e2];e2!=eQ;)e3.push(eQ),e0=(e$=eK.indexOf(eQ))%2,eQ=eK.splice(e$-e0,2)[1-e0];w.subVectors(e3[0],e3[1]).cross(p.subVectors(e3[0],e3[2])).normalize();var e5=0>w.dot(e3[0]);e5&&w.negate();for(var e4=1;e4<=e3.length-2;e4++)W(e3[e4+ +e5]),W(e3[e4+1-e5]),W(e3[0])}}(),function(){for(var e=new h.Fc,r=new h.Fc,n=new h.Fc,i=new h.Fc,a=new h.Dc,o=new h.Dc,s=new h.Dc,l=function(e,r,n,i){i<0&&1===e.x&&(d[r]=e.x-1),0===n.x&&0===n.z&&(d[r]=i/2/Math.PI+.5)},c=0,p=0;c<f;c+=9,p+=6){e.set(u[c+0],u[c+1],u[c+2]),r.set(u[c+3],u[c+4],u[c+5]),n.set(u[c+6],u[c+7],u[c+8]),a.set(d[p+0],d[p+1]),o.set(d[p+2],d[p+3]),s.set(d[p+4],d[p+5]),i.copy(e).add(r).add(n).divideScalar(3);var v,y=Math.atan2((v=i).z,-v.x);l(a,p+0,e,y),l(o,p+2,r,y),l(s,p+4,n,y)}for(var m=f/3*2,g=0;g<m;g+=6){var b=d[g+0],w=d[g+2],x=d[g+4],S=Math.max(b,w,x),k=Math.min(b,w,x);S>.9&&k<.1&&(b<.2&&(d[g+0]+=1),w<.2&&(d[g+2]+=1),x<.2&&(d[g+4]+=1))}}(),l.setAttribute("position",new h.Zc(new Float32Array(u.subarray(0,f)),3)),l.setAttribute("normal",new h.Zc(new Float32Array(c.subarray(0,f)),3)),void l.setAttribute("uv",new h.Zc(new Float32Array(d.subarray(0,f/3*2)),2))))}return S(r,e),b(r,null,[{key:"fromJSON",value:function(e){return new t9(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}}]),r}(h.dd),t7=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;y(this,r);var o=(1+Math.sqrt(5))/2,s=1/o,l="DodecahedronGeometry";return(e=v(this,r,[[-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,-s,-o,0,-s,o,0,s,-o,0,s,o,-s,-o,0,-s,o,0,s,-o,0,s,o,0,-o,0,-s,o,0,-s,-o,0,s,o,0,s],[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],l,n,i,a])).type=l,e}return S(r,e),b(r,null,[{key:"fromJSON",value:function(e){return new t7(e.radius,e.corner,e.cornerSides)}}]),r}(t9),re=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;y(this,r);var o=(1+Math.sqrt(5))/2,s="IcosahedronGeometry";return(e=v(this,r,[[-1,o,0,1,o,0,-1,-o,0,1,-o,0,0,-1,o,0,1,o,0,-1,-o,0,1,-o,o,0,-1,o,0,1,-o,0,-1,-o,0,1],[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],s,n,i,a])).type=s,e}return S(r,e),b(r,null,[{key:"fromJSON",value:function(e){return new re(e.radius,e.corner,e.cornerSides)}}]),r}(t9);function rt(e,r){return Math.abs(r-e)/2+Math.min(e,r)}var rr=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;y(this,e),this.subdivisions=r}return b(e,[{key:"modify",value:function(e){for(var r=function(e){var r=e.getAttribute("position");if(void 0===r)return console.error("SubdivisionModifier: Position attribute required for subdivision."),{positions:new Float64Array(0),faces:new Uint32Array(0),materialIndices:[],uvs:null};for(var n=e.getAttribute("uv"),i=e.getIndex(),a=r.count,o=new Map,s=new Uint32Array(a),l=[],u=0,c=0;c<a;c++){var h=r.getX(c),d=r.getY(c),f=r.getZ(c),p=Math.round(1e4*h),v=Math.round(1e4*d),y=Math.round(1e4*f),m=o.get(p);void 0===m&&(m=new Map,o.set(p,m));var g=m.get(v);void 0===g&&(g=new Map,m.set(v,g));var b=g.get(y);void 0===b&&(b=u++,g.set(y,b),l.push(h,d,f)),s[c]=b}var w=[],x=[],S=void 0===n?null:[],k=null!==i?i.count:a,M=function(e,r){var o=null!==i?i.getX(e):e,l=null!==i?i.getX(e+1):e+1,u=null!==i?i.getX(e+2):e+2;if(o<a&&l<a&&u<a){var c=s[o],h=s[l],d=s[u];c===h||h===d||d===c||(w.push(c,h,d),x.push(r),null!==S&&S.push(n.getX(o),n.getY(o),n.getX(l),n.getY(l),n.getX(u),n.getY(u)))}},A=e.groups;if(A.length>0)for(var O=0;O<A.length;O++)for(var C=A[O],_=void 0===C.materialIndex?0:C.materialIndex,P=Math.max(C.start,0),E=Math.min(C.start+C.count,k),D=P;D<E&&D+2<k;D+=3)M(D,_);else for(var j=0;j+2<k;j+=3)M(j,0);return{positions:Float64Array.from(l),faces:Uint32Array.from(w),materialIndices:x,uvs:null===S?null:Float64Array.from(S)}}(e),n=this.subdivisions;n-- >0;)r=function(e){for(var r=e.positions,n=e.faces,i=e.materialIndices,a=e.uvs,o=r.length/3,s=n.length/3,l=null!==a&&s>0,u=3*s,c=new Uint32Array(u),h=new Uint32Array(u),d=new Uint32Array(u),f=new Uint32Array(u),p=new Uint32Array(u),v=0,y=8;y<2*u;)y*=2;for(var m=y-1,g=new Int32Array(y).fill(-1),b=function(e,r){for(var n=(Math.imul(e,0x9e3779b1)^r)&m;;){var i=g[n];if(-1===i)return g[n]=v,c[v]=e,h[v]=r,v++;if(c[i]===e&&h[i]===r)return i;n=n+1&m}},w=function(e,r){for(var n=e<r?e:r,i=e<r?r:e,a=(Math.imul(n,0x9e3779b1)^i)&m;;){var o=g[a];if(c[o]===n&&h[o]===i)return o;a=a+1&m}},x=new Uint32Array(o),S=new Float64Array(3*o),k=function(e,n,i){var a=e<n?b(e,n):b(n,e),o=++d[a];1===o?f[a]=i:2===o&&(p[a]=i),x[e]++,x[n]++,S[3*e]+=r[3*n],S[3*e+1]+=r[3*n+1],S[3*e+2]+=r[3*n+2],S[3*n]+=r[3*e],S[3*n+1]+=r[3*e+1],S[3*n+2]+=r[3*e+2]},M=0;M<s;M++){var A=n[3*M],O=n[3*M+1],C=n[3*M+2];k(A,O,C),k(O,C,A),k(C,A,O)}for(var _=new Float64Array(3*v),P=0;P<v;P++){var E=3*c[P],D=3*h[P];if(2===d[P]){var j=3*f[P],T=3*p[P];_[3*P]=.375*(r[E]+r[D])+.125*(r[j]+r[T]),_[3*P+1]=.375*(r[E+1]+r[D+1])+.125*(r[j+1]+r[T+1]),_[3*P+2]=.375*(r[E+2]+r[D+2])+.125*(r[j+2]+r[T+2])}else _[3*P]=.5*(r[E]+r[D]),_[3*P+1]=.5*(r[E+1]+r[D+1]),_[3*P+2]=.5*(r[E+2]+r[D+2])}for(var I,R=new Float64Array(3*o),B=0;B<o;B++){var z=x[B];3===z?I=3/16:z>3&&(I=3/(8*z));var L=1-z*Number(I),F=Number(I);2===z&&(L=3/4,F=1/8),R[3*B]=r[3*B]*L+S[3*B]*F,R[3*B+1]=r[3*B+1]*L+S[3*B+1]*F,R[3*B+2]=r[3*B+2]*L+S[3*B+2]*F}var U=new Float64Array(3*(o+v));U.set(R),U.set(_,3*o);for(var V=new Uint32Array(12*s),N=Array(4*s),G=l?new Float64Array(24*s):null,W=0;W<s;W++){var H=n[3*W],q=n[3*W+1],Y=n[3*W+2],X=w(H,q)+o,Z=w(q,Y)+o,K=w(Y,H)+o,J=12*W;V[J++]=X,V[J++]=Z,V[J++]=K,V[J++]=H,V[J++]=X,V[J++]=K,V[J++]=q,V[J++]=Z,V[J++]=X,V[J++]=Y,V[J++]=K,V[J++]=Z;var Q=i[W];if(N[4*W]=Q,N[4*W+1]=Q,N[4*W+2]=Q,N[4*W+3]=Q,null!==G){var $=6*W,ee=a[$],et=a[$+1],er=a[$+2],en=a[$+3],ei=a[$+4],ea=a[$+5],eo=rt(ee,er),es=rt(et,en),el=rt(er,ei),eu=rt(en,ea),ec=rt(ee,ei),eh=rt(et,ea),ed=24*W;G[ed++]=eo,G[ed++]=es,G[ed++]=el,G[ed++]=eu,G[ed++]=ec,G[ed++]=eh,G[ed++]=ee,G[ed++]=et,G[ed++]=eo,G[ed++]=es,G[ed++]=ec,G[ed++]=eh,G[ed++]=er,G[ed++]=en,G[ed++]=el,G[ed++]=eu,G[ed++]=eo,G[ed++]=es,G[ed++]=ei,G[ed++]=ea,G[ed++]=ec,G[ed++]=eh,G[ed++]=el,G[ed++]=eu}}return{positions:U,faces:V,materialIndices:N,uvs:G}}(r);return function(e,r){for(var n=e.positions,i=e.faces,a=e.materialIndices,o=e.uvs,s=n.length/3,l=i.length/3,u=new Float64Array(3*s),c=0;c<l;c++){var d=3*i[3*c],f=3*i[3*c+1],p=3*i[3*c+2],v=n[p]-n[f],y=n[p+1]-n[f+1],m=n[p+2]-n[f+2],g=n[d]-n[f],b=n[d+1]-n[f+1],w=n[d+2]-n[f+2],x=y*w-m*b,S=m*g-v*w,k=v*b-y*g;u[d]+=x,u[d+1]+=S,u[d+2]+=k,u[f]+=x,u[f+1]+=S,u[f+2]+=k,u[p]+=x,u[p+1]+=S,u[p+2]+=k}for(var M=0;M<s;M++){var A=u[3*M],O=u[3*M+1],C=u[3*M+2],_=Math.sqrt(A*A+O*O+C*C)||1;u[3*M]=A/_,u[3*M+1]=O/_,u[3*M+2]=C/_}for(var P=3*l,E=new Float32Array(3*P),D=new Float32Array(3*P),j=null!==o&&o.length>0?new Float32Array(2*P):null,T=0;T<P;T++){var I=3*i[T];E[3*T]=n[I],E[3*T+1]=n[I+1],E[3*T+2]=n[I+2],D[3*T]=u[I],D[3*T+1]=u[I+1],D[3*T+2]=u[I+2]}null!==j&&j.set(o.subarray(0,2*P));var R=new h.dd;R.setAttribute("position",new h.Zc(E,3)),P>0&&(R.setAttribute("normal",new h.Zc(D,3)),R.setAttribute("color",new h.Zc(new Float32Array(3*P).fill(1),3))),null!==j&&R.setAttribute("uv",new h.Zc(j,2));for(var B=0;B<l;){var z=a[B],L=B;do B++;while(B<l&&a[B]===z);R.addGroup(3*L,3*(B-L),z)}return null!==r.boundingBox&&(R.boundingBox=r.boundingBox.clone()),null!==r.boundingSphere&&(R.boundingSphere=r.boundingSphere.clone()),R}(r,e)}}]),e}(),rn=new h.Fc;function ri(e,r,n){n.x=e.x*r.x,n.y=e.y,n.z=e.x*r.y}var ra=new h.Fc,ro=new h.Fc;function rs(e,r,n,i,a,o){var s=ra.copy(r).sub(e),l=ro.copy(n).sub(e),u=s.angleTo(l);if(s.normalize(),l.normalize(),i===a){var c=s.add(l).normalize();o.copy(e).addScaledVector(c,i/Math.sin(u/2))}else{var h=s.angleTo(l);o.copy(e),o.addScaledVector(s,a/Math.sin(h)),o.addScaledVector(l,i/Math.sin(h))}}var rl=function(e){function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:4;y(this,r);var u=function(e,r,n,i,a){var o=-i/2,u=(Math.PI-i)/2,c=r.clone().normalize().cross(n);e.addScaledVector(n,-s/Math.sin(u));for(var d=new h.Fc,v=new h.Fc,y=b,w=[],x=0;x<=l;x++){var S=o+x/l*i;v.set(0,0,0),v.addScaledVector(c,Math.sin(S)),v.addScaledVector(n,Math.cos(S));for(var k=0;k<=1;k++){var M=k/1-.5;if(d.copy(e),d.addScaledVector(r,M),d.addScaledVector(v,s),null!=a){var A=Math.max(0,d.y-a);d.addScaledVector(r,-A/r.y)}p.push(d.x,d.y,d.z),m.push(v.x,v.y,v.z),g.push(0,0),0===k&&w.push(b),b++}}for(var O=0;O<l;O++)for(var C=0;C<1;C++){var _=y+C+2*O,P=_+2,E=P+1,D=_+1;f.push(_,P,D),f.push(P,E,D)}return[e.clone().addScaledVector(r,.5),w]};c=v(this,r),i=Math.floor(Math.max(3,i)),a=Math.floor(a),l=Math.floor(l);var c,d,f=[],p=[],m=[],g=[],b=0,w=n/2,x=Math.PI/i,S=e*Math.cos(Math.PI/i),k=2*Math.PI/i,M=Math.PI-(i-2)*Math.PI/i,A=new h.Fc(0,-w,0),O=new h.Fc(0,w,0),C=new h.Dc(e,-w),P=new h.Dc(S,-w),E=new h.Dc(0,O.y).sub(P),D=new h.Dc(0,O.y).sub(C),j=new h.Dc(E.y,-E.x).normalize(),T=new h.Dc(D.y,-D.x).normalize(),I=e*Math.cos(Math.PI/i)*Math.tan((Math.PI-E.angle())/2)-1e-8;s=Math.min(s,I);var R=new h.Fc(j.x,j.y,0),B=new h.Fc(Math.cos(k)*R.x,R.y,Math.sin(k)*R.x);d=R.angleTo(B);var z=s/Math.tan((Math.PI-E.angle())/2),L=s/Math.tan((Math.PI-d)/2),F=new h.Fc;if(!o){p.push(A.x,A.y,A.z),m.push(0,-1,0),g.push(0,0);var U=b++,V=[],N=C.clone(),G=z/Math.cos(Math.PI/i);N.x-=G;for(var W=0;W<i;W++){var H=W/i*Math.PI*2+x;ri(N,new h.Dc(Math.sin(H),Math.cos(H)),F),p.push(F.x,F.y,F.z),m.push(0,-1,0),g.push(0,0),V.push(b++)}for(var q=0;q<V.length;q++)f.push(V[q],U,V[(q+1)%V.length])}for(var Y=[],X=new h.Fc,Z=new h.Fc,K=new h.Fc,J=new h.Fc,Q=new h.Fc,$=new h.Fc,ee=0;ee<i;ee++){var et=ee/i*Math.PI*2+x,er=(ee+.5)/i*Math.PI*2+x,en=(ee+1)/i*Math.PI*2+x,ei=new h.Dc(Math.sin(et),Math.cos(et)),ea=new h.Dc(Math.sin(er),Math.cos(er)),eo=new h.Dc(Math.sin(en),Math.cos(en));ri(C,ei,Z),ri(C,eo,K),ri(j,ea,X),rs(O,Z,K,L,L,J),p.push(J.x,J.y,J.z),rs(Z,O,K,L,z,Q),p.push(Q.x,Q.y,Q.z),rs(K,Z,O,z,L,$),p.push($.x,$.y,$.z),m.push(X.x,X.y,X.z),m.push(X.x,X.y,X.z),m.push(X.x,X.y,X.z),g.push(0,0),g.push(0,0),g.push(0,0);var es=b++,el=b++,eu=b++;if(f.push(es,el,eu),s>0){var ec=Z.clone().add(K).multiplyScalar(.5),eh=O.clone().sub(ec).normalize(),ed=A.clone().sub(ec).normalize().add(eh).normalize().multiplyScalar(-1);u(ec,$.clone().sub(Q),ed,E.angle());var ef,ep=void 0,ev=void 0,ey=new h.Fc;ri(T,eo,ey);var em=$.clone().add(J).multiplyScalar(.5);ep=(ef=_(u(em=function(e,r,n){var i=e.clone().sub(r),a=n.clone().sub(r);return i.projectOnVector(a),i.add(r)}(em,K,O),$.clone().sub(J),ey,d,J.y),2))[0],ev=ef[1];var eg=ep,eb=eg.clone().setY(0).normalize(),ew=new h.Fc(0,-1,0),ex=eb.clone().cross(ew);!function(e,r,n,i){for(var a=Math.PI/2,o=D.angle()-a,u=[],c=new h.Fc,d=new h.Fc,v=0;v<=l;v++){for(var y=[],w=v/l,x=0;x<=v;x++){var S=((v?x/v:0)-.5)*M,k=Math.cos(S),A=Math.sin(S),O=(a+Math.atan(Math.tan(o)*k))*w,C=Math.cos(O),_=Math.sin(O);c.set(0,0,0),c.addScaledVector(r,_*k),c.addScaledVector(n,C),c.addScaledVector(i,_*A),d.copy(e).addScaledVector(c,s),p.push(d.x,d.y,d.z),m.push(c.x,c.y,c.z),g.push(0,0),y.push(b++)}u.push(y)}for(var P=u.length-1,E=0;E<P;E++){var j=u[E],T=u[E+1],I=j.length-1;f.push(j[0],T[1],T[0]);for(var R=1;R<=I;R++)f.push(j[R-1],j[R],T[R]),f.push(j[R],T[R+1],T[R])}}(eg,eb,ew,ex),Y.concat(ev);var eS=E.angle(),ek=Math.PI-eS,eM=O.clone();eM.y-=s/Math.sin(eS-Math.PI/2);for(var eA=new h.Fc,eO=[],eC=0;eC<l;eC++){for(var e_=[],eP=Math.PI/2-ek*eC/l,eE=Math.cos(eP),eD=Math.sin(eP),ej=er,eT=0;eT<=eC;eT++){var eI=Math.cos(ej);X.x=eE*Math.sin(ej),X.y=eD,X.z=eE*eI,eA.copy(eM).addScaledVector(X,s),p.push(eA.x,eA.y,eA.z),m.push(X.x,X.y,X.z),g.push(0,0),e_.push(b++),ej+=2*Math.PI/eC/i}eO.push(e_)}ev.reverse(),eO.push(ev);for(var eR=eO.length-1,eB=0;eB<eR;eB++){var ez=eO[eB],eL=eO[eB+1],eF=ez.length-1;f.push(eL[1],ez[0],eL[0]);for(var eU=1;eU<=eF;eU++)f.push(ez[eU],ez[eU-1],eL[eU]),f.push(eL[eU+1],ez[eU],eL[eU])}}}return c.setIndex(f),c.setAttribute("position",new h.bd(p,3)),c.setAttribute("normal",new h.bd(m,3)),c.setAttribute("uv",new h.bd(g,2)),c}return S(r,e),r}(h.dd),ru=function(e){function r(){var e,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:90,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:24;y(this,r),(X=v(this,r)).type="BackdropGeometry";var c=[],d=[],f=[];0==l&&(u=1),u=Math.max(1,Math.floor(u)),l=Math.min(l,100),s=Math.PI/180*Math.min(179.999,s);var p=[],m=Math.PI/2,g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new h.Fc(e,r,n)},b=g(),w=g(),x=[a/2,i/2,o/2],S=x[0],k=x[1],M=x[2],A=-k,O=+k,C=[g(A,-S,+M),g(A,-S,-M),g(A,+S,-M)],P=C[0],E=C[1],D=C[2],j=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Math.sin(e-Math.PI/(+r+1))},T=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Math.cos(e-Math.PI/(+r+1))};D.y=Math.sin(s)*a-S;var I=Math.cos(s)*a-M,R=P.z-.001;s<=m?(D.z=Math.min(I,R),D.z==R&&(D.y-=(I-R)/Math.tan(m-s))):E.z=Math.min(E.z-I-M,P.z-.001),b.subVectors(P,E),w.subVectors(D,E);var B=Math.min(b.length(),w.length())*l/100,z=B*Math.tan(s/2),L=B/Math.cos(s/2),F=b.clone().normalize().add(w.normalize()).setLength(L).add(E);b.set(0,j(s,!0),T(s,!0)),p.push([D,b.clone()]);for(var U=(Math.PI-s)/u,V=0;V<=u;V++){var N=m+s+V*U;b.set(0,Math.sin(N)*z,Math.cos(N)*z),b.add(F),w.set(0,j(N),T(N)),p.push([b.clone(),w.clone()])}p.push([P,g(0,1,0)]);var G=Math.sin(U/2)*z*2,W=p.length-1,H=p[0][0].distanceTo(p[1][0]),q=H+G*u+p[W-1][0].distanceTo(p[W][0]);p[0].push(1);for(var Y=0;Y<=u;Y++)p[Y+1].push(1-(H+Y*G)/q);p[W].push(0);for(var X,Z,K,J,Q=_(p[0],3),$=Q[0],ee=Q[1],et=Q[2],er=1;er<p.length;er++)Z=(e=_(p[er],3))[0],K=e[1],J=e[2],c.push(A,$.y,$.z,A,Z.y,Z.z,O,$.y,$.z,O,$.y,$.z,A,Z.y,Z.z,O,Z.y,Z.z),d.push(0,ee.y,ee.z,0,K.y,K.z,0,ee.y,ee.z,0,ee.y,ee.z,0,K.y,K.z,0,K.y,K.z),f.push(0,et,0,J,1,et,1,et,0,J,1,J),$=(n=[Z,K,J])[0],ee=n[1],et=n[2];return X.setAttribute("position",new h.bd(c,3)),X.setAttribute("normal",new h.bd(d,3)),X.setAttribute("uv",new h.bd(f,2)),X}return S(r,e),r}(h.dd),rc={ConeGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,radialSegments:32,heightSegments:8,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadiusTop:8,cornerRadiusBottom:8,cornerSegments:8},e.parameters);return o.thetaLength=h.Cc.clamp(o.thetaLength,0,360),{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:o.width)})}}},{key:"build",value:function(e){var r,n=e.parameters,i=n.width,a=n.depth,o=n.height,s=n.radialSegments,l=n.heightSegments,u=n.openEnded,c=n.thetaStart,d=n.thetaLength,f=n.cornerRadiusTop,p=n.cornerRadiusBottom,v=n.cornerSegments;0===d?(r=new h.dd).setAttribute("position",new h.bd([],3)):r=f>0||p>0||d<360?new t4(0,i/2,o,s,l,u,c,d*Math.PI/180,f,p,v,0,!0):new h.Gd(i/2,o,s,l,u);var y=a/i;return 1!==y&&r.scale(1,1,y),Object.assign(r,{userData:A(M({},e),{type:"ConeGeometry"})})}}]),e}(),CubeGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:8,cornerSegments:8},e.parameters);return{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:o.width)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height,a=r.depth,o=r.widthSegments,s=r.heightSegments,l=r.depthSegments,u=r.cornerRadius,c=r.cornerSegments;return Object.assign(0===u?new h.Ed(n,i,a,o,s,l):new t8(n,i,a,o,s,l,u,c),{userData:A(M({},e),{type:"CubeGeometry"})})}}]),e}(),CylinderGeometry:t3,DodecahedronGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,detail:0,corner:0,cornerSides:4},e.parameters);return{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:o.width)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height,a=r.depth,o=r.detail,s=r.corner,l=r.cornerSides,u=0===o&&0!==s?new t7(.5*n,s,l):new h.Hd(.5*n,o),c=i/n,d=a/n;return(1!==c||1!==d)&&u.scale(1,c,d),Object.assign(u,{userData:A(M({},e),{type:"DodecahedronGeometry"})})}}]),e}(),EllipseGeometry:tN,HelixGeometry:o.k,IcosahedronGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,detail:0,corner:0,cornerSides:4},e.parameters);return{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:o.width)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height,a=r.depth,o=r.detail,s=r.corner,l=r.cornerSides,u=0===o&&0!==s?new re(.5*n,s,l):new h.Td(.5*n,o),c=i/n,d=a/n;return(1!==c||1!==d)&&u.scale(1,c,d),Object.assign(u,{userData:A(M({},e),{type:"IcosahedronGeometry"})})}}]),e}(),LatheGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){(null!=(n=null==(s=e.parameters)?void 0:s.points)?n:[]).forEach(function(e){Array.isArray(e)&&(e.x=e[0],e.y=e[1])});var n,i,a,o,s,l=Object.assign({},null!=(i=null==r?void 0:r.parameters)?i:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},e.parameters);return{parameters:Object.assign(l,{width:Math.abs(l.width),height:Math.abs(null!=(a=l.height)?a:l.width),depth:Math.abs(null!=(o=l.depth)?o:l.width)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.points,i=r.segments,a=r.verticalSegments,o=new h.Rd;o.moveTo(n[0].x,n[0].y),o.bezierCurveTo(n[1].x,n[1].y,n[2].x,n[2].y,n[3].x,n[3].y);var s=new h.Ud(o.extractPoints(a).shape,i);return s.rotateZ(Math.PI),Object.assign(s,{userData:A(M({},e),{type:"LatheGeometry"})})}}]),e}(),NonParametricGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=null!=(n=null!=(i=e.geometry)?i:null==r?void 0:r.geometry)?n:(new h.dd).copy(new h.Ed(100,100,100));void 0===r?(o.computeBoundingBox(),o.boundingBox.getSize(rn),a={width:rn.x,height:rn.y,depth:rn.z,subdivisions:0}):a=r.parameters;var s=M({},a,e.parameters);return{parameters:{width:Math.abs(s.width),height:Math.abs(s.height),depth:Math.abs(s.depth),subdivisions:Math.abs(s.subdivisions)},geometry:o}}},{key:"build",value:function(e){var r,n,i,a,o=e.parameters,s=o.width,l=o.height,u=o.depth,c=o.subdivisions,d=null!=(a=e.geometry)?a:(new h.dd).copy(new h.Ed(100,100,100)),f=d.userData.parameters;void 0===f?(d.boundingBox=(r=d,n=new h.Xc,(i=r.attributes.position)?n.setFromBufferAttribute(i):n.makeEmpty(),n),d.boundingBox.getSize(rn)):rn.set(f.width,f.height,f.depth),(s!==rn.x||l!==rn.y||u!==rn.z)&&d.scale(0===rn.x?1:s/rn.x,0===rn.y?1:l/rn.y,0===rn.z?1:u/rn.z);var p=d.originalGeometry;try{c>0?(void 0===p||(null==f?void 0:f.subdivisions)!==c)&&(void 0===p&&(p=d),d=new rr(c).modify(p)):(void 0!==p&&(d=p),p=void 0,void 0===d.getAttribute("normal")&&d.computeVertexNormals())}catch(e){void 0!==p&&(d=p),p=void 0,void 0===d.getAttribute("normal")&&d.computeVertexNormals()}return void 0!==p&&Object.assign(d,{originalGeometry:p}),delete e.geometry,Object.assign(d,{userData:A(M({},e),{type:"NonParametricGeometry"})})}},{key:"loadFromUrl",value:function(e,r,n){var i=this;new h.He(n).load(e,function(e){var n=i.normalizeInputs({geometry:e});e.boundingBox.getSize(rn);var a=100/rn.x;Object.assign(n.parameters,{width:100,height:rn.y*a,depth:rn.z*a}),r(i.build(n))})}}]),e}(),PolygonGeometry:tJ,PyramidGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,radialSegments:4,heightSegments:1,cornerRadius:0,cornerSegments:8,openEnded:!1},e.parameters);return{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:o.width)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height,a=r.depth,o=new rl(.5*n,i,r.radialSegments,r.heightSegments,r.openEnded,r.cornerRadius,r.cornerSegments),s=a/n;return 1!==s&&o.scale(1,1,s),Object.assign(o,{userData:A(M({},e),{type:"PyramidGeometry"})})}}]),e}(),RectangleGeometry:tQ,SphereGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:180},e.parameters);return o.thetaLength=h.Cc.clamp(o.thetaLength,0,180),{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:o.width)})}}},{key:"build",value:function(e){var r,n=e.parameters,i=n.width,a=void 0===i?100:i,o=n.height,s=n.depth,l=n.widthSegments,u=n.heightSegments,c=n.phiStart,d=n.phiLength,f=n.thetaStart,p=n.thetaLength;return 0===p?(r=new h.dd).setAttribute("position",new h.bd([],3)):r=new h.Wd(.5*a,void 0===l?64:l,void 0===u?64:u,c,d,f,p*h.Cc.DEG2RAD),r.scale(1,(void 0===o?a:o)/a,(void 0===s?a:s)/a),Object.assign(r,{userData:A(M({},e),{type:"SphereGeometry"})})}}]),e}(),PlaneGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,depth:0,widthSegments:8,heightSegments:8},e.parameters);return{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!=(i=a.height)?i:a.width),depth:0})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=void 0===n?100:n,a=r.height,o=r.widthSegments,s=r.heightSegments,l=new h.Vd(i,void 0===a?i:a,void 0===o?8:o,void 0===s?8:s);return l.scale(1,1,1),Object.assign(l,{userData:A(M({},e),{type:"PlaneGeometry"})})}}]),e}(),BackdropGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,angle:90,cornerRadius:24,cornerSegments:8},e.parameters);return{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:o.width)})}}},{key:"build",value:function(e){var r=e.parameters;return Object.assign(new ru(r.width,r.height,r.depth,r.angle,r.cornerRadius,r.cornerSegments),{userData:A(M({},e),{type:"BackdropGeometry"})})}}]),e}(),StarGeometry:t$,TextFrameGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,depth:0},e.parameters);return{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width),depth:Math.abs(null!=(a=o.depth)?a:0)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height;return Object.assign(new h.Vd(n,i),{userData:A(M({},e),{type:"TextFrameGeometry"})})}}]),e}(),TorusGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,radialSegments:32,tubularSegments:64,arc:360,cornerRadius:30,cornerSegments:8},e.parameters),s=Math.abs(o.width),l=Math.abs(null!=(i=o.height)?i:o.width);o.shapeBlendNode&&(l=s);var u=Math.round(Math.abs(null!=(a=o.depth)?a:.25*o.width));return{parameters:Object.assign(o,{width:s,height:l,depth:u})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height,a=r.depth,s=r.radialSegments,l=r.tubularSegments,u=function(e,r,n,i,a,s,l,u,c,d){r=(f=[n,r])[0],n=f[1],l=r/2;var f,p=h.Cc.clamp(a/360,0,1);if(0===p){var v=new h.dd;return v.setAttribute("position",new h.bd([],3)),v}return 1===p&&(c=0),new o.m(!0,e,r,n,i,p,s,l,0,u,c,d)}(n,i,a,.5*n,r.arc,l,0,s,r.cornerRadius,r.cornerSegments);return u.scale(1,i/n,1),Object.assign(u,{userData:A(M({},e),{type:"TorusGeometry"})})}}]),e}(),TorusKnotGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o,s=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,tubularSegments:64,radialSegments:32,p:2,q:3},e.parameters);return{parameters:Object.assign(s,{width:Math.abs(s.width),height:Math.abs(null!=(i=s.height)?i:s.width),depth:Math.abs(null!=(a=s.depth)?a:s.width),tube:null!=(o=s.tube)?o:.125*s.width})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.tube,a=r.tubularSegments,o=r.radialSegments,s=r.p,l=r.q,u=.5*n;return u!==i&&(u-=i),Object.assign(new h.Yd(u,i,a,o,s,l),{userData:A(M({},e),{type:"TorusKnotGeometry"})})}}]),e}(),TriangleGeometry:function(){function e(){y(this,e)}return b(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1,isRect:!1},e.parameters);return{shape:e.shape&&k(e.shape,eE)?e.shape:new eE,parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!=(i=o.height)?i:o.width*(o.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(null!=(a=o.depth)?a:0)})}}},{key:"build",value:function(e){var r=e.parameters,n=r.width,i=r.height,a=r.cornerRadius,o=r.depth,s=r.extrudeBevelSize,l=r.extrudeBevelSegments,u=r.isRect,c=e.shape,h=.5*(void 0===n?100:n),d=.5*i;u?c.addPoint(c.createPoint(-h,d)):c.addPoint(c.createPoint(0,d)),c.addPoint(c.createPoint(h,-d)),c.addPoint(c.createPoint(-h,-d)),c.isClosed=!0;for(var f=0,p=c.points.length;f<p;f++)c.points[f].roundness=a;return c.roundness=a,c.update(),Object.assign(e3.create({shape:c,parameters:{roundness:a,depth:o,extrudeBevelSize:s,extrudeBevelSegments:l}}),{userData:A(M({},e),{type:"TriangleGeometry"})})}}]),e}(),VectorGeometry:e3},rh=function(e){var r,n=null!=(r=rc[e.type])?r:(0,u.i)(e.type);if(void 0===n)throw Error('No geometry factory registered for "'.concat(e.type,'" — was its feature compiled out of this runtime build?'));return n.create(e)},rd=["font"];function rf(e,r,n,i){"PathGeometry"===e.type?(d=A(M({},e),{extrusion:M({},e.extrusion)}),f=[[],["extrusion"]]):(d=M({},e),f=[[]]);var a=!0,o=!1,s=void 0;try{for(var l,d,f,p,v=f[Symbol.iterator]();!(a=(p=v.next()).done);a=!0){var y=p.value,m=d,g=!0,b=!1,w=void 0;try{for(var x,S=y[Symbol.iterator]();!(g=(x=S.next()).done);g=!0)m=m[x.value]}catch(e){b=!0,w=e}finally{try{g||null==S.return||S.return()}finally{if(b)throw w}}for(l in m){var k=m[l];(0,c.I)(k)&&!rd.includes(l)&&(m[l]=r.getVariable(k,[i.uuid,"geometry"].concat(P(y),[l])),(0,c.I)(m[l])&&(m[l]=1))}}}catch(e){o=!0,s=e}finally{try{a||null==v.return||v.return()}finally{if(o)throw s}}var O,C={parameters:d,type:d.type};if("PathGeometry"===d.type){C.path=d.path;var _=i.profileShape;void 0!==_&&(C.shapeData=_),C.ownerId=i.uuid}else if("VectorGeometry"===d.type)C.shape=eE.createFromState(d.shape,d.width,d.height),C.ownerId=i.uuid;else if("NonParametricGeometry"===d.type){if(d.data.groups&&(null==(E=d.data.groups)||E.forEach(function(e){var r;return e.materialIndex=Math.max(null!=(r=e.materialIndex)?r:0,0)})),C.geometry=(new h.He).parse(d),0===C.geometry.groups.length){var E,D,j,T=C.geometry;T.addGroup(0,Math.max(null!=(D=null==(j=T.getIndex())?void 0:j.count)?D:0,T.getAttribute("position").count),0)}}else{if("SubdivGeometry"===d.type){var I=new rO(d,n);return I.data=e,I}if("TextGeometry"===d.type||"InputGeometry"===d.type){var R=(0,u.i)(d.type);if(R)return R.create(d,r);(0,u.c)("text","a ".concat(d.type));var B=eE.createFromState(c.ha.defaultData(),100,100);return rh(A(M({},d),{shape:B,type:"VectorGeometry"}))}if("UIGeometry"===d.type)return tQ.create({parameters:{width:d.width,height:d.height,cornerRadius:d.cornerRadius,cornerType:d.cornerType}})}try{O=rh(C)}catch(e){console.error(e),console.error("Error generating geometry with inputs: ".concat(C)),C.shape=eE.createFromState(c.ha.defaultData(),100,100),C.type="VectorGeometry",O=rh(C)}return O}var rp=new h.Oc;function rv(e,r){if(Object.keys(e.morphAttributes).length>0||Object.keys(r.morphAttributes).length>0)return!1;var n=Object.keys(e.attributes),i=Object.keys(r.attributes);if(n.length!==i.length)return!1;var a=!0,o=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,h=e.attributes[c],d=r.attributes[c];if(void 0===h||!0===h.isInterleavedBufferAttribute||!0===d.isInterleavedBufferAttribute||h.itemSize!==d.itemSize||h.normalized!==d.normalized||h.array.constructor!==d.array.constructor||h.array.length!==d.array.length)return!1}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}var f=e.index,p=r.index;if(null===f!=(null===p))return!1;var v=!1;if(null!==f&&null!==p){if(f.array.length!==p.array.length)return!1;var y=f.array.constructor,m=p.array.constructor;if(y!==m){if(y!==Uint32Array||m!==Uint16Array)return!1;v=!0}}if(e.groups.length!==r.groups.length)return!1;for(var g=0;g<r.groups.length;g++){var b=e.groups[g],w=r.groups[g];if(b.start!==w.start||b.count!==w.count||b.materialIndex!==w.materialIndex)return!1}var x=!0,S=!1,k=void 0;try{for(var M,A=i[Symbol.iterator]();!(x=(M=A.next()).done);x=!0){var O=M.value,C=e.attributes[O],_=r.attributes[O];C.array.set(_.array),C.needsUpdate=!0}}catch(e){S=!0,k=e}finally{try{x||null==A.return||A.return()}finally{if(S)throw k}}var P=e.takeDepthStateFrom;if("function"==typeof P&&P.call(e,r),null!==f&&null!==p){if(v)for(var E=f.array,D=p.array,j=0,T=D.length;j<T;j++){var I=D[j];E[j]=65535===I?0xffffffff:I}else f.array.set(p.array);f.needsUpdate=!0}return e.drawRange.start=r.drawRange.start,e.drawRange.count=r.drawRange.count,e.userData=r.userData,e.boundingBox=null,e.boundingSphere=null,!0}function ry(e,r,n,i){for(var a,o,s,l=e.position.array,u=e.normal.array,c=rp.makeScale(r,n,i).invert().elements,h=0,d=l.length;h<d;h+=3)l[h]*=r,l[h+1]*=n,l[h+2]*=i,a=u[h],o=u[h+1],s=u[h+2],u[h]=c[0]*a+c[4]*o+c[8]*s,u[h+1]=c[1]*a+c[5]*o+c[9]*s,u[h+2]=c[2]*a+c[6]*o+c[10]*s;e.position.needsUpdate=!0,e.normal.needsUpdate=!0}var rm,rg=new h.Xc,rb=new h.Fc;t0.then(function(e){rm=e});var rw=new Float32Array([10,10,0,-10,10,0,-10,-10,0,10,-10,0]),rx=new Uint32Array([0,1,2,3]),rS=new Uint8Array([4]);function rk(e){var r=Number(e);return Number.isInteger(r)&&r>=0&&String(r)===e?r:-1}function rM(e){if(null!=e){if(Array.isArray(e)||ArrayBuffer.isView(e)&&!k(e,DataView))return e;if("object"==(void 0===e?"undefined":E(e)))return function(e){var r=Object.keys(e),n=0,i=!0,a=!1,o=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=rk(u);c>=n&&(n=c+1)}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}if(0!==n&&!(n>r.length)){for(var h=Array(n),d=0;d<n;d++){var f=e[d];if("number"!=typeof f)return;h[d]=f}return h}}(e)}}function rA(e){if(null==e)return"missing";if(Array.isArray(e))return"Array(".concat(e.length,")");if(ArrayBuffer.isView(e))return"".concat(e.constructor.name,"(").concat(e.length,")");if("object"!=(void 0===e?"undefined":E(e)))return void 0===e?"undefined":E(e);var r=Object.keys(e),n=r.filter(function(e){return -1===rk(e)}),i=0,a=!0,o=!1,s=void 0;try{for(var l,u=r[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,h=rk(c);h>=i&&(i=h+1)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}for(var d=-1,f=-1,p=0;p<i;p++)p in e?"number"!=typeof e[p]&&-1===f&&(f=p):-1===d&&(d=p);var v=["".concat(r.length," keys"),"max index "+(i-1)];return -1!==d&&v.push("first missing index ".concat(d)),-1!==f&&v.push("non-number at ".concat(f," (").concat(E(e[f]),")")),n.length&&v.push("stray keys ".concat(n.slice(0,3).join(","))),"Object{".concat(v.join(", "),"}")}var rO=function(e){function r(e,n){var i;return y(this,r),(i=v(this,r)).data=e,i.flatShading=n,i.subdivPointer=0,i.rebuild(),i.freeSubdivPointer(),i}return S(r,e),b(r,[{key:"mutateDirectlyScaleBaked",value:function(e,r){this.freeSubdivPointer();var n=this.data.scaleBaked.map(function(e){return"number"==typeof e?e:1}),i=c.A.div(r.map(function(e){return"number"==typeof e?e:0}),n);if(!i.every(function(e){return 1===e})){this.subdividedGeometry&&ry.apply(void 0,[this.subdividedGeometry.attributes].concat(P(i))),this.originalGeometry&&ry.apply(void 0,[this.originalGeometry.attributes].concat(P(i))),this.data=e;var a=this.userData.parameters;this.userData.parameters={width:a.width*i[0],height:a.height*i[1],depth:a.depth*i[2]},this.originalGeometry.boundingSphere.center.multiply(rb.fromArray(i));var o=rb.set(a.width,a.height,a.depth).length();this.originalGeometry.boundingSphere.radius=o/2}}},{key:"ensureSubdivPointer",value:function(){return 0===this.subdivPointer&&this.rebuild(),this.subdivPointer}},{key:"mutateDirectlySubdivisions",value:function(e){this.freeSubdivPointer(),this.data=e;var r,n,i,a=null!=(r=e.phongAngle)?r:35;this.flatShading&&(a=-1);var o=null;if(e.subdivisions>0){var s=0;try{s=rO.allocate(e),o=rO.buildRefined(s,e.subdivisions,a)}catch(r){console.error(r,e)}finally{s&&rO.freeSubdivPointer(s)}}null==(i=this.subdividedGeometry)||i.dispose(),this.subdividedGeometry=null!=o?o:void 0,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=this.originalGeometry.boundingSphere);var l=this.userData.parameters;Object.assign(this,null!=(n=this.subdividedGeometry)?n:this.originalGeometry),this.userData.parameters=l}},{key:"rebuild",value:function(){var e,r,n,i,a;try{r=(a=rO.build(this.data,void 0,!this.flatShading,void 0)).originalGeometry,n=a.subdividedGeometry,i=a.subdivPointer}catch(e){r=new h.Ed(100,100,100),i=0}this.subdivPointer=i,this.originalGeometry=r,this.subdividedGeometry=null!=n?n:void 0,Object.assign(this,null!=(e=this.subdividedGeometry)?e:this.originalGeometry),this.calcBoundingBox()}},{key:"freeSubdivPointer",value:function(){this.subdivPointer&&(rO.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0)}},{key:"dispose",value:function(){w(x(r.prototype),"dispose",this).call(this),this.freeSubdivPointer()}},{key:"calcBoundingBox",value:function(){var e=this.originalGeometry;null===e.boundingSphere&&(e.boundingSphere=new h.cd,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=e.boundingSphere));var r=e.attributes.position,n=e.boundingSphere.center;rg.setFromBufferAttribute(r),rg.getCenter(n),e.boundingSphere.radius=n.distanceTo(rg.max),isNaN(e.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),rg.getSize(rb);var i={width:rb.x,height:rb.y,depth:rb.z};return this.userData.parameters=i,i}}],[{key:"build",value:function(e,r,n,i){var a,o,s,l=null!=(a=null==e?void 0:e.phongAngle)?a:35;!1===n&&(l=-1),r&&(rm.free_bvh(r),rm.free_subdivision_surface(r));try{o=rO.allocate(e,i)}catch(r){console.error(r,e),o=rO.allocate({positionWASM:rw,indexWASM:rx,verticesPerFaceWASM:rS},i)}rm.set_destination_refinement_level(o,0);var u=rO.buildLevel(o,!0,l);return s=e.subdivisions>0?rO.buildRefined(o,e.subdivisions,l):null,{subdivPointer:o,originalGeometry:u,subdividedGeometry:s}}},{key:"buildRefined",value:function(e,r,n){var i,a;try{return rm.set_destination_refinement_level(e,r),null!=(i=rO.buildLevel(e,!1,n))?i:null}catch(i){try{return rm.set_destination_refinement_level(e,r-1),null!=(a=rO.buildLevel(e,!1,n))?a:null}catch(e){return null}}}},{key:"primitiveToQuads",value:function(e,r,n){e.widthSegments>16&&(e.widthSegments=16),e.heightSegments>16&&(e.heightSegments=16),e.depthSegments>16&&(e.depthSegments=16),e.radialSegments>16&&(e.radialSegments=16),"DodecahedronGeometry"===e.type&&(e.detail=0);var i,a=void 0!==e.shape||void 0!==e.path?r.geometry:rf(e,n,!1,r);i=(0,o.l)(e)?a.getClosedTorusIndicesForBooleanOrSubdiv():a.getIndex();var s,l=r_(a.getAttribute("position"),i),u=l.positions,c=l.triIndices,h=l.triOriginals;if("CylinderGeometry"===e.type&&0===e.cornerRadius&&0===e.hollow&&!1===e.openEnded){var d=e.radialSegments*e.heightSegments*6;s=[d,d+3*e.radialSegments]}var f=function(e,r,n,i,a){var o=[],s=[],l=a?n.getAttribute("uv"):void 0,u=l&&2===l.itemSize?[]:void 0,c=function(e){if(u){var r=a[e];u.push(l.getX(r),l.getY(r))}};if(void 0!==n.userData.shape&&0===n.userData.parameters.depth&&0===n.userData.shape.shapeHoles.length){var h=n.userData.shape.extractShapePointsToFlatArray([]),d=n.userData.parameters.spikes;if("EllipseGeometry"===n.userData.type&&d<=24&&d%4==0&&n.userData.parameters.angle>=360){var f=h.length/2/d;h=h.filter(function(e,r){return Math.floor(r/2)%f==0})}for(var p=0,v=0;v<h.length;v+=2)p+=(h[v]-h[(0===v?h.length:v)-2])*(h[v+1]+h[(0===v?h.length:v)-1]);e.length=0;var y=0;if(p<0)for(var m=0;m<h.length;m+=2)e.push(h[m],h[m+1],0),o.push(y++);else for(var g=h.length-2;g>=0;g-=2)e.push(h[g],h[g+1],0),o.push(y++);return s.push(y),{indices:o,verticesPerFace:s}}for(var b=new Float32Array([n.userData.parameters.depth])[0],w=0;w<r.length&&"break"!==function(){if(n.useNgonForTopBottomFaceDuringBake){var a=0;if((e[3*r[w]+2]===b||0===e[3*r[w]+2])&&a++,(e[3*r[w+1]+2]===b||0===e[3*r[w+1]+2])&&a++,(e[3*r[w+2]+2]===b||0===e[3*r[w+2]+2])&&a++,3===a)return"break"}if(r[w+1]===r[w+3]&&r[w+2]===r[w+5]||r[w+0]===r[w+3]&&r[w+2]===r[w+4]){rP.set(e[3*r[w]],e[3*r[w]+1],e[3*r[w]+2]),rE.set(e[3*r[w+1]],e[3*r[w+1]+1],e[3*r[w+1]+2]),rD.set(e[3*r[w+4]],e[3*r[w+4]+1],e[3*r[w+4]+2]),rj.set(e[3*r[w+5]],e[3*r[w+5]+1],e[3*r[w+5]+2]),rE.sub(rP).normalize(),rD.sub(rP).normalize(),rj.sub(rP).normalize();var l=rE.cross(rD).dot(rj),u=w;Math.abs(l)>.005||i&&i.some(function(e,r){return r%2!=1&&u>=i[r]&&u<i[r+1]})?(o.push(r[w],r[w+1],r[w+2]),c(w),c(w+1),c(w+2),s.push(3),w+=3):(o.push(r[w],r[w+1],r[w+4],r[w+5]),c(w),c(w+1),c(w+4),c(w+5),s.push(4),w+=6)}else o.push(r[w],r[w+1],r[w+2]),c(w),c(w+1),c(w+2),s.push(3),w+=3}(););if(n.useNgonForTopBottomFaceDuringBake){for(var x=[],S=[],k=0,M=0,A=0;M<e.length;M+=3,A++)0===e[M+2]&&(x.push(A),k++),e[M+2]===b&&S.push(A);if(0===n.userData.parameters.extrudeBevelSize){var O=S[0];S[0]=S[1],S[1]=O}x.reverse(),o.push.apply(o,P(x).concat(P(S))),s.push(k,k),u=void 0}return{indices:o,verticesPerFace:s,uvs:u}}(u,c,a,s,h);return{positions:u,indices:f.indices,verticesPerFace:f.verticesPerFace,uvs:f.uvs}}},{key:"allocate",value:function(e,r){var n,i,a,o,s,l=[],u=[],c=rM(e.positionWASM),d=rM(e.indexWASM),f=rM(e.verticesPerFaceWASM);if(c&&c.length>0){if(!(null==d?void 0:d.length)||!(null==f?void 0:f.length))throw Error("SubdivGeometry.allocate: unusable cage topology — positionWASM ".concat(rA(e.positionWASM),", indexWASM ").concat(rA(e.indexWASM),", verticesPerFaceWASM ").concat(rA(e.verticesPerFaceWASM)));a=c,o=d,s=f;var p=rM(e.uvWASM);rm.alloc_subdivision_surface_uvs&&p&&p.length===2*o.length&&(u=p)}else a=rw,o=rx,s=rS;var v=a.length,y=o.length,m=s.length,g=a.length+l.length+u.length,b=o.length+s.length,w=g*Float32Array.BYTES_PER_ELEMENT+b*Uint32Array.BYTES_PER_ELEMENT,x=g*Float32Array.BYTES_PER_ELEMENT,S=rm._malloc(w);if(!S)throw Error("SubdivGeometry.allocate: wasm _malloc(".concat(w,") failed"));var k,M=new Float32Array(rm.HEAPF32.buffer,S,g),A=new Uint32Array(rm.HEAPU32.buffer,S+x,b);M.set(a,0),M.set(l,a.length),M.set(u,a.length+l.length),A.set(o,0),A.set(s,o.length),(null==e||null==(i=e.scaleBaked)?void 0:i.some(function(e){return 1!==e}))&&(k=(n=new h.Oc).makeScale.apply(n,P(e.scaleBaked.map(function(e){return"number"==typeof e?e:1})))),r&&(k?k.premultiply(r):k=r);var O=S+(a.length+l.length)*Float32Array.BYTES_PER_ELEMENT,C=u.length?k?rm.alloc_subdivision_surface_uvs2(S,v,S+x,y,S+x+o.length*Uint32Array.BYTES_PER_ELEMENT,m,O,u.length,k.elements):rm.alloc_subdivision_surface_uvs(S,v,S+x,y,S+x+o.length*Uint32Array.BYTES_PER_ELEMENT,m,O,u.length):k?rm.alloc_subdivision_surface2(S,v,S+x,y,S+x+o.length*Uint32Array.BYTES_PER_ELEMENT,m,k.elements):rm.alloc_subdivision_surface(S,v,S+x,y,S+x+o.length*Uint32Array.BYTES_PER_ELEMENT,m);return rm._free(S),C}},{key:"buildLevel",value:function(e,r,n,i,a){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=a?rm.get_mesh_data2(e,r?rm.Level.CONTROL:rm.Level.REFINED,n,a.elements):rm.get_mesh_data(e,r?rm.Level.CONTROL:rm.Level.REFINED,n),l=rm.HEAPU32.subarray(s>>2,10+(s>>2)),u=l.subarray(4,8),c=0,d=rm.HEAPU32[l[c]>>2],f=rm.HEAPF32.subarray(d>>2,(d>>2)+u[c]);c++;var p=rm.HEAPU32[l[c]>>2],v=rm.HEAPF32.subarray(p>>2,(p>>2)+u[c]);c++;var y=rm.HEAPU32[l[c]>>2],m=rm.HEAPU32.subarray(y>>2,(y>>2)+u[c]);c++;var g,b=rm.HEAPU32[l[c]>>2],w=rm.HEAPU32.subarray(b>>2,(b>>2)+u[c]);if(c++,rm.alloc_subdivision_surface_uvs){var x=l[9];if(x>0){var S=rm.HEAPU32[l[8]>>2];g=rm.HEAPF32.subarray(S>>2,(S>>2)+x)}}if(void 0===i){var k=new h.dd;if(k.setIndex(new h.$c(w,1)),k.setAttribute("position",new h.bd(f,3)),k.setAttribute("normal",new h.bd(v,3)),g&&k.setAttribute("uv",new h.bd(g,2)),r){k.setAttribute("faceMap",new h.$c(m,1));var M=new Float32Array(v.length/3*4).fill(0);k.setAttribute("color",new h.Zc(M,4))}return rm.free_mesh_data(s),k.userData.type="SubdivGeometry",k}if(i.getAttribute("position").copyArray(f),i.getAttribute("normal").copyArray(v),i.attributes.position.needsUpdate=!0,i.attributes.normal.needsUpdate=!0,o){var A=i.getIndex();null!==A&&A.array.length===w.length&&(A.copyArray(w),A.needsUpdate=!0)}var O=i.getAttribute("uv");g&&O&&O.array.length===g.length&&(O.copyArray(g),O.needsUpdate=!0),rm.free_mesh_data(s)}},{key:"freeSubdivPointer",value:function(e){rm.free_bvh(e),rm.free_subdivision_surface(e)}},{key:"buildControlCageWireframe",value:function(e,r,n){var i=rm.get_wireframe_data_for_base_level(e),a=rm.HEAPU32.subarray(i>>2,4+(i>>2)),o=a.subarray(2,4),s=0,l=rm.HEAPU32[a[s]>>2],u=rm.HEAPF32.subarray(l>>2,(l>>2)+o[s]);s++;var c=rm.HEAPU32[a[s]>>2],d=rm.HEAPU32.subarray(c>>2,(c>>2)+o[s]);if(void 0===r){var f=new h.dd;f.setAttribute("position",new h.bd(u,3));for(var p=new Float32Array(u.length),v=0,y=u.length;v<y;)p[v++]=n.r,p[v++]=n.g,p[v++]=n.b;return f.setAttribute("color",new h.Zc(p,3)),f.setIndex(new h.$c(d,1)),rm.free_wireframe_data_for_base_level(i),f}r.getAttribute("position").copyArray(u),r.attributes.position.needsUpdate=!0,rm.free_wireframe_data_for_base_level(i)}},{key:"updateCollabMesh",value:function(e,r,n){var i=0===r;i||rm.set_destination_refinement_level(e,r);var a=n?rm.get_topological_data2(e,i?rm.Level.CONTROL:rm.Level.REFINED,n.elements):rm.get_topological_data(e,i?rm.Level.CONTROL:rm.Level.REFINED),o=rm.HEAPU32.subarray(a>>2,8+(a>>2)),s=o.subarray(3,6),l=0,u=rm.HEAPU32[o[l]>>2],c=new Float32Array(rm.HEAPF32.subarray(u>>2,(u>>2)+s[l]));l++;var h=rm.HEAPU32[o[l]>>2],d=new Uint32Array(rm.HEAPU32.subarray(h>>2,(h>>2)+s[l]));l++;var f,p=rm.HEAPU32[o[l]>>2],v=new Uint8Array(rm.HEAPU32.subarray(p>>2,(p>>2)+s[l]));if(rm.alloc_subdivision_surface_uvs){var y=o[7];if(y>0){var m=rm.HEAPU32[o[6]>>2];f=new Float32Array(rm.HEAPF32.subarray(m>>2,(m>>2)+y))}}return rm.free_topological_data(a),{positions:c,indices:d,verticesPerFace:v,uvs:f}}}]),r}(h.dd);function rC(e){var r=Object.keys(e);return 1===r.length&&"subdivisions"===r[0]}function r_(e,r){for(var n=r?r.count:e.count,i=0,a=new Map,o=new Uint32Array(n),s=[],l=0;l<n;l++){var u=r?r.getX(l):l,c=e.getX(u),h=e.getY(u),d=e.getZ(u),f=Math.round(1e4*c),p=Math.round(1e4*h),v=Math.round(1e4*d),y=a.get(f);void 0===y&&(y=new Map,a.set(f,y));var m=y.get(p);void 0===m&&(m=new Map,y.set(p,m));var g=m.get(v);void 0===g&&(g=i++,m.set(v,g),s.push(c,h,d)),o[l]=g}for(var b=[],w=[],x=0;x<o.length;x+=3)o[x]===o[x+1]||o[x]===o[x+2]||o[x+1]===o[x+2]||(b.push(o[x],o[x+1],o[x+2]),w.push(r?r.getX(x):x,r?r.getX(x+1):x+1,r?r.getX(x+2):x+2));return{positions:s,triIndices:b,triOriginals:w}}var rP=new h.Fc,rE=new h.Fc,rD=new h.Fc,rj=new h.Fc;function rT(e,r){var n=0;if(!e.layers||0===e.layers.length)return!1;var i=null==(c=e.layers)?void 0:c.find(function(e){return"light"===e.data.type});if(i){var a=i.data,o=Number(r.getVariable(a.alphaOverride));if(("string"==typeof a.alphaOverride?o/100:a.alphaOverride)<1)return!0}var s=!0,l=!1,u=void 0;try{for(var c,h,d=e.layers[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var f=h.value;if("displace"!==f.data.type&&f.data.isMask)return!0;if("displace"!==f.data.type&&"alpha"in f.data&&"light"!==f.data.type&&"fresnel"!==f.data.type&&"cavity"!==f.data.type&&"dust"!==f.data.type&&"texture"!==f.data.type&&"matcap"!==f.data.type&&"rainbow"!==f.data.type&&"outline"!==f.data.type&&"pattern"!==f.data.type){var p=f.data.visible?f.data.alpha:0;if("string"==typeof p&&(p=Math.max(0,Math.min(1,Number(null!=(g=r.getVariable(p))?g:100)/100))),1===p&&"depth"===f.data.type||"gradient"===f.data.type){var v=!0,y=!1,m=void 0;try{for(var g,b,w=f.data.colors[Symbol.iterator]();!(v=(b=w.next()).done);v=!0){var x=b.value;if(x[3]<1){p=x[3];break}}}catch(e){y=!0,m=e}finally{try{v||null==w.return||w.return()}finally{if(y)throw m}}}else if(1===p&&"noise"===f.data.type){var S=r.color(f.data.colorA).a,k=r.color(f.data.colorB).a,M=r.color(f.data.colorC).a,A=r.color(f.data.colorD).a,O=Math.min(S,Math.min(k,Math.min(M,A)));O<1&&(p=O)}n+=(1-n)*p}}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}return n<1}var rI=function(e,r,n){var i,a;return null!=(i=Math.max(0,Math.min(1,Number(null!=(a=r.getVariable("number"==typeof e?100*e:e,n))?a:100)/100)))?i:1},rR=function(e,r,n){return"number"==typeof e?e:r.getVariable(e,n)};function rB(e){var r="string"==typeof e?e:e.type;return"texture"===r||"video"===r||"displace_map"===r||"matcap"===r}function rz(e){return"string"==typeof e||"number"==typeof e&&0!==e}var rL={noise:["noiseType"],texture:["projection","axis","projectionAxis","side"],video:["projection","axis","projectionAxis","side"],displace:["noiseType"],light:["roughnessMap","bumpMap","roughnessMapChannel","metalnessMap","metalnessMapChannel","normalMap","aoMap","aoMapChannel","emissiveMap"],depth:["smooth","isWorldSpace","gradientType","isVector"],pattern:["style","projection","axis"],reflection:["tracingMode","mirror"]},rF={depth:["colors"],gradient:["colors","steps"],toon:["colors","steps"]},rU=function(e){function r(e){var n;return y(this,r),(n=v(this,r)).object=e,n.isClone=!0,n.matrixAutoUpdate=!1,n.hasNonUniformScale=e.hasNonUniformScale,n}return S(r,e),b(r,[{key:"raycast",value:function(e,r){}},{key:"expand",value:function(){for(var e=0,r=this.object.entityChildren(e);r;){var n=this.children[e];(null==n?void 0:n.object)!==r&&(n&&this.remove(n),n=new rU(r),this.add(n),this.children.splice(e,0,this.children.pop()),n.matrixWorldNeedsUpdate=!0,n.matrixAutoUpdate=!1,n.matrix=r.matrix,n.hiddenMatrix=r.hiddenMatrix,n.pivotMatrix=r.pivotMatrix),n.expand(),e+=1,r=this.object.entityChildren(e)}for(;this.children.length>e;)this.remove(this.children[e]);this.pivotMatrix=this.object.pivotMatrix}},{key:"visible",get:function(){var e,r=this.object.cloner;return(void 0===r||this.parent!==r||!r.instancingActive&&!r.insideBoolean)&&(void 0!==this.playModeVisible?this.playModeVisible:this.object.visible||this.object.dataPatched.visible&&!0===(null==(e=this.object.dataPatched.cloner)?void 0:e.hideBase))},set:function(e){}},{key:"castShadow",get:function(){return this.object.castShadow},set:function(e){}},{key:"receiveShadow",get:function(){return this.object.receiveShadow},set:function(e){}},{key:"isMesh",get:function(){return"Mesh"===this.object.type}},{key:"isLight",get:function(){return this.object.isLight}},{key:"layers",get:function(){return this.object.layers},set:function(e){}},{key:"isCamera",get:function(){return!1}},{key:"geometry",get:function(){if(this.object.geometry)return this.object.geometry}},{key:"material",get:function(){if(this.object.material)return this.object.material}},{key:"morphTargetInfluences",get:function(){if(this.object.morphTargetInfluences)return this.object.morphTargetInfluences},set:function(e){}}]),r}(function(e){function r(){return y(this,r),v(this,r,arguments)}return S(r,e),r}((0,o.f)(h.Rc))),rV=function(e){function r(){return y(this,r),v(this,r,arguments)}return S(r,e),r}(tO),rN=function(e){function r(e){var n;return y(this,r),(n=v(this,r)).flatShading=e,n}return S(r,e),b(r,[{key:"disposeObject",value:function(e){e.dispose()}},{key:"createObject",value:function(e,r,n){var i=rf(e,r,this.flatShading,n);return i.computeBoundingSphere(),i}}]),r}(function(){function e(){y(this,e),this.objects=new Map,this.unreachable=new Set}return b(e,[{key:"getCached",value:function(e){return this.objects.get(e)}},{key:"size",get:function(){return this.objects.size}},{key:"get",value:function(e,r,n){var i=this.objects.get(e);return void 0===i?(i=this.createObject(e,r,n),this.objects.set(e,i)):i.isShared=!0,i}},{key:"forceDelete",value:function(e){var r=this.objects.get(e);r&&(this.disposeObject(r),this.objects.delete(e))}},{key:"adopt",value:function(e,r){this.objects.set(e,r)}},{key:"mutateIfUnique",value:function(e,r){var n=this.objects.get(e);if(n&&!0!==n.isShared)return this.objects.delete(e),this.objects.set(r,n),n}},{key:"startGc",value:function(){this.unreachable=new Set(this.objects.keys())}},{key:"markAsReachable",value:function(e,r){r===this.objects.get(e)&&this.unreachable.delete(e)}},{key:"endGc",value:function(){var e=this;this.unreachable.forEach(function(r){e.disposeObject(e.objects.get(r)),e.objects.delete(r)}),this.unreachable.clear()}},{key:"dispose",value:function(){var e=this;this.objects.forEach(function(r){e.disposeObject(r)}),this.objects.clear()}}]),e}()),rG={markNeedsUpdateRendererDirty:function(){}};function rW(e){return"variable_"+e}var rH=new h.Oc,rq=new h.Fc,rY=new h.Ec,rX=new h.Fc,rZ=new h.Pc,rK=function(e){function r(e){var n;return y(this,r),(n=v(this,r)).shared=e,n}return S(r,e),b(r,[{key:"create",value:function(e){return new tB(e,this.shared)}}]),r}(tE),rJ=new Set,rQ=function(){function e(r){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];y(this,e);var s=!0,u=!1,h=void 0;if(this.data=r,this.needsJitter=a,this.enableLocalStorageForPersistentVariables=o,this.geometryCache=new rN(!0),this.geometryCache2=new rN(!1),this.imageHolderCache=new rK(this),this.thisContext={scene:rG,shared:this},this.deletedImage=new tz(l.b.emptyImage,this),this.deletedVideo=new tz(c.U.defaultVideo,this),this.materials={},this.images={},this.uiBuffers={},this.videos={},this.colors={},this.audios={},this.particles={},this.fonts={},this.variables={},this.userAPIs={},this.userWebhooks={},this.mouseProperty=null,this.raycastProperty=null,this.requestRender=function(){n._requestRender&&n._requestRender()},this.transientGeometryKeys=new WeakSet,i.images)try{for(var d,f=Object.entries(i.images)[Symbol.iterator]();!(s=(d=f.next()).done);s=!0){var p=_(d.value,2),v=p[0],m=p[1];this.addImage(v,m)}}catch(e){u=!0,h=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw h}}var g=!0,b=!1,w=void 0;if(i.videos)try{for(var x,S=Object.entries(i.videos)[Symbol.iterator]();!(g=(x=S.next()).done);g=!0){var k=_(x.value,2),M=k[0],A=k[1];this.addVideo(M,A)}}catch(e){b=!0,w=e}finally{try{g||null==S.return||S.return()}finally{if(b)throw w}}var O=!0,C=!1,P=void 0;if(i.audios)try{for(var E,D=Object.entries(i.audios)[Symbol.iterator]();!(O=(E=D.next()).done);O=!0){var j=_(E.value,2),T=j[0],I=j[1];this.addAudio(T,I)}}catch(e){C=!0,P=e}finally{try{O||null==D.return||D.return()}finally{if(C)throw P}}var R=!0,B=!1,z=void 0;if(i.particles)try{for(var L,F=Object.entries(i.particles)[Symbol.iterator]();!(R=(L=F.next()).done);R=!0){var U=_(L.value,2),V=U[0],N=U[1];this.addParticle(V,N)}}catch(e){B=!0,z=e}finally{try{R||null==F.return||F.return()}finally{if(B)throw z}}this.reset(r)}return b(e,[{key:"deletedMaterial",get:function(){return null!=this._deletedMaterial||(this._deletedMaterial=th(c.ea.defaultTwoLayerData("phong"),this.thisContext,"")),this._deletedMaterial}},{key:"setRequestRender",value:function(e){this._requestRender=e}},{key:"getImageLoadPromises",value:function(){return Object.values(this.images).map(function(e){return e.loadPromise})}},{key:"setEntityOpContext",value:function(e){this.entityOpContext=e}},{key:"reset",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.data=e,this.resetLib(e.lib);var i=!0,a=!1,o=void 0;try{for(var s,l,u,c=e.variables[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value,d=h.id,f=h.data;this.addVariableHolder(d,f),r&&this.updateVariableHolder(d,f)}}catch(e){a=!0,o=e}finally{try{i||null==c.return||c.return()}finally{if(a)throw o}}var p=!0,v=!1,y=void 0;try{for(var m,g=Object.entries(null!=(s=e.userAPIs)?s:{})[Symbol.iterator]();!(p=(m=g.next()).done);p=!0){var b=_(m.value,2),w=b[0],x=b[1];this.addUserAPI(w,x)}}catch(e){v=!0,y=e}finally{try{p||null==g.return||g.return()}finally{if(v)throw y}}var S=!0,k=!1,M=void 0;try{for(var A,O=Object.entries(null!=(l=e.userWebhooks)?l:{})[Symbol.iterator]();!(S=(A=O.next()).done);S=!0){var C=_(A.value,2),P=C[0],E=C[1];this.addUserWebhook(P,E)}}catch(e){k=!0,M=e}finally{try{S||null==O.return||O.return()}finally{if(k)throw M}}if(!n){var D=!0,j=!1,T=void 0;try{for(var I,R=Object.entries(e.images)[Symbol.iterator]();!(D=(I=R.next()).done);D=!0){var B=_(I.value,2),z=B[0],L=B[1];this.addImage(z,L)}}catch(e){j=!0,T=e}finally{try{D||null==R.return||R.return()}finally{if(j)throw T}}var F=!0,U=!1,V=void 0;try{for(var N,G=Object.entries(e.videos)[Symbol.iterator]();!(F=(N=G.next()).done);F=!0){var W=_(N.value,2),H=W[0],q=W[1];this.addVideo(H,q)}}catch(e){U=!0,V=e}finally{try{F||null==G.return||G.return()}finally{if(U)throw V}}}var Y=!0,X=!1,Z=void 0;try{for(var K,J=Object.entries(e.colors)[Symbol.iterator]();!(Y=(K=J.next()).done);Y=!0){var Q=_(K.value,2),$=Q[0],ee=Q[1];this.addColor($,ee)}}catch(e){X=!0,Z=e}finally{try{Y||null==J.return||J.return()}finally{if(X)throw Z}}var et=!0,er=!1,en=void 0;try{for(var ei,ea=Object.entries(e.lib.materials)[Symbol.iterator]();!(et=(ei=ea.next()).done);et=!0){var eo=_(ei.value,2),es=eo[0],el=eo[1];this.addMaterial(es,el.asset)}}catch(e){er=!0,en=e}finally{try{et||null==ea.return||ea.return()}finally{if(er)throw en}}var eu=!0,ec=!1,eh=void 0;try{for(var ed,ef=Object.entries(e.materials)[Symbol.iterator]();!(eu=(ed=ef.next()).done);eu=!0){var ep=_(ed.value,2),ev=ep[0],ey=ep[1];this.addMaterial(ev,ey)}}catch(e){ec=!0,eh=e}finally{try{eu||null==ef.return||ef.return()}finally{if(ec)throw eh}}var em=!0,eg=!1,eb=void 0;try{for(var ew,ex=Object.entries(e.audios)[Symbol.iterator]();!(em=(ew=ex.next()).done);em=!0){var eS=_(ew.value,2),ek=eS[0],eM=eS[1];this.addAudio(ek,eM)}}catch(e){eg=!0,eb=e}finally{try{em||null==ex.return||ex.return()}finally{if(eg)throw eb}}var eA=!0,eO=!1,eC=void 0;try{for(var e_,eP=Object.entries(e.particles)[Symbol.iterator]();!(eA=(e_=eP.next()).done);eA=!0){var eE=_(e_.value,2),eD=eE[0],ej=eE[1];this.addParticle(eD,ej)}}catch(e){eO=!0,eC=e}finally{try{eA||null==eP.return||eP.return()}finally{if(eO)throw eC}}var eT=!0,eI=!1,eR=void 0;try{for(var eB,ez=Object.entries(e.fonts)[Symbol.iterator]();!(eT=(eB=ez.next()).done);eT=!0){var eL=_(eB.value,2),eF=eL[0],eU=eL[1];this.addFont(eF,eU)}}catch(e){eI=!0,eR=e}finally{try{eT||null==ez.return||ez.return()}finally{if(eI)throw eR}}}},{key:"addMaterial",value:function(e,r){if(void 0===r.layers&&(r=A(M({},r),{layers:c.ea.defaultTwoLayerData("phong").layers})),this.materials[e]){var n=this.materials[e];n.reset(r,this.thisContext),n.dispose()}else{var i=th(r,this.thisContext,e);this.materials[e]=i}}},{key:"deleteMaterial",value:function(e){this.materials[e]&&(this.materials[e].nodeMaterialDispose(),delete this.materials[e])}},{key:"getMaterial",value:function(e){return this.materials[e]}},{key:"getMaterialOrDeletedPlaceholder",value:function(e){var r;return null!=(r=this.materials[e])?r:this.deletedMaterial}},{key:"material",value:function(e){return"string"==typeof e?this.getMaterialOrDeletedPlaceholder(e):null==e?(console.error("material is undefined or null"),this.deletedMaterial):(void 0===e.layers&&(e=A(M({},e),{layers:c.ea.defaultTwoLayerData("phong").layers})),tc(e,this.thisContext))}},{key:"getMaterials",value:function(){return this.materials}},{key:"addImage",value:function(e,r){return this.images[e]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),this.images[e].updateSrc(r.data),!0):(this.images[e]=new tz(r,this),!1)}},{key:"deleteImage",value:function(e){var r=this.images[e];r&&(r.dispose(),delete this.images[e])}},{key:"getDefaultImage",value:function(){return this.images.image_0}},{key:"getImage",value:function(e){var r;return null!=(r=this.images[e])?r:this.deletedImage}},{key:"image",value:function(e){return"string"==typeof e?this.getImage(e):this.imageHolderCache.load(e)}},{key:"addUIBuffer",value:function(e,r){return this.uiBuffers[e]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),this.uiBuffers[e].updateSrc(r),!0):(this.uiBuffers[e]=new tz(r,this),!1)}},{key:"uiBuffer",value:function(e){return this.uiBuffers[e]}},{key:"getEntityTexture",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.material;if(!n)return null;var i=!0,a=!1,o=void 0;try{for(var s,l=(Array.isArray(n)?n:[n])[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=null!=(p=u.root)?p:u,h=!0,d=!1,f=void 0;try{for(var p,v,y,m,g=(null!=(v=null==c||null==(y=c.data)?void 0:y.layers)?v:[])[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var b,w,x,S,k,M,A,O=m.value,C=null==O?void 0:O.data;if(("texture"===(null==C?void 0:C.type)||"matcap"===(null==C?void 0:C.type))&&(void 0===r.layer||O.id===r.layer||C.type===r.layer)){var _=null==(A=C.texture)?void 0:A.image;if(null!=_){var P=null!=(b="string"==typeof _?this.uiBuffer(_):void 0)?b:this.image(_);if(P){var E=P.getTexture(null!=(w=C.texture.wrapping)?w:"texture"===C.type?1e3:1001,null!=(x=C.texture.minFilter)?x:1008,null!=(S=C.texture.magFilter)?S:1006),D=P.img;return{texture:E,width:null!=(k=null==D?void 0:D.width)?k:0,height:null!=(M=null==D?void 0:D.height)?M:0,layerId:O.id,layerType:C.type}}}}}}catch(e){d=!0,f=e}finally{try{h||null==g.return||g.return()}finally{if(d)throw f}}}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return null}},{key:"addVideo",value:function(e,r){return this.videos[e]?(this.videos[e].updateSrc(r.data),!0):(this.videos[e]=new tz(r,this),!1)}},{key:"deleteVideo",value:function(e){var r=this.videos[e];r&&(r.dispose(),delete this.videos[e])}},{key:"getVideo",value:function(e){var r;return null!=(r=this.videos[e])?r:this.deletedVideo}},{key:"video",value:function(e){return"string"==typeof e?this.getVideo(e):this.imageHolderCache.load(e)}},{key:"addColor",value:function(e,r){return this.colors[e]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),"a"in r?this.colors[e].setRGBA(r.r,r.g,r.b,r.a):this.colors[e].setRGBA(r.r,r.g,r.b,1),!0):(this.colors[e]=new rV(r.r,r.g,r.b,"a"in r?r.a:1),!1)}},{key:"updateColor",value:function(e,r){if(this.colors[e]){this.onColorOrImageUpdate&&this.onColorOrImageUpdate();var n,i,a,o,s=this.colors[e];return this.colors[e].r=null!=(n=r.r)?n:s.r,this.colors[e].g=null!=(i=r.g)?i:s.g,this.colors[e].b=null!=(a=r.b)?a:s.b,this.colors[e].a=null!=(o=r.a)?o:s.a,!0}return!1}},{key:"deleteColor",value:function(e){this.colors[e]&&delete this.colors[e]}},{key:"getColor",value:function(e){return this.colors[e]}},{key:"getColorNames",value:function(){return Object.values(this.data.colors).map(function(e){return e.name})}},{key:"getColorByName",value:function(e){for(var r in this.data.colors)if(this.data.colors[r].name===e)return{color:this.colors[r],id:r}}},{key:"color",value:function(e){if("string"!=typeof e)return new tO(e.r,e.g,e.b,"a"in e?e.a:1);var r,n=this.getColor(e);return n?r=n:(console.warn("Tried to create color layer params with a color key that does not exist in the assets manager"),r=new tO(0,0,0,0)),r}},{key:"addAudio",value:function(e,r){this.audios[e]=r}},{key:"getAudio",value:function(e){var r=this.audios[e];if(k(r,a.c))return r;var n=new a.c({src:r.data});return this.audios[e]=n,n}},{key:"addParticle",value:function(e,r){this.particles[e]=r}},{key:"getParticle",value:function(e){return this.particles[e]}},{key:"deleteParticle",value:function(e){this.particles[e]&&delete this.particles[e]}},{key:"deleteAudio",value:function(e){var r=this.audios[e];r&&(k(r,a.c)&&r.dispose(),delete this.audios[e])}},{key:"addFont",value:function(e,r){var n=this,i=U;null!==i?(this.fonts[e]=new i(r),this.fonts[e].loadingPromise.then(function(){return n.requestRender()})):(0,u.c)("text","a font asset")}},{key:"getFont",value:function(e){return this.fonts[e]}},{key:"deleteFont",value:function(e){this.fonts[e]&&delete this.fonts[e]}},{key:"dispose",value:function(){var e=this;Object.keys(this.materials).forEach(function(r){return e.deleteMaterial(r)}),this._requestRender=void 0,Object.values(this.audios).forEach(function(e){k(e,a.c)&&e.dispose()}),this.audios={},this.particles={},this.geometryCache.dispose(),this.geometryCache2.dispose()}},{key:"addVariableHolder",value:function(e,r){if(void 0===this.variables[e]){var n=r.value;if(this.enableLocalStorageForPersistentVariables&&r.persistent){var i=localStorage.getItem(rW(e));n=null!==i?JSON.parse(i):r.value}return this.variables[e]={value:n,locations:[],persistent:r.persistent},"dynamicVariableType"in r&&(this.variables[e].dynamicVariablePlayState="Playing",this.variables[e].dynamicVariableToggleIsForward=void 0),!0}return this.variables[e].value=r.value,!1}},{key:"resetDynamicVariablePlayState",value:function(){for(var e in this.variables)void 0!==this.variables[e].dynamicVariablePlayState&&(this.variables[e].dynamicVariablePlayState="Playing",this.variables[e].dynamicVariableToggleIsForward=void 0)}},{key:"updateVariableHolder",value:function(e,r){this.updateVariable(e,r.value)}},{key:"updateVariable",value:function(e,r){var n,i=this;if(void 0===this.variables[e])return!1;this.variables[e].value=r,this.enableLocalStorageForPersistentVariables&&this.variables[e].persistent&&localStorage.setItem(rW(e),JSON.stringify(r));for(var a=r;"string"==typeof a;)a=this.variables[a].value;for(var s=this.entityOpContext.scene,l=!1,u=this.variables[e].locations.length-1;u>=0;u--)n=this,function(r){var u=n.variables[e].locations[r];if("material"===u[0]){var c=u[1],d=a,f={scene:s,shared:n},p=u.slice(2);s.traverseMaterial(function(e){var r,n=null!=(r=e.root)?r:e;n.uuid===c&&n.onVariableUpdate(p,d,f)});var v=n.materials[c];v&&v.onVariableUpdate(p,d,f)}else{var y=s.find(u[0]);if(void 0===y)return n.variables[e].locations.splice(r,1);if(l=!0,"geometry"!==u[1]&&"particles"!==u[1]){for(var m=1;m<u.length-1;m++)y=y[u[m]];"rotation"===u[1]?y[u[u.length-1]]=a*h.Cc.DEG2RAD:y[u[u.length-1]]=a}if("ParticleEmitter"===(y=s.find(u[0])).type&&y.updateVariableState(a,u),o.h.is(y))if("position"===u[1]||"rotation"===u[1]||"scale"===u[1])y.onVariableUpdate();else if("geometry"===u[1]){var g=y;y.component&&(g=y.component);var b=g.dataPatched;g.chooseGeoemtryCache(n).forceDelete(b.geometry),g.createGeometryDelayed(n.entityOpContext),g.onVariableUpdate(!0),g.invalidateDownstreamBooleanData(),g.instances.forEach(function(e){var r=e.dataPatched;e.chooseGeoemtryCache(i).forceDelete(r.geometry),e.createGeometryDelayed(i.entityOpContext),e.onVariableUpdate(!0),e.invalidateDownstreamBooleanData()})}else"morphTargetInfluences"===u[1]&&y.updateMorphInfluences(u[2],a)}}(u);return l&&s.markShadowsDirty(),this.requestRender(),!0}},{key:"updateEntityGeometryParams",value:function(e,r){var n=e;if(n.component&&(n=n.component),"function"!=typeof n.chooseGeoemtryCache)return!1;var i=n.dataPatched,a=null==i?void 0:i.geometry;if(!a||"string"!=typeof a.type||"VectorGeometry"===a.type||"PathGeometry"===a.type)return!1;var o=function(e){return e.toLowerCase().replace(/[\s_.-]+/g,"")},s=new Map,l=!0,u=!1,c=void 0;try{for(var h,d=Object.keys(a)[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;s.set(o(f),f)}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}var p={},v=!0,y=!1,m=void 0;try{for(var g,b=Object.entries(null!=r?r:{})[Symbol.iterator]();!(v=(g=b.next()).done);v=!0){var w=_(g.value,2),x=w[0],S=w[1],k=s.get(o(x));if(void 0!==k&&"type"!==k&&"font"!==k&&"shape"!==k&&"path"!==k&&"data"!==k){if("text"===k){("string"==typeof S||"number"==typeof S)&&(p[k]={textValue:String(S)});continue}var O=a[k];"number"==typeof S&&isFinite(S)&&("number"==typeof O||"string"==typeof O)&&(p[k]=S)}}}catch(e){y=!0,m=e}finally{try{v||null==b.return||b.return()}finally{if(y)throw m}}if(0===Object.keys(p).length)return!1;var C=M({},a,p);return n.dataPatched=A(M({},i),{geometry:C}),this.transientGeometryKeys.has(a)&&n.chooseGeoemtryCache(this).forceDelete(i.geometry),this.transientGeometryKeys.add(C),n.createGeometryDelayed(this.entityOpContext),n.onVariableUpdate(!0),n.invalidateDownstreamBooleanData(),this.entityOpContext.scene.markShadowsDirty(),this.requestRender(),!0}},{key:"resetEntityGeometryParams",value:function(e){var r,n=e;if(n.component&&(n=n.component),"function"!=typeof n.chooseGeoemtryCache)return!1;var i=null==(r=n.dataPatched)?void 0:r.geometry;return!(!i||!this.transientGeometryKeys.has(i)||(n.dataPatched=n.data,n.chooseGeoemtryCache(this).forceDelete(i),n.createGeometryDelayed(this.entityOpContext),n.onVariableUpdate(!0),n.invalidateDownstreamBooleanData(),this.entityOpContext.scene.markShadowsDirty(),this.requestRender(),0))}},{key:"updateEntityGeometryVertices",value:function(e,r){var n=e;if(n.component&&(n=n.component),"function"!=typeof n.chooseGeoemtryCache)return!1;var i=n.dataPatched,a=null==i?void 0:i.geometry;if(!a||"NonParametricGeometry"!==a.type)return!1;var o=null==r?void 0:r.vertices;if(void 0===o||"number"!=typeof o.length||o.length<9||o.length%3!=0||o.length/3>rQ.MAX_TRANSIENT_VERTICES)return!1;var s,l,u,c=k(o,Float32Array)?o:Float32Array.from(o),h=c.length/3;if(void 0!==r.normals){if(r.normals.length!==c.length)return!1;s=k(r.normals,Float32Array)?r.normals:Float32Array.from(r.normals)}if(void 0!==r.uvs){if(r.uvs.length!==2*h)return!1;l=k(r.uvs,Float32Array)?r.uvs:Float32Array.from(r.uvs)}if(void 0!==r.indices){var d=h>65535?Uint32Array.from(r.indices):Uint16Array.from(r.indices);if(0===d.length||d.length%3!=0)return!1;for(var f=0;f<d.length;f++)if(d[f]>=h)return!1;u={array:d,itemSize:1,type:d.constructor.name,normalized:!1}}else{var p=a.data,v=null==p?void 0:p.index;if(null==v||null==(m=v.array)?void 0:m.length){var y,m,g,b,w,x,S=(null!=(g=null==p||null==(x=p.attributes)||null==(w=x.position)||null==(b=w.array)?void 0:b.length)?g:0)/3;if(h!==S)return y="".concat(h,"/").concat(S),rJ.has(y)||(rJ.add(y),console.warn("[spline] updateObject: ignoring a geometry update of ".concat(h," vertices for a mesh that holds ").concat(S,". Without `indices` the write is taken as a morph of the mesh's own vertices, which only means anything at the same count — send `indices` alongside `vertices` to replace the topology too."))),!1;u=v}}for(var O=1/0,C=1/0,_=1/0,P=-1/0,E=-1/0,D=-1/0,j=0;j<c.length;j+=3){var T=c[j],I=c[j+1],R=c[j+2];T<O&&(O=T),T>P&&(P=T),I<C&&(C=I),I>E&&(E=I),R<_&&(_=R),R>D&&(D=R)}var B=function(e,r){return{array:e,itemSize:r,type:"Float32Array",normalized:!1}},z={position:B(c,3)};s&&(z.normal=B(s,3)),l&&(z.uv=B(l,2));var L=A(M({},a),{width:P-O,height:E-C,depth:D-_,data:M({attributes:z},u?{index:u}:{})}),F=this.transientGeometryKeys.has(a);return n.dataPatched=A(M({},i),{geometry:L}),this.transientGeometryKeys.add(L),n.applyTransientGeometryData(this.entityOpContext,F),n.onVariableUpdate(!0),n.invalidateDownstreamBooleanData(),this.entityOpContext.scene.markShadowsDirty(),this.requestRender(),!0}},{key:"setEntityInstanceTransforms",value:function(e,r){var n=e;n.component&&(n=n.component);var i=n.cloner;if(void 0===i)return -1;var a=i.children,o=Math.PI/180,s=!1,l=!0,u=!1,c=void 0;if(null===r)try{for(var h,d=a[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value;void 0!==f.transformOverride&&(f.transformOverride=void 0,s=!0)}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}else{if(!Array.isArray(r))return a.length;for(var p=Math.min(r.length,a.length),v=0;v<p;v++){var y,m=r[v],g=a[v];if(null==m){void 0!==g.transformOverride&&(g.transformOverride=void 0,s=!0);continue}var b=null!=(y=g.transformOverride)?y:{position:[g.position.x,g.position.y,g.position.z],rotation:[g.rotation.x,g.rotation.y,g.rotation.z],scale:[g.scale.x,g.scale.y,g.scale.z]};m.position&&("number"==typeof m.position.x&&(b.position[0]=m.position.x),"number"==typeof m.position.y&&(b.position[1]=m.position.y),"number"==typeof m.position.z&&(b.position[2]=m.position.z)),m.rotation&&("number"==typeof m.rotation.x&&(b.rotation[0]=m.rotation.x*o),"number"==typeof m.rotation.y&&(b.rotation[1]=m.rotation.y*o),"number"==typeof m.rotation.z&&(b.rotation[2]=m.rotation.z*o)),m.scale&&("number"==typeof m.scale.x&&(b.scale[0]=m.scale.x),"number"==typeof m.scale.y&&(b.scale[1]=m.scale.y),"number"==typeof m.scale.z&&(b.scale[2]=m.scale.z)),g.transformOverride=b,g.position.fromArray(b.position),g.rotation.fromArray(b.rotation),g.scale.fromArray(b.scale),g.updateMatrix(),g.hasNonUniformScale&&(g.updateMatrixWorld(),g.updateMatrixWorldRigid())}}return s?i.update(this.entityOpContext):i.syncInstanceMatrices(),i.invalidateTransform(n),this.entityOpContext.scene.markShadowsDirty(),this.requestRender(),a.length}},{key:"spawnRuntimeClone",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"==typeof e.entityChildren){var n=e.parent;if(null!==n){var i=new rU(e);i.playModeVisible=!1!==r.visible,i.expand(),"string"==typeof r.name&&(i.name=r.name);var a=Math.PI/180;return i.position.copy(e.position),i.rotation.copy(e.rotation),i.scale.copy(e.scale),i.hiddenMatrix.copy(e.hiddenMatrix),r.position&&("number"==typeof r.position.x&&(i.position.x=r.position.x),"number"==typeof r.position.y&&(i.position.y=r.position.y),"number"==typeof r.position.z&&(i.position.z=r.position.z)),r.rotation&&("number"==typeof r.rotation.x&&(i.rotation.x=r.rotation.x*a),"number"==typeof r.rotation.y&&(i.rotation.y=r.rotation.y*a),"number"==typeof r.rotation.z&&(i.rotation.z=r.rotation.z*a)),r.scale&&("number"==typeof r.scale.x&&(i.scale.x=r.scale.x),"number"==typeof r.scale.y&&(i.scale.y=r.scale.y),"number"==typeof r.scale.z&&(i.scale.z=r.scale.z)),i.updateMatrix(),n.add(i),i.updateWorldMatrix(!0,!0),this.entityOpContext.scene.markShadowsDirty(),this.requestRender(),i}}}},{key:"destroyRuntimeClone",value:function(e){e.removeFromParent(),this.entityOpContext.scene.markShadowsDirty(),this.requestRender()}},{key:"updateEntityMaterialParams",value:function(e,r){var n=e.material;if(!n)return!1;var i=[],a=!0,o=!1,s=void 0;try{for(var l,u=(Array.isArray(n)?n:[n])[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c,h=l.value,d=null!=(c=h.root)?c:h;d&&Array.isArray(d.layers)&&d.data&&!i.includes(d)&&i.push(d)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}if(0===i.length)return!1;var f={scene:this.entityOpContext.scene,shared:this},p=function(e){return e.toLowerCase().replace(/[\s_.-]+/g,"")},v=function(e){if("string"==typeof e){var r=new tO(1,1,1,1);try{r.set(e)}catch(e){return null}return{r:r.r,g:r.g,b:r.b,a:void 0}}if(e&&"object"==(void 0===e?"undefined":E(e))&&"r"in e){if([e.r,e.g,e.b].some(function(e){return"number"!=typeof e||!isFinite(e)}))return null;var n=Math.max(e.r,e.g,e.b)>1?1/255:1;return{r:e.r*n,g:e.g*n,b:e.b*n,a:"number"==typeof e.a?Math.max(0,Math.min(e.a,1)):void 0}}return null},y=function(e,r,n){if(!e.hasValue(r))return!1;var i,a=e.getValue(r);if(!a||"object"!=(void 0===a?"undefined":E(a))||!a.isColor)return!1;var o=null!=(i=n.a)?i:"number"==typeof a.a?a.a:1;return k(a,rV)?e.setValue(r,new tO(n.r,n.g,n.b,o)):"function"==typeof a.setRGBA?a.setRGBA(n.r,n.g,n.b,o):a.setRGB(n.r,n.g,n.b),!0},m=!1,g=!0,b=!1,w=void 0;try{for(var x,S,M=i[Symbol.iterator]();!(g=(S=M.next()).done);g=!0)x=this,function(){var e=S.value,n=null!=(d=e.data.layers)?d:[],i=function(r){return e.layers.find(function(e){return e.uuid===r})};if(void 0!==r.color){var a=v(r.color),o=n.find(function(e){return"color"===e.data.type}),s=o&&i(o.id);if(a&&s&&y(s,"color",a)&&(m=!0,void 0!==a.a)){var l=a.a<1||rT(e.data,x);e.setTransparent?e.setTransparent(l,f.scene):e.transparent=l}}"number"==typeof r.alpha&&isFinite(r.alpha)&&(null==(b=e.onVariableUpdate)||b.call(e,["alphaOverride"],Math.max(0,Math.min(r.alpha,100)),f),m=!0);var u=!0,c=!1,h=void 0;try{for(var d,g,b,w,k=(null!=(g=r.layers)?g:[])[Symbol.iterator]();!(u=(w=k.next()).done);u=!0)!function(){var r=w.value;if(!r||"object"!=(void 0===r?"undefined":E(r)))return;var a="string"==typeof r.id?n.find(function(e){return e.id===r.id}):"number"==typeof r.index?n[r.index]:"string"==typeof r.type?n.find(function(e){return e.data.type===r.type}):void 0,o=a&&i(a.id);if(a&&o){var s=null!=(d=rL[a.data.type])?d:[],l=Object.keys(a.data),u=!0,c=!1,h=void 0;try{for(var d,g,b=Object.entries(r)[Symbol.iterator]();!(u=(g=b.next()).done);u=!0)!function(){var r,n,i,u=_(g.value,2),c=u[0],h=u[1];if("id"===c||"index"===c||"type"===c)return;var d=null!=(r=null!=(n=l.find(function(e){return e===c}))?n:l.find(function(e){return p(e)===p(c)}))?r:c;if(!s.includes(d)){var b=v(h);if(b&&y(o,d,b))m=!0;else if("number"==typeof h&&isFinite(h))null==(i=e.onVariableUpdate)||i.call(e,["layer",a.id,d],h,f),m=!0;else if(Array.isArray(h)&&h.length<=3&&h.every(function(e){return"number"==typeof e&&isFinite(e)})){var w=["x","y","z"];h.forEach(function(r,n){var i;null==(i=e.onVariableUpdate)||i.call(e,["layer",a.id,d,w[n]],r,f)}),m=!0}}}()}catch(e){c=!0,h=e}finally{try{u||null==b.return||b.return()}finally{if(c)throw h}}}}()}catch(e){c=!0,h=e}finally{try{u||null==k.return||k.return()}finally{if(c)throw h}}}()}catch(e){b=!0,w=e}finally{try{g||null==M.return||M.return()}finally{if(b)throw w}}return m&&this.requestRender(),m}},{key:"deleteVariable",value:function(e){this.variables[e]&&delete this.variables[e]}},{key:"getVariable",value:function(e,r){if(Array.isArray(e)){if("mouse"===e[0])return null!=(n=null==(a=this.mouseProperty)?void 0:a[e[1]])?n:0;if("raycast"===e[0])return null!=(i=null==(o=this.raycastProperty)?void 0:o[e[1]])?i:0;var n,i,a,o,s,l=this.entityOpContext.scene.find(e[0]);if("width"===e[1]||"height"===e[1]||"depth"===e[1])return l.geometry.userData.parameters[e[1]];if(("position"===e[1]||"rotation"===e[1])&&e.length>2&&(null==l||null==(s=l.getPhysicsLocalMatrix)?void 0:s.call(l,rH)))return rH.decompose(rq,rY,rX),"position"===e[1]?rq[e[2]]:(rZ.setFromQuaternion(rY,l.rotation.order),rZ[e[2]]*h.Cc.RAD2DEG);for(var u=1;u<e.length;u++)l=l[e[u]];return"rotation"===e[1]&&(l*=h.Cc.RAD2DEG),l}for(var d in this.variables){if(void 0===r)break;var f,p=this.variables[d],v=null==(f=p.locations)?void 0:f.findIndex(function(e){return c.n.equal(e,r)});void 0!==v&&-1!==v&&p.locations.splice(v,1)}if("string"==typeof e){var y=e,m=e;do{if(m=y,void 0===this.variables[y])break;var g=this.variables[y].value;r&&void 0!==this.variables[m]&&this.variables[m].locations.push(r),y=g}while("string"==typeof y);return y}return e}},{key:"getVariables",value:function(){return this.variables}},{key:"getVariablesNames",value:function(){return this.data.variables.map(function(e){return e.data.name})}},{key:"getVariableByName",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.data.variables[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(s.data.name===e)return{variable:s.data,id:s.id}}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"getDynamicVariablePlayState",value:function(e){var r;return null==(r=this.variables[e])?void 0:r.dynamicVariablePlayState}},{key:"setDynamicVariablePlayState",value:function(e,r){void 0!==this.variables[e]&&(this.variables[e].dynamicVariablePlayState=r)}},{key:"getDynamicVariableToggleIsForward",value:function(e){var r;return null==(r=this.variables[e])?void 0:r.dynamicVariableToggleIsForward}},{key:"setDynamicVariableToggleIsForward",value:function(e,r){void 0!==this.variables[e]&&(this.variables[e].dynamicVariableToggleIsForward=r)}},{key:"resetLib",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=Object.entries(e.images)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=_(a.value,2),l=s[0],u=s[1];this.addImage(l,u.asset)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}var c=!0,h=!1,d=void 0;try{for(var f,p=Object.entries(e.audios)[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=_(f.value,2),y=v[0],m=v[1];this.addAudio(y,m.asset)}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}var g=!0,b=!1,w=void 0;try{for(var x,S=Object.entries(e.particles)[Symbol.iterator]();!(g=(x=S.next()).done);g=!0){var k=_(x.value,2),M=k[0],A=k[1];this.addParticle(M,A.asset)}}catch(e){b=!0,w=e}finally{try{g||null==S.return||S.return()}finally{if(b)throw w}}var O=!0,C=!1,P=void 0;try{for(var E,D=Object.entries(e.colors)[Symbol.iterator]();!(O=(E=D.next()).done);O=!0){var j=_(E.value,2),T=j[0],I=j[1];this.addColor(T,I.asset)}}catch(e){C=!0,P=e}finally{try{O||null==D.return||D.return()}finally{if(C)throw P}}var R=!0,B=!1,z=void 0;try{for(var L,F=Object.entries(e.fonts)[Symbol.iterator]();!(R=(L=F.next()).done);R=!0){var U=_(L.value,2),V=U[0],N=U[1];this.addFont(V,N.asset)}}catch(e){B=!0,z=e}finally{try{R||null==F.return||F.return()}finally{if(B)throw z}}var G=!0,W=!1,H=void 0;try{for(var q,Y=Object.entries(e.videos)[Symbol.iterator]();!(G=(q=Y.next()).done);G=!0){var X=_(q.value,2),Z=X[0],K=X[1];this.addVideo(Z,K.asset)}}catch(e){W=!0,H=e}finally{try{G||null==Y.return||Y.return()}finally{if(W)throw H}}var J=!0,Q=!1,$=void 0;try{for(var ee,et=Object.entries(e.variables)[Symbol.iterator]();!(J=(ee=et.next()).done);J=!0){var er=_(ee.value,2),en=er[0],ei=er[1];this.addVariableHolder(en,ei.asset)}}catch(e){Q=!0,$=e}finally{try{J||null==et.return||et.return()}finally{if(Q)throw $}}}},{key:"updateLibByOp",value:function(e,r){"images"===e.path[0]?1===e.path.length&&1===e.type?this.addImage(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteImage(e.id):"videos"===e.path[0]?1===e.path.length&&1===e.type?this.addVideo(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteVideo(e.id):"audios"===e.path[0]?1===e.path.length&&1===e.type?this.addAudio(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteAudio(e.id):"particles"===e.path[0]?1===e.path.length&&1===e.type?this.addParticle(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteParticle(e.id):"colors"===e.path[0]?1===e.path.length&&1===e.type?this.addColor(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteColor(e.id):"materials"===e.path[0]?1===e.path.length&&1===e.type?this.addMaterial(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteMaterial(e.id):"fonts"===e.path[0]?1===e.path.length&&1===e.type?this.addFont(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteFont(e.id):"variables"===e.path[0]?1===e.path.length&&1===e.type?this.addVariableHolder(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteVariable(e.id):"components"===e.path[0]&&r.updateByLibOp(e,this)}},{key:"updateByOp",value:function(e,r,n){if(this.data=r,"images"===e.path[0])2===e.path.length&&0===e.type?e.props.data&&this.getImage(e.path[1]).updateSrc(e.props.data):1===e.path.length&&1===e.type?this.addImage(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteImage(e.id);else if("videos"===e.path[0])2===e.path.length&&0===e.type?e.props.data&&this.getVideo(e.path[1]).updateSrc(e.props.data):1===e.path.length&&1===e.type?this.addVideo(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteVideo(e.id);else if("audios"===e.path[0])2===e.path.length&&0===e.type?e.props.data&&this.addAudio(e.path[1],r.audios[e.path[1]]):1===e.path.length&&1===e.type?this.addAudio(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteAudio(e.id);else if("particles"===e.path[0])2===e.path.length&&0===e.type?e.props.data&&this.addParticle(e.path[1],r.particles[e.path[1]]):1===e.path.length&&1===e.type?this.addParticle(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteParticle(e.id);else if("colors"===e.path[0])2===e.path.length&&0===e.type?this.updateColor(e.path[1],e.props):1===e.path.length&&1===e.type?this.addColor(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteColor(e.id);else if("materials"===e.path[0])1===e.path.length&&1===e.type?this.addMaterial(e.id,e.data):1===e.path.length&&2===e.type?this.deleteMaterial(e.id):e.path.length>1&&this.getMaterial(e.path[1]).updateByOp(c.k.drop(e,2),r.materials[e.path[1]],{shared:this,scene:n});else if("fonts"===e.path[0])2===e.path.length&&0===e.type?this.updateFont(e.path[1],e,n):1===e.path.length&&1===e.type?this.addFont(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteFont(e.id);else if("variables"===e.path[0])2===e.path.length&&0===e.type?"value"in e.props?this.updateVariable(e.path[1],e.props.value):"persistent"in e.props&&(this.variables[e.path[1]].persistent=e.props.persistent):1===e.path.length&&4===e.type?this.addVariableHolder(e.id,e.data):1===e.path.length&&5===e.type&&this.deleteVariable(e.id);else if("userAPIs"===e.path[0]){if(1===e.path.length&&1===e.type)this.addUserAPI(e.id,e.data);else if(1===e.path.length&&2===e.type)this.deleteUserAPI(e.id);else if("string"==typeof e.path[1]){var i=r.userAPIs[e.path[1]];if(i){var a=0===e.type&&void 0===e.props.debounce,o=this.getUserAPI(e.path[1]);void 0!==o&&o===this.openAIRealtime?o.update(i):null==o||o.update(i,this,a)}}}else if("userWebhooks"===e.path[0]){if(1===e.path.length&&1===e.type)this.addUserWebhook(e.id,e.data);else if(1===e.path.length&&2===e.type)this.deleteUserWebhook(e.id);else if("string"==typeof e.path[1]){var s,l=r.userWebhooks[e.path[1]];l&&(null==(s=this.getUserWebhook(e.path[1]))||s.update(l))}}else"lib"===e.path[0]&&this.updateLibByOp(c.k.drop(e,1),n)}},{key:"updateFont",value:function(e,r,n){var i=this;if(r.props.url){var a=this.getFont(e),o=A(M({},this.data.fonts[e]),{url:r.props.url});a.update(o),a.loadingPromise.then(function(){return i.requestRender()}),n.updateFont(e,this)}}},{key:"addUserAPI",value:function(e,r){if(this.userAPIs[e])return this.userAPIs[e].update(r,this),!0;if((null==(n=this.openAIRealtime)?void 0:n.id)===e)return this.openAIRealtime.update(r),!0;if("VoiceAssistant"===(null==(a=r.integration)?void 0:a.type)){var n,a,o=(0,i.d)();return null===o?(0,u.c)("ai-assistant","a voice-assistant integration"):this.openAIRealtime=o(r,e,this),!1}var s=(0,i.b)();return null===s?(0,u.c)("api-services","a user API integration"):this.userAPIs[e]=s.createUserAPI(e,r,this),!1}},{key:"getUserAPI",value:function(e){var r;return(null==(r=this.openAIRealtime)?void 0:r.id)===e?this.openAIRealtime:this.userAPIs[e]}},{key:"getUserAPIs",value:function(){return this.userAPIs}},{key:"deleteUserAPI",value:function(e){var r=this.userAPIs[e];r&&(r.dispose(),delete this.userAPIs[e])}},{key:"addUserWebhook",value:function(e,r){if(this.userWebhooks[e])return this.userWebhooks[e].update(r),!0;var n=(0,i.b)();return null===n?(0,u.c)("api-services","a user webhook"):this.userWebhooks[e]=n.createUserWebhook(e,r),!1}},{key:"getUserWebhook",value:function(e){return this.userWebhooks[e]}},{key:"getUserWebhooks",value:function(){return this.userWebhooks}},{key:"deleteUserWebhook",value:function(e){var r=this.userWebhooks[e];r&&(r.dispose(),delete this.userWebhooks[e])}},{key:"scene",get:function(){return this.entityOpContext.scene}}]),e}(),r$=rQ;function r0(e){return!0===(null==e?void 0:e.isClassicNodeMaterial)}function r1(e){return r0(e)||!0===(null==e?void 0:e.isTSLNodeMaterial)}r$.MAX_TRANSIENT_VERTICES=6e4,new r$(c.Ha.emptyData());var r2=function(e){function r(){return y(this,r),v(this,r,arguments)}return S(r,e),b(r,[{key:"setMaterialOverride",value:function(e,r){this.materialOverride=td(e),this.material!==this.shadowCatcherMaterial&&(this.disposeMaterial(),this.material=this.materialOverride,this.layers.set(0),this.syncShapeBlendNodeLayer(),r.scene.markNeedsUpdateRendererDirty())}},{key:"updateByPatchedOp",value:function(e,n,i){var a=!0,s=!1,l=void 0;if(w(x(r.prototype),"updateByPatchedOp",this).call(this,e,n,i),(0,o.b)(e.path,["geometry"])&&this.syncShadowCatcher(i),null!==(0,o.a)(e.path,["materials"])&&0===e.type&&Array.isArray(this.material))try{for(var u,h=Object.entries(e.props)[Symbol.iterator]();!(a=(u=h.next()).done);a=!0){var d=_(u.value,2),f=d[0],p=d[1],v=this.material[Number(f)],y=i.shared.material(p);y!==v&&r2.disposeOneMaterial(v),this.material[Number(f)]=y}}catch(e){s=!0,l=e}finally{try{a||null==h.return||h.return()}finally{if(s)throw l}}else if((0,o.b)(e.path,["material"])){var m=this.material;!Array.isArray(m)&&"function"==typeof(null==m?void 0:m.updateByOp)&&"material"in n&&"string"!=typeof n.material&&m.updateByOp(c.k.drop(e,1),n.material,i)}else if((0,o.b)(e.path,["materials","*"])&&Array.isArray(this.material)){var g=e.path[1];if("materials"in n&&g<this.material.length){var b=n.materials[g];"string"!=typeof b&&this.material[g].updateByOp(c.k.drop(e,2),b,i)}}}},{key:"needsAO",get:function(){return void 0!==this.material&&(Array.isArray(this.material)?this.material[0]:this.material).hasAO}},{key:"syncShapeBlendNodeLayer",value:function(){"Mesh"===this.dataPatched.type&&this.dataPatched.geometry.shapeBlendNode?this.layers.set(9):512&this.layers.mask&&this.layers.set(0)}},{key:"updateState",value:function(e,n){w(x(r.prototype),"updateState",this).call(this,e,n),void 0!==e.castShadow&&(this.castShadow=e.castShadow),void 0!==e.receiveShadow&&(this.receiveShadow=e.receiveShadow);var i,a,o,s,l=this.dataPatched;this.syncShapeBlendNodeLayer(),"Mesh"===this.dataPatched.type&&"ShapeBlendGeometry"===this.dataPatched.geometry.type&&(s={resolutionLevel:Math.min(8,this.dataPatched.geometry.resolutionLevel),useChildrenColors:this.dataPatched.geometry.useChildrenColors});var u=void 0!==this.materialOverride;!u&&"NonParametricGeometry"!==(null==(i=e.geometry)?void 0:i.type)&&"material"in e&&void 0!==e.material&&(this.disposeMaterial(),this.material=n.shared.material(e.material).getFlavor(l.flatShading,l.side,l.wireframe,s),n.scene.markNeedsUpdateRendererDirty()),!u&&("NonParametricGeometry"===(null==(a=e.geometry)?void 0:a.type)||"materials"in e)&&("materials"in e&&void 0!==e.materials?(this.disposeMaterial(),this.material=e.materials.map(function(e){return n.shared.material(e).getFlavor(l.flatShading,l.side,l.wireframe)}),n.scene.markNeedsUpdateRendererDirty()):"material"in e&&void 0!==e.material&&(this.disposeMaterial(),this.material=[n.shared.material(e.material).getFlavor(l.flatShading,l.side,l.wireframe)],n.scene.markNeedsUpdateRendererDirty()));var c=this.data;if(!u&&"NonParametricGeometry"!==(null==(o=c.geometry)?void 0:o.type)&&"materials"in c&&void 0!==c.materials&&(this.disposeMaterial(),this.material=n.shared.material(c.materials[0]).getFlavor(l.flatShading,l.side,l.wireframe)),!u&&(void 0!==e.flatShading||void 0!==e.wireframe||void 0!==e.side))if(Array.isArray(this.material))for(var h=0;h<this.material.length;h++)this.material[h]=this.material[h].getFlavor(l.flatShading,l.side,l.wireframe);else this.material=this.material.getFlavor(l.flatShading,l.side,l.wireframe,s);this.syncShadowCatcher(n)}},{key:"shadowCatcherActive",value:function(){var e,r=this.dataPatched,n=null==(e=r.geometry)?void 0:e.type;return!0===r.shadowCatcher&&("RectangleGeometry"===n||"PlaneGeometry"===n)}},{key:"syncShadowCatcher",value:function(e){var r=this.dataPatched;if(this.shadowCatcherActive()){if(void 0===this.shadowCatcherMaterial){var n,i=void 0===(n="webgpu"===tn&&void 0!==e8?e8:e9)?null:td(n());if(null===i)return;this.shadowCatcherMaterial=i}this.shadowCatcherMaterial.side=r.side,this.material!==this.shadowCatcherMaterial&&(this.disposeMaterial(),this.material=this.shadowCatcherMaterial,e.scene.markNeedsUpdateRendererDirty()),this.castShadow=!1,this.receiveShadow=!0,this.layers.set(0)}else void 0!==this.shadowCatcherMaterial&&this.material===this.shadowCatcherMaterial&&(void 0!==this.materialOverride?(this.material=this.materialOverride,e.scene.markNeedsUpdateRendererDirty()):"material"in r&&void 0!==r.material&&(this.material=e.shared.material(r.material).getFlavor(r.flatShading,r.side,r.wireframe),e.scene.markNeedsUpdateRendererDirty(),this.needsAO&&this.layers.enable(5)),this.castShadow=r.castShadow,this.receiveShadow=r.receiveShadow)}},{key:"disposeMaterial",value:function(){this.material&&(0,c.a)(this.material).forEach(function(e){r2.disposeOneMaterial(e)})}},{key:"dispose",value:function(){var e;this.disposeMaterial(),null==(e=this.shadowCatcherMaterial)||e.dispose(),w(x(r.prototype),"dispose",this).call(this)}}],[{key:"disposeOneMaterial",value:function(e){r1(e)&&!0!==(null==e?void 0:e.isClassicSharedMaterial)&&!0!==(null==e?void 0:e.isTSLSharedMaterial)&&e.nodeMaterialDispose()}}]),r}(o.v),r3=new h.Fc,r5=new h.Jc,r4=new h.Jc,r6=new h.Fc,r8=new h.Oc,r9=function(e){function r(e,n,i){var a;return y(this,r),(a=v(this,r,[e,n])).data=n,a.isSkinnedMesh=!1,a.localGeometry=void 0,n.bindMode&&n.bindMatrix&&(a.bindMode=n.bindMode,a.bindMatrix=(new h.Oc).fromArray(n.bindMatrix),a.bindMatrixInverse=new h.Oc),a}return S(r,e),b(r,[{key:"chooseGeoemtryCache",value:function(e){return e.geometryCache}},{key:"supportsInPlaceGeometryUpdate",value:function(e){return!0!==e.isTextGeometry}},{key:"markGeometryAsReachable",value:function(e){k(this.geometryCreateDeleyed,h.dd)&&this.chooseGeoemtryCache(e).markAsReachable(this.dataPatched.geometry,this.geometryCreateDeleyed)}},{key:"builtSharedGeometry",get:function(){if(void 0===this.localGeometry)return k(this.geometryCreateDeleyed,h.dd)?this.geometryCreateDeleyed:void 0}},{key:"geometry",get:function(){if(void 0!==this.localGeometry)return this.localGeometry;if(k(this.geometryCreateDeleyed,r$)){var e=this.geometryCreateDeleyed,r=this.chooseGeoemtryCache(e),n=this.dataPatched.geometry;this.geometryCreateDeleyed=r.get(n,e,this),this._geometryCacheKey=n}return this.geometryCreateDeleyed},set:function(e){this.localGeometry=e}},{key:"is2DAndNoDepth",get:function(){var e=this.dataPatched.geometry;return c.ma.is2DParametricMesh(e.type)&&0===e.depth}},{key:"is2DType",get:function(){return c.ma.is2DParametricMesh(this.geometry.userData.type)}},{key:"isTextType",get:function(){return!0===this.geometry.isTextGeometry}},{key:"isNonParametric",get:function(){return"NonParametricGeometry"===this.geometry.userData.type}},{key:"updateByPatchedOp",value:function(e,n,i){w(x(r.prototype),"updateByPatchedOp",this).call(this,e,n,i),(0,o.b)(e.path,["geometry"])&&this.updateByPatchedOpGeometry(c.k.drop(e,1),n.geometry,i)}},{key:"removeInteractionGeometry",value:function(e){var r;null==(r=this.localGeometry)||r.dispose(),this.localGeometry=void 0}},{key:"dispose",value:function(){var e;w(x(r.prototype),"dispose",this).call(this),e=this.uuid,eJ.delete(e)}},{key:"appliedGeometrySize",get:function(){var e,r=null==(e=this.localGeometry)?void 0:e.userData;if(void 0!==r&&void 0!==r.sxPrev)return[r.sxPrev,r.syPrev,r.szPrev]}},{key:"updateGeometryInteractions",value:function(e,r){this.invalidateDownstreamBooleanData();var n=this.data.geometry.type;if("NonParametricGeometry"===n||"SubdivGeometry"===n){if(void 0===this.localGeometry){var i,a,o,s,l=M({},this.data.geometry,e);this.localGeometry=rf(l,r,this.data.flatShading,this)}e.scaleBaked?(a=(i=_(e.scaleBaked,3))[0],o=i[1],s=i[2]):(a=e.width,o=e.height,s=e.depth);var u=this.localGeometry.userData,c="number"==typeof a?a:1,h="number"==typeof o?o:1,d="number"==typeof s?s:1;void 0!==u.sxPrev&&ry(this.localGeometry.attributes,c/u.sxPrev,h/u.syPrev,d/u.szPrev),u.sxPrev=c,u.syPrev=h,u.szPrev=d}else if(!this.absorbDepthInteraction(e)){var f,p=rf(M({},this.data.geometry,e),r,this.data.flatShading,this);void 0!==this.localGeometry&&this.supportsInPlaceGeometryUpdate(this.localGeometry)&&rv(this.localGeometry,p)?p.dispose():(null==(f=this.localGeometry)||f.dispose(),this.localGeometry=p)}}},{key:"absorbDepthInteraction",value:function(e){var r=this.localGeometry;if(void 0===(null==r?void 0:r.shiftDepthTo)||"number"!=typeof e.depth)return!1;var n=null==(s=r.userData)?void 0:s.parameters;if(void 0===n)return!1;var i=!0,a=!1,o=void 0;try{for(var s,l,u=Object.keys(e)[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;if("depth"!==c&&e[c]!==n[c])return!1}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return!!r.shiftDepthTo(e.depth)&&(n.depth=e.depth,!0)}},{key:"refreshAttachedClonersInteractions",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.attachedSurfaceCloners[Symbol.iterator]();!(r=(a=o.next()).done);r=!0)a.value.update(e)}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"refreshAttachedCloners",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.attachedSurfaceCloners[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;e.scene.addPendingUpdateCloner(s.object)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"refreshAttachedPaths",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.attachedPaths[Symbol.iterator]();!(r=(a=o.next()).done);r=!0)!function(){var r=a.value;e.scene.addPendingCommand(function(){return r.updateShape()})}()}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"createGeometryDelayed",value:function(e){this.geometryCreateDeleyed=e.shared,this.refreshAttachedCloners(e),this.refreshAttachedPaths(e)}},{key:"updateByPatchedOpGeometry",value:function(e,r,n){var i,a=!1;if(0===e.type&&0===e.path.length&&Object.keys(e.props).includes("scaleBaked")&&k(this.geometryCreateDeleyed,rO)&&this.chooseGeoemtryCache(n.shared).mutateIfUnique(this.geometryCreateDeleyed.data,r)===this.geometryCreateDeleyed&&(a=!0,this.geometryCreateDeleyed.mutateDirectlyScaleBaked(r,e.props.scaleBaked),this.refreshAttachedCloners(n),this.refreshAttachedPaths(n)),!a&&0===e.type&&0===e.path.length&&rC(e.props)&&k(this.geometryCreateDeleyed,rO)&&this.chooseGeoemtryCache(n.shared).mutateIfUnique(this.geometryCreateDeleyed.data,r)===this.geometryCreateDeleyed&&(a=!0,this.geometryCreateDeleyed.mutateDirectlySubdivisions(r),this.refreshAttachedCloners(n),this.refreshAttachedPaths(n)),!a&&0===e.type&&0===e.path.length&&k(this.geometryCreateDeleyed,h.dd)&&!k(this.geometryCreateDeleyed,rO)&&this.supportsInPlaceGeometryUpdate(this.geometryCreateDeleyed)&&void 0!==this._geometryCacheKey){var o=n.shared,s=this.chooseGeoemtryCache(o),l=this.geometryCreateDeleyed;if(s.getCached(this._geometryCacheKey)===l&&!0!==l.isShared){var u=this.dataPatched.geometry,c=rf(u,o,this.data.flatShading,this);rv(l,c)?(c.dispose(),l.computeBoundingSphere(),s.mutateIfUnique(this._geometryCacheKey,u)):(c.computeBoundingSphere(),s.forceDelete(this._geometryCacheKey),s.adopt(u,c),this.geometryCreateDeleyed=c),this._geometryCacheKey=u,a=!0,this.refreshAttachedCloners(n),this.refreshAttachedPaths(n)}}a||(null==(i=n.scene)||i.markGeometryCacheDirty(),this.createGeometryDelayed(n)),this.syncShapeBlendNodeLayer(),this.resetBBoxNeedsUpdate(),this.invalidateDownstreamBooleanData()}},{key:"updateGeometryOnStateUpdate",value:function(e,r){this.createGeometryDelayed(r)}},{key:"applyTransientGeometryData",value:function(e,r){var n,i=e.shared,a=this.dataPatched.geometry;if(k(this.geometryCreateDeleyed,h.dd)&&!k(this.geometryCreateDeleyed,rO)&&this.supportsInPlaceGeometryUpdate(this.geometryCreateDeleyed)&&void 0!==this._geometryCacheKey){var o=this.chooseGeoemtryCache(i),s=this.geometryCreateDeleyed;if(o.getCached(this._geometryCacheKey)===s&&!0!==s.isShared){var l=rf(a,i,this.data.flatShading,this);return rv(s,l)?(l.dispose(),s.computeBoundingSphere(),o.mutateIfUnique(this._geometryCacheKey,a)):(l.computeBoundingSphere(),o.forceDelete(this._geometryCacheKey),o.adopt(a,l),this.geometryCreateDeleyed=l),this._geometryCacheKey=a,this.refreshAttachedCloners(e),void this.refreshAttachedPaths(e)}}r&&void 0!==this._geometryCacheKey&&this.chooseGeoemtryCache(i).forceDelete(this._geometryCacheKey),null==(n=e.scene)||n.markGeometryCacheDirty(),this.createGeometryDelayed(e)}},{key:"updateState",value:function(e,n){void 0!==e.geometry&&this.updateGeometryOnStateUpdate(e.geometry,n);var i=e.morphTargetInfluences;if(i){this.updateMorphTargets(),this.geometry.morphTargetsRelative=!0;var a=!0,o=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value.data,h=c.name,d=c.value;this.updateMorphInfluences(h,n.shared.getVariable(d,[this.uuid,"morphTargetInfluences",h]))}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}}w(x(r.prototype),"updateState",this).call(this,e,n)}},{key:"updateMorphInfluences",value:function(e,r){if(void 0!==this.morphTargetDictionary){var n=this.morphTargetDictionary[e];void 0!==n&&(this.morphTargetInfluences[n]=r)}}},{key:"updateGeometryGroupsIfNeeded",value:function(){var e,r;Array.isArray(this.material)&&0===this.geometry.groups.length&&this.geometry.addGroup(0,Math.max(null!=(e=null==(r=this.geometry.getIndex())?void 0:r.count)?e:0,this.geometry.getAttribute("position").count),0)}},{key:"updateEntityBoxSize",value:function(e,r){var n,i,a=this.geometry.userData.parameters;this.is2DType||this.isTextType?e.set(0,0,.5*a.depth):this.isNonParametric?(e.setScalar(0),this.geometry.boundingSphere&&e.copy(this.geometry.boundingSphere.center),r.set(a.width,a.height,null!=(n=a.depth)?n:0).multiplyScalar(.5)):a.centerOffset?e.fromArray(a.centerOffset):e.setScalar(0),r.set(a.width,a.height,null!=(i=a.depth)?i:0).multiplyScalar(.5)}},{key:"updateMatrixWorld",value:function(e){w(x(r.prototype),"updateMatrixWorld",this).call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode&&this.bindMatrixInverse.copy(this.bindMatrix).invert()}},{key:"bind",value:function(e,r){this.skeleton=e,this.isSkinnedMesh=!0,void 0===r&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),r=this.matrixWorld),this.bindMatrix.copy(r),this.bindMatrixInverse.copy(r).invert()}},{key:"pose",value:function(){this.skeleton.pose()}},{key:"normalizeSkinWeights",value:function(e){for(var r=new h.Jc,n=this.geometry.attributes.skinWeight,i=0,a=n.count;i<a;i++){r.fromBufferAttribute(n,i);var o=1/r.manhattanLength();o!==1/0?r.multiplyScalar(o):r.set(1,0,0,0),n.setXYZW(i,r.x,r.y,r.z,r.w)}}},{key:"boneTransform",value:function(e,r){var n=this.skeleton;if(void 0!==n){var i=this.geometry;r5.fromBufferAttribute(i.attributes.skinIndex,e),r4.fromBufferAttribute(i.attributes.skinWeight,e),r3.copy(r).applyMatrix4(this.bindMatrix),r.set(0,0,0);for(var a=0;a<4;a++){var o=r4.getComponent(a);if(0!==o){var s=r5.getComponent(a);r8.multiplyMatrices(n.bones[s].matrixWorld,n.boneInverses[s]),r.addScaledVector(r6.copy(r3).applyMatrix4(r8),o)}}return r.applyMatrix4(this.bindMatrixInverse)}}}]),r}(r2)},7410(e,r,n){n.d(r,{a:()=>M,b:()=>g,c:()=>C,d:()=>j,e:()=>T,f:()=>I,g:()=>R});var i=n(461),a=n(3940);function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function s(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function l(e,r,n){return(l=y()?Reflect.construct:function(e,r,n){var i=[null];i.push.apply(i,r);var a=new(Function.bind.apply(e,i));return n&&d(a,n.prototype),a}).apply(null,arguments)}function u(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function c(e,r,n){return r&&u(e.prototype,r),n&&u(e,n),e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,r){return(d=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function f(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function p(e,r){if(e){if("string"==typeof e)return o(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,r)}}function v(e){var r="function"==typeof Map?new Map:void 0;return(v=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return l(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)})(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}var m=new Map;function g(e,r){m.set(e,r)}var b=function(){function e(r){s(this,e),this.expr=r,this.index=0}return c(e,[{key:"char",get:function(){return this.expr.charAt(this.index)}},{key:"code",get:function(){return this.expr.charCodeAt(this.index)}},{key:"throwError",value:function(e){var r=Error(e+" at character "+this.index);throw r.index=this.index,r.description=e,r}},{key:"runHook",value:function(e,r){if(b.hooks[e]){var n={context:this,node:r};return b.hooks.run(e,n),n.node}return r}},{key:"searchHook",value:function(e){if(b.hooks[e]){var r={context:this};return b.hooks[e].find(function(e){return e.call(r.context,r),r.node}),r.node}}},{key:"gobbleSpaces",value:function(){for(var e=this.code;e===b.SPACE_CODE||e===b.TAB_CODE||e===b.LF_CODE||e===b.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}},{key:"parse",value:function(){this.runHook("before-all");var e=this.gobbleExpressions(),r=1===e.length?e[0]:{type:b.COMPOUND,body:e};return this.runHook("after-all",r)}},{key:"gobbleExpressions",value:function(e){for(var r,n,i=[];this.index<this.expr.length;)if((r=this.code)===b.SEMCOL_CODE||r===b.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())i.push(n);else if(this.index<this.expr.length){if(r===e)break;this.throwError('Unexpected "'+this.char+'"')}return i}},{key:"gobbleExpression",value:function(){var e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}},{key:"gobbleBinaryOp",value:function(){this.gobbleSpaces();for(var e=this.expr.substr(this.index,b.max_binop_len),r=e.length;r>0;){if(b.binary_ops.hasOwnProperty(e)&&(!b.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!b.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=r,e;e=e.substr(0,--r)}return!1}},{key:"gobbleBinaryExpression",value:function(){var e,r,n,i,a,o,s,l,u,c;if(!(o=this.gobbleToken())||!(r=this.gobbleBinaryOp()))return o;for(a={value:r,prec:b.binaryPrecedence(r),right_a:b.right_associative.has(r)},(s=this.gobbleToken())||this.throwError("Expected expression after "+r),i=[o,a,s];r=this.gobbleBinaryOp();){if(0===(n=b.binaryPrecedence(r))){this.index-=r.length;break}for(a={value:r,prec:n,right_a:b.right_associative.has(r)},u=r;i.length>2&&(c=i[i.length-2],a.right_a&&c.right_a?n>c.prec:n<=c.prec);)s=i.pop(),r=i.pop().value,o=i.pop(),e={type:b.BINARY_EXP,operator:r,left:o,right:s},i.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+u),i.push(a,e)}for(l=i.length-1,e=i[l];l>1;)e={type:b.BINARY_EXP,operator:i[l-1].value,left:i[l-2],right:e},l-=2;return e}},{key:"gobbleToken",value:function(){var e,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"))return this.runHook("after-token",i);if(e=this.code,b.isDecimalDigit(e)||e===b.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===b.SQUOTE_CODE||e===b.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(e===b.OBRACK_CODE)i=this.gobbleArray();else{for(n=(r=this.expr.substr(this.index,b.max_unop_len)).length;n>0;){if(b.unary_ops.hasOwnProperty(r)&&(!b.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!b.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;var a=this.gobbleToken();return a||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:b.UNARY_EXP,operator:r,argument:a,prefix:!0})}r=r.substr(0,--n)}b.isIdentifierStart(e)?(i=this.gobbleIdentifier(),b.literals.hasOwnProperty(i.name)?i={type:b.LITERAL,value:b.literals[i.name],raw:i.name}:i.name===b.this_str&&(i={type:b.THIS_EXP})):e===b.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}},{key:"gobbleTokenProperty",value:function(e){this.gobbleSpaces();for(var r=this.code;r===b.PERIOD_CODE||r===b.OBRACK_CODE||r===b.OPAREN_CODE||r===b.QUMARK_CODE;){var n=void 0;if(r===b.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==b.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===b.OBRACK_CODE?(e={type:b.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},this.gobbleSpaces(),(r=this.code)!==b.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===b.OPAREN_CODE?e={type:b.CALL_EXP,arguments:this.gobbleArguments(b.CPAREN_CODE),callee:e}:(r===b.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:b.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),r=this.code}return e}},{key:"gobbleNumericLiteral",value:function(){for(var e,r,n="";b.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(this.code===b.PERIOD_CODE)for(n+=this.expr.charAt(this.index++);b.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if("e"===(e=this.char)||"E"===e){for(n+=this.expr.charAt(this.index++),("+"===(e=this.char)||"-"===e)&&(n+=this.expr.charAt(this.index++));b.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);b.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")")}return r=this.code,b.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+n+this.char+")"):(r===b.PERIOD_CODE||1===n.length&&n.charCodeAt(0)===b.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:b.LITERAL,value:parseFloat(n),raw:n}}},{key:"gobbleStringLiteral",value:function(){for(var e="",r=this.index,n=this.expr.charAt(this.index++),i=!1;this.index<this.expr.length;){var a=this.expr.charAt(this.index++);if(a===n){i=!0;break}if("\\"===a)switch(a=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=a}else e+=a}return i||this.throwError('Unclosed quote after "'+e+'"'),{type:b.LITERAL,value:e,raw:this.expr.substring(r,this.index)}}},{key:"gobbleIdentifier",value:function(){var e=this.code,r=this.index;for(b.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,b.isIdentifierPart(e));)this.index++;return{type:b.IDENTIFIER,name:this.expr.slice(r,this.index)}}},{key:"gobbleArguments",value:function(e){for(var r=[],n=!1,i=0;this.index<this.expr.length;){this.gobbleSpaces();var a=this.code;if(a===e){n=!0,this.index++,e===b.CPAREN_CODE&&i&&i>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(a===b.COMMA_CODE){if(this.index++,++i!==r.length){if(e===b.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===b.CBRACK_CODE)for(var o=r.length;o<i;o++)r.push(null)}}else if(r.length!==i&&0!==i)this.throwError("Expected comma");else{var s=this.gobbleExpression();s&&s.type!==b.COMPOUND||this.throwError("Expected comma"),r.push(s)}}return n||this.throwError("Expected "+String.fromCharCode(e)),r}},{key:"gobbleGroup",value:function(){this.index++;var e=this.gobbleExpressions(b.CPAREN_CODE);if(this.code===b.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:b.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}},{key:"gobbleArray",value:function(){return this.index++,{type:b.ARRAY_EXP,elements:this.gobbleArguments(b.CBRACK_CODE)}}}],[{key:"version",get:function(){return"1.3.8"}},{key:"toString",value:function(){return"JavaScript Expression Parser (JSEP) v"+b.version}},{key:"addUnaryOp",value:function(e){return b.max_unop_len=Math.max(e.length,b.max_unop_len),b.unary_ops[e]=1,b}},{key:"addBinaryOp",value:function(e,r,n){return b.max_binop_len=Math.max(e.length,b.max_binop_len),b.binary_ops[e]=r,n?b.right_associative.add(e):b.right_associative.delete(e),b}},{key:"addIdentifierChar",value:function(e){return b.additional_identifier_chars.add(e),b}},{key:"addLiteral",value:function(e,r){return b.literals[e]=r,b}},{key:"removeUnaryOp",value:function(e){return delete b.unary_ops[e],e.length===b.max_unop_len&&(b.max_unop_len=b.getMaxKeyLen(b.unary_ops)),b}},{key:"removeAllUnaryOps",value:function(){return b.unary_ops={},b.max_unop_len=0,b}},{key:"removeIdentifierChar",value:function(e){return b.additional_identifier_chars.delete(e),b}},{key:"removeBinaryOp",value:function(e){return delete b.binary_ops[e],e.length===b.max_binop_len&&(b.max_binop_len=b.getMaxKeyLen(b.binary_ops)),b.right_associative.delete(e),b}},{key:"removeAllBinaryOps",value:function(){return b.binary_ops={},b.max_binop_len=0,b}},{key:"removeLiteral",value:function(e){return delete b.literals[e],b}},{key:"removeAllLiterals",value:function(){return b.literals={},b}},{key:"parse",value:function(e){return new b(e).parse()}},{key:"getMaxKeyLen",value:function(e){var r,n;return(r=Math).max.apply(r,[0].concat(function(e){if(Array.isArray(e))return o(e)}(n=Object.keys(e).map(function(e){return e.length}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||p(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))}},{key:"isDecimalDigit",value:function(e){return e>=48&&e<=57}},{key:"binaryPrecedence",value:function(e){return b.binary_ops[e]||0}},{key:"isIdentifierStart",value:function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!b.binary_ops[String.fromCharCode(e)]||b.additional_identifier_chars.has(String.fromCharCode(e))}},{key:"isIdentifierPart",value:function(e){return b.isIdentifierStart(e)||b.isDecimalDigit(e)}}]),e}();Object.assign(b,{hooks:new(function(){function e(){s(this,e)}return c(e,[{key:"add",value:function(e,r,n){if("string"!=typeof arguments[0])for(var i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],r&&this[e][n?"unshift":"push"](r)},this)}},{key:"run",value:function(e,r){this[e]=this[e]||[],this[e].forEach(function(e){e.call(r&&r.context?r.context:r,r)})}}]),e}()),plugins:new(function(){function e(r){s(this,e),this.jsep=r,this.registered={}}return c(e,[{key:"register",value:function(){for(var e=this,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach(function(r){if("object"!=(void 0===r?"undefined":f(r))||!r.name||!r.init)throw Error("Invalid JSEP plugin format");e.registered[r.name]||(r.init(e.jsep),e.registered[r.name]=r)})}}]),e}())(b),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),b.max_unop_len=b.getMaxKeyLen(b.unary_ops),b.max_binop_len=b.getMaxKeyLen(b.binary_ops);var w=function(e){return new b(e).parse()};Object.getOwnPropertyNames(b).forEach(function(e){void 0===w[e]&&"prototype"!==e&&(w[e]=b[e])}),w.Jsep=b,w.plugins.register({name:"ternary",init:function(e){e.hooks.add("after-expression",function(r){if(r.node&&this.code===e.QUMARK_CODE){this.index++;var n=r.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;var a=this.gobbleExpression();if(a||this.throwError("Expected expression"),r.node={type:"ConditionalExpression",test:n,consequent:i,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){for(var o=n;o.right.operator&&e.binary_ops[o.right.operator]<=.9;)o=o.right;r.node.test=o.right,o.right=r.node,r.node=n}}else this.throwError("Expected :")}})}});var x=["+","-","*","/","(",")","==","!=",">","<",">=","<=","and","or","!","%","^",","],S=["0","1","2","3","4","5","6","7","8","9","."],k=["sin","cos","tan","asin","acos","atan","atan2","sqrt","abs","log","exp","floor","ceil","round","min","max","random"];function M(e,r){for(var n,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",s="",l=0;l<e.length;l++){var u=function(n){var i,l=e[n];if("objType"in l&&"api"===l.objType){var u=JSON.parse(l.id),c=u[0],h=r.getUserAPI(c);if(void 0!==h&&"function"==typeof h.retrieveValue){var d=h.retrieveValue(u.slice(1));void 0!==d&&(s+=d)}return"continue"}if("objType"in l&&"webhook"===l.objType){var f,v=function(e){if(Array.isArray(e))return e}(f=JSON.parse(l.id))||function(e){var r,n,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw n}}return a}}(f)||p(f,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=v[0],m=v[1],g=r.getUserWebhook(y);if(void 0!==g){var b=g.getParameterValue(m);void 0!==b&&(s+=b)}return"continue"}if("objType"in l&&"aiAssistant"===l.objType){var w,M=r.openAIRealtime;if("objId"in l&&void 0!==l.objId){var A=void 0;if(r.scene.data.objects.traverse(function(e,r){var n,i=null==(n=r.events)?void 0:n.find(function(e){return e.id===l.objId});i&&(A=i)}),void 0!==A&&"AIAssistantListener"===A.data.type){var O=null==M?void 0:M.computeAnalysisForListenerEvent(A.data);if(void 0!==O)return s+=O,"continue"}}return s+=null!=(w=null==M?void 0:M.voice)?w:0,"continue"}if("id"in l){var C=e[n-1];if(n>0&&"id"in C)return{v:void console.error("Two variables in a row",e)};var _=r.getVariable(l.id),P=a.Ga.getDisplayedValue(_);return"number"===o&&a.Ga.isTextValue(_)&&Array.isArray(_.textValue)&&1===_.textValue.length?P=parseFloat(P).toString():"boolean"===o&&a.Ga.isBoolean(_)?P=_?"true":"false":"boolean"===o&&a.Ga.isTextValue(_)&&!Array.isArray(_.textValue)&&(P='"'+P+'"'),s+=P,"continue"}"string"!==o?"and"!==l.name?"or"!==l.name?"True"!==l.name?"False"!==l.name?"boolean"!==o||"string"==typeof(i=l.name)&&!isNaN(i)&&!isNaN(parseFloat(i))||S.includes(l.name)||x.includes(l.name)||k.includes(l.name.replace(/\($/g,""))?s+=l.name:s+='"'+l.name+'"':s+="false":s+="true":s+="||":s+="&&":('"'!==l.name&&("+"!==l.name||l.escaped)&&(s+=l.name),"+"!==l.name||l.escaped||"\\"!==s[s.length-1]||(s=s.slice(0,-1)+l.name))}(l);if("object"===f(u))return u.v}if("string"===o)return s;if(0===e.length){if("number"===o)return 0;if("boolean"===o)return!1}try{n=w(s)}catch(e){return void console.error(s,e)}try{i=function e(r){switch(r.type){case"BinaryExpression":switch(r.operator){case"==":return Number(e(r.left)===e(r.right));case"!=":return Number(e(r.left)!==e(r.right));case">":return Number(e(r.left)>e(r.right));case">=":return Number(e(r.left)>=e(r.right));case"<":return Number(e(r.left)<e(r.right));case"<=":return Number(e(r.left)<=e(r.right));case"+":return e(r.left)+e(r.right);case"-":return e(r.left)-e(r.right);case"*":return e(r.left)*e(r.right);case"/":return e(r.left)/e(r.right);case"%":return e(r.left)%e(r.right);case"&&":return e(r.left)&&e(r.right);case"||":return e(r.left)||e(r.right);case"^":return Math.pow(e(r.left),e(r.right));default:throw Error("Unknown operator: "+r.operator)}case"UnaryExpression":switch(r.operator){case"-":return-e(r.argument);case"!":return Number(!e(r.argument));default:throw Error("Unknown operator: "+r.operator)}case"Identifier":throw Error("Unknown identifier: "+r.name);case"Literal":return r.value;case"CallExpression":if("Identifier"===r.callee.type){if("random"===r.callee.name){var n=0,i=1;if(r.arguments.length>=1)try{n=e(r.arguments[0])}catch(e){console.warn(e)}if(r.arguments.length>=2)try{i=e(r.arguments[1])}catch(e){console.warn(e)}return n=Math.min(i,n),i=Math.max(i,n),n+Math.random()*(i-n)}return Math[r.callee.name].apply(null,r.arguments.map(e))}throw Error("Unknown node");default:throw Error("Unknown node type: "+r.type)}}(n)}catch(e){console.error(s,n,e)}return i}w.addBinaryOp("^",11,!0);var A={mousehover:!0,scroll:!0,dragdrop:!0,tracking:!0,resize:!0,conditional:!0,variables:!0,"api-services":!0,"ai-assistant":!0,textinputs:!0,audio:!0,video:!0,"create-destroy":!0,"scene-transition":!0,timeline:!0,transitions:!0,"misc-actions":!0},O=Object.keys(A),C={MouseHover:"mousehover",Scroll:"scroll",DragDrop:"dragdrop",Follow:"tracking",LookAt:"tracking",Resize:"resize",Conditional:"conditional",VariableChange:"variables",API:"api-services",WEBHOOK:"api-services",AIAssistantListener:"ai-assistant",AIAssistantTrigger:"ai-assistant"},_={Audio:"audio",Video:"video",Particles:"particles",Link:"misc-actions",Reset:"misc-actions",SwitchCamera:"misc-actions",ClearLocalStorage:"misc-actions",Create:"create-destroy",Destroy:"create-destroy",Transition:"transitions",Animation:"transitions",TimelineAnimation:"timeline",SceneTransition:"scene-transition",SetVariable:"variables",DynamicVariablePlay:"variables",UserAPI:"api-services"};function P(e){return"object"==(void 0===e?"undefined":f(e))&&null!==e}var E=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,n;return s(this,r),e=r,n=arguments,e=h(e),function(e,r){if(r&&("object"===f(r)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,y()?Reflect.construct(e,n||[],h(this).constructor):e.apply(this,n))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&d(r,e),r}(v(Error));function D(e,r){void 0!==r&&r in A&&e.add(r)}function j(e,r){var n=new Set,i=function(e){if(void 0!==e){if(!Array.isArray(e))throw new E;var r=!0,n=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;if(!P(l))throw new E;a(l.data)}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}}},a=function(e){if(!P(e)||"string"!=typeof e.type)throw new E;D(n,_[e.type]),"Conditional"===e.type&&(i(e.ifActions),i(e.elseActions))},o=function(e){if(!P(e)||"string"!=typeof e.type)throw new E;if(!0!==e.disabled){if(null==r||r(e.type),D(n,C[e.type]),i(e.actions),i(e.inActions),i(e.outActions),i(e.successActions),i(e.errorActions),void 0!==e.dragDropActions){if(!P(e.dragDropActions))throw new E;var a=!0,o=!1,s=void 0;try{for(var l,u=Object.values(e.dragDropActions)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;i(c)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}}if(void 0!==e.gameActions){if(!P(e.gameActions))throw new E;var h=!0,d=!1,f=void 0;try{for(var p,v=Object.values(e.gameActions)[Symbol.iterator]();!(h=(p=v.next()).done);h=!0){var y=p.value;i(y)}}catch(e){d=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(d)throw f}}}if(void 0!==e.breakpoints){if(!Array.isArray(e.breakpoints))throw new E;var m=!0,g=!1,b=void 0;try{for(var w,x=e.breakpoints[Symbol.iterator]();!(m=(w=x.next()).done);m=!0){var S=w.value;if(!P(S)||!P(S.data))throw new E;i(S.data.actions)}}catch(e){g=!0,b=e}finally{try{m||null==x.return||x.return()}finally{if(g)throw b}}}}},s=function(e){if(!P(e))throw new E;(function(e){var r=e.events,n=!0,i=!1,a=void 0;if(void 0!==r)if(Array.isArray(r))try{for(var s,l=r[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=s.value;if(!P(u))throw new E;o(u.data)}}catch(e){i=!0,a=e}finally{try{n||null==l.return||l.return()}finally{if(i)throw a}}else{if(!P(r))throw new E;var c=!0,h=!1,d=void 0;try{for(var f,p=Object.values(r)[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var v=f.value;o(v)}}catch(e){h=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(h)throw d}}}})(e),"Mesh"===e.type&&P(e.geometry)&&"InputGeometry"===e.geometry.type&&n.add("textinputs"),"Page"===e.type&&P(e.uiScene)&&l(e.uiScene.objects)},l=function(e){if(!P(e)||"function"!=typeof e.traverse)throw new E;e.traverse(function(e,r){s(r)})},u=function(e){if(!P(e))throw new E;void 0!==e.data&&s(e.data);var r=e.children;if(void 0!==r){if(!Array.isArray(r))throw new E;var n=!0,i=!1,a=void 0;try{for(var o,l=r[Symbol.iterator]();!(n=(o=l.next()).done);n=!0){var c=o.value;u(c)}}catch(e){i=!0,a=e}finally{try{n||null==l.return||l.return()}finally{if(i)throw a}}}};try{l(e.scene.objects);var c=e.shared;if(void 0!==c){if(!P(c))throw new E;var h=c.variables;if(void 0!==h){if(!Array.isArray(h))throw new E;var d=!0,f=!1,p=void 0;try{for(var v,y=h[Symbol.iterator]();!(d=(v=y.next()).done);d=!0){var m=v.value;if(!P(m)||!P(m.data))throw new E;"dynamicVariableType"in m.data&&n.add("variables")}}catch(e){f=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(f)throw p}}}var g=c.userAPIs;if(void 0!==g){if(!P(g))throw new E;var b=!0,w=!1,x=void 0;try{for(var S,k=Object.values(g)[Symbol.iterator]();!(b=(S=k.next()).done);b=!0){var M=S.value,A=P(M)?M.integration:void 0;P(A)&&"VoiceAssistant"===A.type?n.add("ai-assistant"):n.add("api-services")}}catch(e){w=!0,x=e}finally{try{b||null==k.return||k.return()}finally{if(w)throw x}}}var j=c.userWebhooks;if(void 0!==j){if(!P(j))throw new E;Object.keys(j).length>0&&n.add("api-services")}var T=c.lib;if(void 0!==T){if(!P(T))throw new E;var I=T.components;if(void 0!==I){if(!P(I))throw new E;var R=!0,B=!1,z=void 0;try{for(var L,F=Object.values(I)[Symbol.iterator]();!(R=(L=F.next()).done);R=!0){var U=L.value;if(!P(U))throw new E;void 0!==U.asset&&u(U.asset)}}catch(e){B=!0,z=e}finally{try{R||null==F.return||F.return()}finally{if(B)throw z}}}}}}catch(e){return new Set(O)}return n}function T(e,r){if(void 0===r)return!0;if(0===r.expression.length)return!1;var n=M(r.expression,e,"boolean");return r.negate?!n:!!n}function I(e,r,n,o,s,l,u){var c={Audio:[],Video:[],Particles:[],Link:[],Destroy:[],Create:[],Reset:[],Transition:[],TimelineAnimation:[],SwitchCamera:[],Animation:[],SceneTransition:[],SetVariable:[],DynamicVariablePlay:[],ClearLocalStorage:[],UserAPI:[]},h=function(r){return function(d){var f=d.id,p=d.data;try{if("Conditional"===p.type)return void(a.q[e.type].includes("Conditional")&&(p.ifActions.forEach(h({expression:p.condition,negate:!1})),p.elseActions.forEach(h({expression:p.condition,negate:!0}))));if(!a.q[e.type].includes(p.type))return;var v,y,g=(v=p.type,m.get(v));if(void 0===g)return void(0,i.c)(null!=(y=_[p.type])?y:"misc-actions",'a "'.concat(p.type,'" action'));var b=g({id:f,data:p,object:l,page:n,shared:o,eventManager:s,eventType:e.type,actionCondition:r,runModeOverride:u});null!=b&&p.type in c&&c[p.type].push(b)}catch(e){}}};return r.forEach(h()),c}function R(e){Object.values(e).forEach(function(e){e.forEach(function(e){"function"==typeof e.dispose&&e.dispose()})})}},2784(e,r,n){function i(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}n.d(r,{a:()=>h,b:()=>d,c:()=>f});var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,h=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}},d=function(e,r,n){return n=null!=e?a(u(e)):{},function(e,r,n){var a=!0,u=!1,h=void 0;if(r&&"object"==(void 0===r?"undefined":i(r))||"function"==typeof r)try{for(var d,f=l(r)[Symbol.iterator]();!(a=(d=f.next()).done);a=!0)!function(){var i=d.value;c.call(e,i)||void 0===i||o(e,i,{get:function(){return r[i]},enumerable:!(n=s(r,i))||n.enumerable})}()}catch(e){u=!0,h=e}finally{try{a||null==f.return||f.return()}finally{if(u)throw h}}return e}(!r&&e&&e.__esModule?n:o(n,"default",{value:e,enumerable:!0}),e)},f=function(e,r,n){var a;return a="symbol"!=(void 0===r?"undefined":i(r))?r+"":r,a in e?o(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,n}},4438(e,r,n){n.d(r,{a:()=>a,b:()=>o});var i=null;function a(e){i=e}function o(){return i}},6282(e,r,n){n.d(r,{a:()=>d,b:()=>p});var i=n(9657);function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,r){return(s=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function l(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return a(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var c=[["start","Start"],["keyDown","KeyDown"],["keyUp","KeyUp"],["mouseDown","MouseDown"],["mouseUp","MouseUp"],["mouseHover","MouseHover"],["collision","Collision"],["lookAt","LookAt"],["follow","Follow"],["scroll","Scroll"]],h=function(e){var r;return null==(r=c.find(function(r){var n=l(r,2);return n[0],n[1]===e}))?void 0:r[0]},d=function(e){var r;return null==(r=c.find(function(r){return l(r,1)[0]===e}))?void 0:r[1]},f=function(e,r){var n=h(e);if(n){var i=new CustomEvent(n,{bubbles:!0});return Object.defineProperty(i,"target",{writable:!1,value:r}),i}},p=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,r,i;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,i=arguments,r=o(r),(e=function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,u()?Reflect.construct(r,i||[],o(this).constructor):r.apply(this,i))).objectsPerEvents=new Map,e.splineEvents={},e.onBeginEvent=function(r){if(r.eventName&&r.target&&"Scroll"!==r.eventName){var n,i=null==(n=e.splineEvents[h(r.eventName)])?void 0:n[r.target.uuid];i&&("Scroll"===r.eventName&&void 0!==r.deltaY&&Object.assign(i,{deltaY:r.deltaY}),e.eventContext.domElement.dispatchEvent(i))}},e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&s(n,e),r=[{key:"connect",value:function(){var e=this;this.eventContext.page.traverseEntity(function(r){var n;if(null==(n=r.data)?void 0:n.events.length){var i=!0,a=!1,o=void 0;try{for(var s,u=c[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)!function(){var n=l(s.value,2),i=n[0],a=n[1];if(r.data.events.some(function(e){return e.data.type===a&&!e.data.disabled})){e.objectsPerEvents.has(i)?null==(c=e.objectsPerEvents.get(i))||c.push(r):e.objectsPerEvents.set(i,[r]);var o,u,c,h={id:r.uuid,name:r.name},d=f(a,h),p=e.splineEvents[i];p?p[r.uuid]=d:e.splineEvents[i]=(o={},u=r.uuid,u in o?Object.defineProperty(o,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):o[u]=d,o)}}()}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}}),this.objectsPerEvents.forEach(function(r){r.forEach(function(r){r.addEventListener("beginEvent",e.onBeginEvent)})})}},{key:"disconnect",value:function(){var e=this;this.objectsPerEvents.forEach(function(r){r.forEach(function(r){r.removeEventListener("beginEvent",e.onBeginEvent)})})}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(n.prototype,r),n}(i.a)},6259(e,r,n){function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function a(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}n.d(r,{a:()=>h,b:()=>v,c:()=>y});function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return i(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var s,l,u=new Promise(function(e){s=e}),c=!1;function h(){if(!c){var e;return l||(l=(e=function(){return function(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,n.e("8072").then(n.bind(n,7003))];case 1:return e.sent(),s(void 0!==window?window:global),c=!0,[2]}})},function(){var r=this,n=arguments;return new Promise(function(i,o){var s=e.apply(r,n);function l(e){a(s,i,o,l,u,"next",e)}function u(e){a(s,i,o,l,u,"throw",e)}l(void 0)})})())}}var d,f=new Map;function p(e,r){e.forEach(function(e){"dragDropActions"in e.data?(r.push.apply(r,o(e.data.dragDropActions.drag)),r.push.apply(r,o(e.data.dragDropActions.drop))):"inActions"in e.data?(r.push.apply(r,o(e.data.inActions)),r.push.apply(r,o(e.data.outActions))):"gameActions"in e.data?(r.push.apply(r,o(e.data.gameActions.idle)),r.push.apply(r,o(e.data.gameActions.move)),r.push.apply(r,o(e.data.gameActions.jump)),r.push.apply(r,o(e.data.gameActions.run))):"breakpoints"in e.data?e.data.breakpoints.forEach(function(e){r.push.apply(r,o(e.data.actions))}):"actions"in e.data&&(r.push.apply(r,o(e.data.actions)),e.data.actions.forEach(function(e){"Conditional"===e.data.type&&e.data.ifActions&&(r.push.apply(r,o(e.data.ifActions)),r.push.apply(r,o(e.data.elseActions)))}))})}function v(e){var r=!1,n=[];return e.scene.objects.traverse(function(e,i){if("Page"===i.type&&void 0!==i.uiScene&&i.uiScene.objects.traverse(function(e,i){if(void 0===i.events||!1===Array.isArray(i.events))return!0;p(i.events,n),r=r||n.some(function(e){return"Audio"===e.data.type})}),void 0===i.events||!1===Array.isArray(i.events))return!0;p(i.events,n),r=r||n.some(function(e){return"Audio"===e.data.type})}),r}u.then(function(e){return d=e});var y=function(){var e;function r(e){var n,i=this,a=e.src,o=e.volume,s=e.delay,l=e.loop;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");this._volume=1,this.delay=0,this._loop=1,this.loopsRemaining=0,this._status="stopped",this.onEnd=function(){i.loopsRemaining===1/0?i.replay():i.loopsRemaining>1?(i.replay(),i.loopsRemaining--):(i._status="stopped",i.loopsRemaining=i._loop)},n="string"==typeof a?{src:a}:{src:function(e){if("string"==typeof e)return e;var r=f.get(e);return r||(r={url:URL.createObjectURL(new Blob([e]))},f.set(e,r)),r.url}(a),format:"wav"},this.sound=new d.Howl(n),this.sound.on("end",this.onEnd),this.src=a,void 0!==o&&(this.volume=o),void 0!==s&&(this.delay=s),void 0!==l&&(this.loop=l)}return e=[{key:"status",get:function(){return this._status}},{key:"volume",get:function(){return this._volume},set:function(e){this._volume=e,this.sound.volume(e)}},{key:"loop",get:function(){return this._loop},set:function(e){this._loop=e,this.loopsRemaining=e}},{key:"replay",value:function(){var e=this;this.clearDelay(),this.delayTimerId=window.setTimeout(function(){e.sound.play(),e.clearDelay()},this.delay)}},{key:"fade",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;e?(this.sound.volume(this._volume),this.clearFade(),this.fadeTimerId=window.setTimeout(function(){r.sound.fade(r._volume,0,n),r.clearFade()},e)):this.sound.fade(this._volume,0,n)}},{key:"on",value:function(e,r,n){this.sound.on(e,r,n)}},{key:"off",value:function(e,r,n){this.sound.off(e,r,n)}},{key:"play",value:function(){"playing"===this._status||this.sound.playing()||("paused"===this._status?(0===this.sound.seek()?this.replay():this.sound.play(),this._status="playing"):"stopped"===this._status&&(this.replay(),this._status="playing"))}},{key:"pause",value:function(){"playing"===this._status&&(this.sound.pause(),this.clearFade(),this.clearDelay(),this._status="paused")}},{key:"stop",value:function(){this.sound.stop(),this.loopsRemaining=this._loop,this.clearFade(),this.clearDelay(),this._status="stopped"}},{key:"clearFade",value:function(){this.fadeTimerId&&(clearTimeout(this.fadeTimerId),delete this.fadeTimerId)}},{key:"clearDelay",value:function(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}},{key:"dispose",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],this.off(),this.stop(),this.clearFade(),this.clearDelay()}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(r.prototype,e),r}()},843(e,r,n){n.d(r,{a:()=>E,b:()=>D,c:()=>P,d:()=>Z,e:()=>K,f:()=>Q,g:()=>eh,h:()=>ed,i:()=>eb,j:()=>eC,k:()=>e_,l:()=>eE,m:()=>eT,n:()=>eB,o:()=>eV,p:()=>eG,q:()=>eW,r:()=>eH,s:()=>eq,t:()=>eY,u:()=>eJ,v:()=>e0});var i=n(4691),a=n(5222),o=n(461),s=n(3940),l=n(3027);function u(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function c(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}function h(e,r,n){return r=m(r),k(e,_()?Reflect.construct(r,n||[],m(e).constructor):r.apply(e,n))}function d(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function f(e,r,n){return(f=_()?Reflect.construct:function(e,r,n){var i=[null];i.push.apply(i,r);var a=new(Function.bind.apply(e,i));return n&&M(a,n.prototype),a}).apply(null,arguments)}function p(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e,r,n){return r&&p(e.prototype,r),n&&p(e,n),e}function y(e,r,n){return(y="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=m(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&M(e,r)}function b(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function w(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function x(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function S(e,r){if(null==e)return{};var n,i,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}if(o=function(e,r){if(null==e)return{};var n,i,a={},o=Object.getOwnPropertyNames(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,r),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i]);return o}function k(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M(e,r){return(M=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function A(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||C(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,r){if(e){if("string"==typeof e)return u(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,r)}}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}var P={Cloner:null,changeEntityProptotype:function(){},createEntity:function(){}};function E(e,r){var n=[];if(r.length!==e.length)return null;for(var i=0;i<e.length;){if("*"===r[i])n.push(e[i]);else if(e[i]!==r[i])return null;i+=1}return n}function D(e,r){var n=[];if(!(r.length<=e.length))return null;for(var i=0;i<r.length;){if("*"===r[i])n.push(e[i]);else if(e[i]!==r[i])return null;i+=1}return n}var j=new l.Fc,T=new l.Fc,I=new l.Oc,R=[new l.Fc(-1,1,1),new l.Fc(-1,-1,1),new l.Fc(1,-1,1),new l.Fc(1,1,1),new l.Fc(-1,1,-1),new l.Fc(-1,-1,-1),new l.Fc(1,-1,-1),new l.Fc(1,1,-1)],B=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],z=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],L=function(e,r,n){e.updateEntityBoxSize(j,T),I.copy(r).multiply(e.matrixWorld),0===T.x&&0===T.y&&0===T.z?n.push(new l.Fc(j.x,j.y,j.z).applyMatrix4(I)):R.forEach(function(e){n.push(e.clone().multiply(T).add(j).applyMatrix4(I))})},F=function(e){function r(){var e;return d(this,r),e=h(this,r,arguments),e.matrix=new l.Oc,e.vertices=[],e.faces=[],e.edges=[],e.centerEdges=[],e}return g(r,e),v(r,[{key:"copy",value:function(e){return y(m(r.prototype),"copy",this).call(this,e),this.matrix.copy(e.matrix),this.vertices=e.vertices.map(function(e){return e.clone()}),this.faces=e.faces.map(function(e){return e.clone()}),this.edges=e.edges.map(function(e){return e.clone()}),this.centerEdges=e.centerEdges.map(function(e){return e.clone()}),this}},{key:"setFromObjectSize",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,r),this.makeEmpty(),this.matrix.copy(e.matrixWorld);var n=(new l.Oc).copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,r)}},{key:"expandByObjectSize",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[];if(!0===n){var a=[];e.traverseEntity(function(e){if(e.visible||e.cloner&&e.data.visible){if(!("geometry"in e))return I.copy(r).multiply(e.matrixWorld),void a.push((new l.Fc).applyMatrix4(I));L(e,r,i)}}),0===i.length&&i.push.apply(i,O(a))}else L(e,r,i);return this.setFromPoints(i)}},{key:"getCenter",value:function(e){return(e=y(m(r.prototype),"getCenter",this).call(this,e)).applyMatrix4(this.matrix),e}},{key:"getPositionToCenter",value:function(e){return(e=y(m(r.prototype),"getCenter",this).call(this,e)).applyMatrix4(I.copy(this.matrix).setPosition(0,0,0)),e}},{key:"computeVertices",value:function(){this.getSize(T).multiplyScalar(.5),this.getCenter(j),I.copy(this.matrix).setPosition(j),this.vertices=R.map(function(e){return e.clone().multiply(T).applyMatrix4(I)})}},{key:"computeEdges",value:function(){var e=this;this.vertices.length>0&&this.computeVertices(),this.edges=B.map(function(r){var n=A(r,2),i=n[0],a=n[1];return new l.Re(e.vertices[i],e.vertices[a])}),this.centerEdges=this.edges.map(function(e){return e.getCenter(new l.Fc)})}},{key:"computeFaces",value:function(){var e=this;this.vertices.length>0&&this.computeVertices(),this.faces=z.map(function(r){var n=A(r,2),i=n[0],a=n[1];return e.vertices[i].clone().add(e.vertices[a]).multiplyScalar(.5)})}}]),r}(l.Xc),U=new l.Fc,V=new l.Fc,N=new l.Fc,G=new l.Fc,W=new l.Fc,H=new l.Fc,q=new l.Oc;function Y(e){var r=e.elements;U.set(r[0],r[1],r[2]),V.set(r[4],r[5],r[6]),N.set(r[8],r[9],r[10])}function X(){var e=Math.max(U.lengthSq(),V.lengthSq(),N.lengthSq());U.lengthSq()>1e-12*e?G.copy(U).normalize():G.set(1,0,0),W.crossVectors(N,G),W.lengthSq()<=1e-12*e&&(W.copy(V).addScaledVector(G,-V.dot(G)),W.lengthSq()<=1e-12*e&&(W.set(1,0,0).cross(G),1e-12>=W.lengthSq()&&W.set(0,1,0).cross(G),W.normalize())),W.normalize(),H.crossVectors(G,W)}function Z(e){return Y(e),X(),q.makeBasis(G,W,H)}var K,J=new l.Oc;(K||(K={})).is=function(e){return e&&e.__isSPEObject};var Q=function(e){var r=e;function n(){var e;return d(this,n),e=h(this,n,arguments),e.previousModelViewMatrix=new l.Oc,e.copyPreviousMatrix=!0,e.hiddenMatrix=new l.Oc,e.pivotMatrix=new l.Oc,e.matrixWorldRigid=new l.Oc,e.shearScale=new l.Oc,e.shearScaleInv=new l.Oc,e}return g(n,r),v(n,[{key:"__isSPEObject",get:function(){return!0}},{key:"getPhysicsLocalMatrix",value:function(e){var r;return!!(null==(r=this.rigidBody)?void 0:r.isDynamic())&&(e.copy(this.matrixWorld),this.hasNonUniformScale&&e.multiply(this.shearScaleInv),this.parent&&e.premultiply(J.copy(this.parent.matrixWorld).invert()),e.premultiply(J.copy(this.hiddenMatrix).invert()),e.multiply(J.copy(this.pivotMatrix).invert()),!0)}},{key:"isDescendantOf",value:function(e){b(e,l.Rc)&&(e=e.uuid);for(var r=this;r.parent;){if(r.parent.uuid===e)return!0;r=r.parent}return!1}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,e=!0);var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0)a.value.updateMatrixWorld(e)}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"updateWorldMatrix",value:function(e,r){var n=this.parent,i=!0,a=!1,o=void 0;if(e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),r)try{for(var s,l=this.children[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)s.value.updateWorldMatrix(!1,!0)}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}},{key:"traverseChildren",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!0,i=!1,a=void 0;try{for(var o,s=this.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;K.is(l)&&l.traverseObject(e,r+1)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"traverseObject",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!0,i=!1,a=void 0;if(!0!==e(this,r))try{for(var o,s=this.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;K.is(l)&&l.traverseObject(e,r+1)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"updateMatrixWorldRigid",value:function(){var e,r,n;this.hasNonUniformScale=(e=this.matrixWorld,r=this.matrixWorldRigid,n=this.shearScale,Y(e),X(),r.makeBasis(G,W,H),n.set(G.dot(U),G.dot(V),G.dot(N),0,W.dot(U),W.dot(V),W.dot(N),0,H.dot(U),H.dot(V),H.dot(N),0,0,0,0,1),function(){var e=U.length(),r=V.length(),n=N.length(),i=Math.max(e,r,n);if(i-e>.01||i-r>.01||i-n>.01)return!0;var a=.01*i*i;return Math.abs(U.dot(V))>a||Math.abs(U.dot(N))>a||Math.abs(V.dot(N))>a}()),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}},{key:"attach",value:function(e,r){this.updateWorldMatrix(!0,!1);var n=(new l.Oc).copy(this.matrixWorld).invert();return null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),n.multiply(e.parent.matrixWorld)),"hiddenMatrix"in e&&b(e.hiddenMatrix,l.Oc)?e.hiddenMatrix.premultiply(n):e.applyMatrix4(n),e.updateWorldMatrix(!1,!1),this.add(e),void 0!==r&&(this.children.pop(),this.children.splice(r,0,e)),this}},{key:"copy",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return y(m(n.prototype),"copy",this).call(this,e,r),this.hasNonUniformScale=e.hasNonUniformScale,this}},{key:"onAfterRender",value:function(e,r,n,i,a,o){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}}]),n},$=function(e){function r(){return d(this,r),h(this,r)}return g(r,e),v(r,[{key:"getPoints",value:function(){for(var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[],i=this.getCurveLengths(),a=i[i.length-1]/i.length,o=0,s=this.curves;o<s.length;o++)for(var l=s[o],u=Math.ceil(r*(0===o?i[o]:i[o]-i[o-1])/a),c=l.getPoints(u),h=0;h<c.length;h++){var d=c[h];e&&e.equals(d)||(n.push(d),e=d)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}}]),r}(l.Pd),ee=new l.Fc,et=new l.Fc,er=new l.Fc,en=new l.Fc,ei=new l.Fc,ea=new l.Fc,eo=new l.Fc,es=new l.Fc,el=new l.Fc;function eu(e,r,n){return ee.subVectors(r,e),et.subVectors(r,n),.001>=ee.cross(et).length()}var ec=new WeakMap;function eh(e){var r=ec.get(e.points);if(void 0!==r&&r.isClosed===e.isClosed)return r.curve;var n=function(e){var r=e.points,n=[r[0]],i=[f(l.Fc,O(r[0].data.position))];er.copy(i[0]);for(var a=0;a<r.length-1;a++)ee.fromArray(r[a].data.position),et.fromArray(r[a+1].data.position),ei.subVectors(ee,er),eo.subVectors(ee,et),ei.cross(eo).length()>.001&&(n.push(r[a]),i.push((new l.Fc).copy(ee)),er.copy(ee));var o=r[r.length-1];n.push(o),i.push(f(l.Fc,O(o.data.position)));for(var s=e.isClosed,u=n.length-!s,c=n.length,h=[],d=[],p=0;p<c;p++){var v=n[p].data;h.push(f(l.Fc,O(v.controlPrevious.position))),d.push(f(l.Fc,O(v.controlNext.position)))}for(var y=[],m=0;m<u;m++){var g=m===c-1?0:m+1;y.push(eu(i[m],d[m],i[g])&&eu(i[m],h[g],i[g]))}for(var b=[],w=0;w<c;w++){var x=n[w].data,S=i[w],k={position:S,prevDir:void 0,nextDir:void 0,controlPrevious:h[w],controlNext:d[w],tan:void 0,baseRoundness:x.roundness,removedLength:0};if(b.push(k),0!==x.roundness&&(s||0!==w&&w!==c-1)){var M=s&&0==w?c-1:w-1,A=s&&w==c-1?0:w+1,C=(new l.Fc).subVectors(i[M],S).normalize(),_=(new l.Fc).subVectors(i[A],S).normalize();k.prevDir=C,k.nextDir=_;var P=y[s&&0===w?c-1:w-1],E=y[w];if(P&&E){en.addVectors(C,_).normalize();var D=er.crossVectors(en,C).length()/C.dot(en);k.tan=D,k.removedLength=x.roundness/D}}}for(var j=0;j<u;j++){var T=s&&j===c-1?0:j+1,I=b[j],R=b[T];if(0!==I.removedLength||0!==R.removedLength){var B=I.position.distanceTo(R.position);I.removedLength=Math.min(I.removedLength,B/2),R.removedLength=Math.min(R.removedLength,B/2)}}for(var z=Array(2*c).fill(null),L=0;L<u;L++){var F=s&&L===c-1?0:L+1,U=b[L],V=b[F],N=null;if(y[L]){var G=U.position.clone(),W=V.position.clone();(0!==U.removedLength||0!==V.removedLength)&&(U.nextDir&&G.add(er.copy(U.nextDir).setLength(U.removedLength)),V.prevDir&&W.add(er.copy(V.prevDir).setLength(V.removedLength))),G.distanceTo(W)>.001&&(N=new l.Kd(G,G.clone().lerp(W,.3),W.clone().lerp(G,.3),W))}else U.position.distanceTo(V.position)>.001&&(N=new l.Kd(U.position,U.controlNext,V.controlPrevious,V.position));z[2*L+1]=N}for(var H=0;H<c;H++){var q=b[H];if(0!==q.removedLength){var Y=q.position,X=q.prevDir.clone().multiplyScalar(q.removedLength).add(Y),Z=q.nextDir.clone().multiplyScalar(q.removedLength).add(Y),K=q.tan*q.removedLength;en.addVectors(q.prevDir,q.nextDir).normalize(),ei.copy(X).lerp(Z,.5);var J=X.distanceTo(Z)/2;el.copy(en).multiplyScalar(Math.sqrt(Math.pow(K,2)-Math.pow(J,2))).add(ei),ea.copy(en).multiplyScalar(-K).add(el);var Q=Y.distanceTo(ea)/Y.distanceTo(ei);eo.copy(q.prevDir).multiplyScalar(Q*Y.distanceTo(X)).add(Y),es.copy(eo).lerp(ea,2);var ec=X.clone().lerp(eo,4/3),eh=Z.clone().lerp(es,4/3);z[2*H]=new l.Kd(X,ec,eh,Z)}}for(var ed=new $,ef=0;ef<z.length;ef++){var ep=z[ef];ep&&ed.add(ep)}return ed}(e);return ec.set(e.points,{isClosed:e.isClosed,curve:n}),n}var ed,ef=new l.Oc,ep=new l.Ec,ev=new l.Ec,ey=new l.Pc,em=new l.Fc,eg=new l.Fc(0,1,0);(ed||(ed={})).is=function(e){return e&&e.__isEntity};var eb=function(e){return ed.is(e)},ew={type:"completeState",isfromEntity:!0},ex=["x","y","z"],eS=new l.Fc,ek=new l.Fc(1,1,1),eM=new l.Ec,eA=new l.Pc,eO=new l.Oc,eC=function(e){var r=Q(e);function n(){var e;return d(this,n),e=h(this,n,arguments),e.raycastLock=!1,e.scaleLock=!1,e.disposed=!1,e.stateSelection=null,e.destroyedInAction=!1,e.instances=[],e.prevState=null,e.currentState=null,e.currentAnimationAction=null,e.reversibleToState=null,e.transitionState={settled:!0,state:null},e.currentTransitionEvent=null,e.previousAction=null,e._singleBBox=new F,e._recursiveBBox=new F,e.singleBBoxNeedsUpdate=!0,e.recursiveBBoxNeedsUpdate=!0,e._needApplyPathSnapping=!0,e.attachedPaths=new Set,e}return g(n,r),v(n,[{key:"__isEntity",get:function(){return!0}},{key:"entityChildren",value:function(e){var r=this.children[e];if(ed.is(r))return r}},{key:"entityChildrenCount",value:function(){for(var e=this.children.length;e--;)if(ed.is(this.children[e]))return e+1;return 0}},{key:"isConcreteEntity",get:function(){return"string"==typeof this.identity}},{key:"isVirtualEntity",get:function(){return"string"!=typeof this.identity}},{key:"isInstanceRoot",get:function(){return this.isConcreteEntity&&"Instance"===this.data.type}},{key:"nearestInstanceSelfOrParent",value:function(){for(var e=this;"Instance"!==e.data.type;){var r=e.parent;if(!ed.is(r))return;e=r}return e}},{key:"forInstancesRec",value:function(e){this.instances.forEach(function(r){r.disposed||e(r),r.forInstancesRec(e)})}},{key:"super_Entity",value:function(e,r){"string"==typeof e&&(this.uuid=e),this.identity=e,this.data=r,this.matrixAutoUpdate=!1,this.dataPatched=this.data}},{key:"changeSelectedState",value:function(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0!==this.data.states.length||i){var a=!0,o=!1,l=void 0;try{for(var u,c=this.data.states[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var h=u.value;s.Da.toOps(this.data,h.data).forEach(function(e){var i=s.j.replaceProps(e,n.data);n.dataPatched=n.data,n.updateByPatchedOp(i,n.data,r)})}}catch(e){o=!0,l=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw l}}if(null!==e){var d=this.data.states.data(e);d&&(this.dataPatched=s.Da.patch(this.data,d),s.Da.toOps(this.data,d).forEach(function(e){n.updateByPatchedOp(e,n.dataPatched,r)}))}i&&this.updateTransformState(this.dataPatched,r),this.stateSelection=e,this.updatePathSnapping(this.dataPatched.pathSnapping)}}},{key:"singleBBox",get:function(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}},{key:"recursiveBBox",get:function(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}},{key:"updateEntityBoxSize",value:function(e,r){e.setScalar(0),r.setScalar(0)}},{key:"resetBBoxNeedsUpdateSelf",value:function(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}},{key:"resetBBoxNeedsUpdate",value:function(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(function(e){eb(e)&&e.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(function(e){e.resetBBoxNeedsUpdateSelf()})}},{key:"find",value:function(e){var r;return this.traverseEntity(function(n){n.uuid===e&&(r=n)}),r}},{key:"traverseSortNextHelper",value:function(){var e=this.parent;if(e){var r=e.children,n=r.indexOf(this)+1;if(ed.is(r[n]))return r[n];if(ed.is(e))return e.traverseSortNextHelper()}}},{key:"sortNext",value:function(){var e=this.children;return this.children.length>0&&ed.is(this.children[0])?e[0]:this.traverseSortNextHelper()}},{key:"goUp",value:function(e){for(var r=this;e>0&&null!==r;)r=r.parent,e-=1;return r}},{key:"hasAnccestorOrSelf",value:function(e){return this===e||this.hasAnccestor(e)}},{key:"hasAnccestor",value:function(e){for(var r=this.parent;r;){if(e===r)return!0;r=r.parent}return!1}},{key:"countToAccestor",value:function(e){for(var r=0,n=this;n!==e;){if(null===n)return -1;n=n.parent,r+=1}return r}},{key:"forEachEntity",value:function(e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;eb(s)&&e(s)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"traverseEntityAncestors",value:function(e){this.traverseAncestors(function(r){ed.is(r)&&e(r)})}},{key:"traverseConcreteEntity",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!0,i=!1,a=void 0;if(!0!==e(this,r))try{for(var o,s=this.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;eb(l)&&l.isConcreteEntity&&l.traverseEntity(e,r+1)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"traverseEntity",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!0,i=!1,a=void 0;if(!0!==e(this,r))try{for(var o,s=this.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;eb(l)&&l.traverseEntity(e,r+1)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"traverseVisibleEntity",value:function(e){e(this);var r=!0,n=!1,i=void 0;try{for(var a,o=this.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;eb(s)&&s.visible&&s.traverseVisibleEntity(e)}}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"updateMatrix",value:function(){y(m(n.prototype),"updateMatrix",this).call(this),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}},{key:"updateMatrixWorld",value:function(e){y(m(n.prototype),"updateMatrixWorld",this).call(this,e),this.dispatchEvent({type:"updateMatrixWorld"})}},{key:"copy",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return y(m(n.prototype),"copy",this).call(this,e,r),this.dataPatched=e.dataPatched,this.raycastLock=e.raycastLock,this.scaleLock=e.scaleLock,this.hiddenMatrix.copy(e.hiddenMatrix),this}},{key:"hasEntityChild",value:function(){return this.children.some(function(e){return eb(e)})}},{key:"isAncestorOf",value:function(e){if(this.uuid===e)return!1;var r=!1;return this.traverseEntity(function(n){n.uuid===e&&(r=!0)}),r}},{key:"toObjectTransformState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.updateWorldMatrix(!0,!1);var r={position:this.position.toArray(),rotation:[this.rotation.x*l.Cc.RAD2DEG,this.rotation.y*l.Cc.RAD2DEG,this.rotation.z*l.Cc.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return(0,i.f)(r,e)}},{key:"getTransformValues",value:function(e,r,n){var i=this;return r[e].map(function(r,a){var o;return null!=(o=null==n?void 0:n.shared.getVariable(r,[i.uuid,e,ex[a]]))?o:r})}},{key:"updateTransformState",value:function(e,r){var n,i=this,a=!1;if(e.position&&(this.position.fromArray(this.getTransformValues("position",e,r)),a=!0),e.rotation&&(eS.fromArray(this.getTransformValues("rotation",e,r)).multiplyScalar(l.Cc.DEG2RAD),this.rotation.setFromVector3(eS),a=!0),e.scale&&(this.scale.fromArray(this.getTransformValues("scale",e,r)),a=!0),void 0!==e.hiddenMatrix&&(a=!0,this.hiddenMatrix.fromArray(null!=(n=e.hiddenMatrix)?n:s.C.identity)),void 0!==e.pivot||void 0!==e.pivotRotation){if(a=!0,void 0!==e.pivot&&void 0!==e.pivotRotation)this.pivotMatrix.compose(eS.fromArray(e.pivot).negate(),eM.setFromEuler(eA.fromArray(e.pivotRotation.map(function(e){return e*l.Cc.DEG2RAD}))).invert(),ek);else if(void 0!==e.pivot)this.pivotMatrix.setPosition(-e.pivot[0],-e.pivot[1],-e.pivot[2]);else if(void 0!==e.pivotRotation){var o=eS.setFromMatrixPosition(this.pivotMatrix);eM.setFromEuler(eA.fromArray(e.pivotRotation.map(function(e){return e*l.Cc.DEG2RAD}))).invert(),this.pivotMatrix.compose(o,eM,ek)}}return a&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(function(e){e.invalidateClonerTransform(i)})),e.position&&e.rotation&&e.scale&&void 0!==e.hiddenMatrix&&this.updateWorldMatrix(!1,!0),a}},{key:"onVariableUpdate",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(function(r){r.invalidateClonerTransform(e)}),this.requestRender())}},{key:"dispose",value:function(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}},{key:"disposeChildrenRecursively",value:function(){var e=!0,r=!1,n=void 0;try{for(var i,a=this.children[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;ed.is(o)&&o.disposeRecursively()}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"disposeRecursively",value:function(){this.dispose(),this.children.forEach(function(e){ed.is(e)&&e.disposeRecursively()})}},{key:"toState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=w({name:this.name,visible:this.visible,raycastLock:this.raycastLock},this.toObjectTransformState(e));return(0,i.f)(r,e)}},{key:"updateByObjUpdateOp",value:function(e,r){void 0!==e&&this.updateByOp({type:0,props:e,path:[]},w({},this.data,e),r,!1)}},{key:"updateByOp",value:function(e,r,n,i){var a=this.data;this.data=r;var o=e,l=D(e.path,["states","*"]);if(null!==l){if(0===e.type){var u=A(l,1)[0];if((null===this||void 0===this?void 0:this.stateSelection)===u){var c=w({},e.props);if(delete c.name,Object.values(e.props).some(function(e){return void 0===e})){var h=this.data;if(void 0!==h){var d=s.n.zoom(h,e.path.slice(2));if(d)for(var f in e.props)void 0===e.props[f]&&f in d&&(c[f]=d[f])}}o=x(w({},e),{props:c,path:e.path.slice(2)})}}}else if(0===e.type){var p=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==p){void 0!==e.props.name&&p.name&&(p.name,p=S(p,["name"])),void 0!==e.props.material&&"material"in p&&(p.material,p=S(p,["material"]));var v=s.n.removeOverridden(e.path,e.props,p);o=x(w({},e),{props:v})}}if(this.updateByPatchedOpBase(o,s.Da.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),n),D(e.path,["overrides"])){var y=[],m=O(e.path);for(y.push(m[1]),m.splice(0,2);m.length>0&&"descendants"===m[0];)y.push(m[1]),m.splice(0,2);if(void 0===y[y.length-1]){var g=!0,b=!1,k=void 0;if(0===e.type)try{for(var M,C=Object.keys(e.props)[Symbol.iterator]();!(g=(M=C.next()).done);g=!0){var _=M.value;y[y.length-1]=_;var P=n.scene.findInstance([this.uuid].concat(O(y)));P&&(P.overrideData=e.props[_],P.updateState(s.i.apply(P.component.data,P.overrideData),n))}}catch(e){b=!0,k=e}finally{try{g||null==C.return||C.return()}finally{if(b)throw k}}}else{var E=n.scene.findInstance([this.uuid].concat(O(y)));if(E){var j=s.n.zoom(E.component.data,m);if(0===(e=x(w({},e),{path:m})).type){var T=e.props,I=!0,R=!1,B=void 0;if(j)try{for(var z,L=Object.entries(e.props)[Symbol.iterator]();!(I=(z=L.next()).done);I=!0){var F=A(z.value,2),U=F[0],V=F[1];void 0===V&&(T===e.props&&(T=w({},e.props)),T[U]=j[U])}}catch(e){R=!0,B=e}finally{try{I||null==L.return||L.return()}finally{if(R)throw B}}e=x(w({},e),{props:T})}E.overrideData=s.Aa.resolve(r.overrides,y),E.updateByOp(e,s.k.applySimple(E.data,e),n,!1)}}}else if(this.instances.length>0){var N=!0,G=!1,W=void 0;if(0===e.path.length&&0===e.type){var H=!0,q=!1,Y=void 0;try{for(var X,Z,K,J=s.Ba.rootOverrideProps[Symbol.iterator]();!(H=(K=J.next()).done);H=!0){var Q=K.value;Q in e.props&&(void 0===Z&&(Z={}),Z[Q]=e.props[Q])}}catch(e){q=!0,Y=e}finally{try{H||null==J.return||J.return()}finally{if(q)throw Y}}Z&&(X=x(w({},e),{props:Z}))}else try{for(var $,ee=s.Ba.rootOverrideProps[Symbol.iterator]();!(N=($=ee.next()).done);N=!0){var et=$.value;if(D(e.path,[et])){X=e;break}}}catch(e){G=!0,W=e}finally{try{N||null==ee.return||ee.return()}finally{if(G)throw W}}void 0!==X&&this.instances.forEach(function(e){if(e.isInstanceRoot){var r=s.i.filterOp(e.overrideData,X);r&&e.updateByOp(r,s.k.applySimple(e.data,r),n,!0)}}),this.instances.forEach(function(i){if(!i.isInstanceRoot){var o,l=s.i.filterOp(i.overrideData,e);l&&(o=a===i.data&&e===l?r:s.k.applySimple(i.data,l),i.updateByOp(l,o,n,!0))}})}}},{key:"updateByPatchedOpBase",value:function(e,r,n){if(this.dataPatched=r,0===e.path.length&&0===e.type)void 0===e.props.type||s.J.is(e.props.type)||P.changeEntityProptotype(this,r,n);else if(1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&"type"in e.props){P.changeEntityProptotype(this,r,n);var i=!0,a=!1,o=void 0;try{for(var l,u=this.children[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;ed.is(c)&&c.updateVisible(n.scene)}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}this.updateByPatchedOp(e,r,n)}},{key:"updateByPatchedOp",value:function(e,r,n){if(0===e.path.length&&0===e.type?this.updateState(e.props,n):0===e.type&&("resolutionLevel"in e.props||"useChildrenColors"in e.props)&&this.updateState(r,n),"morphTargetInfluences"===e.path[0]&&0===e.type){var i,a=null==(i=r.morphTargetInfluences.get(e.path[1]))?void 0:i.data.name;a&&this.updateMorphInfluences(a,n.shared.getVariable(e.props.value,[this.uuid,"morphTargetInfluences",a]))}if(null!==D(e.path,["pathSnapping"])&&this.updatePathSnapping(r.pathSnapping),null!==D(e.path,["cloner"])){var o=s.k.drop(e,1);0===o.path.length&&0===o.type&&!0===o.props.disabled?this.setFromClonerState(null,n):this.cloner?this.cloner.updateState(r.cloner,n):(this.setFromClonerState(r.cloner,n),this.expandCloner(n)),this.updateVisible(n.scene)}}},{key:"updatePathSnapping",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataPatched.pathSnapping;this._updatedPathSnapping=e,this._needApplyPathSnapping=!0}},{key:"updatedPathSnapping",get:function(){return this._updatedPathSnapping}},{key:"applyPathSnapping",value:function(e){if(!1===this._needApplyPathSnapping)return;var r,n,i,a,o,s,u,c,h,d,f,p,v=null!=(i=null==(h=this._updatedPathSnapping)?void 0:h.pathId)?i:this.dataPatched.pathSnapping.pathId,y=null!=(a=null!=(o=null==(d=this._updatedPathSnapping)?void 0:d.slide)?o:this.dataPatched.pathSnapping.slide)?a:0,m=null!=(s=null!=(u=null==(f=this._updatedPathSnapping)?void 0:f.offset)?u:this.dataPatched.pathSnapping.offset)?s:0,g=null!=(c=null==(p=this._updatedPathSnapping)?void 0:p.orientation)?c:this.dataPatched.pathSnapping.orientation;if(null===v)return;var b=e.find(v);if(b){this._needApplyPathSnapping=!1;var w=b.data;if(!(w.geometry.path.points.length<=1)){var x=eh(w.geometry.path),S=(n=(r=y+m)%1)<0?n+1:0===n&&r>0?1:n,k=null;try{k=x.curves.length?x.getPointAt(S):null}catch(e){}if(null!==k){b.updateMatrixWorld();var M=this.parent?eO.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix):eO.copy(this.hiddenMatrix),A=function(e,r,n,i){ep.setFromRotationMatrix(ef.extractRotation(i));var a=e.clone().applyMatrix4(ef.copy(i).invert().multiply(n));if(null===r)ev.setFromRotationMatrix(ef.extractRotation(n));else{var o=r.clone().applyMatrix4(ef.extractRotation(n));ev.setFromRotationMatrix(ef.lookAt(em.set(0,0,0),o,eg))}return{position:a,rotation:(new l.Fc).setFromEuler(ey.setFromQuaternion(ep.invert().multiply(ev))).multiplyScalar(l.Cc.RAD2DEG)}}(k,"tangential"===g?x.getTangentAt(S):null,b.matrixWorld,M);this.updateTransformState({position:A.position.toArray(),rotation:A.rotation.toArray()}),this.traverseEntity(function(e){e._cameraType&&e.dispatchEvent(ew)})}}}}},{key:"updateVisible",value:function(e){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||null!=(r=this.dataPatched.cloner.disabled)&&r||!0!==(null==(n=this.dataPatched.cloner)?void 0:n.hideBase)),e){var r,n,i=!1;this.traverseEntity(function(e){if("Splat"===e.data.type)return i=!0,!0}),i&&e.reloadSplats()}}},{key:"updateState_Entity",value:function(e,r){void 0!==e.name&&(this.name=e.name),void 0!==e.raycastLock&&(this.raycastLock=e.raycastLock),void 0!==e.visible&&(this.updateVisible(null==r?void 0:r.scene),this.resetBBoxNeedsUpdate()),r&&"cloner"in e&&void 0!==e.cloner&&(this.setFromClonerState(e.cloner,r),this.updateVisible(r.scene)),this.updateTransformState(e,r)}},{key:"attachedSurfaceCloners",get:function(){return this.children.filter(function(e){return(0,a.h)(e)&&"toObject"===e.parameters.type})}},{key:"setFromClonerState",value:function(e,r){if(!this.disposed)if(null===e||e.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===P.Cloner)return void(0,o.c)("cloners","a cloner");this.cloner=new P.Cloner(this,e),r.scene.addPendingExpandCloner(this)}else this.cloner.updateState(e,r)}},{key:"expandCloner",value:function(e){!this.disposed&&this.cloner&&this.cloner.expandClones(e)}},{key:"invalidateClonerTransform",value:function(e){this.cloner&&this.cloner.invalidateTransform(e)}},{key:"requestRender",value:function(){this.dispatchEvent({type:"requestRender"})}}]),n},e_=function(){function e(){d(this,e)}return v(e,null,[{key:"create",value:function(e){return this.build(this.normalizeInputs(e))}},{key:"normalizeInputs",value:function(e,r){var n,i,a,o=Object.assign({},null!=(n=null==r?void 0:r.parameters)?n:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},e.parameters),s=Math.abs(o.width),l=Math.abs(null!=(i=o.height)?i:s),u=Math.abs(null!=(a=o.depth)?a:s),c=Math.abs(Math.min(s,u))/2;return{parameters:Object.assign(o,{width:s,height:l,depth:u,radius:c,segments:Math.round(o.segments),pathSegments:Math.round(o.pathSegments),cornerSegments:Math.round(o.cornerSegments)})}}},{key:"build",value:function(e){var r=e.parameters;return Object.assign(new eT(!1,r.width,r.height,r.depth,r.radius,r.revolutions,r.segments,r.pathRadius,r.pathType,r.pathSegments,r.cornerRadius,r.cornerSegments),{userData:x(w({},e),{type:"HelixGeometry"})})}}]),e}(),eP=new l.$c([0,0,0],1);function eE(e){return"TorusGeometry"===e.type&&360===e.arc}var eD,ej,eT=function(e){function r(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],n=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:1),i=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:1),a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,u=(arguments.length>8&&void 0!==arguments[8]&&arguments[8],arguments.length>9&&void 0!==arguments[9]?arguments[9]:1),c=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:1;d(this,r);var p=function(r,n){var i=Math.PI/2;O=2*Math.PI*((S=n*W)%V)/V+i,S+=H,M=Math.sin(O)*es,x=Math.cos(O)*es,e?r.set(x,M,S):r.set(x,S,M)};if(y=h(this,r),0===a)return k(y);var v=e&&1===a;v&&(f=0),c>100&&(c=100),0===c&&(f=0);var y,m,g,b,w,x,S,M,O,C=function(){return new l.Fc},_=new l.Fc,P=C(),E=C(),D=C(),j=C(),T=C(),I=C(),R=C(),B=C(),z=C(),L=C(),F=C(),U=n-2*s+.001,V=U/a,N=Math.ceil(o*a),G=N+1,W=U/N,H=-U/2,q=u+1,Y=2*Math.PI/u,X=Math.PI/2/f,Z=Math.min((1-c/100)*s,s-.01),K=s-Z,J=0,Q=2*f+2,$=q*Q/2,ee=$+q*G,et=Math.max(0,q*(G+Q)),er=A([3,3,2].map(function(e){return Array(et*e).fill(0)}),3),en=er[0],ei=er[1],ea=er[2],eo=[],es=i-s;p(_,-1e-10),p(P,0),j.copy(_),p(_,1);for(var el=_.distanceTo(P),eu=v?0:K+Z,ec=el*N+2*eu,eh=ec-eu,ed=0;ed<=N;ed++)!function(r){p(E,r),F.subVectors(E,j).normalize(),j.copy(E),z.copy(E).setComponent(+e+1,0).normalize(),L.crossVectors(F,z).normalize();for(var n=0===r,i=r===N,a=n?3*Math.PI/2:X,o=n?Z:eh,l=n?q:ee,c=n?0:et-q,h=F.clone().multiplyScalar(n?-K:K).add(E),d=F.clone().multiplyScalar(n?-1:1).normalize(),y=0;y<q;y++){var m=y*Y;if(T.addVectors(_.copy(z).multiplyScalar(s*Math.cos(m)),P.copy(L).multiplyScalar(s*Math.sin(m))),I.copy(T).normalize(),n||i){v||(J=c+y,[0,1,2].forEach(function(e){en[3*J+e]=h.getComponent(e),ei[3*J+e]=d.getComponent(e)}),ea[2*J]=+i,ea[2*J+1]=y/u),P.copy(I).multiplyScalar(Z),D.addVectors(E,P);for(var g=0;g<f;g++){var b=g*X+a;R.addVectors(_.copy(F).multiplyScalar(K*Math.sin(b)),P.copy(I).multiplyScalar(K*Math.cos(b))),B.copy(R).normalize(),P.addVectors(D,R),R.normalize(),J=l+g*q+y,[0,1,2].forEach(function(e){en[3*J+e]=P.getComponent(e),ei[3*J+e]=B.getComponent(e)});var w=+n+Math.sin(b);ea[2*J]=(o+K*w)/ec,ea[2*J+1]=y/u}}P.addVectors(E,T),J=$+r*q+y,[0,1,2].forEach(function(e){en[3*J+e]=P.getComponent(e),ei[3*J+e]=I.getComponent(e)}),ea[2*J]=(eu+r*el)/ec,ea[2*J+1]=y/u}}(ed);for(var ef=G+2*f+2,ep=[+v,ef-1],ev=ep[0],ey=ep[1],em=ev;em<=ey-1;em++)for(var eg=v&&em===ey-1,eb=0;eb<q-1;eb++)g=(m=em*q+eb)+1,b=(eg?eb:m)+q,w=(eg?eb+1:g)+q,0===em?eo.push(g,w,b):em===ef-2?eo.push(m,g,b):eo.push(m,g,b,g,w,b);return y.setIndex(eo),y.setAttribute("position",new l.bd(en,3)),y.setAttribute("normal",new l.bd(ei,3)),y.setAttribute("uv",new l.bd(ea,2)),y}return g(r,e),v(r,[{key:"getClosedTorusIndicesForBooleanOrSubdiv",value:function(){for(var e,r,n,i,a=this.userData.parameters,o=Math.ceil(a.tubularSegments),s=a.radialSegments,l=s+1,u=[],c=1;c<o;c++)for(var h=0;h<s;h++)r=(e=c*l+h)+1,n=e+l,i=r+l,u.push(e,r,n,r,i,n);for(var d=0;d<s;d++)r=(e=o*l+d)+1,n=d+l,i=d+1+l,u.push(e,r,n,r,i,n);return eP.array=new Uint32Array(u),eP.count=u.length,eP}}]),r}(l.dd),eI=new Map,eR=0;function eB(e){var r;return ej||(ej=(r=function(){var r,i,a,o;return function(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:return r=null!=e?e:"https://cdn.spline.design/@splinetool/runtime@2.0.60/build",[4,Promise.all([n.e("4513").then(n.bind(n,9707)),fetch("".concat(r,"/boolean.wasm")).then(function(e){return e.arrayBuffer()})])];case 1:return a=(i=A.apply(void 0,[s.sent(),2]))[0],o=i[1],[4,a.default({module_or_path:o})];case 2:return s.sent(),eD=a,[2]}})},function(){var e=this,n=arguments;return new Promise(function(i,a){var o=r.apply(e,n);function s(e){c(o,i,a,s,l,"next",e)}function l(e){c(o,i,a,s,l,"throw",e)}s(void 0)})})())}function ez(){if(void 0===eD)throw Error("boolean-wasm is not loaded");return eD}function eL(e){var r=eI.get(e);if(void 0===r)throw Error("Unknown csg mesh set handle "+e);return r}function eF(e){return eI.set(++eR,e),eR}var eU={0:0,1:1,2:2};function eV(e,r,n){if(void 0===eD)return -1;var i=function(e,r){if(r&&void 0!==e.userData.positions){for(var n=e.userData,i=[],a=0,o=0;a<n.verticesPerFace.length;a++){for(var s=n.verticesPerFace[a],l=1;l<s-1;l++)i.push(n.indices[o],n.indices[o+l],n.indices[o+l+1]);o+=s}return{positions:b(n.positions,Float32Array)?n.positions:new Float32Array(n.positions),indices:new Uint32Array(i)}}var u,c=eE(e.userData.parameters)?e.getClosedTorusIndicesForBooleanOrSubdiv():e.getIndex(),h=e.getAttribute("position");if(null===c){u=new Uint32Array(h.count);for(var d=0;d<u.length;d++)u[d]=d}else u=b(c.array,Uint32Array)?c.array:new Uint32Array(c.array);var f=e.getAttribute("normal"),p=void 0!==f&&3===f.itemSize&&f.count===h.count&&b(f.array,Float32Array)&&!0!==f.isInterleavedBufferAttribute?f.array:void 0;return{positions:h.array,indices:u,normals:p}}(e,r),a=i.positions,o=i.indices,s=i.normals;return eF(new eD.CsgMesh(a,o,s))}function eN(e,r){var n=ez(),i=eU[r];if(void 0===i)throw Error("Unknown boolean operation "+r);var a=e.map(eL);if(1===a.length)return n.clone_mesh(a[0]);var o,s=[];if(2===r&&a.length>2){for(var l=a[0],u=1;u<a.length-1;u++)l=n.boolean_mesh(l,a[u],0),s.push(l);o=n.boolean_mesh(a[a.length-1],l,2)}else if(2===r)o=n.boolean_mesh(a[1],a[0],2);else{for(var c=a[a.length-1],h=0;h<a.length-1&&(c=n.boolean_mesh(c,a[h],i),s.push(c),0!==c.tri_count());h++);o=c,s.pop()}var d=!0,f=!1,p=void 0;try{for(var v,y=s[Symbol.iterator]();!(d=(v=y.next()).done);d=!0)v.value.free()}catch(e){f=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(f)throw p}}return o}function eG(e,r,n,i){var a=ez(),o=eN(e,r),s=a.mesh_render_data(o,Math.max(i,0));if(n.setAttribute("position",new l.bd(s.positions(),3)),n.setAttribute("normal",new l.bd(s.normals(),3)),s.free(),null===n.boundingSphere&&(n.boundingSphere=new l.cd),0===o.tri_count())n.boundingSphere.center.set(0,0,0),n.boundingSphere.radius=0,n.userData.parameters={width:0,height:0,depth:0};else{var u=o.bounds();n.boundingSphere.center.set(u[0],u[1],u[2]),n.boundingSphere.radius=Math.pow(Math.pow(u[3],2)+Math.pow(u[4],2)+Math.pow(u[5],2),.5),n.userData.parameters={width:2*u[3],height:2*u[4],depth:2*u[5]}}return eF(o)}function eW(e,r){var n=ez(),i=eN(e,r),a=n.mesh_topological_data(i),o=a.positions(),s=a.indices();return a.free(),i.free(),{positions:o,indices:s,verticesPerFace:new Uint8Array(s.length/3).fill(3)}}function eH(e,r){eL(e).transform(new Float32Array(r.elements))}function eq(e){var r=eI.get(e);void 0!==r&&(r.free(),eI.delete(e))}function eY(e,r){return eF(ez().instanced_union(eL(e),r))}function eX(e){return null!==e&&"booleanOp"in e}var eZ=function(e){function r(){var e;return d(this,r),e=h(this,r,arguments),e.booleanMeshSetAddress=-1,e.booleanWasTransformed=!1,e.booleanMatrixInvOld=new l.Oc,e}return g(r,e),v(r,[{key:"updateVisible",value:function(e){y(m(r.prototype),"updateVisible",this).call(this,e),this.visible=!eX(this.parent)&&this.visible,eX(this.parent)&&this.parent.invalidateDownstreamBooleanData()}},{key:"onClonerLayoutUpdated",value:function(){eX(this.parent)&&this.invalidateDownstreamBooleanData()}},{key:"freeBooleanPointer",value:function(){-1!==this.booleanMeshSetAddress&&(eq(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}},{key:"invalidateDownstreamBooleanData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?this.booleanWasTransformed=!0:this.freeBooleanPointer(),eX(this.parent)?this.parent.invalidateDownstreamBooleanData():this}},{key:"invalidateUpstreamBooleanData",value:function(){this.freeBooleanPointer();var e=!0,r=!1,n=void 0;try{for(var i,a=this.children[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;b(o,eZ)&&(o.freeBooleanPointer(),eX(o)&&o.invalidateUpstreamBooleanData())}}catch(e){r=!0,n=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"updateTransformState",value:function(e,n){var i=y(m(r.prototype),"updateTransformState",this).call(this,e,n);return i&&eX(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}},{key:"onVariableUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y(m(r.prototype),"onVariableUpdate",this).call(this,e),eX(this.parent)&&this.invalidateDownstreamBooleanData(!0)}}]),r}(eC(l.ld)),eK=new l.Xc;function eJ(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.count,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=1/0,s=1/0,l=1/0,u=-1/0,c=-1/0,h=-1/0,d=r;d<n;d++){var f=e.getX(d),p=e.getY(d),v=e.getZ(d);f<o&&(o=f),p<s&&(s=p),v<l&&(l=v),f>u&&(u=f),p>c&&(c=p),v>h&&(h=v)}eK.min.set(o,s,l),eK.max.set(u,c,h),eK.getCenter(i),eK.getSize(a).multiplyScalar(.5)}var eQ=new l.dd,e$=new l.kd,e0=function(e){function r(e,n){var i;return d(this,r),(i=h(this,r,[eQ,e$])).super_Entity(e,n),i}return g(r,e),v(r,[{key:"updateState",value:function(e,r){this.updateState_Entity(e,r)}},{key:"raycast",value:function(e,n){y(m(r.prototype),"raycast",this).call(this,e,n)}},{key:"updateEntityBoxSize",value:function(e,n){var i=this.geometry.getAttribute("position");void 0!==i?eJ(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,e,n):y(m(r.prototype),"updateEntityBoxSize",this).call(this,e,n)}}]),r}(eZ)},9064(e,r,n){n.d(r,{a:()=>b,b:()=>w,c:()=>x,d:()=>S,e:()=>k});var i=n(6679),a=n(2995),o=n(909),s=n(843),l=n(5222),u=n(3027);function c(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function h(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,r,n){return r&&h(e.prototype,r),n&&h(e,n),e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,r){return(p=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var y=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,n;return c(this,r),n=f(n=r),e=function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,v()?Reflect.construct(n,[],f(this).constructor):n.apply(this,void 0)),(0,o.c)(e.layers),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&p(r,e),d(r,[{key:"setFromCamera",value:function(e,r){r.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld),this.camera=r):r.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(r),this.ray.direction.set(e.x,e.y,.5).unproject(r).sub(this.ray.origin).normalize(),this.camera=r):console.error("Raycaster: Unsupported camera type.")}},{key:"intersectVisibleObjects",value:function(e){var r=this,n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.forEach(function(e){e.visible&&r.intersectObject(e,n,i)}),i}},{key:"createRaycastLineHelper",value:function(){var e=new u.ud({color:65280,linewidth:10}),r=new u.Fc(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new u.Fc(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,a=(new u.Fc).addVectors(r,n.multiplyScalar(i)),o=new u.dd;return o.setFromPoints([r,a]),new u.vd(o,e)}}]),r}(u.Ne),m=function(e){var r;return(null!=(r=i.a)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r)||(0,l.j)(e)};function g(e,r){return e.distance-r.distance}function b(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!i&&!n.some(function(r){return void 0!==S(e,r)}))return[];var o=[];return r.children.forEach(function(r){return function e(r,n,i){if((0,s.i)(n)&&n.visible){(0,a.e)(n)&&n.raycast(r,i);var o=!0,l=!1,u=void 0;try{for(var c,h=n.children[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=c.value;e(r,d,i)}}catch(e){l=!0,u=e}finally{try{o||null==h.return||h.return()}finally{if(l)throw u}}}}(e,r,o)}),o.sort(g),o}function w(e){var r=[];if(e.length){var n=e[0].object;(0,s.i)(n)&&r.push(n);for(var i=n.parent;i;)m(i)&&r.push(i),i=i.parent}return r}function x(e,r,n,i){var a=e.frame;if(a){var o=r[0]*a.width,s=(1-r[1])*a.height,l=!0,u=!1,c=void 0;try{for(var h,d=n[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value,p=f===a.uuid?a:a.find(f);if(null==p?void 0:p.intersects(o,s))return i(p),!0}}catch(e){u=!0,c=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}return!1}function S(e,r){if((0,a.e)(r)){if(r.visible){var n=[];return r.raycast(e,n),n.length?n[0]:void 0}}else if(m(r))return function e(r,n){if((0,s.i)(n)&&n.visible){if((0,a.e)(n)){var i=[];if(n.raycast(r,i),i.length)return i[0]}var o=!0,l=!1,u=void 0;try{for(var c,h=n.children[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=c.value,f=e(r,d);if(f)return f}}catch(e){l=!0,u=e}finally{try{o||null==h.return||h.return()}finally{if(l)throw u}}}}(e,r)}var k=function(){function e(r,n,i,a,o,s,l,u){c(this,e),this.renderer=r,this.publish=n,this.scene=i,this.getCamera=a,this.sharedAssets=o,this.requestRender=s,this.isExport=l,this.frame=u,this.raycaster=new y,this._useWindowEvents=!1,this.pointerWorld={x:0,y:0},this.pointerScreen={x:0,y:0},this._useWindowEvents="window"===n.mouseEventTarget,this.domElement=r.domElement,this.eventElement=this._useWindowEvents?window:r.domElement,this._domRect=this.domElement.getBoundingClientRect()}return d(e,[{key:"stopRaycast",get:function(){return this.publish.stopRaycast}},{key:"page",get:function(){return this.scene.activePage}},{key:"useWindowEvents",get:function(){return this._useWindowEvents},set:function(e){this._useWindowEvents=e,this.eventElement=e?window:this.renderer.domElement}},{key:"domRect",get:function(){return this._domRect},set:function(e){this._domRect=e}},{key:"updateRaycaster",value:function(e){var r,n,i,a=(null==(i=e.touches)?void 0:i.length)>0?e.touches[0]:e,o=a.pageX,s=a.pageY;this.pointerWorld={x:(o-((r=this._domRect).left+window.scrollX))/r.width*2-1,y:-(s-(r.top+window.scrollY))/r.height*2+1},this.pointerScreen={x:(o-((n=this._domRect).left+window.scrollX))/n.width,y:1-(s-(n.top+window.scrollY))/n.height},this.raycaster.setFromCamera(this.pointerWorld,this.getCamera())}},{key:"dispose",value:function(){this.scene=void 0,this.sharedAssets=void 0,this.publish=void 0,this.getCamera=void 0,this.requestRender=void 0,this.frame=void 0,this.isExport=void 0}}]),e}()},4691(e,r,n){function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function a(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function o(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n,i,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,l=!1;try{for(a=a.call(e);!(s=(n=a.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(e){l=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(l)throw i}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return i(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function l(e){var r,n,i,a,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=!0===l.leading,c=!1!==l.trailing,h=void 0!==l.maxWait?Math.max(l.maxWait,s):void 0,d=0,f=function(r){var o=n,s=i;return n=i=void 0,d=r,a=e.apply(s,o)},p=function(e){if(void 0===o)return!0;var r=e-o;return r>=s||r<0||void 0!==h&&e-d>=h},v=function(e){return r=void 0,c&&n?f(e):(n=i=void 0,a)},y=function(){var e,n=Date.now();p(n)?v(n):r=setTimeout(y,(e=s-(n-o),void 0!==h?Math.min(e,h-(n-d)):e))},m=function(){for(var e=arguments.length,l=Array(e),c=0;c<e;c++)l[c]=arguments[c];var v=Date.now(),m=p(v);if(n=l,i=this,o=v,m){if(void 0===r)return d=v,r=setTimeout(y,s),u?f(v):a;if(void 0!==h)return r=setTimeout(y,s),f(v)}return void 0===r&&(r=setTimeout(y,s)),a};return m.cancel=function(){void 0!==r&&clearTimeout(r),d=0,n=o=i=r=void 0},m.flush=function(){return void 0===r?a:v(Date.now())},m}function u(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(e,r,{leading:!1!==n.leading,trailing:!1!==n.trailing,maxWait:r})}function c(e){return function e(r,n){if(null===r||"object"!=(void 0===r?"undefined":s(r)))return r;if(n.has(r))return n.get(r);if(a(r,Date))return new Date(r.getTime());if(a(r,RegExp)){var i=new RegExp(r.source,r.flags);return i.lastIndex=r.lastIndex,i}if(a(r,ArrayBuffer))return r.slice(0);if(ArrayBuffer.isView(r))return new r.constructor(r.buffer.slice(0),r.byteOffset,a(r,DataView)?r.byteLength:r.length);if(a(r,Map)){var l=new Map;return n.set(r,l),r.forEach(function(r,i){return l.set(e(i,n),e(r,n))}),l}if(a(r,Set)){var u=new Set;return n.set(r,u),r.forEach(function(r){return u.add(e(r,n))}),u}if(Array.isArray(r)){var c=new r.constructor(r.length);n.set(r,c);var h=!0,d=!1,f=void 0;try{for(var p,v=Object.entries(r)[Symbol.iterator]();!(h=(p=v.next()).done);h=!0){var y=o(p.value,2),m=y[0],g=y[1];c[m]=e(g,n)}}catch(e){d=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(d)throw f}}return c}var b=Object.create(Object.getPrototypeOf(r));n.set(r,b);var w=!0,x=!1,S=void 0;try{for(var k,M=Object.entries(r)[Symbol.iterator]();!(w=(k=M.next()).done);w=!0){var A=o(k.value,2),O=A[0],C=A[1];b[O]=e(C,n)}}catch(e){x=!0,S=e}finally{try{w||null==M.return||M.return()}finally{if(x)throw S}}return b}(e,new Map)}function h(e,r){var n={},i=!0,a=!1,o=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;u in e&&(n[u]=e[u])}}catch(e){a=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return n}function d(e,r){var n=new Set(r),i={},a=!0,s=!1,l=void 0;try{for(var u,c=Object.entries(e)[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var h=o(u.value,2),d=h[0],f=h[1];n.has(d)||(i[d]=f)}}catch(e){s=!0,l=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}return i}function f(e){if(e&&0!==e.length){var r=!0,n=!1,i=void 0;try{for(var a,o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;l==l&&(void 0===a||l>a)&&(a=l)}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}return a}}function p(e,r){if(void 0===r)return e.replace(/\s+$/,"");for(var n=e.length;n>0&&r.includes(e[n-1]);)n--;return e.slice(0,n)}n.d(r,{a:()=>l,b:()=>u,c:()=>c,d:()=>function e(r,n){if(Object.is(r,n)||r!=r&&n!=n)return!0;if(null===r||null===n||"object"!=(void 0===r?"undefined":s(r))||"object"!=(void 0===n?"undefined":s(n)))return!1;if(a(r,Date)||a(n,Date))return a(r,Date)&&a(n,Date)&&r.getTime()===n.getTime();if(a(r,RegExp)||a(n,RegExp))return a(r,RegExp)&&a(n,RegExp)&&r.source===n.source&&r.flags===n.flags;if(Array.isArray(r)||Array.isArray(n))return!(!Array.isArray(r)||!Array.isArray(n)||r.length!==n.length)&&r.every(function(r,i){return e(r,n[i])});if(ArrayBuffer.isView(r)||ArrayBuffer.isView(n))return!(!ArrayBuffer.isView(r)||!ArrayBuffer.isView(n)||r.constructor!==n.constructor||r.length!==n.length)&&r.every(function(e,r){return Object.is(e,n[r])});if(a(r,Map)||a(n,Map)){if(!(a(r,Map)&&a(n,Map)&&r.size===n.size))return!1;var i=!0,l=!1,u=void 0;try{for(var c,h=r[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=o(c.value,2),f=d[0],p=d[1];if(!n.has(f)||!e(p,n.get(f)))return!1}}catch(e){l=!0,u=e}finally{try{i||null==h.return||h.return()}finally{if(l)throw u}}return!0}if(a(r,Set)||a(n,Set)){if(!(a(r,Set)&&a(n,Set)&&r.size===n.size))return!1;var v=!0,y=!1,m=void 0;try{for(var g,b=r[Symbol.iterator]();!(v=(g=b.next()).done);v=!0){var w=g.value;if(!n.has(w))return!1}}catch(e){y=!0,m=e}finally{try{v||null==b.return||b.return()}finally{if(y)throw m}}return!0}var x=Object.keys(r),S=Object.keys(n);return x.length===S.length&&x.every(function(i){return Object.prototype.hasOwnProperty.call(n,i)&&e(r[i],n[i])})},e:()=>h,f:()=>d,g:()=>f,h:()=>p})},7295(e,r,n){n.d(r,{a:()=>T});var i=n(5181),a=n(4691),o=n(3940),s=n(3027);function l(e,r,n){return r=f(r),function(e,r){if(r&&("object"===g(r)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,b()?Reflect.construct(r,n||[],f(e).constructor):r.apply(e,n))}function u(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function c(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function h(e,r,n){return r&&c(e.prototype,r),n&&c(e,n),e}function d(e,r,n){return(d="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=f(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&m(e,r)}function v(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(r){var i;i=n[r],r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i})}return e}function y(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function m(e,r){return(m=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function g(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function(){return!!e})()}var w=new s.Fc,x=new s.we,S=function(e){function r(e){u(this,r);var n,i=function(e,r,n){a(e,n),a(r,n)},a=function(e,r){h.push(0,0,0),d.push(r.r,r.g,r.b),void 0===f[e]&&(f[e]=[]),f[e].push(h.length/3-1)},o=new s.dd,c=new s.ud({color:0xffffff,vertexColors:!0,toneMapped:!1}),h=[],d=[],f={},p=new s.Tc(0xefbc22),v=new s.Tc(0xefbc22),y=new s.Tc(2857471);return i("n1","n2",p),i("n2","n4",p),i("n4","n3",p),i("n3","n1",p),i("f1","f2",p),i("f2","f4",p),i("f4","f3",p),i("f3","f1",p),i("n1","f1",p),i("n2","f2",p),i("n3","f3",p),i("n4","f4",p),i("p","n1",v),i("p","n2",v),i("p","n3",v),i("p","n4",v),i("u1","u2",y),i("u2","u3",y),i("u3","u1",y),o.setAttribute("position",new s.bd(h,3)),o.setAttribute("color",new s.bd(d,3)),(n=l(this,r,[o,c])).type="CameraHelper",n.camera=e,n.camera.updateProjectionMatrix&&n.camera.updateProjectionMatrix(),n.matrix=e.matrixWorld,n.matrixAutoUpdate=!1,n.pointMap=f,n.update(),n}return p(r,e),h(r,[{key:"update",value:function(){var e=this.geometry,r=this.pointMap;x.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001],k("n1",r,e,x,-1,-1,.8),k("n2",r,e,x,1,-1,.8),k("n3",r,e,x,-1,1,.8),k("n4",r,e,x,1,1,.8),k("f1",r,e,x,-1,-1,.8),k("f2",r,e,x,1,-1,.8),k("f3",r,e,x,-1,1,.8),k("f4",r,e,x,1,1,.8),k("u1",r,e,x,.35,1.1,.8),k("u2",r,e,x,-.35,1.1,.8),k("u3",r,e,x,0,1.55,.8),e.getAttribute("position").needsUpdate=!0}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose()}}]),r}(s.wd);function k(e,r,n,i,a,o,s){w.set(a,o,s).unproject(i);var l=r[e];if(void 0!==l)for(var u=n.getAttribute("position"),c=0,h=l.length;c<h;c++)u.setXYZ(l[c],w.x,w.y,w.z)}var M=function(e){function r(e){var n;return u(this,r),(n=l(this,r,[e])).object=e,n.name="CombinedCameraHelper: ".concat(e.uuid),n}return p(r,e),h(r,[{key:"updateMatrixWorld",value:function(e){d(f(r.prototype),"updateMatrixWorld",this).call(this,e),this.updateTarget()}},{key:"updateTarget",value:function(){var e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e)}},{key:"raycast",value:function(e,r){(0,i.b)(this.object,this.geometry,e,r,!0)}}]),r}((0,i.a)(S));function A(e){return 1-Math.pow(1-e,3)}var O=new s.Fc,C=new s.Fc,_=new s.Ec,P=new s.Fc,E=new s.Fc,D=new s.Fc,j=function(e){function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y(v({},o.ya.defaultData),{name:""});u(this,r),(e=l(this,r))._cameraType="OrthographicCamera",e.targetOffset=o.K.DefaultTargetOffset,e.isUpVectorFlipped=!1,e.angleOffsetFromUp=0,e.wasMovedByUser=!1,e.wasMovedBySwitchCameraAction=!1,e._createdAt=("u"<typeof performance?"undefined":g(performance))<"u"?performance.now():0,e._tickProjectionTransition=function(){var r,n=e._projectionTransition;if(void 0!==n){if(e.disposed)return void e._endProjectionTransition();n.raf=requestAnimationFrame(e._tickProjectionTransition);var i=null!=(r=j.projectionTransitionRequestRender)?r:n.requestRender;e.updateProjectionMatrix(),null==i||i()}},e.super_Entity(n,i),e.previousProjectionMatrix=new s.Oc,e.matrixAutoUpdate=!0,e.width=window.innerWidth,e.height=window.innerHeight;var a=e.width,c=e.height;return e.orthoCamera=new s.Ae(-.5*a,.5*a,.5*c,-.5*c,-5e4,1e4),e.perspCamera=new s.xe(45,a/c,50,1e4),e.left=e.orthoCamera.left,e.right=e.orthoCamera.right,e.top=e.orthoCamera.top,e.bottom=e.orthoCamera.bottom,e.far=e.orthoCamera.far,e.view=e.orthoCamera.view,e.aspect=e.perspCamera.aspect,e.focus=e.perspCamera.focus,e.filmGauge=e.perspCamera.filmGauge,e.filmOffset=e.perspCamera.filmOffset,e.objectHelper.update(),e}return p(r,e),h(r,[{key:"isPerspectiveCamera",get:function(){return"PerspectiveCamera"===this.cameraType}},{key:"isOrthographicCamera",get:function(){return!this.isPerspectiveCamera}},{key:"cameraType",get:function(){return this._cameraType},set:function(e){"PerspectiveCamera"===e?this.toPerspective():"OrthographicCamera"===e&&this.toOrthographic()}},{key:"fov",get:function(){return this.perspCamera.fov},set:function(e){this.perspCamera.fov=e}},{key:"setNear",value:function(e,r){"PerspectiveCamera"===e?this.perspCamera.near=r:this.orthoCamera.near=r}},{key:"setZoom",value:function(e,r){r>=0&&("PerspectiveCamera"===e?this.perspCamera.zoom=r:this.orthoCamera.zoom=r)}},{key:"near",get:function(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near},set:function(e){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=e:this.orthoCamera.near=e}},{key:"zoom",get:function(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom},set:function(e){e>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}},{key:"lookAt",value:function(e,n,i){"number"==typeof e&&(e=new s.Fc(e,n,i)),d(f(r.prototype),"lookAt",this).call(this,e),this.getWorldPosition(O),this.targetOffset=O.distanceTo(e)}},{key:"getTarget",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.Fc;return this.getWorldDirection(C),this.getWorldPosition(O),C.multiplyScalar(this.targetOffset),e.copy(O).add(C),e}},{key:"getDistanceToTarget",value:function(){var e=this.getTarget();return this.getWorldPosition(O),O.distanceTo(e)}},{key:"updateUp",value:function(){this.getWorldQuaternion(_),P.set(0,0,1).applyQuaternion(_),E.copy(s.Rc.DEFAULT_UP),this.isUpVectorFlipped&&E.negate(),E.applyQuaternion(_),D.copy(s.Rc.DEFAULT_UP).projectOnPlane(P),this.angleOffsetFromUp=D.angleTo(E),this.angleOffsetFromUp*=D.cross(E).dot(P)>=0?1:-1}},{key:"updateTransformState",value:function(e,n){var i=d(f(r.prototype),"updateTransformState",this).call(this,e,n);return void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateUp(),i}},{key:"getViewFrontToObject",value:function(e){var r=e.getWorldPosition(new s.Fc),n=e.getWorldDirection(new s.Fc).multiplyScalar(this.targetOffset);return{position:r.clone().add(n),target:r}}},{key:"getViewToTarget",value:function(e){var r=this.getWorldDirection(new s.Fc).multiplyScalar(this.targetOffset);return{position:e.clone().sub(r),target:e}}},{key:"getViewToObject",value:function(e){var r=new s.Fc;return e.getWorldPosition(r),this.getViewToTarget(r)}},{key:"setViewplaneSize",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.aspect=e/r,n){var i=e>r?this.aspect:1,a=e>r?1:this.aspect;this.left=-395*i,this.right=395*i,this.top=1/a*395,this.bottom=-(1/a*395)}else this.left=-(.5*e),this.right=.5*e,this.top=.5*r,this.bottom=-(.5*r);this.updateProjectionMatrix()}},{key:"copyViewPlaneSize",value:function(e){this.aspect=e.aspect,this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.updateProjectionMatrix()}},{key:"toOrthographic",value:function(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}},{key:"toPerspective",value:function(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}},{key:"isProjectionTransitioning",get:function(){return void 0!==this._projectionTransition}},{key:"projectionTransitionProgress",get:function(){var e=this._projectionTransition;if(void 0===e)return 1;var r=(performance.now()-e.start)/e.duration;return r>=1?1:r<=0?0:A(r)}},{key:"_activeSubCamera",get:function(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}},{key:"_canAnimateProjection",value:function(){return j.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&("u"<typeof performance?"undefined":g(performance))<"u"&&performance.now()-this._createdAt>=j.projectionTransitionMinAgeMs}},{key:"_beginProjectionTransition",value:function(e){var r=this._projectionTransition;void 0===r&&(r={from:new s.Oc,blend:new s.Oc,blendInverse:new s.Oc,start:0,duration:j.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:e},this._projectionTransition=r),r.from.copy(this.projectionMatrix),r.start=performance.now(),r.duration=j.projectionTransitionDuration,r.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,e&&(r.requestRender=e),0!==r.raf&&cancelAnimationFrame(r.raf),r.raf=requestAnimationFrame(this._tickProjectionTransition)}},{key:"_applyProjectionTransition",value:function(){var e=this._projectionTransition;if(void 0!==e){var r=(performance.now()-e.start)/e.duration;if(r>=1)return void this._endProjectionTransition();for(var n=A(r),i=e.from.elements,a=this._activeSubCamera.projectionMatrix.elements,o=e.blend.elements,s=e.referenceDepth,l=Math.max(1e-6,i[15]-i[11]*s),u=n*l/(n*l+(1-n)*Math.max(1e-6,a[15]-a[11]*s)),c=0;c<16;c++)o[c]=i[c]+(a[c]-i[c])*u;e.blendInverse.copy(e.blend).invert(),this.projectionMatrix=e.blend,this.projectionMatrixInverse=e.blendInverse}}},{key:"_endProjectionTransition",value:function(){var e=this._projectionTransition;if(void 0!==e){0!==e.raf&&cancelAnimationFrame(e.raf),this._projectionTransition=void 0;var r=this._activeSubCamera;this.projectionMatrix=r.projectionMatrix,this.projectionMatrixInverse=r.projectionMatrixInverse}}},{key:"_syncProjectionTransition",value:function(e){var r=e._projectionTransition;if(void 0===r)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());var n=this._projectionTransition;void 0===n?(n={from:new s.Oc,blend:new s.Oc,blendInverse:new s.Oc,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=n):0!==n.raf&&(cancelAnimationFrame(n.raf),n.raf=0),n.requestRender=void 0,n.from.copy(r.from),n.start=r.start,n.duration=r.duration,n.referenceDepth=r.referenceDepth,this._applyProjectionTransition()}},{key:"setFocalLength",value:function(e){this.perspCamera.setFocalLength(e),this.toPerspective()}},{key:"getFocalLength",value:function(){return this.perspCamera.getFocalLength()}},{key:"getEffectiveFOV",value:function(){return this.perspCamera.getEffectiveFOV()}},{key:"getFilmWidth",value:function(){return this.perspCamera.getFilmWidth()}},{key:"getFilmHeight",value:function(){return this.perspCamera.getFilmHeight()}},{key:"setViewOffset",value:function(e,r,n,i,a,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(e,r,n,i,a,o):this.orthoCamera.setViewOffset(e,r,n,i,a,o),this._applyProjectionTransition()}},{key:"clearViewOffset",value:function(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}},{key:"copyHistory",value:function(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}},{key:"updateProjectionMatrix",value:function(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}},{key:"updateMatrixWorld",value:function(e){d(f(r.prototype),"updateMatrixWorld",this).call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,n){d(f(r.prototype),"updateWorldMatrix",this).call(this,e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"copy",value:function(e,n){return d(f(r.prototype),"copy",this).call(this,e,n),this.parent=e.parent,this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=null===e.view?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=o.K.sanitizeTargetOffset(e.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(e),this}},{key:"toCameraState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return(0,a.f)(r,e)}},{key:"updateCameraSubtype",value:function(e,r){var n="perspective"===e?"PerspectiveCamera":"OrthographicCamera";void 0!==r.zoom&&this.setZoom(n,r.zoom),void 0!==r.near&&this.setNear(n,r.near),void 0!==r.fov&&"PerspectiveCamera"===n&&(this.fov=r.fov)}},{key:"updateState",value:function(e,r){this.updateCameraState(e,r)}},{key:"updateCameraState",value:function(e,r){this.updateState_Entity(e,r),void 0!==e.far&&(this.far=e.far),void 0!==e.orthographic&&this.updateCameraSubtype("orthographic",e.orthographic),void 0!==e.perspective&&this.updateCameraSubtype("perspective",e.perspective),void 0!==e.type&&(e.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(null==r?void 0:r.shared.requestRender),this.cameraType=e.type),void 0!==e.up&&this.up.fromArray(e.up.map(function(e){return"number"==typeof e?e:0})),void 0!==e.targetOffset&&(this.targetOffset=o.K.sanitizeTargetOffset(e.targetOffset)),void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateProjectionMatrix()}},{key:"updateByPatchedOp",value:function(e,n,i){d(f(r.prototype),"updateByPatchedOp",this).call(this,e,n,i),1===e.path.length&&0===e.type&&this.updateCameraSubtype(e.path[0],e.props)}},{key:"toState",value:function(e){return y(v({},d(f(r.prototype),"toState",this).call(this,e),this.toCameraState(e)),{type:this.cameraType})}}],[{key:"withoutProjectionTransition",value:function(e){var r=j.projectionTransitionsEnabled;j.projectionTransitionsEnabled=!1;try{return e()}finally{j.projectionTransitionsEnabled=r}}}]),r}((0,i.d)(s.we,M)),T=j;T.projectionTransitionsEnabled=!1,T.projectionTransitionDuration=350,T.projectionTransitionMinAgeMs=1e3},5498(e,r,n){function i(e,r,n,i,a,o,s){try{var l=e[o](s),u=l.value}catch(e){n(e);return}l.done?r(u):Promise.resolve(u).then(i,a)}n.d(r,{a:()=>s,b:()=>l,c:()=>c});var a,o,s=!1,l=new Promise(function(e){a=e}),u=!1;function c(){if(s=!0,!u){var e;return o||(o=(e=function(){var e;return function(e,r){var n,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,i&&(a=2&c[0]?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],i=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,n.e("9035").then(n.bind(n,2278))];case 1:return e=r.sent(),a(e),u=!0,[2]}})},function(){var r=this,n=arguments;return new Promise(function(a,o){var s=e.apply(r,n);function l(e){i(s,a,o,l,u,"next",e)}function u(e){i(s,a,o,l,u,"throw",e)}l(void 0)})})())}}},9968(e,r,n){function i(e,r){return r.color(e)}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=arguments.length>1?arguments[1]:void 0,n=r.format,i=e.getSeconds(),a=e;r&&null!==r.timeZone&&(a=function(e,r){try{var n=new Intl.DateTimeFormat("en-US",{timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(e),i=function(e){var r;return Number(null==(r=n.find(function(r){return r.type===e}))?void 0:r.value)};return new Date(i("year"),i("month")-1,i("day"),i("hour"),i("minute"),i("second"),e.getMilliseconds())}catch(e){return new Date(NaN)}}(new Date,r.timeZone));var o,s=a.getHours(),l=a.getMinutes();"12ampm"===r.format12h24h&&(o=s>=12?"PM":"AM");var u,c,h=s;switch("24"!==r.format12h24h&&0==(h=s%12)&&(h=12),n){case"HH:mm:ss":u=[h,l,i];break;case"HH:mm":u=[h,l];break;case"HH":u=[h],o=void 0;break;case"mm":u=[l],o=void 0;break;case"ss":u=[i],o=void 0;break;case"year":c=a.getFullYear();break;case"month":c=a.getMonth()+1;break;case"dayOfYear":c=Math.floor((a.getTime()-new Date(a.getFullYear(),0,0).getTime())/864e5);break;case"dayOfMonth":c=a.getDate();break;case"secondOfDay":c=60*s*60+60*l+i;break;default:console.error("Unknown time format",n),c=0}return void 0!==u?{textValue:u,suffix:o}:c}n.d(r,{a:()=>i,b:()=>a})},461(e,r,n){n.d(r,{a:()=>a,b:()=>o,c:()=>l,d:()=>h,e:()=>d,f:()=>f,g:()=>p,h:()=>y,i:()=>m,j:()=>w,k:()=>x,l:()=>S});var i=new Set;function a(e){i.add(e)}function o(e){return i.has(e)}var s=new Set;function l(e,r){var n="".concat(e,":").concat(r);s.has(n)||s.add(n)}var u=new Map,c=new Map;function h(e,r){u.set(e,r)}function d(e){return u.get(e)}function f(e,r){c.set(e,r)}function p(e){return c.get(e)}var v=new Map;function y(e,r){v.set(e,r)}function m(e){return v.get(e)}var g=null,b=null;function w(e){g=e,null!==b&&e.setHanaUIWasmUrl(b)}function x(e){b=e,null==g||g.setHanaUIWasmUrl(e)}function S(){return g}},7173(e,r,n){n.d(r,{a:()=>o,b:()=>l});var i=n(909),a=n(3027);function o(e){if(Array.isArray(e.material)){var r,n=!0,o=!1,s=void 0;try{for(var l,u=e.material[Symbol.iterator]();!(n=(l=u.next()).done);n=!0){var c=l.value;if(0===c.getLayersOfType("outline").length)return}}catch(e){o=!0,s=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw s}}}else if(!(0,i.h)(e.material)||0===e.material.getLayersOfType("outline").length)return;(null!=(r=i.ia)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r)&&e.is2DAndNoDepth?function(e){if(!e.geometry.attributes.extrudeNormals&&e.geometry.attributes.position){for(var r=e.geometry.attributes.position.array,n=new Float32Array(r.length),i=new a.Fc,o=0;o<r.length;o+=3)i.set(r[o],r[o+1],r[o+2]).normalize(),n[o]=i.x,n[o+1]=i.y,n[o+2]=i.z;e.geometry.setAttribute("extrudeNormal",new a.bd(n,3))}}(e):function(e){if(!e.geometry.attributes.extrudeNormal&&e.geometry.attributes.position&&e.geometry.attributes.normal){for(var r=new Map,n=e.geometry.attributes,i=n.position.array,o=n.normal.array,s=new Float32Array(i.length),l=0;l<i.length;l+=3){var u,c="".concat(i[l],"_").concat(i[l+1],"_").concat(i[l+2]),h=new a.Fc(o[l],o[l+1],o[l+2]);r.has(c)?null==(u=r.get(c))||u.normals.push(h):r.set(c,{normals:[h],result:new a.Fc})}r.forEach(function(e,r){var n=!0,i=!1,a=void 0;try{for(var o,s=e.normals[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;e.result.add(l)}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}e.result.divideScalar(e.normals.length)});for(var d=0;d<i.length;d+=3){var f,p="".concat(i[d],"_").concat(i[d+1],"_").concat(i[d+2]),v=null==(f=r.get(p))?void 0:f.result;v&&(s[d]=v.x,s[d+1]=v.y,s[d+2]=v.z)}e.geometry.setAttribute("extrudeNormal",new a.bd(s,3))}}(e)}function s(e){return Math.min(2047,Math.max(1,Math.round(2048*e)))/2048}function l(e){if(e.geometry.attributes.position){var r=e.geometry.attributes,n=r.position.array,i=r.randomColor;if(void 0===i||3*i.count!==n.length){for(var o=new Float32Array(n.length),l=parseInt(e.uuid.replace(/\D/g,"")),u=[s(a.Cc.seededRandom(l)),s(a.Cc.seededRandom(l+1e4)),s(a.Cc.seededRandom(l+2e4))],c=0;c<n.length;c++)o[c]=u[c%3];e.geometry.setAttribute("randomColor",new a.Zc(o,3))}}}},2865(e,r,n){n.d(r,{a:()=>a,b:()=>h,c:()=>f,d:()=>y,e:()=>m});var i=n(2769),a=[],o={},s={},l={};function u(e){a.includes(e)||a.push(e)}function c(e){delete o[e.pointerId];for(var r=0;r<a.length;r++)if(a[r].pointerId===e.pointerId){a.splice(r,1);break}}function h(){a.splice(0,a.length)}function d(e){if("touch"===e.pointerType){var r=o[e.pointerId];void 0===r&&(r={x:0,y:0},o[e.pointerId]=r),r.x=e.pageX,r.y=e.pageY}}function f(e){return o[(e.pointerId===a[0].pointerId?a[1]:a[0]).pointerId]}function p(e){s[e.key]=!0,l[e.key]=void 0===l[e.key]?1:l[e.key]+1}function v(e){if(i.b&&s.Meta)for(var r in s)s[r]=!1;else s[e.key]=!1;l={}}function y(e){e.addEventListener("pointerdown",u,!0),e.addEventListener("pointerdown",d,!0),e.addEventListener("pointermove",d,!0),e.addEventListener("pointerup",c,!0),e.addEventListener("pointercancel",c,!0),e.addEventListener("pointerleave",c,!0),window.addEventListener("keydown",p,!0),window.addEventListener("keyup",v,!0)}function m(e){e.removeEventListener("pointerdown",u,!0),e.removeEventListener("pointerdown",d,!0),e.removeEventListener("pointermove",d,!0),e.removeEventListener("pointerup",c,!0),e.removeEventListener("pointercancel",c,!0),e.removeEventListener("pointerleave",c,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener("keyup",v,!0)}},1955(e,r,n){n.d(r,{a:()=>p,b:()=>v});var i=n(7173),a=n(909),o=n(843),s=n(3027);function l(e,r,n){return(l="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=u(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,r){return(c=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}var d=new s.Xc,f=new s.Fc;function p(e){var r=!1;return e.scene.objects.traverse(function(e,n){"Mesh"===n.type&&"SubdivGeometry"===n.geometry.type&&(r=!0)}),r}var v=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(e,r,i){var a,o,l;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return o=n,l=[e,r,i],o=u(o),(a=function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(o,l||[],u(this).constructor):o.apply(this,l))).data=r,a.hiddenMatrixOld=new s.Oc,a.smoothShading=!0,a.skipReactionUpdate=!1,a}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&c(n,e),r=[{key:"chooseGeoemtryCache",value:function(e){return this.dataPatched.flatShading?e.geometryCache:e.geometryCache2}},{key:"subdivPointerNew",get:function(){return void 0!==this.localGeometry?this.subdivPointer:this.geometry.ensureSubdivPointer()}},{key:"originalGeometryNew",get:function(){return void 0!==this.localGeometry?this.originalGeometry:this.geometry.originalGeometry}},{key:"phongAngle",get:function(){var e;return null!=(e=this.data.geometry.phongAngle)?e:45}},{key:"updateEntityBoxSize",value:function(e,r){var n,i=this.geometry.userData.parameters;e.copy(this.originalGeometryNew.boundingSphere.center),r.set(i.width,i.height,null!=(n=i.depth)?n:0).multiplyScalar(.5)}},{key:"createGeometryByControls",value:function(e){if(!0!==this.skipReactionUpdate){var r,n,o,s,l=null==(n=this.localGeometry)?void 0:n.uuid,u=a.I.build(e,this.subdivPointer,this.smoothShading,this.hasNonUniformScale?this.shearScale:void 0),c=u.originalGeometry,h=u.subdividedGeometry,d=u.subdivPointer;this.subdivPointer=d,void 0!==c&&(null==(o=this.originalGeometry)||o.dispose(),this.originalGeometry=c),void 0!==h&&(null==(s=this.subdividedGeometry)||s.dispose(),this.subdividedGeometry=null!=h?h:void 0),this.localGeometry=null!=(r=this.subdividedGeometry)?r:this.originalGeometry,(0,i.a)(this),(0,i.b)(this),this.calcBoundingBox(),l&&(this.localGeometry.uuid=l)}}},{key:"updateState",value:function(e,r){if(l(u(n.prototype),"updateState",this).call(this,e,r),void 0!==e.flatShading){var i=this.material;this.material=Array.isArray(i)?i.map(function(e){return e.getFlavor(!1,e.side,e.wireframe)}):i.getFlavor(!1,i.side,i.wireframe),this.smoothShading=!e.flatShading,this.createGeometryDelayed(r)}}},{key:"updateMesh",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&this.subdividedGeometry||a.I.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1,this.originalGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0,n),this.subdividedGeometry&&a.I.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1,this.subdividedGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0)}},{key:"updateTopology",value:function(){var e,r,n=null==(r=this.localGeometry)?void 0:r.uuid;this.originalGeometry.dispose(),this.originalGeometry=a.I.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1),this.subdividedGeometry&&(this.subdividedGeometry.dispose(),this.subdividedGeometry=a.I.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1)),this.localGeometry=null!=(e=this.subdividedGeometry)?e:this.originalGeometry,(0,i.a)(this),(0,i.b)(this),this.calcBoundingBox(),n&&(this.localGeometry.uuid=n)}},{key:"raycast",value:function(e,r){var n=this.localGeometry;this.localGeometry=this.originalGeometryNew,o.v.prototype.raycast.call(this,e,r),this.localGeometry=n}},{key:"activateShearCompensation",value:function(){this.hasNonUniformScale&&(this.matrix.copy(this.matrixWorldRigid),this.hiddenMatrixOld.copy(this.hiddenMatrix),this.hiddenMatrix.copy(this.parent.matrixWorld).invert())}},{key:"deactivateShearCompensation",value:function(){this.hasNonUniformScale&&(this.updateMatrix(),this.hasNonUniformScale=void 0,this.hiddenMatrix.copy(this.hiddenMatrixOld))}},{key:"calcBoundingBox",value:function(){var e=this.originalGeometry;null===e.boundingSphere&&(e.boundingSphere=new s.cd,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=e.boundingSphere));var r=e.attributes.position,n=e.boundingSphere.center;d.setFromBufferAttribute(r),d.getCenter(n),e.boundingSphere.radius=n.distanceTo(d.max),isNaN(e.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),d.getSize(f),this.hasNonUniformScale&&f.divide(this.scale);var i={width:f.x,height:f.y,depth:f.z};return this.geometry.userData.parameters=i,i}},{key:"updateBoundingSphere",value:function(e){var r=this.originalGeometry;d.min.set(e[0],e[2],e[4]),d.max.set(e[1],e[3],e[5]),this.hasNonUniformScale&&(d.min.applyMatrix4(this.shearScaleInv),d.max.applyMatrix4(this.shearScaleInv)),null===r.boundingSphere&&(r.boundingSphere=new s.cd);var n=r.boundingSphere.center;d.getCenter(n),r.boundingSphere.radius=n.distanceTo(d.max)}},{key:"freeSubdivPointer",value:function(){var e,r;this.subdivPointer&&(a.I.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0),this.localGeometry=void 0,null==(e=this.originalGeometry)||e.dispose(),null==(r=this.subdividedGeometry)||r.dispose()}},{key:"dispose",value:function(){l(u(n.prototype),"dispose",this).call(this),this.freeSubdivPointer()}},{key:"updateSubdivisionLevel",value:function(e){if(!0!==this.skipReactionUpdate){var r,n,o,s=this.localGeometry,l=null==s?void 0:s.uuid,u=null==s?void 0:s.userData.parameters,c=e.subdivisions>0?a.I.buildRefined(this.subdivPointer,e.subdivisions,this.smoothShading?null!=(r=e.phongAngle)?r:35:-1):null;null==(o=this.subdividedGeometry)||o.dispose(),this.subdividedGeometry=null!=c?c:void 0,this.subdividedGeometry&&this.originalGeometry.boundingSphere&&(this.subdividedGeometry.boundingSphere=this.originalGeometry.boundingSphere),this.localGeometry=null!=(n=this.subdividedGeometry)?n:this.originalGeometry,(0,i.a)(this),(0,i.b)(this),void 0!==u&&(this.localGeometry.userData.parameters=u),l&&(this.localGeometry.uuid=l)}}},{key:"updateByPatchedOpGeometry",value:function(e,r,i){l(u(n.prototype),"updateByPatchedOpGeometry",this).call(this,e,r,i),this.localGeometry&&(0===e.type&&0===e.path.length&&(0,a.J)(e.props)&&this.subdivPointer?this.updateSubdivisionLevel(r):this.createGeometryByControls(r))}}],function(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(n.prototype,r),n}(a.ia)},7565(e,r,n){var i;function a(e){i=e}function o(e){if(void 0!==i)return"".concat(i,"/").concat(e);var r="file:///home/runner/work/Frontend-esm-framework/Frontend-esm-framework/node_modules/@splinetool/runtime/build/runtime-chunk-Y3BMDVJ7.js",n=r.lastIndexOf("/");return n>0?r.slice(0,n+1)+e:e}n.d(r,{a:()=>a,b:()=>o})},8005(e,r,n){n.d(r,{a:()=>m});var i=n(2995),a=n(5181),o=n(3027);function s(e,r,n){return r=d(r),function(e,r){var n;if(r&&("object"==((n=r)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,v()?Reflect.construct(r,n||[],d(e).constructor):r.apply(e,n))}function l(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function u(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function c(e,r,n){return r&&u(e.prototype,r),n&&u(e,n),e}function h(e,r,n){return(h="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,r,n){var i=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=d(e)););return e}(e,r);if(i){var a=Object.getOwnPropertyDescriptor(i,r);return a.get?a.get.call(n||e):a.value}})(e,r,n||e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&p(e,r)}function p(e,r){return(p=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var y=function(e){function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6710886;return l(this,r),(n=s(this,r,[e,i,a])).object=e,n.name="PointLightHelper: ".concat(e.uuid),n}return f(r,e),c(r,[{key:"raycast",value:function(e,r){(0,a.b)(this.object,y.geometryHelper,e,r)}}]),r}((0,a.a)(o.Te)),m=function(e){function r(e,n,i){l(this,r),(a=s(this,r)).super_Entity(e,n),a.castShadow=!0,a.shadow.mapSize.width=1024,a.shadow.mapSize.height=1024,a.shadow.normalBias=1,a.layers.enable(3);var a,u=a.shadow.camera;u.fov=90,u.aspect=1,u.near=100,u.far=2500;var c=new o.Fc(-u.far+a.position.x,-u.far+a.position.y,-u.far+a.position.z),h=new o.Fc(u.far+a.position.x,u.far+a.position.y,u.far+a.position.z),d=new o.Xc(c,h),f=new o.We(d,new o.Tc(0xffaa00));return f.visible=!1,a.gizmos.shadowmap=f,a.update(),a}return f(r,e),c(r,[{key:"update",value:function(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this.gizmos))for(var e in this.gizmos){var r,n=this.gizmos[e];if(null!=(r=o.We)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r){var i=this.shadow.camera,a=new o.Fc(-i.far+this.position.x,-i.far+this.position.y,-i.far+this.position.z),s=new o.Fc(i.far+this.position.x,i.far+this.position.y,i.far+this.position.z);n.box.set(a,s),n.updateMatrixWorld(!0)}}}},{key:"updateMatrixWorld",value:function(e){h(d(r.prototype),"updateMatrixWorld",this).call(this,e),this.objectHelper&&this.objectHelper.update()}},{key:"updateState",value:function(e,r){this.updateState_Light(e,r),void 0!==e.distance&&(this.distance=e.distance),void 0!==e.decay&&(this.decay=e.decay),void 0!==e.shadowRadius&&(this.shadow.radius=e.shadowRadius),void 0!==e.shadowResolution&&(this.shadow.mapSize.set(e.shadowResolution,e.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}}]),r}((0,i.d)(o.ze,y))}}]);
|