1 line
3.6 MiB
1 line
3.6 MiB
var zLe=Object.create,f1=Object.defineProperty,jLe=Object.defineProperties,WLe=Object.getOwnPropertyDescriptor,qLe=Object.getOwnPropertyDescriptors,YLe=Object.getOwnPropertyNames,b9=Object.getOwnPropertySymbols,I9=Object.getPrototypeOf,_9=Object.prototype.hasOwnProperty,XLe=Object.prototype.propertyIsEnumerable,$Le=Reflect.get,ap=Math.pow,x9=(e,t,i)=>t in e?f1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Mr=(e,t)=>{for(var i in t||(t={}))_9.call(t,i)&&x9(e,i,t[i]);if(b9)for(var i of b9(t))XLe.call(t,i)&&x9(e,i,t[i]);return e},Ln=(e,t)=>jLe(e,qLe(t)),_2=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')})),ZLe=(e,t)=>()=>(e&&(t=e(e=0)),t),z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fw=(e,t)=>{for(var i in t)f1(e,i,{get:t[i],enumerable:!0})},S9=(e,t,i,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of YLe(t))!_9.call(e,n)&&n!==i&&f1(e,n,{get:()=>t[n],enumerable:!(r=WLe(t,n))||r.enumerable});return e},ps=(e,t,i)=>(i=null!=e?zLe(I9(e)):{},S9(!t&&e&&e.__esModule?i:f1(i,"default",{value:e,enumerable:!0}),e)),KLe=e=>S9(f1({},"__esModule",{value:!0}),e),w9=(e,t,i)=>$Le(I9(e),i,t),ct=(e,t,i)=>new Promise(((r,n)=>{var s=e=>{try{o(i.next(e))}catch(e){n(e)}},a=e=>{try{o(i.throw(e))}catch(e){n(e)}},o=e=>e.done?r(e.value):Promise.resolve(e.value).then(s,a);o((i=i.apply(e,t)).next())})),D9={};function mw(e){return(mw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function QLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R9(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function eFe(e,t,i){return t&&R9(e.prototype,t),i&&R9(e,i),e}function nFe(e,t,i){var r=function(e){do{if(t(e))return e;e=e.replace(/-?[^-]*$/,"")}while(e);return null},n=function(){function n(i){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};QLe(this,n),this._locale=function(e){for(var t=M9(e),i=0;i<t.length;++i){var n=r(t[i]);if(n)return n}return r(rFe())}(i),this._select=t(this._locale),this._type=iFe(s.type),this._nf=new e("en",s)}return eFe(n,[{key:"resolvedOptions",value:function(){var e=this._nf.resolvedOptions(),t=e.minimumIntegerDigits,r=e.minimumFractionDigits,n=e.maximumFractionDigits,s=e.minimumSignificantDigits,a=e.maximumSignificantDigits,o={locale:this._locale,minimumIntegerDigits:t,minimumFractionDigits:r,maximumFractionDigits:n,pluralCategories:i(this._locale,"ordinal"===this._type),type:this._type};return"number"==typeof s&&(o.minimumSignificantDigits=s,o.maximumSignificantDigits=a),o}},{key:"select",value:function(e){if(!(this instanceof n))throw new TypeError("select() called on incompatible ".concat(this));if("number"!=typeof e&&(e=Number(e)),!isFinite(e))return"other";var t=this._nf.format(Math.abs(e));return this._select(t,"ordinal"===this._type)}}],[{key:"supportedLocalesOf",value:function(e){return M9(e).filter(r)}}]),n}();return Object.defineProperty(n,"prototype",{writable:!1}),n}fw(D9,{default:()=>nFe});var tFe,M9,rFe,iFe,C9=ZLe((()=>{tFe=function(e){return e.split("-").every((function(e){return/[a-z0-9]+/i.test(e)}))},M9=function(e){if(!e)return[];Array.isArray(e)||(e=[e]);for(var t={},i=0;i<e.length;++i){var r=e[i];if(r&&"object"===mw(r)&&(r=String(r)),"string"!=typeof r){var n="Locales should be strings, ".concat(JSON.stringify(r)," isn't.");throw new TypeError(n)}if("*"!==r[0]){if(!tFe(r)){var s=JSON.stringify(r),a="The locale ".concat(s," is not a structurally valid BCP 47 language tag.");throw new RangeError(a)}t[r]=!0}}return Object.keys(t)},rFe=function(){return"undefined"!=typeof navigator&&navigator&&(navigator.userLanguage||navigator.language)||"en-US"},iFe=function(e){if(!e)return"cardinal";if("cardinal"===e||"ordinal"===e)return e;throw new RangeError("Not a valid plural type: "+JSON.stringify(e))}})),P9=z(((e,t)=>{"use strict";function i(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r=function(){function e(t,i){var r=i.minimumIntegerDigits,n=i.minimumFractionDigits,s=i.maximumFractionDigits,a=i.minimumSignificantDigits,o=i.maximumSignificantDigits;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._minID="number"==typeof r?r:1,this._minFD="number"==typeof n?n:0,this._maxFD="number"==typeof s?s:Math.max(this._minFD,3),("number"==typeof a||"number"==typeof o)&&(this._minSD="number"==typeof a?a:1,this._maxSD="number"==typeof o?o:21)}return function(e,t,r){t&&i(e.prototype,t)}(e,[{key:"resolvedOptions",value:function(){var e={minimumIntegerDigits:this._minID,minimumFractionDigits:this._minFD,maximumFractionDigits:this._maxFD};return"number"==typeof this._minSD&&(e.minimumSignificantDigits=this._minSD,e.maximumSignificantDigits=this._maxSD),e}},{key:"format",value:function(e){if(this._minSD){for(var t=String(e),i=0,r=0;r<t.length;++r){var n=t[r];n>="0"&&n<="9"&&++i}return i<this._minSD?e.toPrecision(this._minSD):i>this._maxSD?e.toPrecision(this._maxSD):t}return this._minFD>0?e.toFixed(this._minFD):0===this._maxFD?e.toFixed(0):String(e)}}]),e}();t.exports=r})),G9=z(((e,t)=>{"use strict";var i=(C9(),KLe(D9)),r=P9();function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(i),a=n(r);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var h,u,c,p,d,f,m,g,y={exports:{}};h=y,c=function(e,t){return t?"other":1==e?"one":"other"},p=function(e,t){return t?"other":0==e||1==e?"one":"other"},d=function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},f=function(e,t){var i=!String(e).split(".")[1];return t?"other":1==e&&i?"one":"other"},g=function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},u={_in:m=function(e,t){return"other"},af:c,ak:p,am:d,an:c,ar:function(e,t){var i=String(e).split("."),r=Number(i[0])==e&&i[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ars:function(e,t){var i=String(e).split("."),r=Number(i[0])==e&&i[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:c,ast:f,az:function(e,t){var i=String(e).split(".")[0],r=i.slice(-1),n=i.slice(-2),s=i.slice(-3);return t?1==r||2==r||5==r||7==r||8==r||20==n||50==n||70==n||80==n?"one":3==r||4==r||100==s||200==s||300==s||400==s||500==s||600==s||700==s||800==s||900==s?"few":0==i||6==r||40==n||60==n||90==n?"many":"other":1==e?"one":"other"},be:function(e,t){var i=String(e).split("."),r=Number(i[0])==e,n=r&&i[0].slice(-1),s=r&&i[0].slice(-2);return t?2!=n&&3!=n||12==s||13==s?"other":"few":1==n&&11!=s?"one":n>=2&&n<=4&&(s<12||s>14)?"few":r&&0==n||n>=5&&n<=9||s>=11&&s<=14?"many":"other"},bem:c,bez:c,bg:c,bho:p,bm:m,bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:m,br:function(e,t){var i=String(e).split("."),r=Number(i[0])==e,n=r&&i[0].slice(-1),s=r&&i[0].slice(-2),a=r&&i[0].slice(-6);return t?"other":1==n&&11!=s&&71!=s&&91!=s?"one":2==n&&12!=s&&72!=s&&92!=s?"two":(3==n||4==n||9==n)&&(s<10||s>19)&&(s<70||s>79)&&(s<90||s>99)?"few":0!=e&&r&&0==a?"many":"other"},brx:c,bs:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=r.slice(-2),l=n.slice(-1),h=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=h?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(h<12||h>14)?"few":"other"},ca:function(e,t){var i=!String(e).split(".")[1];return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&i?"one":"other"},ce:c,ceb:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=n.slice(-1);return t?"other":s&&(1==r||2==r||3==r)||s&&4!=a&&6!=a&&9!=a||!s&&4!=o&&6!=o&&9!=o?"one":"other"},cgg:c,chr:c,ckb:c,cs:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1];return t?"other":1==e&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var i=String(e).split("."),r=i[0],n=Number(i[0])==e;return t||1!=e&&(n||0!=r&&1!=r)?"other":"one"},de:f,doi:d,dsb:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-2),o=n.slice(-2);return t?"other":s&&1==a||1==o?"one":s&&2==a||2==o?"two":s&&(3==a||4==a)||3==o||4==o?"few":"other"},dv:c,dz:m,ee:c,el:c,en:function(e,t){var i=String(e).split("."),r=!i[1],n=Number(i[0])==e,s=n&&i[0].slice(-1),a=n&&i[0].slice(-2);return t?1==s&&11!=a?"one":2==s&&12!=a?"two":3==s&&13!=a?"few":"other":1==e&&r?"one":"other"},eo:c,es:c,et:f,eu:c,fa:d,ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:f,fil:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=n.slice(-1);return t?1==e?"one":"other":s&&(1==r||2==r||3==r)||s&&4!=a&&6!=a&&9!=a||!s&&4!=o&&6!=o&&9!=o?"one":"other"},fo:c,fr:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=r.slice(-6);return t?1==e?"one":"other":e>=0&&e<2?"one":0!=r&&0==s&&n?"many":"other"},fur:c,fy:f,ga:function(e,t){var i=String(e).split("."),r=Number(i[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var i=String(e).split("."),r=Number(i[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"},gl:f,gsw:c,gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:p,gv:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=r.slice(-1),a=r.slice(-2);return t?"other":n&&1==s?"one":n&&2==s?"two":!n||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?n?"other":"many":"few"},ha:c,haw:c,he:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=Number(i[0])==e,a=s&&i[0].slice(-1);return t?"other":1==e&&n?"one":2==r&&n?"two":n&&(e<0||e>10)&&s&&0==a?"many":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hr:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=r.slice(-2),l=n.slice(-1),h=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=h?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(h<12||h>14)?"few":"other"},hsb:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-2),o=n.slice(-2);return t?"other":s&&1==a||1==o?"one":s&&2==a||2==o?"two":s&&(3==a||4==a)||3==o||4==o?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:f,id:m,ig:m,ii:m,io:f,is:function(e,t){var i=String(e).split("."),r=i[0],n=Number(i[0])==e,s=r.slice(-1),a=r.slice(-2);return t?"other":n&&1==s&&11!=a||!n?"one":"other"},it:function(e,t){var i=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":"other"},iu:g,iw:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=Number(i[0])==e,a=s&&i[0].slice(-1);return t?"other":1==e&&n?"one":2==r&&n?"two":n&&(e<0||e>10)&&s&&0==a?"many":"other"},ja:m,jbo:m,jgo:c,ji:f,jmc:c,jv:m,jw:m,ka:function(e,t){var i=String(e).split(".")[0],r=i.slice(-2);return t?1==i?"one":0==i||r>=2&&r<=20||40==r||60==r||80==r?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:c,kcg:c,kde:m,kea:m,kk:function(e,t){var i=String(e).split("."),r=Number(i[0])==e,n=r&&i[0].slice(-1);return t?6==n||9==n||r&&0==n&&0!=e?"many":"other":1==e?"one":"other"},kkj:c,kl:c,km:m,kn:d,ko:m,ks:c,ksb:c,ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:c,kw:function(e,t){var i=String(e).split("."),r=Number(i[0])==e,n=r&&i[0].slice(-2),s=r&&i[0].slice(-3),a=r&&i[0].slice(-5),o=r&&i[0].slice(-6);return t?r&&e>=1&&e<=4||n>=1&&n<=4||n>=21&&n<=24||n>=41&&n<=44||n>=61&&n<=64||n>=81&&n<=84?"one":5==e||5==n?"many":"other":0==e?"zero":1==e?"one":2==n||22==n||42==n||62==n||82==n||r&&0==s&&(a>=1e3&&a<=2e4||4e4==a||6e4==a||8e4==a)||0!=e&&1e5==o?"two":3==n||23==n||43==n||63==n||83==n?"few":1==e||1!=n&&21!=n&&41!=n&&61!=n&&81!=n?"other":"many"},ky:c,lag:function(e,t){var i=String(e).split(".")[0];return t?"other":0==e?"zero":0!=i&&1!=i||0==e?"other":"one"},lb:c,lg:c,lij:function(e,t){var i=String(e).split("."),r=!i[1],n=Number(i[0])==e;return t?11==e||8==e||n&&e>=80&&e<=89||n&&e>=800&&e<=899?"many":"other":1==e&&r?"one":"other"},lkt:m,ln:p,lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var i=String(e).split("."),r=i[1]||"",n=Number(i[0])==e,s=n&&i[0].slice(-1),a=n&&i[0].slice(-2);return t?"other":1==s&&(a<11||a>19)?"one":s>=2&&s<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(e,t){var i=String(e).split("."),r=i[1]||"",n=r.length,s=Number(i[0])==e,a=s&&i[0].slice(-1),o=s&&i[0].slice(-2),l=r.slice(-2),h=r.slice(-1);return t?"other":s&&0==a||o>=11&&o<=19||2==n&&l>=11&&l<=19?"zero":1==a&&11!=o||2==n&&1==h&&11!=l||2!=n&&1==h?"one":"other"},mas:c,mg:p,mgo:c,mk:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=r.slice(-2),l=n.slice(-1),h=n.slice(-2);return t?1==a&&11!=o?"one":2==a&&12!=o?"two":7!=a&&8!=a||17==o||18==o?"other":"many":s&&1==a&&11!=o||1==l&&11!=h?"one":"other"},ml:c,mn:c,mo:function(e,t){var i=String(e).split("."),r=!i[1],n=Number(i[0])==e&&i[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||n>=2&&n<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":1==e?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var i=String(e).split("."),r=Number(i[0])==e&&i[0].slice(-2);return t?"other":1==e?"one":0==e||r>=2&&r<=10?"few":r>=11&&r<=19?"many":"other"},my:m,nah:c,naq:g,nb:c,nd:c,ne:function(e,t){var i=String(e).split("."),r=Number(i[0])==e;return t?r&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:f,nn:c,nnh:c,no:c,nqo:m,nr:c,nso:p,ny:c,nyn:c,om:c,or:function(e,t){var i=String(e).split("."),r=Number(i[0])==e;return t?1==e||5==e||r&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:c,osa:m,pa:p,pap:c,pcm:d,pl:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=r.slice(-1),a=r.slice(-2);return t?"other":1==e&&n?"one":n&&s>=2&&s<=4&&(a<12||a>14)?"few":n&&1!=r&&(0==s||1==s)||n&&s>=5&&s<=9||n&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var i=String(e).split("."),r=i[1]||"",n=r.length,s=Number(i[0])==e,a=s&&i[0].slice(-1),o=s&&i[0].slice(-2),l=r.slice(-2),h=r.slice(-1);return t?"other":s&&0==a||o>=11&&o<=19||2==n&&l>=11&&l<=19?"zero":1==a&&11!=o||2==n&&1==h&&11!=l||2!=n&&1==h?"one":"other"},ps:c,pt:function(e,t){var i=String(e).split(".")[0];return t?"other":0==i||1==i?"one":"other"},pt_PT:f,rm:c,ro:function(e,t){var i=String(e).split("."),r=!i[1],n=Number(i[0])==e&&i[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||n>=2&&n<=19?"few":"other"},rof:c,root:m,ru:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=r.slice(-1),a=r.slice(-2);return t?"other":n&&1==s&&11!=a?"one":n&&s>=2&&s<=4&&(a<12||a>14)?"few":n&&0==s||n&&s>=5&&s<=9||n&&a>=11&&a<=14?"many":"other"},rwk:c,sah:m,saq:c,sat:g,sc:function(e,t){var i=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":"other"},scn:function(e,t){var i=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":"other"},sd:c,sdh:c,se:g,seh:c,ses:m,sg:m,sh:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=r.slice(-2),l=n.slice(-1),h=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=h?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(h<12||h>14)?"few":"other"},shi:function(e,t){var i=String(e).split("."),r=Number(i[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"},si:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"";return t?"other":0==e||1==e||0==r&&1==n?"one":"other"},sk:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1];return t?"other":1==e&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},sl:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=r.slice(-2);return t?"other":n&&1==s?"one":n&&2==s?"two":n&&(3==s||4==s)||!n?"few":"other"},sma:g,smi:g,smj:g,smn:g,sms:g,sn:c,so:c,sq:function(e,t){var i=String(e).split("."),r=Number(i[0])==e,n=r&&i[0].slice(-1),s=r&&i[0].slice(-2);return t?1==e?"one":4==n&&14!=s?"many":"other":1==e?"one":"other"},sr:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=r.slice(-2),l=n.slice(-1),h=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=h?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(h<12||h>14)?"few":"other"},ss:c,ssy:c,st:c,su:m,sv:function(e,t){var i=String(e).split("."),r=!i[1],n=Number(i[0])==e,s=n&&i[0].slice(-1),a=n&&i[0].slice(-2);return t?1!=s&&2!=s||11==a||12==a?"other":"one":1==e&&r?"one":"other"},sw:f,syr:c,ta:c,te:c,teo:c,th:m,ti:p,tig:c,tk:function(e,t){var i=String(e).split("."),r=Number(i[0])==e&&i[0].slice(-1);return t?6==r||9==r||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var i=String(e).split("."),r=i[0],n=i[1]||"",s=!i[1],a=r.slice(-1),o=n.slice(-1);return t?1==e?"one":"other":s&&(1==r||2==r||3==r)||s&&4!=a&&6!=a&&9!=a||!s&&4!=o&&6!=o&&9!=o?"one":"other"},tn:c,to:m,tr:c,ts:c,tzm:function(e,t){var i=String(e).split("."),r=Number(i[0])==e;return t?"other":0==e||1==e||r&&e>=11&&e<=99?"one":"other"},ug:c,uk:function(e,t){var i=String(e).split("."),r=i[0],n=!i[1],s=Number(i[0])==e,a=s&&i[0].slice(-1),o=s&&i[0].slice(-2),l=r.slice(-1),h=r.slice(-2);return t?3==a&&13!=o?"few":"other":n&&1==l&&11!=h?"one":n&&l>=2&&l<=4&&(h<12||h>14)?"few":n&&0==l||n&&l>=5&&l<=9||n&&h>=11&&h<=14?"many":"other"},ur:f,uz:c,ve:c,vi:function(e,t){return t&&1==e?"one":"other"},vo:c,vun:c,wa:p,wae:c,wo:m,xh:c,xog:c,yi:f,yo:m,yue:m,zh:m,zu:d},Object.defineProperty(u,"__esModule",{value:!0}),h.exports=u;var v=l(y.exports),T=Object.freeze(Object.assign(Object.create(null),y.exports,{default:v})),x={exports:{}};!function(e,t){var i,r="zero",n="one",s="two",a="few",o="many",l="other",h={cardinal:[n,l],ordinal:[l]},u={cardinal:[l],ordinal:[l]},c={cardinal:[n,a,o,l],ordinal:[l]},p={cardinal:[n,l],ordinal:[n,l]},d={cardinal:[n,s,l],ordinal:[l]};i={_in:u,af:h,ak:h,am:h,an:h,ar:{cardinal:[r,n,s,a,o,l],ordinal:[l]},ars:{cardinal:[r,n,s,a,o,l],ordinal:[l]},as:{cardinal:[n,l],ordinal:[n,s,a,o,l]},asa:h,ast:h,az:{cardinal:[n,l],ordinal:[n,a,o,l]},be:{cardinal:[n,a,o,l],ordinal:[a,l]},bem:h,bez:h,bg:h,bho:h,bm:u,bn:{cardinal:[n,l],ordinal:[n,s,a,o,l]},bo:u,br:{cardinal:[n,s,a,o,l],ordinal:[l]},brx:h,bs:{cardinal:[n,a,l],ordinal:[l]},ca:{cardinal:[n,l],ordinal:[n,s,a,l]},ce:h,ceb:h,cgg:h,chr:h,ckb:h,cs:c,cy:{cardinal:[r,n,s,a,o,l],ordinal:[r,n,s,a,o,l]},da:h,de:h,doi:h,dsb:{cardinal:[n,s,a,l],ordinal:[l]},dv:h,dz:u,ee:h,el:h,en:{cardinal:[n,l],ordinal:[n,s,a,l]},eo:h,es:h,et:h,eu:h,fa:h,ff:h,fi:h,fil:p,fo:h,fr:{cardinal:[n,o,l],ordinal:[n,l]},fur:h,fy:h,ga:{cardinal:[n,s,a,o,l],ordinal:[n,l]},gd:{cardinal:[n,s,a,l],ordinal:[n,s,a,l]},gl:h,gsw:h,gu:{cardinal:[n,l],ordinal:[n,s,a,o,l]},guw:h,gv:{cardinal:[n,s,a,o,l],ordinal:[l]},ha:h,haw:h,he:{cardinal:[n,s,o,l],ordinal:[l]},hi:{cardinal:[n,l],ordinal:[n,s,a,o,l]},hr:{cardinal:[n,a,l],ordinal:[l]},hsb:{cardinal:[n,s,a,l],ordinal:[l]},hu:p,hy:p,ia:h,id:u,ig:u,ii:u,io:h,is:h,it:{cardinal:[n,l],ordinal:[o,l]},iu:d,iw:{cardinal:[n,s,o,l],ordinal:[l]},ja:u,jbo:u,jgo:h,ji:h,jmc:h,jv:u,jw:u,ka:{cardinal:[n,l],ordinal:[n,o,l]},kab:h,kaj:h,kcg:h,kde:u,kea:u,kk:{cardinal:[n,l],ordinal:[o,l]},kkj:h,kl:h,km:u,kn:h,ko:u,ks:h,ksb:h,ksh:{cardinal:[r,n,l],ordinal:[l]},ku:h,kw:{cardinal:[r,n,s,a,o,l],ordinal:[n,o,l]},ky:h,lag:{cardinal:[r,n,l],ordinal:[l]},lb:h,lg:h,lij:{cardinal:[n,l],ordinal:[o,l]},lkt:u,ln:h,lo:{cardinal:[l],ordinal:[n,l]},lt:c,lv:{cardinal:[r,n,l],ordinal:[l]},mas:h,mg:h,mgo:h,mk:{cardinal:[n,l],ordinal:[n,s,o,l]},ml:h,mn:h,mo:{cardinal:[n,a,l],ordinal:[n,l]},mr:{cardinal:[n,l],ordinal:[n,s,a,l]},ms:{cardinal:[l],ordinal:[n,l]},mt:c,my:u,nah:h,naq:d,nb:h,nd:h,ne:p,nl:h,nn:h,nnh:h,no:h,nqo:u,nr:h,nso:h,ny:h,nyn:h,om:h,or:{cardinal:[n,l],ordinal:[n,s,a,o,l]},os:h,osa:u,pa:h,pap:h,pcm:h,pl:c,prg:{cardinal:[r,n,l],ordinal:[l]},ps:h,pt:h,pt_PT:h,rm:h,ro:{cardinal:[n,a,l],ordinal:[n,l]},rof:h,root:u,ru:c,rwk:h,sah:u,saq:h,sat:d,sc:{cardinal:[n,l],ordinal:[o,l]},scn:{cardinal:[n,l],ordinal:[o,l]},sd:h,sdh:h,se:d,seh:h,ses:u,sg:u,sh:{cardinal:[n,a,l],ordinal:[l]},shi:{cardinal:[n,a,l],ordinal:[l]},si:h,sk:c,sl:{cardinal:[n,s,a,l],ordinal:[l]},sma:d,smi:d,smj:d,smn:d,sms:d,sn:h,so:h,sq:{cardinal:[n,l],ordinal:[n,o,l]},sr:{cardinal:[n,a,l],ordinal:[l]},ss:h,ssy:h,st:h,su:u,sv:p,sw:h,syr:h,ta:h,te:h,teo:h,th:u,ti:h,tig:h,tk:{cardinal:[n,l],ordinal:[a,l]},tl:p,tn:h,to:u,tr:h,ts:h,tzm:h,ug:h,uk:{cardinal:[n,a,o,l],ordinal:[a,l]},ur:h,uz:h,ve:h,vi:{cardinal:[l],ordinal:[n,l]},vo:h,vun:h,wa:h,wae:h,wo:u,xh:h,xog:h,yi:h,yo:u,yue:u,zh:u,zu:h},Object.defineProperty(i,"__esModule",{value:!0}),e.exports=i}(x);var b=l(x.exports),E=Object.freeze(Object.assign(Object.create(null),x.exports,{default:b})),_=v||T,w=b||E,S="object"===("undefined"==typeof Intl?"undefined":o(Intl))&&Intl.NumberFormat||a.default,M=function(e){return"in"===e?"_in":"pt-PT"===e?"pt_PT":e},I=s.default(S,(function(e){return _[M(e)]}),(function(e,t){return w[M(e)][t?"ordinal":"cardinal"]}));t.exports=I})),j9=z((e=>{"use strict";var t,i,r=(t=G9())&&"object"==typeof t&&"default"in t?t:{default:t};"undefined"==typeof Intl?("undefined"!=typeof global?global.Intl={PluralRules:r.default}:"undefined"!=typeof window?window.Intl={PluralRules:r.default}:e.Intl={PluralRules:r.default},r.default.polyfill=!0):Intl.PluralRules?(i=["en","es","ru","zh"],Intl.PluralRules.supportedLocalesOf(i).length<i.length&&(Intl.PluralRules=r.default,r.default.polyfill=!0)):(Intl.PluralRules=r.default,r.default.polyfill=!0)})),Qt=z(((e,t)=>{var i=function(e){return e&&e.Math==Math&&e};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof global&&global)||function(){return this}()||e||Function("return this")()})),Dt=z(((e,t)=>{t.exports=function(e){try{return!!e()}catch(e){return!0}}})),Dr=z(((e,t)=>{var i=Dt();t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))})),uv=z(((e,t)=>{var i=Dt();t.exports=!i((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))})),ri=z(((e,t)=>{var i=uv(),r=Function.prototype.call;t.exports=i?r.bind(r):function(){return r.apply(r,arguments)}})),m1=z((e=>{"use strict";var t={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!t.call({1:2},1);e.f=r?function(e){var t=i(this,e);return!!t&&t.enumerable}:t})),Bo=z(((e,t)=>{t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}})),Lt=z(((e,t)=>{var i=uv(),r=Function.prototype,n=r.call,s=i&&r.bind.bind(n,n);t.exports=i?s:function(e){return function(){return n.apply(e,arguments)}}})),Qs=z(((e,t)=>{var i=Lt(),r=i({}.toString),n=i("".slice);t.exports=function(e){return n(r(e),8,-1)}})),Om=z(((e,t)=>{var i=Lt(),r=Dt(),n=Qs(),s=Object,a=i("".split);t.exports=r((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==n(e)?a(e,""):s(e)}:s})),Ra=z(((e,t)=>{t.exports=function(e){return null==e}})),ds=z(((e,t)=>{var i=Ra(),r=TypeError;t.exports=function(e){if(i(e))throw r("Can't call method on "+e);return e}})),bs=z(((e,t)=>{var i=Om(),r=ds();t.exports=function(e){return i(r(e))}})),A2=z(((e,t)=>{var i="object"==typeof document&&document.all,r=void 0===i&&void 0!==i;t.exports={all:i,IS_HTMLDDA:r}})),yi=z(((e,t)=>{var i=A2(),r=i.all;t.exports=i.IS_HTMLDDA?function(e){return"function"==typeof e||e===r}:function(e){return"function"==typeof e}})),Ei=z(((e,t)=>{var i=yi(),r=A2(),n=r.all;t.exports=r.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:i(e)||e===n}:function(e){return"object"==typeof e?null!==e:i(e)}})),Sn=z(((e,t)=>{var i=Qt(),r=yi();t.exports=function(e,t){return arguments.length<2?function(e){return r(e)?e:void 0}(i[e]):i[e]&&i[e][t]}})),ko=z(((e,t)=>{var i=Lt();t.exports=i({}.isPrototypeOf)})),Pu=z(((e,t)=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""})),Nu=z(((e,t)=>{var i,r,n=Qt(),s=Pu(),a=n.process,o=n.Deno,l=a&&a.versions||o&&o.version,h=l&&l.v8;h&&(r=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!r&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(r=+i[1]),t.exports=r})),Pm=z(((e,t)=>{var i=Nu(),r=Dt(),n=Qt().String;t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&i&&i<41}))})),N2=z(((e,t)=>{var i=Pm();t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator})),kd=z(((e,t)=>{var i=Sn(),r=yi(),n=ko(),s=N2(),a=Object;t.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=i("Symbol");return r(t)&&n(t.prototype,a(e))}})),Gd=z(((e,t)=>{var i=String;t.exports=function(e){try{return i(e)}catch(e){return"Object"}}})),Wn=z(((e,t)=>{var i=yi(),r=Gd(),n=TypeError;t.exports=function(e){if(i(e))return e;throw n(r(e)+" is not a function")}})),Lu=z(((e,t)=>{var i=Wn(),r=Ra();t.exports=function(e,t){var n=e[t];return r(n)?void 0:i(n)}})),U2=z(((e,t)=>{var i=ri(),r=yi(),n=Ei(),s=TypeError;t.exports=function(e,t){var a,o;if("string"===t&&r(a=e.toString)&&!n(o=i(a,e))||r(a=e.valueOf)&&!n(o=i(a,e))||"string"!==t&&r(a=e.toString)&&!n(o=i(a,e)))return o;throw s("Can't convert object to primitive value")}})),qn=z(((e,t)=>{t.exports=!1})),Tw=z(((e,t)=>{var i=Qt(),r=Object.defineProperty;t.exports=function(e,t){try{r(i,e,{value:t,configurable:!0,writable:!0})}catch(r){i[e]=t}return t}})),bw=z(((e,t)=>{var i=Qt(),r=Tw(),n="__core-js_shared__",s=i[n]||r(n,{});t.exports=s})),Nm=z(((e,t)=>{var i=qn(),r=bw();(t.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:i?"pure":"global",copyright:"\xa9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"})})),Vi=z(((e,t)=>{var i=ds(),r=Object;t.exports=function(e){return r(i(e))}})),Ci=z(((e,t)=>{var i=Lt(),r=Vi(),n=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return n(r(e),t)}})),Lm=z(((e,t)=>{var i=Lt(),r=0,n=Math.random(),s=i(1..toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+n,36)}})),Ti=z(((e,t)=>{var i=Qt(),r=Nm(),n=Ci(),s=Lm(),a=Pm(),o=N2(),l=i.Symbol,h=r("wks"),u=o?l.for||l:l&&l.withoutSetter||s;t.exports=function(e){return n(h,e)||(h[e]=a&&n(l,e)?l[e]:u("Symbol."+e)),h[e]}})),g1=z(((e,t)=>{var i=ri(),r=Ei(),n=kd(),s=Lu(),a=U2(),o=Ti(),l=TypeError,h=o("toPrimitive");t.exports=function(e,t){if(!r(e)||n(e))return e;var o,u=s(e,h);if(u){if(void 0===t&&(t="default"),o=i(u,e,t),!r(o)||n(o))return o;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}})),op=z(((e,t)=>{var i=g1(),r=kd();t.exports=function(e){var t=i(e,"string");return r(t)?t:t+""}})),v1=z(((e,t)=>{var i=Qt(),r=Ei(),n=i.document,s=r(n)&&r(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}})),G2=z(((e,t)=>{var i=Dr(),r=Dt(),n=v1();t.exports=!i&&!r((function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))})),Vs=z((e=>{var t=Dr(),i=ri(),r=m1(),n=Bo(),s=bs(),a=op(),o=Ci(),l=G2(),h=Object.getOwnPropertyDescriptor;e.f=t?h:function(e,t){if(e=s(e),t=a(t),l)try{return h(e,t)}catch(e){}if(o(e,t))return n(!i(r.f,e,t),e[t])}})),V2=z(((e,t)=>{var i=Dr(),r=Dt();t.exports=i&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))})),$r=z(((e,t)=>{var i=Ei(),r=String,n=TypeError;t.exports=function(e){if(i(e))return e;throw n(r(e)+" is not an object")}})),An=z((e=>{var t=Dr(),i=G2(),r=V2(),n=$r(),s=op(),a=TypeError,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",u="configurable",c="writable";e.f=t?r?function(e,t,i){if(n(e),t=s(t),n(i),"function"==typeof e&&"prototype"===t&&"value"in i&&c in i&&!i[c]){var r=l(e,t);r&&r[c]&&(e[t]=i.value,i={configurable:u in i?i[u]:r[u],enumerable:h in i?i[h]:r[h],writable:!1})}return o(e,t,i)}:o:function(e,t,r){if(n(e),t=s(t),n(r),i)try{return o(e,t,r)}catch(e){}if("get"in r||"set"in r)throw a("Accessors not supported");return"value"in r&&(e[t]=r.value),e}})),ea=z(((e,t)=>{var i=Dr(),r=An(),n=Bo();t.exports=i?function(e,t,i){return r.f(e,t,n(1,i))}:function(e,t,i){return e[t]=i,e}})),Fm=z(((e,t)=>{var i=Dr(),r=Ci(),n=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,a=r(n,"name"),o=a&&"something"===function(){}.name,l=a&&(!i||i&&s(n,"name").configurable);t.exports={EXISTS:a,PROPER:o,CONFIGURABLE:l}})),Iw=z(((e,t)=>{var i=Lt(),r=yi(),n=bw(),s=i(Function.toString);r(n.inspectSource)||(n.inspectSource=function(e){return s(e)}),t.exports=n.inspectSource})),Z2=z(((e,t)=>{var i=Qt(),r=yi(),n=i.WeakMap;t.exports=r(n)&&/native code/.test(String(n))})),y1=z(((e,t)=>{var i=Nm(),r=Lm(),n=i("keys");t.exports=function(e){return n[e]||(n[e]=r(e))}})),pv=z(((e,t)=>{t.exports={}})),fs=z(((e,t)=>{var i,r,n,s,a,o=Z2(),l=Qt(),h=Ei(),u=ea(),c=Ci(),p=bw(),d=y1(),f=pv(),m="Object already initialized",g=l.TypeError,y=l.WeakMap;o||p.state?((s=p.state||(p.state=new y)).get=s.get,s.has=s.has,s.set=s.set,i=function(e,t){if(s.has(e))throw g(m);return t.facade=e,s.set(e,t),t},r=function(e){return s.get(e)||{}},n=function(e){return s.has(e)}):(f[a=d("state")]=!0,i=function(e,t){if(c(e,a))throw g(m);return t.facade=e,u(e,a,t),t},r=function(e){return c(e,a)?e[a]:{}},n=function(e){return c(e,a)}),t.exports={set:i,get:r,has:n,enforce:function(e){return n(e)?r(e):i(e,{})},getterFor:function(e){return function(t){var i;if(!h(t)||(i=r(t)).type!==e)throw g("Incompatible receiver, "+e+" required");return i}}}})),Mw=z(((e,t)=>{var i=Lt(),r=Dt(),n=yi(),s=Ci(),a=Dr(),o=Fm().CONFIGURABLE,l=Iw(),h=fs(),u=h.enforce,c=h.get,p=String,d=Object.defineProperty,f=i("".slice),m=i("".replace),g=i([].join),y=a&&!r((function(){return 8!==d((function(){}),"length",{value:8}).length})),v=String(String).split("String"),T=t.exports=function(e,t,i){"Symbol("===f(p(t),0,7)&&(t="["+m(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!s(e,"name")||o&&e.name!==t)&&(a?d(e,"name",{value:t,configurable:!0}):e.name=t),y&&i&&s(i,"arity")&&e.length!==i.arity&&d(e,"length",{value:i.arity});try{i&&s(i,"constructor")&&i.constructor?a&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=u(e);return s(r,"source")||(r.source=g(v,"string"==typeof t?t:"")),e};Function.prototype.toString=T((function(){return n(this)&&c(this).source||l(this)}),"toString")})),Fn=z(((e,t)=>{var i=yi(),r=An(),n=Mw(),s=Tw();t.exports=function(e,t,a,o){o||(o={});var l=o.enumerable,h=void 0!==o.name?o.name:t;if(i(a)&&n(a,h,o),o.global)l?e[t]=a:s(t,a);else{try{o.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=a:r.f(e,t,{value:a,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}})),rN=z(((e,t)=>{var i=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r:i)(t)}})),Yn=z(((e,t)=>{var i=rN();t.exports=function(e){var t=+e;return t!=t||0===t?0:i(t)}})),Rc=z(((e,t)=>{var i=Yn(),r=Math.max,n=Math.min;t.exports=function(e,t){var s=i(e);return s<0?r(s+t,0):n(s,t)}})),io=z(((e,t)=>{var i=Yn(),r=Math.min;t.exports=function(e){return e>0?r(i(e),9007199254740991):0}})),Yi=z(((e,t)=>{var i=io();t.exports=function(e){return i(e.length)}})),dv=z(((e,t)=>{var i=bs(),r=Rc(),n=Yi(),s=function(e){return function(t,s,a){var o,l=i(t),h=n(l),u=r(a,h);if(e&&s!=s){for(;h>u;)if((o=l[u++])!=o)return!0}else for(;h>u;u++)if((e||u in l)&&l[u]===s)return e||u||0;return!e&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}})),nN=z(((e,t)=>{var i=Lt(),r=Ci(),n=bs(),s=dv().indexOf,a=pv(),o=i([].push);t.exports=function(e,t){var i,l=n(e),h=0,u=[];for(i in l)!r(a,i)&&r(l,i)&&o(u,i);for(;t.length>h;)r(l,i=t[h++])&&(~s(u,i)||o(u,i));return u}})),Dw=z(((e,t)=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]})),lp=z((e=>{var t=nN(),i=Dw().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,i)}})),T1=z((e=>{e.f=Object.getOwnPropertySymbols})),Cw=z(((e,t)=>{var i=Sn(),r=Lt(),n=lp(),s=T1(),a=$r(),o=r([].concat);t.exports=i("Reflect","ownKeys")||function(e){var t=n.f(a(e)),i=s.f;return i?o(t,i(e)):t}})),b1=z(((e,t)=>{var i=Ci(),r=Cw(),n=Vs(),s=An();t.exports=function(e,t,a){for(var o=r(t),l=s.f,h=n.f,u=0;u<o.length;u++){var c=o[u];!i(e,c)&&(!a||!i(a,c))&&l(e,c,h(t,c))}}})),fv=z(((e,t)=>{var i=Dt(),r=yi(),n=/#|\.prototype\./,s=function(e,t){var n=o[a(e)];return n==h||n!=l&&(r(t)?i(t):!!t)},a=s.normalize=function(e){return String(e).replace(n,".").toLowerCase()},o=s.data={},l=s.NATIVE="N",h=s.POLYFILL="P";t.exports=s})),Le=z(((e,t)=>{var i=Qt(),r=Vs().f,n=ea(),s=Fn(),a=Tw(),o=b1(),l=fv();t.exports=function(e,t){var h,u,c,p,d,f=e.target,m=e.global,g=e.stat;if(h=m?i:g?i[f]||a(f,{}):(i[f]||{}).prototype)for(u in t){if(p=t[u],c=e.dontCallGetSet?(d=r(h,u))&&d.value:h[u],!l(m?u:f+(g?".":"#")+u,e.forced)&&void 0!==c){if(typeof p==typeof c)continue;o(p,c)}(e.sham||c&&c.sham)&&n(p,"sham",!0),s(h,u,p,e)}}})),Aw=z(((e,t)=>{var i={};i[Ti()("toStringTag")]="z",t.exports="[object z]"===String(i)})),Mc=z(((e,t)=>{var i=Aw(),r=yi(),n=Qs(),s=Ti()("toStringTag"),a=Object,o="Arguments"==n(function(){return arguments}());t.exports=i?n:function(e){var t,i,l;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=a(e),s))?i:o?n(t):"Object"==(l=n(t))&&r(t.callee)?"Arguments":l}})),si=z(((e,t)=>{var i=Mc(),r=String;t.exports=function(e){if("Symbol"===i(e))throw TypeError("Cannot convert a Symbol value to a string");return r(e)}})),mv=z(((e,t)=>{var i=nN(),r=Dw();t.exports=Object.keys||function(e){return i(e,r)}})),Pw=z((e=>{var t=Dr(),i=V2(),r=An(),n=$r(),s=bs(),a=mv();e.f=t&&!i?Object.defineProperties:function(e,t){n(e);for(var i,o=s(t),l=a(t),h=l.length,u=0;h>u;)r.f(e,i=l[u++],o[i]);return e}})),aN=z(((e,t)=>{var i=Sn();t.exports=i("document","documentElement")})),no=z(((e,t)=>{var i,r=$r(),n=Pw(),s=Dw(),a=pv(),o=aN(),l=v1(),h=y1(),u="prototype",c="script",p=h("IE_PROTO"),d=function(){},f=function(e){return"<"+c+">"+e+"</"+c+">"},m=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{i=new ActiveXObject("htmlfile")}catch(e){}g="undefined"!=typeof document?document.domain&&i?m(i):function(){var e,t=l("iframe"),i="java"+c+":";return t.style.display="none",o.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F}():m(i);for(var e=s.length;e--;)delete g[u][s[e]];return g()};a[p]=!0,t.exports=Object.create||function(e,t){var i;return null!==e?(d[u]=r(e),i=new d,d[u]=null,i[p]=e):i=g(),void 0===t?i:n.f(i,t)}})),Fu=z(((e,t)=>{"use strict";var i=op(),r=An(),n=Bo();t.exports=function(e,t,s){var a=i(t);a in e?r.f(e,a,n(0,s)):e[a]=s}})),gv=z(((e,t)=>{var i=Rc(),r=Yi(),n=Fu(),s=Array,a=Math.max;t.exports=function(e,t,o){for(var l=r(e),h=i(t,l),u=i(void 0===o?l:o,l),c=s(a(u-h,0)),p=0;h<u;h++,p++)n(c,p,e[h]);return c.length=p,c}})),Fw=z(((e,t)=>{var i=Qs(),r=bs(),n=lp().f,s=gv(),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(e){return a&&"Window"==i(e)?function(e){try{return n(e)}catch(e){return s(a)}}(e):n(r(e))}})),Ds=z(((e,t)=>{var i=Mw(),r=An();t.exports=function(e,t,n){return n.get&&i(n.get,t,{getter:!0}),n.set&&i(n.set,t,{setter:!0}),r.f(e,t,n)}})),uN=z((e=>{var t=Ti();e.f=t})),Hw=z(((e,t)=>{var i=Qt();t.exports=i})),Ma=z(((e,t)=>{var i=Hw(),r=Ci(),n=uN(),s=An().f;t.exports=function(e){var t=i.Symbol||(i.Symbol={});r(t,e)||s(t,e,{value:n.f(e)})}})),hN=z(((e,t)=>{var i=ri(),r=Sn(),n=Ti(),s=Fn();t.exports=function(){var e=r("Symbol"),t=e&&e.prototype,a=t&&t.valueOf,o=n("toPrimitive");t&&!t[o]&&s(t,o,(function(e){return i(a,this)}),{arity:1})}})),so=z(((e,t)=>{var i=An().f,r=Ci(),n=Ti()("toStringTag");t.exports=function(e,t,s){e&&!s&&(e=e.prototype),e&&!r(e,n)&&i(e,n,{configurable:!0,value:t})}})),cp=z(((e,t)=>{var i=Qs(),r=Lt();t.exports=function(e){if("Function"===i(e))return r(e)}})),xl=z(((e,t)=>{var i=cp(),r=Wn(),n=uv(),s=i(i.bind);t.exports=function(e,t){return r(e),void 0===t?e:n?s(e,t):function(){return e.apply(t,arguments)}}})),up=z(((e,t)=>{var i=Qs();t.exports=Array.isArray||function(e){return"Array"==i(e)}})),Um=z(((e,t)=>{var i=Lt(),r=Dt(),n=yi(),s=Mc(),a=Sn(),o=Iw(),l=function(){},h=[],u=a("Reflect","construct"),c=/^\s*(?:class|function)\b/,p=i(c.exec),d=!c.exec(l),f=function(e){if(!n(e))return!1;try{return u(l,h,e),!0}catch(e){return!1}},m=function(e){if(!n(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!p(c,o(e))}catch(e){return!0}};m.sham=!0,t.exports=!u||r((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?m:f})),_W=z(((e,t)=>{var i=up(),r=Um(),n=Ei(),s=Ti()("species"),a=Array;t.exports=function(e){var t;return i(e)&&(t=e.constructor,(r(t)&&(t===a||i(t.prototype))||n(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?a:t}})),vv=z(((e,t)=>{var i=_W();t.exports=function(e,t){return new(i(e))(0===t?0:t)}})),Cs=z(((e,t)=>{var i=xl(),r=Lt(),n=Om(),s=Vi(),a=Yi(),o=vv(),l=r([].push),h=function(e){var t=1==e,r=2==e,h=3==e,u=4==e,c=6==e,p=7==e,d=5==e||c;return function(f,m,g,y){for(var v,T,x=s(f),b=n(x),E=i(m,g),_=a(b),w=0,S=y||o,M=t?S(f,_):r||p?S(f,0):void 0;_>w;w++)if((d||w in b)&&(T=E(v=b[w],w,x),e))if(t)M[w]=T;else if(T)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:l(M,v)}else switch(e){case 4:return!1;case 7:l(M,v)}return c?-1:h||u?u:M}};t.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6),filterReject:h(7)}})),zW=z((()=>{"use strict";var e=Le(),t=Qt(),i=ri(),r=Lt(),n=qn(),s=Dr(),a=Pm(),o=Dt(),l=Ci(),h=ko(),u=$r(),c=bs(),p=op(),d=si(),f=Bo(),m=no(),g=mv(),y=lp(),v=Fw(),T=T1(),x=Vs(),b=An(),E=Pw(),_=m1(),w=Fn(),S=Ds(),M=Nm(),I=y1(),D=pv(),A=Lm(),R=Ti(),C=uN(),O=Ma(),P=hN(),N=so(),L=fs(),F=Cs().forEach,U=I("hidden"),k="Symbol",B="prototype",z=L.set,G=L.getterFor(k),H=Object[B],V=t.Symbol,j=V&&V[B],W=t.TypeError,Y=t.QObject,X=x.f,q=b.f,Z=v.f,J=_.f,K=r([].push),$=M("symbols"),Q=M("op-symbols"),ee=M("wks"),te=!Y||!Y[B]||!Y[B].findChild,ie=s&&o((function(){return 7!=m(q({},"a",{get:function(){return q(this,"a",{value:7}).a}})).a}))?function(e,t,i){var r=X(H,t);r&&delete H[t],q(e,t,i),r&&e!==H&&q(H,t,r)}:q,re=function(e,t){var i=$[e]=m(j);return z(i,{type:k,tag:e,description:t}),s||(i.description=t),i},ne=function(e,t,i){e===H&&ne(Q,t,i),u(e);var r=p(t);return u(i),l($,r)?(i.enumerable?(l(e,U)&&e[U][r]&&(e[U][r]=!1),i=m(i,{enumerable:f(0,!1)})):(l(e,U)||q(e,U,f(1,{})),e[U][r]=!0),ie(e,r,i)):q(e,r,i)},se=function(e,t){u(e);var r=c(t),n=g(r).concat(he(r));return F(n,(function(t){(!s||i(ae,r,t))&&ne(e,t,r[t])})),e},ae=function(e){var t=p(e),r=i(J,this,t);return!(this===H&&l($,t)&&!l(Q,t))&&(!(r||!l(this,t)||!l($,t)||l(this,U)&&this[U][t])||r)},oe=function(e,t){var i=c(e),r=p(t);if(i!==H||!l($,r)||l(Q,r)){var n=X(i,r);return n&&l($,r)&&!(l(i,U)&&i[U][r])&&(n.enumerable=!0),n}},le=function(e){var t=Z(c(e)),i=[];return F(t,(function(e){!l($,e)&&!l(D,e)&&K(i,e)})),i},he=function(e){var t=e===H,i=Z(t?Q:c(e)),r=[];return F(i,(function(e){l($,e)&&(!t||l(H,e))&&K(r,$[e])})),r};a||(w(j=(V=function(){if(h(j,this))throw W("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?d(arguments[0]):void 0,t=A(e),r=function(e){this===H&&i(r,Q,e),l(this,U)&&l(this[U],t)&&(this[U][t]=!1),ie(this,t,f(1,e))};return s&&te&&ie(H,t,{configurable:!0,set:r}),re(t,e)})[B],"toString",(function(){return G(this).tag})),w(V,"withoutSetter",(function(e){return re(A(e),e)})),_.f=ae,b.f=ne,E.f=se,x.f=oe,y.f=v.f=le,T.f=he,C.f=function(e){return re(R(e),e)},s&&(S(j,"description",{configurable:!0,get:function(){return G(this).description}}),n||w(H,"propertyIsEnumerable",ae,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!a,sham:!a},{Symbol:V}),F(g(ee),(function(e){O(e)})),e({target:k,stat:!0,forced:!a},{useSetter:function(){te=!0},useSimple:function(){te=!1}}),e({target:"Object",stat:!0,forced:!a,sham:!s},{create:function(e,t){return void 0===t?m(e):se(m(e),t)},defineProperty:ne,defineProperties:se,getOwnPropertyDescriptor:oe}),e({target:"Object",stat:!0,forced:!a},{getOwnPropertyNames:le}),P(),N(V,k),D[U]=!0})),wN=z(((e,t)=>{var i=Pm();t.exports=i&&!!Symbol.for&&!!Symbol.keyFor})),qW=z((()=>{var e=Le(),t=Sn(),i=Ci(),r=si(),n=Nm(),s=wN(),a=n("string-to-symbol-registry"),o=n("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!s},{for:function(e){var n=r(e);if(i(a,n))return a[n];var s=t("Symbol")(n);return a[n]=s,o[s]=n,s}})})),XW=z((()=>{var e=Le(),t=Ci(),i=kd(),r=Gd(),n=Nm(),s=wN(),a=n("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!s},{keyFor:function(e){if(!i(e))throw TypeError(r(e)+" is not a symbol");if(t(a,e))return a[e]}})})),Go=z(((e,t)=>{var i=uv(),r=Function.prototype,n=r.apply,s=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(n):function(){return s.apply(n,arguments)})})),zd=z(((e,t)=>{var i=Lt();t.exports=i([].slice)})),nq=z(((e,t)=>{var i=Lt(),r=up(),n=yi(),s=Qs(),a=si(),o=i([].push);t.exports=function(e){if(n(e))return e;if(r(e)){for(var t=e.length,i=[],l=0;l<t;l++){var h=e[l];"string"==typeof h?o(i,h):("number"==typeof h||"Number"==s(h)||"String"==s(h))&&o(i,a(h))}var u=i.length,c=!0;return function(e,t){if(c)return c=!1,t;if(r(this))return t;for(var n=0;n<u;n++)if(i[n]===e)return t}}}})),MN=z((()=>{var e=Le(),t=Sn(),i=Go(),r=ri(),n=Lt(),s=Dt(),a=yi(),o=kd(),l=zd(),h=nq(),u=Pm(),c=String,p=t("JSON","stringify"),d=n(/./.exec),f=n("".charAt),m=n("".charCodeAt),g=n("".replace),y=n(1..toString),v=/[\uD800-\uDFFF]/g,T=/^[\uD800-\uDBFF]$/,x=/^[\uDC00-\uDFFF]$/,b=!u||s((function(){var e=t("Symbol")();return"[null]"!=p([e])||"{}"!=p({a:e})||"{}"!=p(Object(e))})),E=s((function(){return'"\\udf06\\ud834"'!==p("\udf06\ud834")||'"\\udead"'!==p("\udead")})),_=function(e,t){var n=l(arguments),s=h(t);if(a(s)||void 0!==e&&!o(e))return n[1]=function(e,t){if(a(s)&&(t=r(s,this,c(e),t)),!o(t))return t},i(p,null,n)},w=function(e,t,i){var r=f(i,t-1),n=f(i,t+1);return d(T,e)&&!d(x,n)||d(x,e)&&!d(T,r)?"\\u"+y(m(e,0),16):e};p&&e({target:"JSON",stat:!0,arity:3,forced:b||E},{stringify:function(e,t,r){var n=l(arguments),s=i(b?_:p,null,n);return E&&"string"==typeof s?g(s,v,w):s}})})),vq=z((()=>{var e=Le(),t=Pm(),i=Dt(),r=T1(),n=Vi();e({target:"Object",stat:!0,forced:!t||i((function(){r.f(1)}))},{getOwnPropertySymbols:function(e){var t=r.f;return t?t(n(e)):[]}})})),yq=z((()=>{zW(),qW(),XW(),MN(),vq()})),Sq=z((()=>{"use strict";var e,t,i,r,n,s,a,o,l=Le(),h=Dr(),u=Qt(),c=Lt(),p=Ci(),d=yi(),f=ko(),m=si(),g=Ds(),y=b1(),v=u.Symbol,T=v&&v.prototype;h&&d(v)&&(!("description"in T)||void 0!==v().description)&&(e={},y(t=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:m(arguments[0]),i=f(T,this)?new v(t):void 0===t?v():v(t);return""===t&&(e[i]=!0),i},v),t.prototype=T,T.constructor=t,i="Symbol(test)"==String(v("test")),r=c(T.valueOf),n=c(T.toString),s=/^Symbol\((.*)\)[^)]+$/,a=c("".replace),o=c("".slice),g(T,"description",{configurable:!0,get:function(){var t=r(this);if(p(e,t))return"";var l=n(t),h=i?o(l,7,-1):a(l,s,"$1");return""===h?void 0:h}}),l({global:!0,constructor:!0,forced:!0},{Symbol:t}))})),wq=z((()=>{Ma()("asyncIterator")})),Rq=z((()=>{Ma()("hasInstance")})),Mq=z((()=>{Ma()("isConcatSpreadable")})),Dq=z((()=>{Ma()("iterator")})),Cq=z((()=>{Ma()("match")})),Aq=z((()=>{Ma()("matchAll")})),Oq=z((()=>{Ma()("replace")})),Pq=z((()=>{Ma()("search")})),Nq=z((()=>{Ma()("species")})),Lq=z((()=>{Ma()("split")})),Fq=z((()=>{var e=Ma(),t=hN();e("toPrimitive"),t()})),Hq=z((()=>{var e=Sn(),t=Ma(),i=so();t("toStringTag"),i(e("Symbol"),"Symbol")})),Uq=z((()=>{Ma()("unscopables")})),kq=z(((e,t)=>{var i=Lt(),r=Wn();t.exports=function(e,t,n){try{return i(r(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}})),CN=z(((e,t)=>{var i=yi(),r=String,n=TypeError;t.exports=function(e){if("object"==typeof e||i(e))return e;throw n("Can't set "+r(e)+" as a prototype")}})),Dc=z(((e,t)=>{var i=kq(),r=$r(),n=CN();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,s={};try{(e=i(Object.prototype,"__proto__","set"))(s,[]),t=s instanceof Array}catch(e){}return function(i,s){return r(i),n(s),t?e(i,s):i.__proto__=s,i}}():void 0)})),AN=z(((e,t)=>{var i=An().f;t.exports=function(e,t,r){r in e||i(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}})),Vm=z(((e,t)=>{var i=yi(),r=Ei(),n=Dc();t.exports=function(e,t,s){var a,o;return n&&i(a=t.constructor)&&a!==s&&r(o=a.prototype)&&o!==s.prototype&&n(e,o),e}})),Tv=z(((e,t)=>{var i=si();t.exports=function(e,t){return void 0===e?arguments.length<2?"":t:i(e)}})),ON=z(((e,t)=>{var i=Ei(),r=ea();t.exports=function(e,t){i(t)&&"cause"in t&&r(e,"cause",t.cause)}})),Ww=z(((e,t)=>{var i=Lt(),r=Error,n=i("".replace),s=String(r("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,o=a.test(s);t.exports=function(e,t){if(o&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=n(e,a,"");return e}})),PN=z(((e,t)=>{var i=Dt(),r=Bo();t.exports=!i((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))})),NN=z(((e,t)=>{var i=ea(),r=Ww(),n=PN(),s=Error.captureStackTrace;t.exports=function(e,t,a,o){n&&(s?s(e,t):i(e,"stack",r(a,o)))}})),LN=z(((e,t)=>{"use strict";var i=Sn(),r=Ci(),n=ea(),s=ko(),a=Dc(),o=b1(),l=AN(),h=Vm(),u=Tv(),c=ON(),p=NN(),d=Dr(),f=qn();t.exports=function(e,t,m,g){var y="stackTraceLimit",v=g?2:1,T=e.split("."),x=T[T.length-1],b=i.apply(null,T);if(b){var E=b.prototype;if(!f&&r(E,"cause")&&delete E.cause,!m)return b;var _=i("Error"),w=t((function(e,t){var i=u(g?t:e,void 0),r=g?new b(e):new b;return void 0!==i&&n(r,"message",i),p(r,w,r.stack,2),this&&s(E,this)&&h(r,this,w),arguments.length>v&&c(r,arguments[v]),r}));if(w.prototype=E,"Error"!==x?a?a(w,_):o(w,_,{name:!0}):d&&y in b&&(l(w,b,y),l(w,b,"prepareStackTrace")),o(w,b),!f)try{E.name!==x&&n(E,"name",x),E.constructor=w}catch(e){}return w}}})),uY=z((()=>{var e=Le(),t=Qt(),i=Go(),r=LN(),n="WebAssembly",s=t[n],a=7!==Error("e",{cause:7}).cause,o=function(t,i){var n={};n[t]=r(t,i,a),e({global:!0,constructor:!0,arity:1,forced:a},n)},l=function(t,i){if(s&&s[t]){var o={};o[t]=r(n+"."+t,i,a),e({target:n,stat:!0,constructor:!0,arity:1,forced:a},o)}};o("Error",(function(e){return function(t){return i(e,this,arguments)}})),o("EvalError",(function(e){return function(t){return i(e,this,arguments)}})),o("RangeError",(function(e){return function(t){return i(e,this,arguments)}})),o("ReferenceError",(function(e){return function(t){return i(e,this,arguments)}})),o("SyntaxError",(function(e){return function(t){return i(e,this,arguments)}})),o("TypeError",(function(e){return function(t){return i(e,this,arguments)}})),o("URIError",(function(e){return function(t){return i(e,this,arguments)}})),l("CompileError",(function(e){return function(t){return i(e,this,arguments)}})),l("LinkError",(function(e){return function(t){return i(e,this,arguments)}})),l("RuntimeError",(function(e){return function(t){return i(e,this,arguments)}}))})),UN=z(((e,t)=>{"use strict";var i=Dr(),r=Dt(),n=$r(),s=no(),a=Tv(),o=Error.prototype.toString,l=r((function(){if(i){var e=s(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==o.call(e))return!0}return"2: 1"!==o.call({message:1,name:2})||"Error"!==o.call({})}));t.exports=l?function(){var e=n(this),t=a(e.name,"Error"),i=a(e.message);return t?i?t+": "+i:t:i}:o})),mY=z((()=>{var e=Fn(),t=UN(),i=Error.prototype;i.toString!==t&&e(i,"toString",t)})),Xw=z(((e,t)=>{var i=Dt();t.exports=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))})),Vo=z(((e,t)=>{var i=Ci(),r=yi(),n=Vi(),s=y1(),a=Xw(),o=s("IE_PROTO"),l=Object,h=l.prototype;t.exports=a?l.getPrototypeOf:function(e){var t=n(e);if(i(t,o))return t[o];var s=t.constructor;return r(s)&&t instanceof s?s.prototype:t instanceof l?h:null}})),bv=z(((e,t)=>{t.exports={}})),$w=z(((e,t)=>{var i=Ti(),r=bv(),n=i("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||s[n]===e)}})),xv=z(((e,t)=>{var i=Mc(),r=Lu(),n=Ra(),s=bv(),a=Ti()("iterator");t.exports=function(e){if(!n(e))return r(e,a)||r(e,"@@iterator")||s[i(e)]}})),C1=z(((e,t)=>{var i=ri(),r=Wn(),n=$r(),s=Gd(),a=xv(),o=TypeError;t.exports=function(e,t){var l=arguments.length<2?a(e):t;if(r(l))return n(i(l,e));throw o(s(e)+" is not iterable")}})),kN=z(((e,t)=>{var i=ri(),r=$r(),n=Lu();t.exports=function(e,t,s){var a,o;r(e);try{if(!(a=n(e,"return"))){if("throw"===t)throw s;return s}a=i(a,e)}catch(e){o=!0,a=e}if("throw"===t)throw s;if(o)throw a;return r(a),s}})),Cc=z(((e,t)=>{var i=xl(),r=ri(),n=$r(),s=Gd(),a=$w(),o=Yi(),l=ko(),h=C1(),u=xv(),c=kN(),p=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;t.exports=function(e,t,m){var g,y,v,T,x,b,E,_=m&&m.that,w=!(!m||!m.AS_ENTRIES),S=!(!m||!m.IS_RECORD),M=!(!m||!m.IS_ITERATOR),I=!(!m||!m.INTERRUPTED),D=i(t,_),A=function(e){return g&&c(g,"normal",e),new d(!0,e)},R=function(e){return w?(n(e),I?D(e[0],e[1],A):D(e[0],e[1])):I?D(e,A):D(e)};if(S)g=e.iterator;else if(M)g=e;else{if(!(y=u(e)))throw p(s(e)+" is not iterable");if(a(y)){for(v=0,T=o(e);T>v;v++)if((x=R(e[v]))&&l(f,x))return x;return new d(!1)}g=h(e,y)}for(b=S?e.next:g.next;!(E=r(b,g)).done;){try{x=R(E.value)}catch(e){c(g,"throw",e)}if("object"==typeof x&&x&&l(f,x))return x}return new d(!1)}})),AY=z((()=>{"use strict";var e=Le(),t=ko(),i=Vo(),r=Dc(),n=b1(),s=no(),a=ea(),o=Bo(),l=ON(),h=NN(),u=Cc(),c=Tv(),p=Ti()("toStringTag"),d=Error,f=[].push,m=function(e,n){var o,y=t(g,this);r?o=r(d(),y?i(this):g):(o=y?this:s(g),a(o,p,"Error")),void 0!==n&&a(o,"message",c(n)),h(o,m,o.stack,1),arguments.length>2&&l(o,arguments[2]);var v=[];return u(e,f,{that:v}),a(o,"errors",v),o};r?r(m,d):n(m,d,{name:!0});var g=m.prototype=s(d.prototype,{constructor:o(1,m),message:o(1,""),name:o(1,"AggregateError")});e({global:!0,constructor:!0,arity:2},{AggregateError:m})})),OY=z((()=>{AY()})),FY=z((()=>{var e=Le(),t=Sn(),i=Go(),r=Dt(),n=LN(),s="AggregateError",a=t(s),o=!r((function(){return 1!==a([1]).errors[0]}))&&r((function(){return 7!==a([1],s,{cause:7}).cause}));e({global:!0,constructor:!0,arity:2,forced:o},{AggregateError:n(s,(function(e){return function(t,r){return i(e,this,arguments)}}),o,!0)})})),Da=z(((e,t)=>{var i=Ti(),r=no(),n=An().f,s=i("unscopables"),a=Array.prototype;null==a[s]&&n(a,s,{configurable:!0,value:r(null)}),t.exports=function(e){a[s][e]=!0}})),UY=z((()=>{"use strict";var e=Le(),t=Vi(),i=Yi(),r=Yn(),n=Da();e({target:"Array",proto:!0},{at:function(e){var n=t(this),s=i(n),a=r(e),o=a>=0?a:s+a;return o<0||o>=s?void 0:n[o]}}),n("at")})),jm=z(((e,t)=>{var i=TypeError;t.exports=function(e){if(e>9007199254740991)throw i("Maximum allowed index exceeded");return e}})),_v=z(((e,t)=>{var i=Dt(),r=Ti(),n=Nu(),s=r("species");t.exports=function(e){return n>=51||!i((function(){var t=[];return(t.constructor={})[s]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}})),jY=z((()=>{"use strict";var e=Le(),t=Dt(),i=up(),r=Ei(),n=Vi(),s=Yi(),a=jm(),o=Fu(),l=vv(),h=_v(),u=Ti(),c=Nu(),p=u("isConcatSpreadable"),d=c>=51||!t((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),f=function(e){if(!r(e))return!1;var t=e[p];return void 0!==t?!!t:i(e)};e({target:"Array",proto:!0,arity:1,forced:!d||!h("concat")},{concat:function(e){var t,i,r,h,u,c=n(this),p=l(c,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(f(u=-1===t?c:arguments[t]))for(h=s(u),a(d+h),i=0;i<h;i++,d++)i in u&&o(p,d,u[i]);else a(d+1),o(p,d++,u);return p.length=d,p}})})),A1=z(((e,t)=>{"use strict";var i=Gd(),r=TypeError;t.exports=function(e,t){if(!delete e[t])throw r("Cannot delete property "+i(t)+" of "+i(e))}})),XN=z(((e,t)=>{"use strict";var i=Vi(),r=Rc(),n=Yi(),s=A1(),a=Math.min;t.exports=[].copyWithin||function(e,t){var o=i(this),l=n(o),h=r(e,l),u=r(t,l),c=arguments.length>2?arguments[2]:void 0,p=a((void 0===c?l:r(c,l))-u,l-h),d=1;for(u<h&&h<u+p&&(d=-1,u+=p-1,h+=p-1);p-- >0;)u in o?o[h]=o[u]:s(o,h),h+=d,u+=d;return o}})),XY=z((()=>{var e=Le(),t=XN(),i=Da();e({target:"Array",proto:!0},{copyWithin:t}),i("copyWithin")})),Uu=z(((e,t)=>{"use strict";var i=Dt();t.exports=function(e,t){var r=[][e];return!!r&&i((function(){r.call(null,t||function(){return 1},1)}))}})),ZY=z((()=>{"use strict";var e=Le(),t=Cs().every;e({target:"Array",proto:!0,forced:!Uu()("every")},{every:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),Qw=z(((e,t)=>{"use strict";var i=Vi(),r=Rc(),n=Yi();t.exports=function(e){for(var t=i(this),s=n(t),a=arguments.length,o=r(a>1?arguments[1]:void 0,s),l=a>2?arguments[2]:void 0,h=void 0===l?s:r(l,s);h>o;)t[o++]=e;return t}})),QY=z((()=>{var e=Le(),t=Qw(),i=Da();e({target:"Array",proto:!0},{fill:t}),i("fill")})),eX=z((()=>{"use strict";var e=Le(),t=Cs().filter;e({target:"Array",proto:!0,forced:!_v()("filter")},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),rX=z((()=>{"use strict";var e=Le(),t=Cs().find,i=Da(),r="find",n=!0;r in[]&&Array(1)[r]((function(){n=!1})),e({target:"Array",proto:!0,forced:n},{find:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),i(r)})),nX=z((()=>{"use strict";var e=Le(),t=Cs().findIndex,i=Da(),r="findIndex",n=!0;r in[]&&Array(1)[r]((function(){n=!1})),e({target:"Array",proto:!0,forced:n},{findIndex:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),i(r)})),O1=z(((e,t)=>{var i=xl(),r=Om(),n=Vi(),s=Yi(),a=function(e){var t=1==e;return function(a,o,l){for(var h,u=n(a),c=r(u),p=i(o,l),d=s(c);d-- >0;)if(p(h=c[d],d,u))switch(e){case 0:return h;case 1:return d}return t?-1:void 0}};t.exports={findLast:a(0),findLastIndex:a(1)}})),oX=z((()=>{"use strict";var e=Le(),t=O1().findLast,i=Da();e({target:"Array",proto:!0},{findLast:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),i("findLast")})),lX=z((()=>{"use strict";var e=Le(),t=O1().findLastIndex,i=Da();e({target:"Array",proto:!0},{findLastIndex:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),i("findLastIndex")})),KN=z(((e,t)=>{"use strict";var i=up(),r=Yi(),n=jm(),s=xl(),a=function(e,t,o,l,h,u,c,p){for(var d,f,m=h,g=0,y=!!c&&s(c,p);g<l;)g in o&&(d=y?y(o[g],g,t):o[g],u>0&&i(d)?(f=r(d),m=a(e,t,d,f,m,u-1)-1):(n(m+1),e[m]=d),m++),g++;return m};t.exports=a})),hX=z((()=>{"use strict";var e=Le(),t=KN(),i=Vi(),r=Yi(),n=Yn(),s=vv();e({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,a=i(this),o=r(a),l=s(a,0);return l.length=t(l,a,a,o,0,void 0===e?1:n(e)),l}})})),pX=z((()=>{"use strict";var e=Le(),t=KN(),i=Wn(),r=Vi(),n=Yi(),s=vv();e({target:"Array",proto:!0},{flatMap:function(e){var a,o=r(this),l=n(o);return i(e),(a=s(o,0)).length=t(a,o,o,l,0,1,e,arguments.length>1?arguments[1]:void 0),a}})})),JN=z(((e,t)=>{"use strict";var i=Cs().forEach,r=Uu()("forEach");t.exports=r?[].forEach:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})),mX=z((()=>{"use strict";var e=Le(),t=JN();e({target:"Array",proto:!0,forced:[].forEach!=t},{forEach:t})})),vX=z(((e,t)=>{var i=$r(),r=kN();t.exports=function(e,t,n,s){try{return s?t(i(n)[0],n[1]):t(n)}catch(t){r(e,"throw",t)}}})),QN=z(((e,t)=>{"use strict";var i=xl(),r=ri(),n=Vi(),s=vX(),a=$w(),o=Um(),l=Yi(),h=Fu(),u=C1(),c=xv(),p=Array;t.exports=function(e){var t=n(e),d=o(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=i(m,f>2?arguments[2]:void 0));var y,v,T,x,b,E,_=c(t),w=0;if(!_||this===p&&a(_))for(y=l(t),v=d?new this(y):p(y);y>w;w++)E=g?m(t[w],w):t[w],h(v,w,E);else for(b=(x=u(t,_)).next,v=d?new this:[];!(T=r(b,x)).done;w++)E=g?s(x,m,[T.value,w],!0):T.value,h(v,w,E);return v.length=w,v}})),P1=z(((e,t)=>{var i,r,n=Ti()("iterator"),s=!1;try{i=0,(r={next:function(){return{done:!!i++}},return:function(){s=!0}})[n]=function(){return this},Array.from(r,(function(){throw 2}))}catch(e){}t.exports=function(e,t){if(!t&&!s)return!1;var i=!1;try{var r={};r[n]=function(){return{next:function(){return{done:i=!0}}}},e(r)}catch(e){}return i}})),SX=z((()=>{var e=Le(),t=QN();e({target:"Array",stat:!0,forced:!P1()((function(e){Array.from(e)}))},{from:t})})),wX=z((()=>{"use strict";var e=Le(),t=dv().includes,i=Dt(),r=Da();e({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r("includes")})),MX=z((()=>{"use strict";var e=Le(),t=cp(),i=dv().indexOf,r=Uu(),n=t([].indexOf),s=!!n&&1/n([1],1,-0)<0;e({target:"Array",proto:!0,forced:s||!r("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return s?n(this,e,t)||0:i(this,e,t)}})})),DX=z((()=>{Le()({target:"Array",stat:!0},{isArray:up()})})),sL=z(((e,t)=>{"use strict";var i,r,n,s=Dt(),a=yi(),o=Ei(),l=no(),h=Vo(),u=Fn(),c=Ti(),p=qn(),d=c("iterator"),f=!1;[].keys&&("next"in(n=[].keys())?(r=h(h(n)))!==Object.prototype&&(i=r):f=!0),!o(i)||s((function(){var e={};return i[d].call(e)!==e}))?i={}:p&&(i=l(i)),a(i[d])||u(i,d,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:f}})),eR=z(((e,t)=>{"use strict";var i=sL().IteratorPrototype,r=no(),n=Bo(),s=so(),a=bv(),o=function(){return this};t.exports=function(e,t,l,h){var u=t+" Iterator";return e.prototype=r(i,{next:n(+!h,l)}),s(e,u,!1,!0),a[u]=o,e}})),iR=z(((e,t)=>{"use strict";var i=Le(),r=ri(),n=qn(),s=Fm(),a=yi(),o=eR(),l=Vo(),h=Dc(),u=so(),c=ea(),p=Fn(),d=Ti(),f=bv(),m=sL(),g=s.PROPER,y=s.CONFIGURABLE,v=m.IteratorPrototype,T=m.BUGGY_SAFARI_ITERATORS,x=d("iterator"),b="keys",E="values",_="entries",w=function(){return this};t.exports=function(e,t,s,d,m,S,M){o(s,t,d);var I,D,A,R=function(e){if(e===m&&L)return L;if(!T&&e in P)return P[e];switch(e){case b:case E:case _:return function(){return new s(this,e)}}return function(){return new s(this)}},C=t+" Iterator",O=!1,P=e.prototype,N=P[x]||P["@@iterator"]||m&&P[m],L=!T&&N||R(m),F="Array"==t&&P.entries||N;if(F&&(I=l(F.call(new e)))!==Object.prototype&&I.next&&(!n&&l(I)!==v&&(h?h(I,v):a(I[x])||p(I,x,w)),u(I,C,!0,!0),n&&(f[C]=w)),g&&m==E&&N&&N.name!==E&&(!n&&y?c(P,"name",E):(O=!0,L=function(){return r(N,this)})),m)if(D={values:R(E),keys:S?L:R(b),entries:R(_)},M)for(A in D)(T||O||!(A in P))&&p(P,A,D[A]);else i({target:t,proto:!0,forced:T||O},D);return(!n||M)&&P[x]!==L&&p(P,x,L,{name:m}),f[t]=L,D}})),F1=z(((e,t)=>{t.exports=function(e,t){return{value:e,done:t}}})),H1=z(((e,t)=>{"use strict";var i=bs(),r=Da(),n=bv(),s=fs(),a=An().f,o=iR(),l=F1(),h=qn(),u=Dr(),c="Array Iterator",p=s.set,d=s.getterFor(c);t.exports=o(Array,"Array",(function(e,t){p(this,{type:c,target:i(e),index:0,kind:t})}),(function(){var e=d(this),t=e.target,i=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,l(void 0,!0)):l("keys"==i?r:"values"==i?t[r]:[r,t[r]],!1)}),"values");var f=n.Arguments=n.Array;if(r("keys"),r("values"),r("entries"),!h&&u&&"values"!==f.name)try{a(f,"name",{value:"values"})}catch(e){}})),ZX=z((()=>{"use strict";var e=Le(),t=Lt(),i=Om(),r=bs(),n=Uu(),s=t([].join);e({target:"Array",proto:!0,forced:i!=Object||!n("join",",")},{join:function(e){return s(r(this),void 0===e?",":e)}})})),cL=z(((e,t)=>{"use strict";var i=Go(),r=bs(),n=Yn(),s=Yi(),a=Uu(),o=Math.min,l=[].lastIndexOf,h=!!l&&1/[1].lastIndexOf(1,-0)<0,u=a("lastIndexOf"),c=h||!u;t.exports=c?function(e){if(h)return i(l,this,arguments)||0;var t=r(this),a=s(t),u=a-1;for(arguments.length>1&&(u=o(u,n(arguments[1]))),u<0&&(u=a+u);u>=0;u--)if(u in t&&t[u]===e)return u||0;return-1}:l})),e$=z((()=>{var e=Le(),t=cL();e({target:"Array",proto:!0,forced:t!==[].lastIndexOf},{lastIndexOf:t})})),t$=z((()=>{"use strict";var e=Le(),t=Cs().map;e({target:"Array",proto:!0,forced:!_v()("map")},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),i$=z((()=>{"use strict";var e=Le(),t=Dt(),i=Um(),r=Fu(),n=Array;e({target:"Array",stat:!0,forced:t((function(){function e(){}return!(n.of.call(e)instanceof e)}))},{of:function(){for(var e=0,t=arguments.length,s=new(i(this)?this:n)(t);t>e;)r(s,e,arguments[e++]);return s.length=t,s}})})),sR=z(((e,t)=>{"use strict";var i=Dr(),r=up(),n=TypeError,s=Object.getOwnPropertyDescriptor,a=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();t.exports=a?function(e,t){if(r(e)&&!s(e,"length").writable)throw n("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}})),s$=z((()=>{"use strict";var e=Le(),t=Vi(),i=Yi(),r=sR(),n=jm();e({target:"Array",proto:!0,arity:1,forced:Dt()((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var s=t(this),a=i(s),o=arguments.length;n(a+o);for(var l=0;l<o;l++)s[a]=arguments[l],a++;return r(s,a),a}})})),U1=z(((e,t)=>{var i=Wn(),r=Vi(),n=Om(),s=Yi(),a=TypeError,o=function(e){return function(t,o,l,h){i(o);var u=r(t),c=n(u),p=s(u),d=e?p-1:0,f=e?-1:1;if(l<2)for(;;){if(d in c){h=c[d],d+=f;break}if(d+=f,e?d<0:p<=d)throw a("Reduce of empty array with no initial value")}for(;e?d>=0:p>d;d+=f)d in c&&(h=o(h,c[d],d,u));return h}};t.exports={left:o(!1),right:o(!0)}})),Bu=z(((e,t)=>{var i=Qs();t.exports="undefined"!=typeof process&&"process"==i(process)})),u$=z((()=>{"use strict";var e=Le(),t=U1().left,i=Uu(),r=Nu();e({target:"Array",proto:!0,forced:!Bu()&&r>79&&r<83||!i("reduce")},{reduce:function(e){var i=arguments.length;return t(this,e,i,i>1?arguments[1]:void 0)}})})),p$=z((()=>{"use strict";var e=Le(),t=U1().right,i=Uu(),r=Nu();e({target:"Array",proto:!0,forced:!Bu()&&r>79&&r<83||!i("reduceRight")},{reduceRight:function(e){return t(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})})),f$=z((()=>{"use strict";var e=Le(),t=Lt(),i=up(),r=t([].reverse),n=[1,2];e({target:"Array",proto:!0,forced:String(n)===String(n.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),r(this)}})})),v$=z((()=>{"use strict";var e=Le(),t=up(),i=Um(),r=Ei(),n=Rc(),s=Yi(),a=bs(),o=Fu(),l=Ti(),h=_v(),u=zd(),c=h("slice"),p=l("species"),d=Array,f=Math.max;e({target:"Array",proto:!0,forced:!c},{slice:function(e,l){var h,c,m,g=a(this),y=s(g),v=n(e,y),T=n(void 0===l?y:l,y);if(t(g)&&(h=g.constructor,(i(h)&&(h===d||t(h.prototype))||r(h)&&null===(h=h[p]))&&(h=void 0),h===d||void 0===h))return u(g,v,T);for(c=new(void 0===h?d:h)(f(T-v,0)),m=0;v<T;v++,m++)v in g&&o(c,m,g[v]);return c.length=m,c}})})),y$=z((()=>{"use strict";var e=Le(),t=Cs().some;e({target:"Array",proto:!0,forced:!Uu()("some")},{some:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),aR=z(((e,t)=>{var i=gv(),r=Math.floor,n=function(e,t){var o=e.length,l=r(o/2);return o<8?s(e,t):a(e,n(i(e,0,l),t),n(i(e,l),t),t)},s=function(e,t){for(var i,r,n=e.length,s=1;s<n;){for(r=s,i=e[s];r&&t(e[r-1],i)>0;)e[r]=e[--r];r!==s++&&(e[r]=i)}return e},a=function(e,t,i,r){for(var n=t.length,s=i.length,a=0,o=0;a<n||o<s;)e[a+o]=a<n&&o<s?r(t[a],i[o])<=0?t[a++]:i[o++]:a<n?t[a++]:i[o++];return e};t.exports=n})),pL=z(((e,t)=>{var i=Pu().match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]})),dL=z(((e,t)=>{var i=Pu();t.exports=/MSIE|Trident/.test(i)})),oR=z(((e,t)=>{var i=Pu().match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]})),N$=z((()=>{"use strict";var e=Le(),t=Lt(),i=Wn(),r=Vi(),n=Yi(),s=A1(),a=si(),o=Dt(),l=aR(),h=Uu(),u=pL(),c=dL(),p=Nu(),d=oR(),f=[],m=t(f.sort),g=t(f.push),y=o((function(){f.sort(void 0)})),v=o((function(){f.sort(null)})),T=h("sort"),x=!o((function(){if(p)return p<70;if(!(u&&u>3)){if(c)return!0;if(d)return d<603;var e,t,i,r,n="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(r=0;r<47;r++)f.push({k:t+r,v:i})}for(f.sort((function(e,t){return t.v-e.v})),r=0;r<f.length;r++)t=f[r].k.charAt(0),n.charAt(n.length-1)!==t&&(n+=t);return"DGBEFHACIJK"!==n}}));e({target:"Array",proto:!0,forced:y||!v||!T||!x},{sort:function(e){void 0!==e&&i(e);var t=r(this);if(x)return void 0===e?m(t):m(t,e);var o,h,u=[],c=n(t);for(h=0;h<c;h++)h in t&&g(u,t[h]);for(l(u,function(e){return function(t,i){return void 0===i?-1:void 0===t?1:void 0!==e?+e(t,i)||0:a(t)>a(i)?1:-1}}(e)),o=n(u),h=0;h<o;)t[h]=u[h++];for(;h<c;)s(t,h++);return t}})})),Wm=z(((e,t)=>{"use strict";var i=Sn(),r=Ds(),n=Ti(),s=Dr(),a=n("species");t.exports=function(e){var t=i(e);s&&t&&!t[a]&&r(t,a,{configurable:!0,get:function(){return this}})}})),H$=z((()=>{Wm()("Array")})),U$=z((()=>{"use strict";var e=Le(),t=Vi(),i=Rc(),r=Yn(),n=Yi(),s=sR(),a=jm(),o=vv(),l=Fu(),h=A1(),u=_v()("splice"),c=Math.max,p=Math.min;e({target:"Array",proto:!0,forced:!u},{splice:function(e,u){var d,f,m,g,y,v,T=t(this),x=n(T),b=i(e,x),E=arguments.length;for(0===E?d=f=0:1===E?(d=0,f=x-b):(d=E-2,f=p(c(r(u),0),x-b)),a(x+d-f),m=o(T,f),g=0;g<f;g++)(y=b+g)in T&&l(m,g,T[y]);if(m.length=f,d<f){for(g=b;g<x-f;g++)v=g+d,(y=g+f)in T?T[v]=T[y]:h(T,v);for(g=x;g>x-f+d;g--)h(T,g-1)}else if(d>f)for(g=x-f;g>b;g--)v=g+d-1,(y=g+f-1)in T?T[v]=T[y]:h(T,v);for(g=0;g<d;g++)T[g+b]=arguments[g+2];return s(T,x-f+d),m}})})),gL=z(((e,t)=>{var i=Yi();t.exports=function(e,t){for(var r=i(e),n=new t(r),s=0;s<r;s++)n[s]=e[r-s-1];return n}})),k$=z((()=>{"use strict";var e=Le(),t=gL(),i=bs(),r=Da(),n=Array;e({target:"Array",proto:!0},{toReversed:function(){return t(i(this),n)}}),r("toReversed")})),lR=z(((e,t)=>{var i=Yi();t.exports=function(e,t){for(var r=0,n=i(t),s=new e(n);n>r;)s[r]=t[r++];return s}})),z$=z(((e,t)=>{var i=Qt();t.exports=function(e){return i[e].prototype}})),j$=z((()=>{"use strict";var e=Le(),t=Lt(),i=Wn(),r=bs(),n=lR(),s=z$(),a=Da(),o=Array,l=t(s("Array").sort);e({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&i(e);var t=r(this),s=n(o,t);return l(s,e)}}),a("toSorted")})),W$=z((()=>{"use strict";var e=Le(),t=Da(),i=jm(),r=Yi(),n=Rc(),s=bs(),a=Yn(),o=Array,l=Math.max,h=Math.min;e({target:"Array",proto:!0},{toSpliced:function(e,t){var u,c,p,d,f=s(this),m=r(f),g=n(e,m),y=arguments.length,v=0;for(0===y?u=c=0:1===y?(u=0,c=m-g):(u=y-2,c=h(l(a(t),0),m-g)),p=i(m+u-c),d=o(p);v<g;v++)d[v]=f[v];for(;v<g+u;v++)d[v]=arguments[v-g+2];for(;v<p;v++)d[v]=f[v+c-u];return d}}),t("toSpliced")})),q$=z((()=>{Da()("flat")})),Y$=z((()=>{Da()("flatMap")})),X$=z((()=>{"use strict";var e=Le(),t=Vi(),i=Yi(),r=sR(),n=A1(),s=jm();e({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var a=t(this),o=i(a),l=arguments.length;if(l){s(o+l);for(var h=o;h--;){var u=h+l;h in a?a[u]=a[h]:n(a,u)}for(var c=0;c<l;c++)a[c]=arguments[c]}return r(a,o+l)}})})),vL=z(((e,t)=>{var i=Yi(),r=Yn(),n=RangeError;t.exports=function(e,t,s,a){var o=i(e),l=r(s),h=l<0?o+l:l;if(h>=o||h<0)throw n("Incorrect index");for(var u=new t(o),c=0;c<o;c++)u[c]=c===h?a:e[c];return u}})),Z$=z((()=>{"use strict";var e=Le(),t=vL(),i=bs(),r=Array;e({target:"Array",proto:!0},{with:function(e,n){return t(i(this),r,e,n)}})})),cR=z(((e,t)=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView})),Sv=z(((e,t)=>{var i=Fn();t.exports=function(e,t,r){for(var n in t)i(e,n,t[n],r);return e}})),Ac=z(((e,t)=>{var i=ko(),r=TypeError;t.exports=function(e,t){if(i(t,e))return e;throw r("Incorrect invocation")}})),yL=z(((e,t)=>{var i=Yn(),r=io(),n=RangeError;t.exports=function(e){if(void 0===e)return 0;var t=i(e),s=r(t);if(t!==s)throw n("Wrong length or index");return s}})),rZ=z(((e,t)=>{var i=Array,r=Math.abs,n=Math.pow,s=Math.floor,a=Math.log,o=Math.LN2;t.exports={pack:function(e,t,l){var h,u,c,p=i(l),d=8*l-t-1,f=(1<<d)-1,m=f>>1,g=23===t?n(2,-24)-n(2,-77):0,y=e<0||0===e&&1/e<0?1:0,v=0;for((e=r(e))!=e||e===1/0?(u=e!=e?1:0,h=f):(h=s(a(e)/o),e*(c=n(2,-h))<1&&(h--,c*=2),(e+=h+m>=1?g/c:g*n(2,1-m))*c>=2&&(h++,c/=2),h+m>=f?(u=0,h=f):h+m>=1?(u=(e*c-1)*n(2,t),h+=m):(u=e*n(2,m-1)*n(2,t),h=0));t>=8;)p[v++]=255&u,u/=256,t-=8;for(h=h<<t|u,d+=t;d>0;)p[v++]=255&h,h/=256,d-=8;return p[--v]|=128*y,p},unpack:function(e,t){var i,r=e.length,s=8*r-t-1,a=(1<<s)-1,o=a>>1,l=s-7,h=r-1,u=e[h--],c=127&u;for(u>>=7;l>0;)c=256*c+e[h--],l-=8;for(i=c&(1<<-l)-1,c>>=-l,l+=t;l>0;)i=256*i+e[h--],l-=8;if(0===c)c=1-o;else{if(c===a)return i?NaN:u?-1/0:1/0;i+=n(2,t),c-=o}return(u?-1:1)*i*n(2,c-t)}}})),G1=z(((e,t)=>{"use strict";var i,r,n,s,a,o,l=Qt(),h=Lt(),u=Dr(),c=cR(),p=Fm(),d=ea(),f=Ds(),m=Sv(),g=Dt(),y=Ac(),v=Yn(),T=io(),x=yL(),b=rZ(),E=Vo(),_=Dc(),w=lp().f,S=Qw(),M=gv(),I=so(),D=fs(),A=p.PROPER,R=p.CONFIGURABLE,C="ArrayBuffer",O="DataView",P="prototype",N="Wrong index",L=D.getterFor(C),F=D.getterFor(O),U=D.set,k=l[C],B=k,z=B&&B[P],G=l[O],H=G&&G[P],V=Object.prototype,j=l.Array,W=l.RangeError,Y=h(S),X=h([].reverse),q=b.pack,Z=b.unpack,J=function(e){return[255&e]},K=function(e){return[255&e,e>>8&255]},$=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Q=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},ee=function(e){return q(e,23,4)},te=function(e){return q(e,52,8)},ie=function(e,t,i){f(e[P],t,{configurable:!0,get:function(){return i(this)[t]}})},re=function(e,t,i,r){var n=x(i),s=F(e);if(n+t>s.byteLength)throw W(N);var a=s.bytes,o=n+s.byteOffset,l=M(a,o,o+t);return r?l:X(l)},ne=function(e,t,i,r,n,s){var a=x(i),o=F(e);if(a+t>o.byteLength)throw W(N);for(var l=o.bytes,h=a+o.byteOffset,u=r(+n),c=0;c<t;c++)l[h+c]=u[s?c:t-c-1]};if(c){if(i=A&&k.name!==C,g((function(){k(1)}))&&g((function(){new k(-1)}))&&!g((function(){return new k,new k(1.5),new k(NaN),1!=k.length||i&&!R})))i&&R&&d(k,"name",C);else{for((B=function(e){return y(this,z),new k(x(e))})[P]=z,r=w(k),n=0;r.length>n;)(s=r[n++])in B||d(B,s,k[s]);z.constructor=B}_&&E(H)!==V&&_(H,V),a=new G(new B(2)),o=h(H.setInt8),a.setInt8(0,2147483648),a.setInt8(1,2147483649),(a.getInt8(0)||!a.getInt8(1))&&m(H,{setInt8:function(e,t){o(this,e,t<<24>>24)},setUint8:function(e,t){o(this,e,t<<24>>24)}},{unsafe:!0})}else z=(B=function(e){y(this,z);var t=x(e);U(this,{type:C,bytes:Y(j(t),0),byteLength:t}),u||(this.byteLength=t,this.detached=!1)})[P],H=(G=function(e,t,i){y(this,H),y(e,z);var r=L(e),n=r.byteLength,s=v(t);if(s<0||s>n)throw W("Wrong offset");if(s+(i=void 0===i?n-s:T(i))>n)throw W("Wrong length");U(this,{type:O,buffer:e,byteLength:i,byteOffset:s,bytes:r.bytes}),u||(this.buffer=e,this.byteLength=i,this.byteOffset=s)})[P],u&&(ie(B,"byteLength",L),ie(G,"buffer",F),ie(G,"byteLength",F),ie(G,"byteOffset",F)),m(H,{getInt8:function(e){return re(this,1,e)[0]<<24>>24},getUint8:function(e){return re(this,1,e)[0]},getInt16:function(e){var t=re(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=re(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Q(re(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Q(re(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Z(re(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Z(re(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){ne(this,1,e,J,t)},setUint8:function(e,t){ne(this,1,e,J,t)},setInt16:function(e,t){ne(this,2,e,K,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){ne(this,2,e,K,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){ne(this,4,e,$,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){ne(this,4,e,$,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){ne(this,4,e,ee,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){ne(this,8,e,te,t,arguments.length>2?arguments[2]:void 0)}});I(B,C),I(G,O),t.exports={ArrayBuffer:B,DataView:G}})),xZ=z((()=>{"use strict";var e=Le(),t=Qt(),i=G1(),r=Wm(),n="ArrayBuffer",s=i[n];e({global:!0,constructor:!0,forced:t[n]!==s},{ArrayBuffer:s}),r(n)})),ui=z(((e,t)=>{"use strict";var i,r,n,s=cR(),a=Dr(),o=Qt(),l=yi(),h=Ei(),u=Ci(),c=Mc(),p=Gd(),d=ea(),f=Fn(),m=Ds(),g=ko(),y=Vo(),v=Dc(),T=Ti(),x=Lm(),b=fs(),E=b.enforce,_=b.get,w=o.Int8Array,S=w&&w.prototype,M=o.Uint8ClampedArray,I=M&&M.prototype,D=w&&y(w),A=S&&y(S),R=Object.prototype,C=o.TypeError,O=T("toStringTag"),P=x("TYPED_ARRAY_TAG"),N="TypedArrayConstructor",L=s&&!!v&&"Opera"!==c(o.opera),F=!1,U={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},k={BigInt64Array:8,BigUint64Array:8},B=function(e){var t=y(e);if(h(t)){var i=_(t);return i&&u(i,N)?i[N]:B(t)}},z=function(e){if(!h(e))return!1;var t=c(e);return u(U,t)||u(k,t)};for(i in U)(n=(r=o[i])&&r.prototype)?E(n)[N]=r:L=!1;for(i in k)(n=(r=o[i])&&r.prototype)&&(E(n)[N]=r);if((!L||!l(D)||D===Function.prototype)&&(D=function(){throw C("Incorrect invocation")},L))for(i in U)o[i]&&v(o[i],D);if((!L||!A||A===R)&&(A=D.prototype,L))for(i in U)o[i]&&v(o[i].prototype,A);if(L&&y(I)!==A&&v(I,A),a&&!u(A,O))for(i in F=!0,m(A,O,{configurable:!0,get:function(){return h(this)?this[P]:void 0}}),U)o[i]&&d(o[i],P,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:F&&P,aTypedArray:function(e){if(z(e))return e;throw C("Target is not a typed array")},aTypedArrayConstructor:function(e){if(l(e)&&(!v||g(D,e)))return e;throw C(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,i,r){if(a){if(i)for(var n in U){var s=o[n];if(s&&u(s.prototype,e))try{delete s.prototype[e]}catch(i){try{s.prototype[e]=t}catch(e){}}}(!A[e]||i)&&f(A,e,i?t:L&&S[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,i){var r,n;if(a){if(v){if(i)for(r in U)if((n=o[r])&&u(n,e))try{delete n[e]}catch(e){}if(D[e]&&!i)return;try{return f(D,e,i?t:L&&D[e]||t)}catch(e){}}for(r in U)(n=o[r])&&(!n[e]||i)&&f(n,e,t)}},getTypedArrayConstructor:B,isView:function(e){if(!h(e))return!1;var t=c(e);return"DataView"===t||u(U,t)||u(k,t)},isTypedArray:z,TypedArray:D,TypedArrayPrototype:A}})),NZ=z((()=>{var e=Le(),t=ui();e({target:"ArrayBuffer",stat:!0,forced:!t.NATIVE_ARRAY_BUFFER_VIEWS},{isView:t.isView})})),bR=z(((e,t)=>{var i=Um(),r=Gd(),n=TypeError;t.exports=function(e){if(i(e))return e;throw n(r(e)+" is not a constructor")}})),Ym=z(((e,t)=>{var i=$r(),r=bR(),n=Ra(),s=Ti()("species");t.exports=function(e,t){var a,o=i(e).constructor;return void 0===o||n(a=i(o)[s])?t:r(a)}})),zZ=z((()=>{"use strict";var e=Le(),t=cp(),i=Dt(),r=G1(),n=$r(),s=Rc(),a=io(),o=Ym(),l=r.ArrayBuffer,h=r.DataView,u=h.prototype,c=t(l.prototype.slice),p=t(u.getUint8),d=t(u.setUint8);e({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(c&&void 0===t)return c(n(this),e);for(var i=n(this).byteLength,r=s(e,i),u=s(void 0===t?i:t,i),f=new(o(this,l))(a(u-r)),m=new h(this),g=new h(f),y=0;r<u;)d(g,y++,p(m,r++));return f}})})),jZ=z((()=>{var e=Le(),t=G1();e({global:!0,constructor:!0,forced:!cR()},{DataView:t.DataView})})),WZ=z((()=>{jZ()})),qZ=z((()=>{"use strict";var e=Le(),t=Lt(),i=Dt()((function(){return 120!==new Date(16e11).getYear()})),r=t(Date.prototype.getFullYear);e({target:"Date",proto:!0,forced:i},{getYear:function(){return r(this)-1900}})})),XZ=z((()=>{var e=Le(),t=Lt(),i=Date,r=t(i.prototype.getTime);e({target:"Date",stat:!0},{now:function(){return r(new i)}})})),KZ=z((()=>{"use strict";var e=Le(),t=Lt(),i=Yn(),r=Date.prototype,n=t(r.getTime),s=t(r.setFullYear);e({target:"Date",proto:!0},{setYear:function(e){n(this);var t=i(e);return s(this,0<=t&&t<=99?t+1900:t)}})})),JZ=z((()=>{Le()({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})})),V1=z(((e,t)=>{"use strict";var i=Yn(),r=si(),n=ds(),s=RangeError;t.exports=function(e){var t=r(n(this)),a="",o=i(e);if(o<0||o==1/0)throw s("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(a+=t);return a}})),xR=z(((e,t)=>{var i=Lt(),r=io(),n=si(),s=V1(),a=ds(),o=i(s),l=i("".slice),h=Math.ceil,u=function(e){return function(t,i,s){var u,c,p=n(a(t)),d=r(i),f=p.length,m=void 0===s?" ":n(s);return d<=f||""==m?p:((c=o(m,h((u=d-f)/m.length))).length>u&&(c=l(c,0,u)),e?p+c:c+p)}};t.exports={start:u(!1),end:u(!0)}})),aK=z(((e,t)=>{"use strict";var i=Lt(),r=Dt(),n=xR().start,s=RangeError,a=isFinite,o=Math.abs,l=Date.prototype,h=l.toISOString,u=i(l.getTime),c=i(l.getUTCDate),p=i(l.getUTCFullYear),d=i(l.getUTCHours),f=i(l.getUTCMilliseconds),m=i(l.getUTCMinutes),g=i(l.getUTCMonth),y=i(l.getUTCSeconds);t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=h.call(new Date(-50000000000001))}))||!r((function(){h.call(new Date(NaN))}))?function(){if(!a(u(this)))throw s("Invalid time value");var e=this,t=p(e),i=f(e),r=t<0?"-":t>9999?"+":"";return r+n(o(t),r?6:4,0)+"-"+n(g(e)+1,2,0)+"-"+n(c(e),2,0)+"T"+n(d(e),2,0)+":"+n(m(e),2,0)+":"+n(y(e),2,0)+"."+n(i,3,0)+"Z"}:h})),lK=z((()=>{var e=Le(),t=aK();e({target:"Date",proto:!0,forced:Date.prototype.toISOString!==t},{toISOString:t})})),cK=z((()=>{"use strict";var e=Le(),t=Dt(),i=Vi(),r=g1();e({target:"Date",proto:!0,arity:1,forced:t((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=i(this),n=r(t,"number");return"number"!=typeof n||isFinite(n)?t.toISOString():null}})})),hK=z(((e,t)=>{"use strict";var i=$r(),r=U2(),n=TypeError;t.exports=function(e){if(i(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw n("Incorrect hint");return r(this,e)}})),fK=z((()=>{var e=Ci(),t=Fn(),i=hK(),r=Ti()("toPrimitive"),n=Date.prototype;e(n,r)||t(n,r,i)})),yK=z((()=>{var e=Lt(),t=Fn(),i=Date.prototype,r="Invalid Date",n="toString",s=e(i[n]),a=e(i.getTime);String(new Date(NaN))!=r&&t(i,n,(function(){var e=a(this);return e==e?s(this):r}))})),TK=z((()=>{"use strict";var e=Le(),t=Lt(),i=si(),r=t("".charAt),n=t("".charCodeAt),s=t(/./.exec),a=t(1..toString),o=t("".toUpperCase),l=/[\w*+\-./@]/,h=function(e,t){for(var i=a(e,16);i.length<t;)i="0"+i;return i};e({global:!0},{escape:function(e){for(var t,a,u=i(e),c="",p=u.length,d=0;d<p;)t=r(u,d++),s(l,t)?c+=t:c+=(a=n(t,0))<256?"%"+h(a,2):"%u"+o(h(a,4));return c}})})),GL=z(((e,t)=>{"use strict";var i=Lt(),r=Wn(),n=Ei(),s=Ci(),a=zd(),o=uv(),l=Function,h=i([].concat),u=i([].join),c={};t.exports=o?l.bind:function(e){var t=r(this),i=t.prototype,o=a(arguments,1),p=function(){var i=h(o,a(arguments));return this instanceof p?function(e,t,i){if(!s(c,t)){for(var r=[],n=0;n<t;n++)r[n]="a["+n+"]";c[t]=l("C,a","return new C("+u(r,",")+")")}return c[t](e,i)}(t,i.length,i):t.apply(e,i)};return n(i)&&(p.prototype=i),p}})),wK=z((()=>{var e=Le(),t=GL();e({target:"Function",proto:!0,forced:Function.bind!==t},{bind:t})})),DK=z((()=>{"use strict";var e=yi(),t=Ei(),i=An(),r=Vo(),n=Ti(),s=Mw(),a=n("hasInstance"),o=Function.prototype;a in o||i.f(o,a,{value:s((function(i){if(!e(this)||!t(i))return!1;var n=this.prototype;if(!t(n))return i instanceof this;for(;i=r(i);)if(n===i)return!0;return!1}),a)})})),PK=z((()=>{var e=Dr(),t=Fm().EXISTS,i=Lt(),r=Ds(),n=Function.prototype,s=i(n.toString),a=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,o=i(a.exec);e&&!t&&r(n,"name",{configurable:!0,get:function(){try{return o(a,s(this))[1]}catch(e){return""}}})})),NK=z((()=>{var e=Le(),t=Qt();e({global:!0,forced:t.globalThis!==t},{globalThis:t})})),LK=z((()=>{var e=Qt();so()(e.JSON,"JSON",!0)})),IR=z(((e,t)=>{var i=Dt();t.exports=i((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))})),SR=z(((e,t)=>{var i=Dt(),r=Ei(),n=Qs(),s=IR(),a=Object.isExtensible,o=i((function(){a(1)}));t.exports=o||s?function(e){return!(!r(e)||s&&"ArrayBuffer"==n(e))&&(!a||a(e))}:a})),$m=z(((e,t)=>{var i=Dt();t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))})),Kd=z(((e,t)=>{var i=Le(),r=Lt(),n=pv(),s=Ei(),a=Ci(),o=An().f,l=lp(),h=Fw(),u=SR(),c=Lm(),p=$m(),d=!1,f=c("meta"),m=0,g=function(e){o(e,f,{value:{objectID:"O"+m++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},d=!0;var e=l.f,t=r([].splice),n={};n[f]=1,e(n).length&&(l.f=function(i){for(var r=e(i),n=0,s=r.length;n<s;n++)if(r[n]===f){t(r,n,1);break}return r},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h.f}))},fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,f)){if(!u(e))return"F";if(!t)return"E";g(e)}return e[f].objectID},getWeakData:function(e,t){if(!a(e,f)){if(!u(e))return!0;if(!t)return!1;g(e)}return e[f].weakData},onFreeze:function(e){return p&&d&&u(e)&&!a(e,f)&&g(e),e}};n[f]=!0})),j1=z(((e,t)=>{"use strict";var i=Le(),r=Qt(),n=Lt(),s=fv(),a=Fn(),o=Kd(),l=Cc(),h=Ac(),u=yi(),c=Ra(),p=Ei(),d=Dt(),f=P1(),m=so(),g=Vm();t.exports=function(e,t,y){var v=-1!==e.indexOf("Map"),T=-1!==e.indexOf("Weak"),x=v?"set":"add",b=r[e],E=b&&b.prototype,_=b,w={},S=function(e){var t=n(E[e]);a(E,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(T&&!p(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return T&&!p(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(T&&!p(e))&&t(this,0===e?0:e)}:function(e,i){return t(this,0===e?0:e,i),this})};if(s(e,!u(b)||!(T||E.forEach&&!d((function(){(new b).entries().next()})))))_=y.getConstructor(t,e,v,x),o.enable();else if(s(e,!0)){var M=new _,I=M[x](T?{}:-0,1)!=M,D=d((function(){M.has(1)})),A=f((function(e){new b(e)})),R=!T&&d((function(){for(var e=new b,t=5;t--;)e[x](t,t);return!e.has(-0)}));A||((_=t((function(e,t){h(e,E);var i=g(new b,e,_);return c(t)||l(t,i[x],{that:i,AS_ENTRIES:v}),i}))).prototype=E,E.constructor=_),(D||R)&&(S("delete"),S("has"),v&&S("get")),(R||I)&&S(x),T&&E.clear&&delete E.clear}return w[e]=_,i({global:!0,constructor:!0,forced:_!=b},w),m(_,e),T||y.setStrong(_,e,v),_}})),ZL=z(((e,t)=>{"use strict";var i=no(),r=Ds(),n=Sv(),s=xl(),a=Ac(),o=Ra(),l=Cc(),h=iR(),u=F1(),c=Wm(),p=Dr(),d=Kd().fastKey,f=fs(),m=f.set,g=f.getterFor;t.exports={getConstructor:function(e,t,h,u){var c=e((function(e,r){a(e,f),m(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),p||(e.size=0),o(r)||l(r,e[u],{that:e,AS_ENTRIES:h})})),f=c.prototype,y=g(t),v=function(e,t,i){var r,n,s=y(e),a=T(e,t);return a?a.value=i:(s.last=a={index:n=d(t,!0),key:t,value:i,previous:r=s.last,next:void 0,removed:!1},s.first||(s.first=a),r&&(r.next=a),p?s.size++:e.size++,"F"!==n&&(s.index[n]=a)),e},T=function(e,t){var i,r=y(e),n=d(t);if("F"!==n)return r.index[n];for(i=r.first;i;i=i.next)if(i.key==t)return i};return n(f,{clear:function(){for(var e=y(this),t=e.index,i=e.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete t[i.index],i=i.next;e.first=e.last=void 0,p?e.size=0:this.size=0},delete:function(e){var t=this,i=y(t),r=T(t,e);if(r){var n=r.next,s=r.previous;delete i.index[r.index],r.removed=!0,s&&(s.next=n),n&&(n.previous=s),i.first==r&&(i.first=n),i.last==r&&(i.last=s),p?i.size--:t.size--}return!!r},forEach:function(e){for(var t,i=y(this),r=s(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:i.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!T(this,e)}}),n(f,h?{get:function(e){var t=T(this,e);return t&&t.value},set:function(e,t){return v(this,0===e?0:e,t)}}:{add:function(e){return v(this,e=0===e?0:e,e)}}),p&&r(f,"size",{configurable:!0,get:function(){return y(this).size}}),c},setStrong:function(e,t,i){var r=t+" Iterator",n=g(t),s=g(r);h(e,t,(function(e,t){m(this,{type:r,target:e,state:n(e),kind:t,last:void 0})}),(function(){for(var e=s(this),t=e.kind,i=e.last;i&&i.removed;)i=i.previous;return e.target&&(e.last=i=i?i.next:e.state.first)?u("keys"==t?i.key:"values"==t?i.value:[i.key,i.value],!1):(e.target=void 0,u(void 0,!0))}),i?"entries":"values",!i,!0),c(t)}}})),ZK=z((()=>{"use strict";j1()("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ZL())})),KK=z((()=>{ZK()})),KL=z(((e,t)=>{var i=Math.log;t.exports=Math.log1p||function(e){var t=+e;return t>-1e-8&&t<1e-8?t-t*t/2:i(1+t)}})),eJ=z((()=>{var e=Le(),t=KL(),i=Math.acosh,r=Math.log,n=Math.sqrt,s=Math.LN2;e({target:"Math",stat:!0,forced:!i||710!=Math.floor(i(Number.MAX_VALUE))||i(1/0)!=1/0},{acosh:function(e){var i=+e;return i<1?NaN:i>94906265.62425156?r(i)+s:t(i-1+n(i-1)*n(i+1))}})})),iJ=z((()=>{var e=Le(),t=Math.asinh,i=Math.log,r=Math.sqrt;e({target:"Math",stat:!0,forced:!(t&&1/t(0)>0)},{asinh:function e(t){var n=+t;return isFinite(n)&&0!=n?n<0?-e(-n):i(n+r(n*n+1)):n}})})),sJ=z((()=>{var e=Le(),t=Math.atanh,i=Math.log;e({target:"Math",stat:!0,forced:!(t&&1/t(-0)<0)},{atanh:function(e){var t=+e;return 0==t?t:i((1+t)/(1-t))/2}})})),RR=z(((e,t)=>{t.exports=Math.sign||function(e){var t=+e;return 0==t||t!=t?t:t<0?-1:1}})),oJ=z((()=>{var e=Le(),t=RR(),i=Math.abs,r=Math.pow;e({target:"Math",stat:!0},{cbrt:function(e){var n=+e;return t(n)*r(i(n),1/3)}})})),lJ=z((()=>{var e=Le(),t=Math.floor,i=Math.log,r=Math.LOG2E;e({target:"Math",stat:!0},{clz32:function(e){var n=e>>>0;return n?31-t(i(n+.5)*r):32}})})),Y1=z(((e,t)=>{var i=Math.expm1,r=Math.exp;t.exports=!i||i(10)>22025.465794806718||i(10)<22025.465794806718||-2e-17!=i(-2e-17)?function(e){var t=+e;return 0==t?t:t>-1e-6&&t<1e-6?t+t*t/2:r(t)-1}:i})),hJ=z((()=>{var e=Le(),t=Y1(),i=Math.cosh,r=Math.abs,n=Math.E;e({target:"Math",stat:!0,forced:!i||i(710)===1/0},{cosh:function(e){var i=t(r(e)-1)+1;return(i+1/(i*n*n))*(n/2)}})})),dJ=z((()=>{var e=Le(),t=Y1();e({target:"Math",stat:!0,forced:t!=Math.expm1},{expm1:t})})),mJ=z(((e,t)=>{var i=RR(),r=Math.abs,n=Math.pow,s=n(2,-52),a=n(2,-23),o=n(2,127)*(2-a),l=n(2,-126);t.exports=Math.fround||function(e){var t,n,h=+e,u=r(h),c=i(h);return u<l?c*(u/l/a+1/s-1/s)*l*a:(n=(t=(1+a/s)*u)-(t-u))>o||n!=n?c*(1/0):c*n}})),gJ=z((()=>{Le()({target:"Math",stat:!0},{fround:mJ()})})),yJ=z((()=>{var e=Le(),t=Math.hypot,i=Math.abs,r=Math.sqrt;e({target:"Math",stat:!0,arity:2,forced:!!t&&t(1/0,NaN)!==1/0},{hypot:function(e,t){for(var n,s,a=0,o=0,l=arguments.length,h=0;o<l;)h<(n=i(arguments[o++]))?(a=a*(s=h/n)*s+1,h=n):a+=n>0?(s=n/h)*s:n;return h===1/0?1/0:h*r(a)}})})),TJ=z((()=>{var e=Le(),t=Dt(),i=Math.imul;e({target:"Math",stat:!0,forced:t((function(){return-5!=i(4294967295,5)||2!=i.length}))},{imul:function(e,t){var i=65535,r=+e,n=+t,s=i&r,a=i&n;return 0|s*a+((i&r>>>16)*a+s*(i&n>>>16)<<16>>>0)}})})),rF=z(((e,t)=>{var i=Math.log,r=Math.LOG10E;t.exports=Math.log10||function(e){return i(e)*r}})),xJ=z((()=>{Le()({target:"Math",stat:!0},{log10:rF()})})),IJ=z((()=>{Le()({target:"Math",stat:!0},{log1p:KL()})})),_J=z((()=>{var e=Le(),t=Math.log,i=Math.LN2;e({target:"Math",stat:!0},{log2:function(e){return t(e)/i}})})),SJ=z((()=>{Le()({target:"Math",stat:!0},{sign:RR()})})),MJ=z((()=>{var e=Le(),t=Dt(),i=Y1(),r=Math.abs,n=Math.exp,s=Math.E;e({target:"Math",stat:!0,forced:t((function(){return-2e-17!=Math.sinh(-2e-17)}))},{sinh:function(e){var t=+e;return r(t)<1?(i(t)-i(-t))/2:(n(t-1)-n(-t-1))*(s/2)}})})),AJ=z((()=>{var e=Le(),t=Y1(),i=Math.exp;e({target:"Math",stat:!0},{tanh:function(e){var r=+e,n=t(r),s=t(-r);return n==1/0?1:s==1/0?-1:(n-s)/(i(r)+i(-r))}})})),OJ=z((()=>{so()(Math,"Math",!0)})),PJ=z((()=>{Le()({target:"Math",stat:!0},{trunc:rN()})})),X1=z(((e,t)=>{var i=Lt();t.exports=i(1..valueOf)})),$1=z(((e,t)=>{t.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"})),Zm=z(((e,t)=>{var i=Lt(),r=ds(),n=si(),s=$1(),a=i("".replace),o=RegExp("^["+s+"]+"),l=RegExp("(^|[^"+s+"])["+s+"]+$"),h=function(e){return function(t){var i=n(r(t));return 1&e&&(i=a(i,o,"")),2&e&&(i=a(i,l,"$1")),i}};t.exports={start:h(1),end:h(2),trim:h(3)}})),jJ=z((()=>{"use strict";var e=Le(),t=qn(),i=Dr(),r=Qt(),n=Hw(),s=Lt(),a=fv(),o=Ci(),l=Vm(),h=ko(),u=kd(),c=g1(),p=Dt(),d=lp().f,f=Vs().f,m=An().f,g=X1(),y=Zm().trim,v="Number",T=r[v],x=n[v],b=T.prototype,E=r.TypeError,_=s("".slice),w=s("".charCodeAt),S=a(v,!T(" 0o1")||!T("0b1")||T("+0x1")),M=function(e){var t,i=arguments.length<1?0:T(function(e){var t=c(e,"number");return"bigint"==typeof t?t:function(e){var t,i,r,n,s,a,o,l,h=c(e,"number");if(u(h))throw E("Cannot convert a Symbol value to a number");if("string"==typeof h&&h.length>2)if(h=y(h),43===(t=w(h,0))||45===t){if(88===(i=w(h,2))||120===i)return NaN}else if(48===t){switch(w(h,1)){case 66:case 98:r=2,n=49;break;case 79:case 111:r=8,n=55;break;default:return+h}for(a=(s=_(h,2)).length,o=0;o<a;o++)if((l=w(s,o))<48||l>n)return NaN;return parseInt(s,r)}return+h}(t)}(e));return h(b,t=this)&&p((function(){g(t)}))?l(Object(i),this,M):i};M.prototype=b,S&&!t&&(b.constructor=M),e({global:!0,constructor:!0,wrap:!0,forced:S},{Number:M});var I=function(e,t){for(var r,n=i?d(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),s=0;n.length>s;s++)o(t,r=n[s])&&!o(e,r)&&m(e,r,f(t,r))};t&&x&&I(n[v],x),(S||t)&&I(n[v],T)})),WJ=z((()=>{Le()({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})})),YJ=z(((e,t)=>{var i=Qt().isFinite;t.exports=Number.isFinite||function(e){return"number"==typeof e&&i(e)}})),XJ=z((()=>{Le()({target:"Number",stat:!0},{isFinite:YJ()})})),OR=z(((e,t)=>{var i=Ei(),r=Math.floor;t.exports=Number.isInteger||function(e){return!i(e)&&isFinite(e)&&r(e)===e}})),ZJ=z((()=>{Le()({target:"Number",stat:!0},{isInteger:OR()})})),KJ=z((()=>{Le()({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})})),JJ=z((()=>{var e=Le(),t=OR(),i=Math.abs;e({target:"Number",stat:!0},{isSafeInteger:function(e){return t(e)&&i(e)<=9007199254740991}})})),QJ=z((()=>{Le()({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})})),eQ=z((()=>{Le()({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})})),cF=z(((e,t)=>{var i=Qt(),r=Dt(),n=Lt(),s=si(),a=Zm().trim,o=$1(),l=n("".charAt),h=i.parseFloat,u=i.Symbol,c=u&&u.iterator,p=1/h(o+"-0")!=-1/0||c&&!r((function(){h(Object(c))}));t.exports=p?function(e){var t=a(s(e)),i=h(t);return 0===i&&"-"==l(t,0)?-0:i}:h})),aQ=z((()=>{var e=Le(),t=cF();e({target:"Number",stat:!0,forced:Number.parseFloat!=t},{parseFloat:t})})),uF=z(((e,t)=>{var i=Qt(),r=Dt(),n=Lt(),s=si(),a=Zm().trim,o=$1(),l=i.parseInt,h=i.Symbol,u=h&&h.iterator,c=/^[+-]?0x/i,p=n(c.exec),d=8!==l(o+"08")||22!==l(o+"0x16")||u&&!r((function(){l(Object(u))}));t.exports=d?function(e,t){var i=a(s(e));return l(i,t>>>0||(p(c,i)?16:10))}:l})),fQ=z((()=>{var e=Le(),t=uF();e({target:"Number",stat:!0,forced:Number.parseInt!=t},{parseInt:t})})),EQ=z((()=>{"use strict";var e=Le(),t=Lt(),i=Yn(),r=X1(),n=V1(),s=rF(),a=Dt(),o=RangeError,l=String,h=isFinite,u=Math.abs,c=Math.floor,p=Math.pow,d=Math.round,f=t(1..toExponential),m=t(n),g=t("".slice),y="-6.9000e-11"===f(-69e-12,4)&&"1.25e+0"===f(1.255,2)&&"1.235e+4"===f(12345,3)&&"3e+1"===f(25,0);e({target:"Number",proto:!0,forced:!y||!(a((function(){f(1,1/0)}))&&a((function(){f(1,-1/0)})))||!!a((function(){f(1/0,1/0),f(NaN,1/0)}))},{toExponential:function(e){var t=r(this);if(void 0===e)return f(t);var n=i(e);if(!h(t))return String(t);if(n<0||n>20)throw o("Incorrect fraction digits");if(y)return f(t,n);var a="",v="",T=0,x="",b="";if(t<0&&(a="-",t=-t),0===t)T=0,v=m("0",n+1);else{var E=s(t);T=c(E);var _=0,w=p(10,T-n);2*t>=(2*(_=d(t/w))+1)*w&&(_+=1),_>=p(10,n+1)&&(_/=10,T+=1),v=l(_)}return 0!==n&&(v=g(v,0,1)+"."+g(v,1)),0===T?(x="+",b="0"):(x=T>0?"+":"-",b=l(u(T))),a+(v+"e")+x+b}})})),SQ=z((()=>{"use strict";var e=Le(),t=Lt(),i=Yn(),r=X1(),n=V1(),s=Dt(),a=RangeError,o=String,l=Math.floor,h=t(n),u=t("".slice),c=t(1..toFixed),p=function(e,t,i){return 0===t?i:t%2==1?p(e,t-1,i*e):p(e*e,t/2,i)},d=function(e,t,i){for(var r=-1,n=i;++r<6;)n+=t*e[r],e[r]=n%1e7,n=l(n/1e7)},f=function(e,t){for(var i=6,r=0;--i>=0;)r+=e[i],e[i]=l(r/t),r=r%t*1e7},m=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var r=o(e[t]);i=""===i?r:i+h("0",7-r.length)+r}return i};e({target:"Number",proto:!0,forced:s((function(){return"0.000"!==c(8e-5,3)||"1"!==c(.9,0)||"1.25"!==c(1.255,2)||"1000000000000000128"!==c(0xde0b6b3a7640080,0)}))||!s((function(){c({})}))},{toFixed:function(e){var t,n,s,l,c=r(this),g=i(e),y=[0,0,0,0,0,0],v="",T="0";if(g<0||g>20)throw a("Incorrect fraction digits");if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return o(c);if(c<0&&(v="-",c=-c),c>1e-21)if(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(c*p(2,69,1))-69,n=t<0?c*p(2,-t,1):c/p(2,t,1),n*=4503599627370496,(t=52-t)>0){for(d(y,0,n),s=g;s>=7;)d(y,1e7,0),s-=7;for(d(y,p(10,s,1),0),s=t-1;s>=23;)f(y,1<<23),s-=23;f(y,1<<s),d(y,1,1),f(y,2),T=m(y)}else d(y,0,n),d(y,1<<-t,0),T=m(y)+h("0",g);return T=g>0?v+((l=T.length)<=g?"0."+h("0",g-l)+T:u(T,0,l-g)+"."+u(T,l-g)):v+T}})})),MQ=z((()=>{"use strict";var e=Le(),t=Lt(),i=Dt(),r=X1(),n=t(1..toPrecision);e({target:"Number",proto:!0,forced:i((function(){return"1"!==n(1,void 0)}))||!i((function(){n({})}))},{toPrecision:function(e){return void 0===e?n(r(this)):n(r(this),e)}})})),vF=z(((e,t)=>{"use strict";var i=Dr(),r=Lt(),n=ri(),s=Dt(),a=mv(),o=T1(),l=m1(),h=Vi(),u=Om(),c=Object.assign,p=Object.defineProperty,d=r([].concat);t.exports=!c||s((function(){if(i&&1!==c({b:1},c(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=c({},e)[r]||a(c({},t)).join("")!=n}))?function(e,t){for(var r=h(e),s=arguments.length,c=1,p=o.f,f=l.f;s>c;)for(var m,g=u(arguments[c++]),y=p?d(a(g),p(g)):a(g),v=y.length,T=0;v>T;)m=y[T++],(!i||n(f,g,m))&&(r[m]=g[m]);return r}:c})),PQ=z((()=>{var e=Le(),t=vF();e({target:"Object",stat:!0,arity:2,forced:Object.assign!==t},{assign:t})})),NQ=z((()=>{Le()({target:"Object",stat:!0,sham:!Dr()},{create:no()})})),Q1=z(((e,t)=>{"use strict";var i=qn(),r=Qt(),n=Dt(),s=oR();t.exports=i||!n((function(){if(!(s&&s<535)){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete r[e]}}))})),HQ=z((()=>{"use strict";var e=Le(),t=Dr(),i=Q1(),r=Wn(),n=Vi(),s=An();t&&e({target:"Object",proto:!0,forced:i},{__defineGetter__:function(e,t){s.f(n(this),e,{get:r(t),enumerable:!0,configurable:!0})}})})),BQ=z((()=>{var e=Le(),t=Dr(),i=Pw().f;e({target:"Object",stat:!0,forced:Object.defineProperties!==i,sham:!t},{defineProperties:i})})),GQ=z((()=>{var e=Le(),t=Dr(),i=An().f;e({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!t},{defineProperty:i})})),VQ=z((()=>{"use strict";var e=Le(),t=Dr(),i=Q1(),r=Wn(),n=Vi(),s=An();t&&e({target:"Object",proto:!0,forced:i},{__defineSetter__:function(e,t){s.f(n(this),e,{set:r(t),enumerable:!0,configurable:!0})}})})),yF=z(((e,t)=>{var i=Dr(),r=Lt(),n=mv(),s=bs(),a=r(m1().f),o=r([].push),l=function(e){return function(t){for(var r,l=s(t),h=n(l),u=h.length,c=0,p=[];u>c;)r=h[c++],(!i||a(l,r))&&o(p,e?[r,l[r]]:l[r]);return p}};t.exports={entries:l(!0),values:l(!1)}})),qQ=z((()=>{var e=Le(),t=yF().entries;e({target:"Object",stat:!0},{entries:function(e){return t(e)}})})),YQ=z((()=>{var e=Le(),t=$m(),i=Dt(),r=Ei(),n=Kd().onFreeze,s=Object.freeze;e({target:"Object",stat:!0,forced:i((function(){s(1)})),sham:!t},{freeze:function(e){return s&&r(e)?s(n(e)):e}})})),XQ=z((()=>{var e=Le(),t=Cc(),i=Fu();e({target:"Object",stat:!0},{fromEntries:function(e){var r={};return t(e,(function(e,t){i(r,e,t)}),{AS_ENTRIES:!0}),r}})})),KQ=z((()=>{var e=Le(),t=Dt(),i=bs(),r=Vs().f,n=Dr();e({target:"Object",stat:!0,forced:!n||t((function(){r(1)})),sham:!n},{getOwnPropertyDescriptor:function(e,t){return r(i(e),t)}})})),JQ=z((()=>{var e=Le(),t=Dr(),i=Cw(),r=bs(),n=Vs(),s=Fu();e({target:"Object",stat:!0,sham:!t},{getOwnPropertyDescriptors:function(e){for(var t,a,o=r(e),l=n.f,h=i(o),u={},c=0;h.length>c;)void 0!==(a=l(o,t=h[c++]))&&s(u,t,a);return u}})})),QQ=z((()=>{var e=Le(),t=Dt(),i=Fw().f;e({target:"Object",stat:!0,forced:t((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:i})})),tee=z((()=>{var e=Le(),t=Dt(),i=Vi(),r=Vo(),n=Xw();e({target:"Object",stat:!0,forced:t((function(){r(1)})),sham:!n},{getPrototypeOf:function(e){return r(i(e))}})})),ree=z((()=>{Le()({target:"Object",stat:!0},{hasOwn:Ci()})})),TF=z(((e,t)=>{t.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),nee=z((()=>{Le()({target:"Object",stat:!0},{is:TF()})})),aee=z((()=>{var e=Le(),t=SR();e({target:"Object",stat:!0,forced:Object.isExtensible!==t},{isExtensible:t})})),lee=z((()=>{var e=Le(),t=Dt(),i=Ei(),r=Qs(),n=IR(),s=Object.isFrozen;e({target:"Object",stat:!0,forced:n||t((function(){s(1)}))},{isFrozen:function(e){return!(i(e)&&(!n||"ArrayBuffer"!=r(e)))||!!s&&s(e)}})})),uee=z((()=>{var e=Le(),t=Dt(),i=Ei(),r=Qs(),n=IR(),s=Object.isSealed;e({target:"Object",stat:!0,forced:n||t((function(){s(1)}))},{isSealed:function(e){return!(i(e)&&(!n||"ArrayBuffer"!=r(e)))||!!s&&s(e)}})})),pee=z((()=>{var e=Le(),t=Vi(),i=mv();e({target:"Object",stat:!0,forced:Dt()((function(){i(1)}))},{keys:function(e){return i(t(e))}})})),dee=z((()=>{"use strict";var e=Le(),t=Dr(),i=Q1(),r=Vi(),n=op(),s=Vo(),a=Vs().f;t&&e({target:"Object",proto:!0,forced:i},{__lookupGetter__:function(e){var t,i=r(this),o=n(e);do{if(t=a(i,o))return t.get}while(i=s(i))}})})),fee=z((()=>{"use strict";var e=Le(),t=Dr(),i=Q1(),r=Vi(),n=op(),s=Vo(),a=Vs().f;t&&e({target:"Object",proto:!0,forced:i},{__lookupSetter__:function(e){var t,i=r(this),o=n(e);do{if(t=a(i,o))return t.set}while(i=s(i))}})})),mee=z((()=>{var e=Le(),t=Ei(),i=Kd().onFreeze,r=$m(),n=Dt(),s=Object.preventExtensions;e({target:"Object",stat:!0,forced:n((function(){s(1)})),sham:!r},{preventExtensions:function(e){return s&&t(e)?s(i(e)):e}})})),bee=z((()=>{"use strict";var e=Dr(),t=Ds(),i=Ei(),r=Vi(),n=ds(),s=Object.getPrototypeOf,a=Object.setPrototypeOf,o=Object.prototype,l="__proto__";if(e&&s&&a&&!(l in o))try{t(o,l,{configurable:!0,get:function(){return s(r(this))},set:function(e){var t=n(this);!i(e)&&null!==e||!i(t)||a(t,e)}})}catch(e){}})),xee=z((()=>{var e=Le(),t=Ei(),i=Kd().onFreeze,r=$m(),n=Dt(),s=Object.seal;e({target:"Object",stat:!0,forced:n((function(){s(1)})),sham:!r},{seal:function(e){return s&&t(e)?s(i(e)):e}})})),Iee=z((()=>{Le()({target:"Object",stat:!0},{setPrototypeOf:Dc()})})),See=z(((e,t)=>{"use strict";var i=Aw(),r=Mc();t.exports=i?{}.toString:function(){return"[object "+r(this)+"]"}})),wee=z((()=>{var e=Aw(),t=Fn(),i=See();e||t(Object.prototype,"toString",i,{unsafe:!0})})),Ree=z((()=>{var e=Le(),t=yF().values;e({target:"Object",stat:!0},{values:function(e){return t(e)}})})),Dee=z((()=>{var e=Le(),t=cF();e({global:!0,forced:parseFloat!=t},{parseFloat:t})})),Aee=z((()=>{var e=Le(),t=uF();e({global:!0,forced:parseInt!=t},{parseInt:t})})),zu=z(((e,t)=>{var i=TypeError;t.exports=function(e,t){if(e<t)throw i("Not enough arguments");return e}})),SF=z(((e,t)=>{var i=Pu();t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)})),rb=z(((e,t)=>{var i,r,n,s,a=Qt(),o=Go(),l=xl(),h=yi(),u=Ci(),c=Dt(),p=aN(),d=zd(),f=v1(),m=zu(),g=SF(),y=Bu(),v=a.setImmediate,T=a.clearImmediate,x=a.process,b=a.Dispatch,E=a.Function,_=a.MessageChannel,w=a.String,S=0,M={},I="onreadystatechange";c((function(){i=a.location}));var D=function(e){if(u(M,e)){var t=M[e];delete M[e],t()}},A=function(e){return function(){D(e)}},R=function(e){D(e.data)},C=function(e){a.postMessage(w(e),i.protocol+"//"+i.host)};(!v||!T)&&(v=function(e){m(arguments.length,1);var t=h(e)?e:E(e),i=d(arguments,1);return M[++S]=function(){o(t,void 0,i)},r(S),S},T=function(e){delete M[e]},y?r=function(e){x.nextTick(A(e))}:b&&b.now?r=function(e){b.now(A(e))}:_&&!g?(s=(n=new _).port2,n.port1.onmessage=R,r=l(s.postMessage,s)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&i&&"file:"!==i.protocol&&!c(C)?(r=C,a.addEventListener("message",R,!1)):r=I in f("script")?function(e){p.appendChild(f("script"))[I]=function(){p.removeChild(this),D(e)}}:function(e){setTimeout(A(e),0)}),t.exports={set:v,clear:T}})),NF=z(((e,t)=>{var i=function(){this.head=null,this.tail=null};i.prototype={add:function(e){var t={item:e,next:null},i=this.tail;i?i.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},t.exports=i})),qee=z(((e,t)=>{var i=Pu();t.exports=/ipad|iphone|ipod/i.test(i)&&"undefined"!=typeof Pebble})),Xee=z(((e,t)=>{var i=Pu();t.exports=/web0s(?!.*chrome)/i.test(i)})),kF=z(((e,t)=>{var i,r,n,s,a,o,l,h=Qt(),u=xl(),c=Vs().f,p=rb().set,d=NF(),f=SF(),m=qee(),g=Xee(),y=Bu(),v=h.MutationObserver||h.WebKitMutationObserver,T=h.document,x=h.process,b=h.Promise,E=c(h,"queueMicrotask"),_=E&&E.value;_||(o=new d,l=function(){var e,t;for(y&&(e=x.domain)&&e.exit();t=o.get();)try{t()}catch(e){throw o.head&&i(),e}e&&e.enter()},f||y||g||!v||!T?!m&&b&&b.resolve?((s=b.resolve(void 0)).constructor=b,a=u(s.then,s),i=function(){a(l)}):y?i=function(){x.nextTick(l)}:(p=u(p,h),i=function(){p(l)}):(r=!0,n=T.createTextNode(""),new v(l).observe(n,{characterData:!0}),i=function(){n.data=r=!r}),_=function(e){o.head||i(),o.add(e)}),t.exports=_})),ite=z(((e,t)=>{t.exports=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}}})),Fv=z(((e,t)=>{t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}})),Qm=z(((e,t)=>{var i=Qt();t.exports=i.Promise})),HR=z(((e,t)=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version})),GF=z(((e,t)=>{var i=HR(),r=Bu();t.exports=!i&&!r&&"object"==typeof window&&"object"==typeof document})),Hv=z(((e,t)=>{var i=Qt(),r=Qm(),n=yi(),s=fv(),a=Iw(),o=Ti(),l=GF(),h=HR(),u=qn(),c=Nu(),p=r&&r.prototype,d=o("species"),f=!1,m=n(i.PromiseRejectionEvent),g=s("Promise",(function(){var e=a(r),t=e!==String(r);if(!t&&66===c||u&&(!p.catch||!p.finally))return!0;if(!c||c<51||!/native code/.test(e)){var i=new r((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[d]=n,!(f=i.then((function(){}))instanceof n))return!0}return!t&&(l||h)&&!m}));t.exports={CONSTRUCTOR:g,REJECTION_EVENT:m,SUBCLASSING:f}})),Jd=z(((e,t)=>{"use strict";var i=Wn(),r=TypeError,n=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw r("Bad Promise constructor");t=e,n=i})),this.resolve=i(t),this.reject=i(n)};t.exports.f=function(e){return new n(e)}})),Ate=z((()=>{"use strict";var e,t,i,r=Le(),n=qn(),s=Bu(),a=Qt(),o=ri(),l=Fn(),h=Dc(),u=so(),c=Wm(),p=Wn(),d=yi(),f=Ei(),m=Ac(),g=Ym(),y=rb().set,v=kF(),T=ite(),x=Fv(),b=NF(),E=fs(),_=Qm(),w=Hv(),S=Jd(),M="Promise",I=w.CONSTRUCTOR,D=w.REJECTION_EVENT,A=w.SUBCLASSING,R=E.getterFor(M),C=E.set,O=_&&_.prototype,P=_,N=O,L=a.TypeError,F=a.document,U=a.process,k=S.f,B=k,z=!!(F&&F.createEvent&&a.dispatchEvent),G="unhandledrejection",H=function(e){var t;return!(!f(e)||!d(t=e.then))&&t},V=function(e,t){var i,r,n,s=t.value,a=1==t.state,l=a?e.ok:e.fail,h=e.resolve,u=e.reject,c=e.domain;try{l?(a||(2===t.rejection&&q(t),t.rejection=1),!0===l?i=s:(c&&c.enter(),i=l(s),c&&(c.exit(),n=!0)),i===e.promise?u(L("Promise-chain cycle")):(r=H(i))?o(r,i,h,u):h(i)):u(s)}catch(e){c&&!n&&c.exit(),u(e)}},j=function(e,t){e.notified||(e.notified=!0,v((function(){for(var i,r=e.reactions;i=r.get();)V(i,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},W=function(e,t,i){var r,n;z?((r=F.createEvent("Event")).promise=t,r.reason=i,r.initEvent(e,!1,!0),a.dispatchEvent(r)):r={promise:t,reason:i},!D&&(n=a["on"+e])?n(r):e===G&&T("Unhandled promise rejection",i)},Y=function(e){o(y,a,(function(){var t,i=e.facade,r=e.value;if(X(e)&&(t=x((function(){s?U.emit("unhandledRejection",r,i):W(G,i,r)})),e.rejection=s||X(e)?2:1,t.error))throw t.value}))},X=function(e){return 1!==e.rejection&&!e.parent},q=function(e){o(y,a,(function(){var t=e.facade;s?U.emit("rejectionHandled",t):W("rejectionhandled",t,e.value)}))},Z=function(e,t,i){return function(r){e(t,r,i)}},J=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,j(e,!0))},K=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw L("Promise can't be resolved itself");var r=H(t);r?v((function(){var i={done:!1};try{o(r,t,Z(K,i,e),Z(J,i,e))}catch(t){J(i,t,e)}})):(e.value=t,e.state=1,j(e,!1))}catch(t){J({done:!1},t,e)}}};if(I&&(N=(P=function(t){m(this,N),p(t),o(e,this);var i=R(this);try{t(Z(K,i),Z(J,i))}catch(e){J(i,e)}}).prototype,(e=function(e){C(this,{type:M,done:!1,notified:!1,parent:!1,reactions:new b,rejection:!1,state:0,value:void 0})}).prototype=l(N,"then",(function(e,t){var i=R(this),r=k(g(this,P));return i.parent=!0,r.ok=!d(e)||e,r.fail=d(t)&&t,r.domain=s?U.domain:void 0,0==i.state?i.reactions.add(r):v((function(){V(r,i)})),r.promise})),t=function(){var t=new e,i=R(t);this.promise=t,this.resolve=Z(K,i),this.reject=Z(J,i)},S.f=k=function(e){return e===P||void 0===e?new t(e):B(e)},!n&&d(_)&&O!==Object.prototype)){i=O.then,A||l(O,"then",(function(e,t){var r=this;return new P((function(e,t){o(i,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete O.constructor}catch(e){}h&&h(O,N)}r({global:!0,constructor:!0,wrap:!0,forced:I},{Promise:P}),u(P,M,!1,!0),c(M)})),ab=z(((e,t)=>{var i=Qm(),r=P1(),n=Hv().CONSTRUCTOR;t.exports=n||!r((function(e){i.all(e).then(void 0,(function(){}))}))})),Pte=z((()=>{"use strict";var e=Le(),t=ri(),i=Wn(),r=Jd(),n=Fv(),s=Cc();e({target:"Promise",stat:!0,forced:ab()},{all:function(e){var a=this,o=r.f(a),l=o.resolve,h=o.reject,u=n((function(){var r=i(a.resolve),n=[],o=0,u=1;s(e,(function(e){var i=o++,s=!1;u++,t(r,a,e).then((function(e){s||(s=!0,n[i]=e,--u||l(n))}),h)})),--u||l(n)}));return u.error&&h(u.value),o.promise}})})),Lte=z((()=>{"use strict";var e,t=Le(),i=qn(),r=Hv().CONSTRUCTOR,n=Qm(),s=Sn(),a=yi(),o=Fn(),l=n&&n.prototype;t({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&a(n)&&(e=s("Promise").prototype.catch,l.catch!==e&&o(l,"catch",e,{unsafe:!0}))})),Fte=z((()=>{"use strict";var e=Le(),t=ri(),i=Wn(),r=Jd(),n=Fv(),s=Cc();e({target:"Promise",stat:!0,forced:ab()},{race:function(e){var a=this,o=r.f(a),l=o.reject,h=n((function(){var r=i(a.resolve);s(e,(function(e){t(r,a,e).then(o.resolve,l)}))}));return h.error&&l(h.value),o.promise}})})),Hte=z((()=>{"use strict";var e=Le(),t=ri(),i=Jd();e({target:"Promise",stat:!0,forced:Hv().CONSTRUCTOR},{reject:function(e){var r=i.f(this);return t(r.reject,void 0,e),r.promise}})})),e5=z(((e,t)=>{var i=$r(),r=Ei(),n=Jd();t.exports=function(e,t){if(i(e),r(t)&&t.constructor===e)return t;var s=n.f(e);return(0,s.resolve)(t),s.promise}})),Gte=z((()=>{"use strict";var e=Le(),t=Sn(),i=qn(),r=Qm(),n=Hv().CONSTRUCTOR,s=e5(),a=t("Promise"),o=i&&!n;e({target:"Promise",stat:!0,forced:i||n},{resolve:function(e){return s(o&&this===a?r:this,e)}})})),Vte=z((()=>{Ate(),Pte(),Lte(),Fte(),Hte(),Gte()})),zte=z((()=>{"use strict";var e=Le(),t=ri(),i=Wn(),r=Jd(),n=Fv(),s=Cc();e({target:"Promise",stat:!0,forced:ab()},{allSettled:function(e){var a=this,o=r.f(a),l=o.resolve,h=o.reject,u=n((function(){var r=i(a.resolve),n=[],o=0,h=1;s(e,(function(e){var i=o++,s=!1;h++,t(r,a,e).then((function(e){s||(s=!0,n[i]={status:"fulfilled",value:e},--h||l(n))}),(function(e){s||(s=!0,n[i]={status:"rejected",reason:e},--h||l(n))}))})),--h||l(n)}));return u.error&&h(u.value),o.promise}})})),Wte=z((()=>{"use strict";var e=Le(),t=ri(),i=Wn(),r=Sn(),n=Jd(),s=Fv(),a=Cc(),o=ab(),l="No one promise resolved";e({target:"Promise",stat:!0,forced:o},{any:function(e){var o=this,h=r("AggregateError"),u=n.f(o),c=u.resolve,p=u.reject,d=s((function(){var r=i(o.resolve),n=[],s=0,u=1,d=!1;a(e,(function(e){var i=s++,a=!1;u++,t(r,o,e).then((function(e){a||d||(d=!0,c(e))}),(function(e){a||d||(a=!0,n[i]=e,--u||p(new h(n,l)))}))})),--u||p(new h(n,l))}));return d.error&&p(d.value),u.promise}})})),$te=z((()=>{"use strict";var e,t=Le(),i=qn(),r=Qm(),n=Dt(),s=Sn(),a=yi(),o=Ym(),l=e5(),h=Fn(),u=r&&r.prototype;t({target:"Promise",proto:!0,real:!0,forced:!!r&&n((function(){u.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=o(this,s("Promise")),i=a(e);return this.then(i?function(i){return l(t,e()).then((function(){return i}))}:e,i?function(i){return l(t,e()).then((function(){throw i}))}:e)}}),!i&&a(r)&&(e=s("Promise").prototype.finally,u.finally!==e&&h(u,"finally",e,{unsafe:!0}))})),Zte=z((()=>{var e=Le(),t=Go(),i=Wn(),r=$r();e({target:"Reflect",stat:!0,forced:!Dt()((function(){Reflect.apply((function(){}))}))},{apply:function(e,n,s){return t(i(e),n,r(s))}})})),ire=z((()=>{var e=Le(),t=Sn(),i=Go(),r=GL(),n=bR(),s=$r(),a=Ei(),o=no(),l=Dt(),h=t("Reflect","construct"),u=Object.prototype,c=[].push,p=l((function(){function e(){}return!(h((function(){}),[],e)instanceof e)})),d=!l((function(){h((function(){}))})),f=p||d;e({target:"Reflect",stat:!0,forced:f,sham:f},{construct:function(e,t){n(e),s(t);var l=arguments.length<3?e:n(arguments[2]);if(d&&!p)return h(e,t,l);if(e==l){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var f=[null];return i(c,f,t),new(i(r,e,f))}var m=l.prototype,g=o(a(m)?m:u),y=i(e,g,t);return a(y)?y:g}})})),are=z((()=>{var e=Le(),t=Dr(),i=$r(),r=op(),n=An();e({target:"Reflect",stat:!0,forced:Dt()((function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})})),sham:!t},{defineProperty:function(e,t,s){i(e);var a=r(t);i(s);try{return n.f(e,a,s),!0}catch(e){return!1}}})})),ore=z((()=>{var e=Le(),t=$r(),i=Vs().f;e({target:"Reflect",stat:!0},{deleteProperty:function(e,r){var n=i(t(e),r);return!(n&&!n.configurable)&&delete e[r]}})})),s5=z(((e,t)=>{var i=Ci();t.exports=function(e){return void 0!==e&&(i(e,"value")||i(e,"writable"))}})),hre=z((()=>{var e=Le(),t=ri(),i=Ei(),r=$r(),n=s5(),s=Vs(),a=Vo();e({target:"Reflect",stat:!0},{get:function e(o,l){var h,u,c=arguments.length<3?o:arguments[2];return r(o)===c?o[l]:(h=s.f(o,l))?n(h)?h.value:void 0===h.get?void 0:t(h.get,c):i(u=a(o))?e(u,l,c):void 0}})})),pre=z((()=>{var e=Le(),t=Dr(),i=$r(),r=Vs();e({target:"Reflect",stat:!0,sham:!t},{getOwnPropertyDescriptor:function(e,t){return r.f(i(e),t)}})})),dre=z((()=>{var e=Le(),t=$r(),i=Vo();e({target:"Reflect",stat:!0,sham:!Xw()},{getPrototypeOf:function(e){return i(t(e))}})})),fre=z((()=>{Le()({target:"Reflect",stat:!0},{has:function(e,t){return t in e}})})),mre=z((()=>{var e=Le(),t=$r(),i=SR();e({target:"Reflect",stat:!0},{isExtensible:function(e){return t(e),i(e)}})})),gre=z((()=>{Le()({target:"Reflect",stat:!0},{ownKeys:Cw()})})),vre=z((()=>{var e=Le(),t=Sn(),i=$r();e({target:"Reflect",stat:!0,sham:!$m()},{preventExtensions:function(e){i(e);try{var r=t("Object","preventExtensions");return r&&r(e),!0}catch(e){return!1}}})})),xre=z((()=>{var e=Le(),t=ri(),i=$r(),r=Ei(),n=s5(),s=Dt(),a=An(),o=Vs(),l=Vo(),h=Bo();e({target:"Reflect",stat:!0,forced:s((function(){var e=function(){},t=a.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}))},{set:function e(s,u,c){var p,d,f,m=arguments.length<4?s:arguments[3],g=o.f(i(s),u);if(!g){if(r(d=l(s)))return e(d,u,c,m);g=h(0)}if(n(g)){if(!1===g.writable||!r(m))return!1;if(p=o.f(m,u)){if(p.get||p.set||!1===p.writable)return!1;p.value=c,a.f(m,u,p)}else a.f(m,u,h(0,c))}else{if(void 0===(f=g.set))return!1;t(f,m,c)}return!0}})})),_re=z((()=>{var e=Le(),t=$r(),i=CN(),r=Dc();r&&e({target:"Reflect",stat:!0},{setPrototypeOf:function(e,n){t(e),i(n);try{return r(e,n),!0}catch(e){return!1}}})})),Sre=z((()=>{var e=Le(),t=Qt(),i=so();e({global:!0},{Reflect:{}}),i(t.Reflect,"Reflect",!0)})),Vv=z(((e,t)=>{var i=Ei(),r=Qs(),n=Ti()("match");t.exports=function(e){var t;return i(e)&&(void 0!==(t=e[n])?!!t:"RegExp"==r(e))}})),WR=z(((e,t)=>{"use strict";var i=$r();t.exports=function(){var e=i(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}})),zv=z(((e,t)=>{var i=ri(),r=Ci(),n=ko(),s=WR(),a=RegExp.prototype;t.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||r(e,"flags")||!n(a,e)?t:i(s,e)}})),ob=z(((e,t)=>{var i=Dt(),r=Qt().RegExp,n=i((function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),s=n||i((function(){return!r("a","y").sticky})),a=n||i((function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:n}})),qR=z(((e,t)=>{var i=Dt(),r=Qt().RegExp;t.exports=i((function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))})),u5=z(((e,t)=>{var i=Dt(),r=Qt().RegExp;t.exports=i((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))})),Gre=z((()=>{var e,t,i,r=Dr(),n=Qt(),s=Lt(),a=fv(),o=Vm(),l=ea(),h=lp().f,u=ko(),c=Vv(),p=si(),d=zv(),f=ob(),m=AN(),g=Fn(),y=Dt(),v=Ci(),T=fs().enforce,x=Wm(),b=Ti(),E=qR(),_=u5(),w=b("match"),S=n.RegExp,M=S.prototype,I=n.SyntaxError,D=s(M.exec),A=s("".charAt),R=s("".replace),C=s("".indexOf),O=s("".slice),P=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,N=/a/g,L=/a/g,F=new S(N)!==N,U=f.MISSED_STICKY,k=f.UNSUPPORTED_Y;if(a("RegExp",r&&(!F||U||E||_||y((function(){return L[w]=!1,S(N)!=N||S(L)==L||"/a/i"!=S(N,"i")}))))){for(e=function(t,i){var r,n,s,a,h,f,m=u(M,this),g=c(t),y=void 0===i,x=[],b=t;if(!m&&g&&y&&t.constructor===e)return t;if((g||u(M,t))&&(t=t.source,y&&(i=d(b))),t=void 0===t?"":p(t),i=void 0===i?"":p(i),b=t,E&&"dotAll"in N&&(n=!!i&&C(i,"s")>-1)&&(i=R(i,/s/g,"")),r=i,U&&"sticky"in N&&(s=!!i&&C(i,"y")>-1)&&k&&(i=R(i,/y/g,"")),_&&(a=function(e){for(var t,i=e.length,r=0,n="",s=[],a={},o=!1,l=!1,h=0,u="";r<=i;r++){if("\\"===(t=A(e,r)))t+=A(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:D(P,O(e,r+1))&&(r+=2,l=!0),n+=t,h++;continue;case">"===t&&l:if(""===u||v(a,u))throw new I("Invalid capture group name");a[u]=!0,s[s.length]=[u,h],l=!1,u="";continue}l?u+=t:n+=t}return[n,s]}(t),t=a[0],x=a[1]),h=o(S(t,i),m?this:M,e),(n||s||x.length)&&(f=T(h),n&&(f.dotAll=!0,f.raw=e(function(e){for(var t,i=e.length,r=0,n="",s=!1;r<=i;r++)"\\"!==(t=A(e,r))?s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),n+=t):n+="[\\s\\S]":n+=t+A(e,++r);return n}(t),r)),s&&(f.sticky=!0),x.length&&(f.groups=x)),t!==b)try{l(h,"source",""===b?"(?:)":b)}catch(e){}return h},t=h(S),i=0;t.length>i;)m(e,S,t[i++]);M.constructor=e,e.prototype=M,g(n,"RegExp",e,{constructor:!0})}x("RegExp")})),zre=z((()=>{var e=Dr(),t=qR(),i=Qs(),r=Ds(),n=fs().get,s=RegExp.prototype,a=TypeError;e&&t&&r(s,"dotAll",{configurable:!0,get:function(){if(this!==s){if("RegExp"===i(this))return!!n(this).dotAll;throw a("Incompatible receiver, RegExp required")}}})})),cb=z(((e,t)=>{"use strict";var i,r,n=ri(),s=Lt(),a=si(),o=WR(),l=ob(),h=Nm(),u=no(),c=fs().get,p=qR(),d=u5(),f=h("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,g=m,y=s("".charAt),v=s("".indexOf),T=s("".replace),x=s("".slice),b=(r=/b*/g,n(m,i=/a/,"a"),n(m,r,"a"),0!==i.lastIndex||0!==r.lastIndex),E=l.BROKEN_CARET,_=void 0!==/()??/.exec("")[1];(b||_||E||p||d)&&(g=function(e){var t,i,r,s,l,h,p,d=this,w=c(d),S=a(e),M=w.raw;if(M)return M.lastIndex=d.lastIndex,t=n(g,M,S),d.lastIndex=M.lastIndex,t;var I=w.groups,D=E&&d.sticky,A=n(o,d),R=d.source,C=0,O=S;if(D&&(A=T(A,"y",""),-1===v(A,"g")&&(A+="g"),O=x(S,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==y(S,d.lastIndex-1))&&(R="(?: "+R+")",O=" "+O,C++),i=new RegExp("^(?:"+R+")",A)),_&&(i=new RegExp("^"+R+"$(?!\\s)",A)),b&&(r=d.lastIndex),s=n(m,D?i:d,O),D?s?(s.input=x(s.input,C),s[0]=x(s[0],C),s.index=d.lastIndex,d.lastIndex+=s[0].length):d.lastIndex=0:b&&s&&(d.lastIndex=d.global?s.index+s[0].length:r),_&&s&&s.length>1&&n(f,s[0],i,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(s[l]=void 0)})),s&&I)for(s.groups=h=u(null),l=0;l<I.length;l++)h[(p=I[l])[0]]=s[p[1]];return s}),t.exports=g})),ZR=z((()=>{"use strict";var e=Le(),t=cb();e({target:"RegExp",proto:!0,forced:/./.exec!==t},{exec:t})})),$re=z((()=>{var e=Qt(),t=Dr(),i=Ds(),r=WR(),n=Dt(),s=e.RegExp,a=s.prototype;t&&n((function(){var e=!0;try{s(".","d")}catch(t){e=!1}var t={},i="",r=e?"dgimsy":"gimsy",n=function(e,r){Object.defineProperty(t,e,{get:function(){return i+=r,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var l in e&&(o.hasIndices="d"),o)n(l,o[l]);return Object.getOwnPropertyDescriptor(a,"flags").get.call(t)!==r||i!==r}))&&i(a,"flags",{configurable:!0,get:r})})),Kre=z((()=>{var e=Dr(),t=ob().MISSED_STICKY,i=Qs(),r=Ds(),n=fs().get,s=RegExp.prototype,a=TypeError;e&&t&&r(s,"sticky",{configurable:!0,get:function(){if(this!==s){if("RegExp"===i(this))return!!n(this).sticky;throw a("Incompatible receiver, RegExp required")}}})})),eie=z((()=>{"use strict";ZR();var e,t,i=Le(),r=ri(),n=yi(),s=$r(),a=si(),o=(e=!1,(t=/[ac]/).exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e),l=/./.test;i({target:"RegExp",proto:!0,forced:!o},{test:function(e){var t=s(this),i=a(e),o=t.exec;if(!n(o))return r(l,t,i);var h=r(o,t,i);return null!==h&&(s(h),!0)}})})),iie=z((()=>{"use strict";var e=Fm().PROPER,t=Fn(),i=$r(),r=si(),n=Dt(),s=zv(),a="toString",o=RegExp.prototype[a],l=n((function(){return"/a/b"!=o.call({source:"a",flags:"b"})})),h=e&&o.name!=a;(l||h)&&t(RegExp.prototype,a,(function(){var e=i(this);return"/"+r(e.source)+"/"+r(s(e))}),{unsafe:!0})})),nie=z((()=>{"use strict";j1()("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ZL())})),sie=z((()=>{nie()})),aie=z((()=>{"use strict";var e=Le(),t=Lt(),i=ds(),r=Yn(),n=si(),s=Dt(),a=t("".charAt);e({target:"String",proto:!0,forced:s((function(){return"\ud842"!=="\ud842\udfb7".at(-2)}))},{at:function(e){var t=n(i(this)),s=t.length,o=r(e),l=o>=0?o:s+o;return l<0||l>=s?void 0:a(t,l)}})})),ub=z(((e,t)=>{var i=Lt(),r=Yn(),n=si(),s=ds(),a=i("".charAt),o=i("".charCodeAt),l=i("".slice),h=function(e){return function(t,i){var h,u,c=n(s(t)),p=r(i),d=c.length;return p<0||p>=d?e?"":void 0:(h=o(c,p))<55296||h>56319||p+1===d||(u=o(c,p+1))<56320||u>57343?e?a(c,p):h:e?l(c,p,p+2):u-56320+(h-55296<<10)+65536}};t.exports={codeAt:h(!1),charAt:h(!0)}})),uie=z((()=>{"use strict";var e=Le(),t=ub().codeAt;e({target:"String",proto:!0},{codePointAt:function(e){return t(this,e)}})})),KR=z(((e,t)=>{var i=Vv(),r=TypeError;t.exports=function(e){if(i(e))throw r("The method doesn't accept regular expressions");return e}})),JR=z(((e,t)=>{var i=Ti()("match");t.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[i]=!1,"/./"[e](t)}catch(e){}}return!1}})),vie=z((()=>{"use strict";var e,t=Le(),i=cp(),r=Vs().f,n=io(),s=si(),a=KR(),o=ds(),l=JR(),h=qn(),u=i("".endsWith),c=i("".slice),p=Math.min,d=l("endsWith");t({target:"String",proto:!0,forced:!(!h&&!d&&(e=r(String.prototype,"endsWith"),e&&!e.writable))&&!d},{endsWith:function(e){var t=s(o(this));a(e);var i=arguments.length>1?arguments[1]:void 0,r=t.length,l=void 0===i?r:p(n(i),r),h=s(e);return u?u(t,h,l):c(t,l-h.length,l)===h}})})),Tie=z((()=>{var e=Le(),t=Lt(),i=Rc(),r=RangeError,n=String.fromCharCode,s=String.fromCodePoint,a=t([].join);e({target:"String",stat:!0,arity:1,forced:!!s&&1!=s.length},{fromCodePoint:function(e){for(var t,s=[],o=arguments.length,l=0;o>l;){if(t=+arguments[l++],i(t,1114111)!==t)throw r(t+" is not a valid code point");s[l]=t<65536?n(t):n(55296+((t-=65536)>>10),t%1024+56320)}return a(s,"")}})})),xie=z((()=>{"use strict";var e=Le(),t=Lt(),i=KR(),r=ds(),n=si(),s=JR(),a=t("".indexOf);e({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~a(n(r(this)),n(i(e)),arguments.length>1?arguments[1]:void 0)}})})),b5=z((()=>{"use strict";var e=ub().charAt,t=si(),i=fs(),r=iR(),n=F1(),s="String Iterator",a=i.set,o=i.getterFor(s);r(String,"String",(function(e){a(this,{type:s,string:t(e),index:0})}),(function(){var t,i=o(this),r=i.string,s=i.index;return s>=r.length?n(void 0,!0):(t=e(r,s),i.index+=t.length,n(t,!1))}))})),hb=z(((e,t)=>{"use strict";ZR();var i=cp(),r=Fn(),n=cb(),s=Dt(),a=Ti(),o=ea(),l=a("species"),h=RegExp.prototype;t.exports=function(e,t,u,c){var p=a(e),d=!s((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),f=d&&!s((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[l]=function(){return i},i.flags="",i[p]=/./[p]),i.exec=function(){return t=!0,null},i[p](""),!t}));if(!d||!f||u){var m=i(/./[p]),g=t(p,""[e],(function(e,t,r,s,a){var o=i(e),l=t.exec;return l===n||l===h.exec?d&&!a?{done:!0,value:m(t,r,s)}:{done:!0,value:o(r,t,s)}:{done:!1}}));r(String.prototype,e,g[0]),r(h,p,g[1])}c&&o(h[p],"sham",!0)}})),pb=z(((e,t)=>{"use strict";var i=ub().charAt;t.exports=function(e,t,r){return t+(r?i(e,t).length:1)}})),qv=z(((e,t)=>{var i=ri(),r=$r(),n=yi(),s=Qs(),a=cb(),o=TypeError;t.exports=function(e,t){var l=e.exec;if(n(l)){var h=i(l,e,t);return null!==h&&r(h),h}if("RegExp"===s(e))return i(a,e,t);throw o("RegExp#exec called on incompatible receiver")}})),Lie=z((()=>{"use strict";var e=ri(),t=hb(),i=$r(),r=Ra(),n=io(),s=si(),a=ds(),o=Lu(),l=pb(),h=qv();t("match",(function(t,u,c){return[function(i){var n=a(this),l=r(i)?void 0:o(i,t);return l?e(l,i,n):new RegExp(i)[t](s(n))},function(e){var t=i(this),r=s(e),a=c(u,t,r);if(a.done)return a.value;if(!t.global)return h(t,r);var o=t.unicode;t.lastIndex=0;for(var p,d=[],f=0;null!==(p=h(t,r));){var m=s(p[0]);d[f]=m,""===m&&(t.lastIndex=l(r,n(t.lastIndex),o)),f++}return 0===f?null:d}]}))})),Wie=z((()=>{"use strict";var e=Le(),t=ri(),i=cp(),r=eR(),n=F1(),s=ds(),a=io(),o=si(),l=$r(),h=Ra(),u=Qs(),c=Vv(),p=zv(),d=Lu(),f=Fn(),m=Dt(),g=Ti(),y=Ym(),v=pb(),T=qv(),x=fs(),b=qn(),E=g("matchAll"),_="RegExp String",w=_+" Iterator",S=x.set,M=x.getterFor(w),I=RegExp.prototype,D=TypeError,A=i("".indexOf),R=i("".matchAll),C=!!R&&!m((function(){R("a",/./)})),O=r((function(e,t,i,r){S(this,{type:w,regexp:e,string:t,global:i,unicode:r,done:!1})}),_,(function(){var e=M(this);if(e.done)return n(void 0,!0);var t=e.regexp,i=e.string,r=T(t,i);return null===r?(e.done=!0,n(void 0,!0)):e.global?(""===o(r[0])&&(t.lastIndex=v(i,a(t.lastIndex),e.unicode)),n(r,!1)):(e.done=!0,n(r,!1))})),P=function(e){var t,i,r,n=l(this),s=o(e),h=y(n,RegExp),u=o(p(n));return t=new h(h===RegExp?n.source:n,u),i=!!~A(u,"g"),r=!!~A(u,"u"),t.lastIndex=a(n.lastIndex),new O(t,s,i,r)};e({target:"String",proto:!0,forced:C},{matchAll:function(e){var i,r,n,a,l=s(this);if(h(e)){if(C)return R(l,e)}else{if(c(e)&&(i=o(s(p(e))),!~A(i,"g")))throw D("`.matchAll` does not allow non-global regexes");if(C)return R(l,e);if(void 0===(n=d(e,E))&&b&&"RegExp"==u(e)&&(n=P),n)return t(n,e,l)}return r=o(l),a=new RegExp(e,"g"),b?t(P,a,r):a[E](r)}}),b||E in I||f(I,E,P)})),M5=z(((e,t)=>{var i=Pu();t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)})),Yie=z((()=>{"use strict";var e=Le(),t=xR().end;e({target:"String",proto:!0,forced:M5()},{padEnd:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),Xie=z((()=>{"use strict";var e=Le(),t=xR().start;e({target:"String",proto:!0,forced:M5()},{padStart:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),Jie=z((()=>{var e=Le(),t=Lt(),i=bs(),r=Vi(),n=si(),s=Yi(),a=t([].push),o=t([].join);e({target:"String",stat:!0},{raw:function(e){var t=i(r(e).raw),l=s(t);if(!l)return"";for(var h=arguments.length,u=[],c=0;;){if(a(u,n(t[c++])),c===l)return o(u,"");c<h&&a(u,n(arguments[c]))}}})})),Qie=z((()=>{Le()({target:"String",proto:!0},{repeat:V1()})})),O5=z(((e,t)=>{var i=Lt(),r=Vi(),n=Math.floor,s=i("".charAt),a=i("".replace),o=i("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;t.exports=function(e,t,i,u,c,p){var d=i+e.length,f=u.length,m=h;return void 0!==c&&(c=r(c),m=l),a(p,m,(function(r,a){var l;switch(s(a,0)){case"$":return"$";case"&":return e;case"`":return o(t,0,i);case"'":return o(t,d);case"<":l=c[o(a,1,-1)];break;default:var h=+a;if(0===h)return r;if(h>f){var p=n(h/10);return 0===p?r:p<=f?void 0===u[p-1]?s(a,1):u[p-1]+s(a,1):r}l=u[h-1]}return void 0===l?"":l}))}})),sne=z((()=>{"use strict";var e=Go(),t=ri(),i=Lt(),r=hb(),n=Dt(),s=$r(),a=yi(),o=Ra(),l=Yn(),h=io(),u=si(),c=ds(),p=pb(),d=Lu(),f=O5(),m=qv(),g=Ti()("replace"),y=Math.max,v=Math.min,T=i([].concat),x=i([].push),b=i("".indexOf),E=i("".slice),_=function(e){return void 0===e?e:String(e)},w="$0"==="a".replace(/./,"$0"),S=!!/./[g]&&""===/./[g]("a","$0");r("replace",(function(i,r,n){var w=S?"$":"$0";return[function(e,i){var n=c(this),s=o(e)?void 0:d(e,g);return s?t(s,e,n,i):t(r,u(n),e,i)},function(t,i){var o=s(this),c=u(t);if("string"==typeof i&&-1===b(i,w)&&-1===b(i,"$<")){var d=n(r,o,c,i);if(d.done)return d.value}var g=a(i);g||(i=u(i));var S=o.global;if(S){var M=o.unicode;o.lastIndex=0}for(var I=[];;){var D=m(o,c);if(null===D||(x(I,D),!S))break;""===u(D[0])&&(o.lastIndex=p(c,h(o.lastIndex),M))}for(var A="",R=0,C=0;C<I.length;C++){for(var O=u((D=I[C])[0]),P=y(v(l(D.index),c.length),0),N=[],L=1;L<D.length;L++)x(N,_(D[L]));var F=D.groups;if(g){var U=T([O],N,P,c);void 0!==F&&x(U,F);var k=u(e(i,void 0,U))}else k=f(O,c,P,N,F,i);P>=R&&(A+=E(c,R,P)+k,R=P+O.length)}return A+E(c,R)}]}),!!n((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!w||S)})),une=z((()=>{"use strict";var e=Le(),t=ri(),i=Lt(),r=ds(),n=yi(),s=Ra(),a=Vv(),o=si(),l=Lu(),h=zv(),u=O5(),c=Ti(),p=qn(),d=c("replace"),f=TypeError,m=i("".indexOf),g=i("".replace),y=i("".slice),v=Math.max,T=function(e,t,i){return i>e.length?-1:""===t?i:m(e,t,i)};e({target:"String",proto:!0},{replaceAll:function(e,i){var c,x,b,E,_,w,S,M,I,D=r(this),A=0,R=0,C="";if(!s(e)){if((c=a(e))&&(x=o(r(h(e))),!~m(x,"g")))throw f("`.replaceAll` does not allow non-global regexes");if(b=l(e,d))return t(b,e,D,i);if(p&&c)return g(o(D),e,i)}for(E=o(D),_=o(e),(w=n(i))||(i=o(i)),S=_.length,M=v(1,S),A=T(E,_,0);-1!==A;)I=w?o(i(_,A,E)):u(_,E,A,[],void 0,i),C+=y(E,R,A)+I,R=A+S,A=T(E,_,A+M);return R<E.length&&(C+=y(E,R)),C}})})),dne=z((()=>{"use strict";var e=ri(),t=hb(),i=$r(),r=Ra(),n=ds(),s=TF(),a=si(),o=Lu(),l=qv();t("search",(function(t,h,u){return[function(i){var s=n(this),l=r(i)?void 0:o(i,t);return l?e(l,i,s):new RegExp(i)[t](a(s))},function(e){var t=i(this),r=a(e),n=u(h,t,r);if(n.done)return n.value;var o=t.lastIndex;s(o,0)||(t.lastIndex=0);var c=l(t,r);return s(t.lastIndex,o)||(t.lastIndex=o),null===c?-1:c.index}]}))})),Ene=z((()=>{"use strict";var e=Go(),t=ri(),i=Lt(),r=hb(),n=$r(),s=Ra(),a=Vv(),o=ds(),l=Ym(),h=pb(),u=io(),c=si(),p=Lu(),d=gv(),f=qv(),m=cb(),g=ob(),y=Dt(),v=g.UNSUPPORTED_Y,T=4294967295,x=Math.min,b=[].push,E=i(/./.exec),_=i(b),w=i("".slice);r("split",(function(i,r,g){var y;return y="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(i,n){var s=c(o(this)),l=void 0===n?T:n>>>0;if(0===l)return[];if(void 0===i)return[s];if(!a(i))return t(r,s,i,l);for(var h,u,p,f=[],g=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),y=0,v=new RegExp(i.source,g+"g");(h=t(m,v,s))&&!((u=v.lastIndex)>y&&(_(f,w(s,y,h.index)),h.length>1&&h.index<s.length&&e(b,f,d(h,1)),p=h[0].length,y=u,f.length>=l));)v.lastIndex===h.index&&v.lastIndex++;return y===s.length?(p||!E(v,""))&&_(f,""):_(f,w(s,y)),f.length>l?d(f,0,l):f}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:t(r,this,e,i)}:r,[function(e,r){var n=o(this),a=s(e)?void 0:p(e,i);return a?t(a,e,n,r):t(y,c(n),e,r)},function(e,t){var i=n(this),s=c(e),a=g(y,i,s,t,y!==r);if(a.done)return a.value;var o=l(i,RegExp),p=i.unicode,d=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(v?"g":"y"),m=new o(v?"^(?:"+i.source+")":i,d),b=void 0===t?T:t>>>0;if(0===b)return[];if(0===s.length)return null===f(m,s)?[s]:[];for(var E=0,S=0,M=[];S<s.length;){m.lastIndex=v?0:S;var I,D=f(m,v?w(s,S):s);if(null===D||(I=x(u(m.lastIndex+(v?S:0)),s.length))===E)S=h(s,S,p);else{if(_(M,w(s,E,S)),M.length===b)return M;for(var A=1;A<=D.length-1;A++)if(_(M,D[A]),M.length===b)return M;S=E=I}}return _(M,w(s,E)),M}]}),!!y((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]})),v)})),_ne=z((()=>{"use strict";var e,t=Le(),i=cp(),r=Vs().f,n=io(),s=si(),a=KR(),o=ds(),l=JR(),h=qn(),u=i("".startsWith),c=i("".slice),p=Math.min,d=l("startsWith");t({target:"String",proto:!0,forced:!(!h&&!d&&(e=r(String.prototype,"startsWith"),e&&!e.writable))&&!d},{startsWith:function(e){var t=s(o(this));a(e);var i=n(p(arguments.length>1?arguments[1]:void 0,t.length)),r=s(e);return u?u(t,r,i):c(t,i,i+r.length)===r}})})),wne=z((()=>{"use strict";var e=Le(),t=Lt(),i=ds(),r=Yn(),n=si(),s=t("".slice),a=Math.max,o=Math.min;e({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(e,t){var l,h,u=n(i(this)),c=u.length,p=r(e);return p===1/0&&(p=0),p<0&&(p=a(c+p,0)),(l=void 0===t?c:r(t))<=0||l===1/0||p>=(h=o(p+l,c))?"":s(u,p,h)}})})),iM=z(((e,t)=>{var i=Fm().PROPER,r=Dt(),n=$1();t.exports=function(e){return r((function(){return!!n[e]()||"\u200b\x85\u180e"!=="\u200b\x85\u180e"[e]()||i&&n[e].name!==e}))}})),Cne=z((()=>{"use strict";var e=Le(),t=Zm().trim;e({target:"String",proto:!0,forced:iM()("trim")},{trim:function(){return t(this)}})})),U5=z(((e,t)=>{"use strict";var i=Zm().end,r=iM();t.exports=r("trimEnd")?function(){return i(this)}:"".trimEnd})),Pne=z((()=>{var e=Le(),t=U5();e({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==t},{trimRight:t})})),Lne=z((()=>{Pne();var e=Le(),t=U5();e({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==t},{trimEnd:t})})),B5=z(((e,t)=>{"use strict";var i=Zm().start,r=iM();t.exports=r("trimStart")?function(){return i(this)}:"".trimStart})),Une=z((()=>{var e=Le(),t=B5();e({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==t},{trimLeft:t})})),kne=z((()=>{Une();var e=Le(),t=B5();e({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==t},{trimStart:t})})),lo=z(((e,t)=>{var i=Lt(),r=ds(),n=si(),s=/"/g,a=i("".replace);t.exports=function(e,t,i,o){var l=n(r(e)),h="<"+t;return""!==i&&(h+=" "+i+'="'+a(n(o),s,""")+'"'),h+">"+l+"</"+t+">"}})),co=z(((e,t)=>{var i=Dt();t.exports=function(e){return i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}})),jne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("anchor")},{anchor:function(e){return t(this,"a","name",e)}})})),Wne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("big")},{big:function(){return t(this,"big","","")}})})),qne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("blink")},{blink:function(){return t(this,"blink","","")}})})),Yne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("bold")},{bold:function(){return t(this,"b","","")}})})),Xne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("fixed")},{fixed:function(){return t(this,"tt","","")}})})),$ne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("fontcolor")},{fontcolor:function(e){return t(this,"font","color",e)}})})),Zne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("fontsize")},{fontsize:function(e){return t(this,"font","size",e)}})})),Kne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("italics")},{italics:function(){return t(this,"i","","")}})})),Jne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("link")},{link:function(e){return t(this,"a","href",e)}})})),Qne=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("small")},{small:function(){return t(this,"small","","")}})})),ese=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("strike")},{strike:function(){return t(this,"strike","","")}})})),tse=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("sub")},{sub:function(){return t(this,"sub","","")}})})),rse=z((()=>{"use strict";var e=Le(),t=lo();e({target:"String",proto:!0,forced:co()("sup")},{sup:function(){return t(this,"sup","","")}})})),nM=z(((e,t)=>{var i=Qt(),r=Dt(),n=P1(),s=ui().NATIVE_ARRAY_BUFFER_VIEWS,a=i.ArrayBuffer,o=i.Int8Array;t.exports=!s||!r((function(){o(1)}))||!r((function(){new o(-1)}))||!n((function(e){new o,new o(null),new o(1.5),new o(e)}),!0)||r((function(){return 1!==new o(new a(2),1,void 0).length}))})),ase=z(((e,t)=>{var i=Yn(),r=RangeError;t.exports=function(e){var t=i(e);if(t<0)throw r("The argument can't be less than 0");return t}})),G5=z(((e,t)=>{var i=ase(),r=RangeError;t.exports=function(e,t){var n=i(e);if(n%t)throw r("Wrong offset");return n}})),V5=z(((e,t)=>{var i=Mc();t.exports=function(e){var t=i(e);return"BigInt64Array"==t||"BigUint64Array"==t}})),sM=z(((e,t)=>{var i=g1(),r=TypeError;t.exports=function(e){var t=i(e,"number");if("number"==typeof t)throw r("Can't convert number to bigint");return BigInt(t)}})),z5=z(((e,t)=>{var i=xl(),r=ri(),n=bR(),s=Vi(),a=Yi(),o=C1(),l=xv(),h=$w(),u=V5(),c=ui().aTypedArrayConstructor,p=sM();t.exports=function(e){var t,d,f,m,g,y,v,T,x=n(this),b=s(e),E=arguments.length,_=E>1?arguments[1]:void 0,w=void 0!==_,S=l(b);if(S&&!h(S))for(T=(v=o(b,S)).next,b=[];!(y=r(T,v)).done;)b.push(y.value);for(w&&E>2&&(_=i(_,arguments[2])),d=a(b),f=new(c(x))(d),m=u(f),t=0;d>t;t++)g=w?_(b[t],t):b[t],f[t]=m?p(g):+g;return f}})),ju=z(((e,t)=>{"use strict";var i=Le(),r=Qt(),n=ri(),s=Dr(),a=nM(),o=ui(),l=G1(),h=Ac(),u=Bo(),c=ea(),p=OR(),d=io(),f=yL(),m=G5(),g=op(),y=Ci(),v=Mc(),T=Ei(),x=kd(),b=no(),E=ko(),_=Dc(),w=lp().f,S=z5(),M=Cs().forEach,I=Wm(),D=Ds(),A=An(),R=Vs(),C=fs(),O=Vm(),P=C.get,N=C.set,L=C.enforce,F=A.f,U=R.f,k=Math.round,B=r.RangeError,z=l.ArrayBuffer,G=z.prototype,H=l.DataView,V=o.NATIVE_ARRAY_BUFFER_VIEWS,j=o.TYPED_ARRAY_TAG,W=o.TypedArray,Y=o.TypedArrayPrototype,X=o.aTypedArrayConstructor,q=o.isTypedArray,Z="BYTES_PER_ELEMENT",J="Wrong length",K=function(e,t){X(e);for(var i=0,r=t.length,n=new e(r);r>i;)n[i]=t[i++];return n},$=function(e,t){D(e,t,{configurable:!0,get:function(){return P(this)[t]}})},Q=function(e){var t;return E(G,e)||"ArrayBuffer"==(t=v(e))||"SharedArrayBuffer"==t},ee=function(e,t){return q(e)&&!x(t)&&t in e&&p(+t)&&t>=0},te=function(e,t){return t=g(t),ee(e,t)?u(2,e[t]):U(e,t)},ie=function(e,t,i){return t=g(t),!(ee(e,t)&&T(i)&&y(i,"value"))||y(i,"get")||y(i,"set")||i.configurable||y(i,"writable")&&!i.writable||y(i,"enumerable")&&!i.enumerable?F(e,t,i):(e[t]=i.value,e)};s?(V||(R.f=te,A.f=ie,$(Y,"buffer"),$(Y,"byteOffset"),$(Y,"byteLength"),$(Y,"length")),i({target:"Object",stat:!0,forced:!V},{getOwnPropertyDescriptor:te,defineProperty:ie}),t.exports=function(e,t,s){var o=e.match(/\d+/)[0]/8,l=e+(s?"Clamped":"")+"Array",u="get"+e,p="set"+e,g=r[l],y=g,v=y&&y.prototype,x={},E=function(e,t){F(e,t,{get:function(){return function(e,t){var i=P(e);return i.view[u](t*o+i.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var r=P(e);s&&(i=(i=k(i))<0?0:i>255?255:255&i),r.view[p](t*o+r.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};V?a&&(y=t((function(e,t,i,r){return h(e,v),O(T(t)?Q(t)?void 0!==r?new g(t,m(i,o),r):void 0!==i?new g(t,m(i,o)):new g(t):q(t)?K(y,t):n(S,y,t):new g(f(t)),e,y)})),_&&_(y,W),M(w(g),(function(e){e in y||c(y,e,g[e])})),y.prototype=v):(y=t((function(e,t,i,r){h(e,v);var s,a,l,u=0,c=0;if(T(t)){if(!Q(t))return q(t)?K(y,t):n(S,y,t);s=t,c=m(i,o);var p=t.byteLength;if(void 0===r){if(p%o||(a=p-c)<0)throw B(J)}else if((a=d(r)*o)+c>p)throw B(J);l=a/o}else l=f(t),s=new z(a=l*o);for(N(e,{buffer:s,byteOffset:c,byteLength:a,length:l,view:new H(s)});u<l;)E(e,u++)})),_&&_(y,W),v=y.prototype=b(Y)),v.constructor!==y&&c(v,"constructor",y),L(v).TypedArrayConstructor=y,j&&c(v,j,l);var D=y!=g;x[l]=y,i({global:!0,constructor:!0,forced:D,sham:!V},x),Z in y||c(y,Z,o),Z in v||c(v,Z,o),I(l)}):t.exports=function(){}})),Cse=z((()=>{ju()("Float32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),Ase=z((()=>{ju()("Float64",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),Ose=z((()=>{ju()("Int8",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),Pse=z((()=>{ju()("Int16",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),Nse=z((()=>{ju()("Int32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),Lse=z((()=>{ju()("Uint8",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),Fse=z((()=>{ju()("Uint8",(function(e){return function(t,i,r){return e(this,t,i,r)}}),!0)})),Hse=z((()=>{ju()("Uint16",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),Use=z((()=>{ju()("Uint32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))})),kse=z((()=>{"use strict";var e=ui(),t=Yi(),i=Yn(),r=e.aTypedArray;(0,e.exportTypedArrayMethod)("at",(function(e){var n=r(this),s=t(n),a=i(e),o=a>=0?a:s+a;return o<0||o>=s?void 0:n[o]}))})),Vse=z((()=>{"use strict";var e=Lt(),t=ui(),i=e(XN()),r=t.aTypedArray;(0,t.exportTypedArrayMethod)("copyWithin",(function(e,t){return i(r(this),e,t,arguments.length>2?arguments[2]:void 0)}))})),jse=z((()=>{"use strict";var e=ui(),t=Cs().every,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("every",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),qse=z((()=>{"use strict";var e=ui(),t=Qw(),i=sM(),r=Mc(),n=ri(),s=Lt(),a=Dt(),o=e.aTypedArray,l=e.exportTypedArrayMethod,h=s("".slice);l("fill",(function(e){var s=arguments.length;o(this);var a="Big"===h(r(this),0,3)?i(e):+e;return n(t,this,a,s>1?arguments[1]:void 0,s>2?arguments[2]:void 0)}),a((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))})),Eb=z(((e,t)=>{var i=ui(),r=Ym(),n=i.aTypedArrayConstructor,s=i.getTypedArrayConstructor;t.exports=function(e){return n(r(e,s(e)))}})),Zse=z(((e,t)=>{var i=lR(),r=Eb();t.exports=function(e,t){return i(r(e),t)}})),Jse=z((()=>{"use strict";var e=ui(),t=Cs().filter,i=Zse(),r=e.aTypedArray;(0,e.exportTypedArrayMethod)("filter",(function(e){var n=t(r(this),e,arguments.length>1?arguments[1]:void 0);return i(this,n)}))})),eae=z((()=>{"use strict";var e=ui(),t=Cs().find,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("find",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),rae=z((()=>{"use strict";var e=ui(),t=Cs().findIndex,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("findIndex",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),nae=z((()=>{"use strict";var e=ui(),t=O1().findLast,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("findLast",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),aae=z((()=>{"use strict";var e=ui(),t=O1().findLastIndex,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("findLastIndex",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),lae=z((()=>{"use strict";var e=ui(),t=Cs().forEach,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("forEach",(function(e){t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),cae=z((()=>{"use strict";var e=nM();(0,ui().exportTypedArrayStaticMethod)("from",z5(),e)})),hae=z((()=>{"use strict";var e=ui(),t=dv().includes,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("includes",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),dae=z((()=>{"use strict";var e=ui(),t=dv().indexOf,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("indexOf",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),yae=z((()=>{"use strict";var e=Qt(),t=Dt(),i=Lt(),r=ui(),n=H1(),s=Ti()("iterator"),a=e.Uint8Array,o=i(n.values),l=i(n.keys),h=i(n.entries),u=r.aTypedArray,c=r.exportTypedArrayMethod,p=a&&a.prototype,d=!t((function(){p[s].call([1])})),f=!!p&&p.values&&p[s]===p.values&&"values"===p.values.name,m=function(){return o(u(this))};c("entries",(function(){return h(u(this))}),d),c("keys",(function(){return l(u(this))}),d),c("values",m,d||!f,{name:"values"}),c(s,m,d||!f,{name:"values"})})),Tae=z((()=>{"use strict";var e=ui(),t=Lt(),i=e.aTypedArray,r=e.exportTypedArrayMethod,n=t([].join);r("join",(function(e){return n(i(this),e)}))})),xae=z((()=>{"use strict";var e=ui(),t=Go(),i=cL(),r=e.aTypedArray;(0,e.exportTypedArrayMethod)("lastIndexOf",(function(e){var n=arguments.length;return t(i,r(this),n>1?[e,arguments[1]]:[e])}))})),_ae=z((()=>{"use strict";var e=ui(),t=Cs().map,i=Eb(),r=e.aTypedArray;(0,e.exportTypedArrayMethod)("map",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(i(e))(t)}))}))})),wae=z((()=>{"use strict";var e=ui(),t=nM(),i=e.aTypedArrayConstructor;(0,e.exportTypedArrayStaticMethod)("of",(function(){for(var e=0,t=arguments.length,r=new(i(this))(t);t>e;)r[e]=arguments[e++];return r}),t)})),Mae=z((()=>{"use strict";var e=ui(),t=U1().left,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("reduce",(function(e){var r=arguments.length;return t(i(this),e,r,r>1?arguments[1]:void 0)}))})),Cae=z((()=>{"use strict";var e=ui(),t=U1().right,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("reduceRight",(function(e){var r=arguments.length;return t(i(this),e,r,r>1?arguments[1]:void 0)}))})),Oae=z((()=>{"use strict";var e=ui(),t=e.aTypedArray,i=e.exportTypedArrayMethod,r=Math.floor;i("reverse",(function(){for(var e,i=this,n=t(i).length,s=r(n/2),a=0;a<s;)e=i[a],i[a++]=i[--n],i[n]=e;return i}))})),Uae=z((()=>{"use strict";var e=Qt(),t=ri(),i=ui(),r=Yi(),n=G5(),s=Vi(),a=Dt(),o=e.RangeError,l=e.Int8Array,h=l&&l.prototype,u=h&&h.set,c=i.aTypedArray,p=i.exportTypedArrayMethod,d=!a((function(){var e=new Uint8ClampedArray(2);return t(u,e,{length:1,0:3},1),3!==e[1]})),f=d&&i.NATIVE_ARRAY_BUFFER_VIEWS&&a((function(){var e=new l(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));p("set",(function(e){c(this);var i=n(arguments.length>1?arguments[1]:void 0,1),a=s(e);if(d)return t(u,this,a,i);var l=this.length,h=r(a),p=0;if(h+i>l)throw o("Wrong length");for(;p<h;)this[i+p]=a[p++]}),!d||f)})),kae=z((()=>{"use strict";var e=ui(),t=Eb(),i=Dt(),r=zd(),n=e.aTypedArray;(0,e.exportTypedArrayMethod)("slice",(function(e,i){for(var s=r(n(this),e,i),a=t(this),o=0,l=s.length,h=new a(l);l>o;)h[o]=s[o++];return h}),i((function(){new Int8Array(1).slice()})))})),Vae=z((()=>{"use strict";var e=ui(),t=Cs().some,i=e.aTypedArray;(0,e.exportTypedArrayMethod)("some",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0)}))})),Xae=z((()=>{"use strict";var e=Qt(),t=cp(),i=Dt(),r=Wn(),n=aR(),s=ui(),a=pL(),o=dL(),l=Nu(),h=oR(),u=s.aTypedArray,c=s.exportTypedArrayMethod,p=e.Uint16Array,d=p&&t(p.prototype.sort),f=!(!d||i((function(){d(new p(2),null)}))&&i((function(){d(new p(2),{})}))),m=!!d&&!i((function(){if(l)return l<74;if(a)return a<67;if(o)return!0;if(h)return h<602;var e,t,i=new p(516),r=Array(516);for(e=0;e<516;e++)t=e%4,i[e]=515-e,r[e]=e-2*t+3;for(d(i,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(i[e]!==r[e])return!0}));c("sort",(function(e){return void 0!==e&&r(e),m?d(this,e):n(u(this),(t=e,function(e,i){return void 0!==t?+t(e,i)||0:i!=i?-1:e!=e?1:0===e&&0===i?1/e>0&&1/i<0?1:-1:e>i}));var t}),!m||f)})),Kae=z((()=>{"use strict";var e=ui(),t=io(),i=Rc(),r=Eb(),n=e.aTypedArray;(0,e.exportTypedArrayMethod)("subarray",(function(e,s){var a=n(this),o=a.length,l=i(e,o);return new(r(a))(a.buffer,a.byteOffset+l*a.BYTES_PER_ELEMENT,t((void 0===s?o:i(s,o))-l))}))})),roe=z((()=>{"use strict";var e=Qt(),t=Go(),i=ui(),r=Dt(),n=zd(),s=e.Int8Array,a=i.aTypedArray,o=i.exportTypedArrayMethod,l=[].toLocaleString,h=!!s&&r((function(){l.call(new s(1))}));o("toLocaleString",(function(){return t(l,h?n(a(this)):a(this),n(arguments))}),r((function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()}))||!r((function(){s.prototype.toLocaleString.call([1,2])})))})),ioe=z((()=>{"use strict";var e=gL(),t=ui(),i=t.aTypedArray,r=t.exportTypedArrayMethod,n=t.getTypedArrayConstructor;r("toReversed",(function(){return e(i(this),n(this))}))})),noe=z((()=>{"use strict";var e=ui(),t=Lt(),i=Wn(),r=lR(),n=e.aTypedArray,s=e.getTypedArrayConstructor,a=e.exportTypedArrayMethod,o=t(e.TypedArrayPrototype.sort);a("toSorted",(function(e){void 0!==e&&i(e);var t=n(this),a=r(s(t),t);return o(a,e)}))})),aoe=z((()=>{"use strict";var e=ui().exportTypedArrayMethod,t=Dt(),i=Qt(),r=Lt(),n=i.Uint8Array,s=n&&n.prototype||{},a=[].toString,o=r([].join);t((function(){a.call({})}))&&(a=function(){return o(this)});var l=s.toString!=a;e("toString",a,l)})),ooe=z((()=>{"use strict";var e=vL(),t=ui(),i=V5(),r=Yn(),n=sM(),s=t.aTypedArray,a=t.getTypedArrayConstructor;(0,t.exportTypedArrayMethod)("with",(function(t,o){var l=s(this),h=r(t),u=i(l)?n(o):+o;return e(l,a(l),h,u)}),!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}())})),poe=z((()=>{"use strict";var e=Le(),t=Lt(),i=si(),r=String.fromCharCode,n=t("".charAt),s=t(/./.exec),a=t("".slice),o=/^[\da-f]{2}$/i,l=/^[\da-f]{4}$/i;e({global:!0},{unescape:function(e){for(var t,h,u=i(e),c="",p=u.length,d=0;d<p;){if("%"===(t=n(u,d++)))if("u"===n(u,d)){if(h=a(u,d+1,d+5),s(l,h)){c+=r(parseInt(h,16)),d+=5;continue}}else if(h=a(u,d,d+2),s(o,h)){c+=r(parseInt(h,16)),d+=2;continue}c+=t}return c}})})),p6=z(((e,t)=>{"use strict";var i=Lt(),r=Sv(),n=Kd().getWeakData,s=Ac(),a=$r(),o=Ra(),l=Ei(),h=Cc(),u=Cs(),c=Ci(),p=fs(),d=p.set,f=p.getterFor,m=u.find,g=u.findIndex,y=i([].splice),v=0,T=function(e){return e.frozen||(e.frozen=new x)},x=function(){this.entries=[]},b=function(e,t){return m(e.entries,(function(e){return e[0]===t}))};x.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var i=b(this,e);i?i[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&y(this.entries,t,1),!!~t}},t.exports={getConstructor:function(e,t,i,u){var p=e((function(e,r){s(e,m),d(e,{type:t,id:v++,frozen:void 0}),o(r)||h(r,e[u],{that:e,AS_ENTRIES:i})})),m=p.prototype,g=f(t),y=function(e,t,i){var r=g(e),s=n(a(t),!0);return!0===s?T(r).set(t,i):s[r.id]=i,e};return r(m,{delete:function(e){var t=g(this);if(!l(e))return!1;var i=n(e);return!0===i?T(t).delete(e):i&&c(i,t.id)&&delete i[t.id]},has:function(e){var t=g(this);if(!l(e))return!1;var i=n(e);return!0===i?T(t).has(e):i&&c(i,t.id)}}),r(m,i?{get:function(e){var t=g(this);if(l(e)){var i=n(e);return!0===i?T(t).get(e):i?i[t.id]:void 0}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),p}}})),Moe=z((()=>{"use strict";var e,t,i,r,n=$m(),s=Qt(),a=Lt(),o=Sv(),l=Kd(),h=j1(),u=p6(),c=Ei(),p=fs().enforce,d=Dt(),f=Z2(),m=Object,g=Array.isArray,y=m.isExtensible,v=m.isFrozen,T=m.isSealed,x=m.freeze,b=m.seal,E={},_={},w=!s.ActiveXObject&&"ActiveXObject"in s,S=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},M=h("WeakMap",S,u),I=M.prototype,D=a(I.set);f&&(w?(e=u.getConstructor(S,"WeakMap",!0),l.enable(),t=a(I.delete),i=a(I.has),r=a(I.get),o(I,{delete:function(i){if(c(i)&&!y(i)){var r=p(this);return r.frozen||(r.frozen=new e),t(this,i)||r.frozen.delete(i)}return t(this,i)},has:function(t){if(c(t)&&!y(t)){var r=p(this);return r.frozen||(r.frozen=new e),i(this,t)||r.frozen.has(t)}return i(this,t)},get:function(t){if(c(t)&&!y(t)){var n=p(this);return n.frozen||(n.frozen=new e),i(this,t)?r(this,t):n.frozen.get(t)}return r(this,t)},set:function(t,r){if(c(t)&&!y(t)){var n=p(this);n.frozen||(n.frozen=new e),i(this,t)?D(this,t,r):n.frozen.set(t,r)}else D(this,t,r);return this}})):n&&d((function(){var e=x([]);return D(new M,e,1),!v(e)}))&&o(I,{set:function(e,t){var i;return g(e)&&(v(e)?i=E:T(e)&&(i=_)),D(this,e,t),i==E&&x(e),i==_&&b(e),this}}))})),Doe=z((()=>{Moe()})),Coe=z((()=>{"use strict";j1()("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),p6())})),Aoe=z((()=>{Coe()})),m6=z(((e,t)=>{var i,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n={};for(i=0;i<66;i++)n[r.charAt(i)]=i;t.exports={itoc:r,ctoi:n}})),koe=z((()=>{var e=Le(),t=Qt(),i=Sn(),r=Lt(),n=ri(),s=Dt(),a=si(),o=Ci(),l=zu(),h=m6().ctoi,u=/[^\d+/a-z]/i,c=/[\t\n\f\r ]+/g,p=/[=]{1,2}$/,d=i("atob"),f=String.fromCharCode,m=r("".charAt),g=r("".replace),y=r(u.exec),v=s((function(){return""!==d(" ")})),T=!s((function(){d("a")})),x=!v&&!T&&!s((function(){d()})),b=!v&&!T&&1!==d.length;e({global:!0,bind:!0,enumerable:!0,forced:v||T||x||b},{atob:function(e){if(l(arguments.length,1),x||b)return n(d,t,e);var r,s,v=g(a(e),c,""),T="",E=0,_=0;if(v.length%4==0&&(v=g(v,p,"")),v.length%4==1||y(u,v))throw new(i("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;r=m(v,E++);)o(h,r)&&(s=_%4?64*s+h[r]:h[r],_++%4&&(T+=f(255&s>>(-2*_&6))));return T}})})),$oe=z((()=>{var e=Le(),t=Qt(),i=Sn(),r=Lt(),n=ri(),s=Dt(),a=si(),o=zu(),l=m6().itoc,h=i("btoa"),u=r("".charAt),c=r("".charCodeAt),p=!!h&&!s((function(){h()})),d=!!h&&s((function(){return"bnVsbA=="!==h(null)})),f=!!h&&1!==h.length;e({global:!0,bind:!0,enumerable:!0,forced:p||d||f},{btoa:function(e){if(o(arguments.length,1),p||d||f)return n(h,t,a(e));for(var r,s,m=a(e),g="",y=0,v=l;u(m,y)||(v="=",y%1);){if((s=c(m,y+=3/4))>255)throw new(i("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");g+=u(v,63&(r=r<<8|s)>>8-y%1*8)}return g}})})),b6=z(((e,t)=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}})),I6=z(((e,t)=>{var i=v1()("span").classList,r=i&&i.constructor&&i.constructor.prototype;t.exports=r===Object.prototype?void 0:r})),rle=z((()=>{var e,t=Qt(),i=b6(),r=I6(),n=JN(),s=ea(),a=function(e){if(e&&e.forEach!==n)try{s(e,"forEach",n)}catch(t){e.forEach=n}};for(e in i)i[e]&&a(t[e]&&t[e].prototype);a(r)})),lle=z((()=>{var e,t=Qt(),i=b6(),r=I6(),n=H1(),s=ea(),a=Ti(),o=a("iterator"),l=a("toStringTag"),h=n.values,u=function(e,t){if(e){if(e[o]!==h)try{s(e,o,h)}catch(t){e[o]=h}if(e[l]||s(e,l,t),i[t])for(var r in n)if(e[r]!==n[r])try{s(e,r,n[r])}catch(t){e[r]=n[r]}}};for(e in i)u(t[e]&&t[e].prototype,e);u(r,"DOMTokenList")})),ule=z(((e,t)=>{var i=Bu();t.exports=function(e){try{if(i)return Function('return require("'+e+'")')()}catch(e){}}})),M6=z(((e,t)=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}})),xle=z((()=>{"use strict";var e=Le(),t=ule(),i=Sn(),r=Dt(),n=no(),s=Bo(),a=An().f,o=Fn(),l=Ds(),h=Ci(),u=Ac(),c=$r(),p=UN(),d=Tv(),f=M6(),m=Ww(),g=fs(),y=Dr(),v=qn(),T="DOMException",x="DATA_CLONE_ERR",b=i("Error"),E=i(T)||function(){try{(new(i("MessageChannel")||t("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name==x&&25==e.code)return e.constructor}}(),_=E&&E.prototype,w=b.prototype,S=g.set,M=g.getterFor(T),I="stack"in b(T),D=function(e){return h(f,e)&&f[e].m?f[e].c:0},A=function(){u(this,R);var e=arguments.length,t=d(e<1?void 0:arguments[0]),i=d(e<2?void 0:arguments[1],"Error"),r=D(i);if(S(this,{type:T,name:i,message:t,code:r}),y||(this.name=i,this.message=t,this.code=r),I){var n=b(t);n.name=T,a(this,"stack",s(1,m(n.stack,1)))}},R=A.prototype=n(w),C=function(e){return{enumerable:!0,configurable:!0,get:e}},O=function(e){return C((function(){return M(this)[e]}))};y&&(l(R,"code",O("code")),l(R,"message",O("message")),l(R,"name",O("name"))),a(R,"constructor",s(1,A));var P=r((function(){return!(new E instanceof b)})),N=P||r((function(){return w.toString!==p||"2: 1"!==String(new E(1,2))})),L=P||r((function(){return 25!==new E(1,"DataCloneError").code})),F=P||25!==E[x]||25!==_[x],U=v?N||L||F:P;e({global:!0,constructor:!0,forced:U},{DOMException:U?A:E});var k,B,z,G,H=i(T),V=H.prototype;for(G in N&&(v||E===H)&&o(V,"toString",p),L&&y&&E===H&&l(V,"code",C((function(){return D(c(this).name)}))),f)h(f,G)&&(B=(k=f[G]).s,z=s(6,k.c),h(H,B)||a(H,B,z),h(V,B)||a(V,B,z))})),Dle=z((()=>{"use strict";var e=Le(),t=Qt(),i=Sn(),r=Bo(),n=An().f,s=Ci(),a=Ac(),o=Vm(),l=Tv(),h=M6(),u=Ww(),c=Dr(),p=qn(),d="DOMException",f=i("Error"),m=i(d),g=function(){a(this,y);var e=arguments.length,t=l(e<1?void 0:arguments[0]),i=l(e<2?void 0:arguments[1],"Error"),s=new m(t,i),h=f(t);return h.name=d,n(s,"stack",r(1,u(h.stack,1))),o(s,this,g),s},y=g.prototype=m.prototype,v="stack"in f(d),T="stack"in new m(1,2),x=m&&c&&Object.getOwnPropertyDescriptor(t,d),b=!(!x||x.writable&&x.configurable),E=v&&!b&&!T;e({global:!0,constructor:!0,forced:p||E},{DOMException:E?g:m});var _,w,S,M=i(d),I=M.prototype;if(I.constructor!==M)for(S in p||n(I,"constructor",r(1,M)),h)s(h,S)&&(s(M,w=(_=h[S]).s)||n(M,w,r(6,_.c)))})),Ale=z((()=>{var e=Sn(),t="DOMException";so()(e(t),t)})),Ple=z((()=>{var e=Le(),t=Qt(),i=rb().clear;e({global:!0,bind:!0,enumerable:!0,forced:t.clearImmediate!==i},{clearImmediate:i})})),Lle=z(((e,t)=>{t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version})),AM=z(((e,t)=>{"use strict";var i,r=Qt(),n=Go(),s=yi(),a=Lle(),o=Pu(),l=zd(),h=zu(),u=r.Function,c=/MSIE .\./.test(o)||a&&((i=r.Bun.version.split(".")).length<3||0==i[0]&&(i[1]<3||3==i[1]&&0==i[2]));t.exports=function(e,t){var i=t?2:1;return c?function(r,a){var o=h(arguments.length,1)>i,c=s(r)?r:u(r),p=o?l(arguments,i):[],d=o?function(){n(c,this,p)}:c;return t?e(d,a):e(d)}:e}})),Gle=z((()=>{var e=Le(),t=Qt(),i=rb().set,r=AM(),n=t.setImmediate?r(i,!1):i;e({global:!0,bind:!0,enumerable:!0,forced:t.setImmediate!==n},{setImmediate:n})})),Vle=z((()=>{Ple(),Gle()})),zle=z((()=>{var e=Le(),t=Qt(),i=kF(),r=Wn(),n=zu(),s=Bu(),a=t.process;e({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(e){n(arguments.length,1),r(e);var t=s&&a.domain;i(t?t.bind(e):e)}})})),Wle=z((()=>{"use strict";var e,t=Le(),i=Qt(),r=Ds(),n=Dr(),s=TypeError,a=Object.defineProperty,o=i.self!==i;try{n?(e=Object.getOwnPropertyDescriptor(i,"self"),(o||!e||!e.get||!e.enumerable)&&r(i,"self",{get:function(){return i},set:function(e){if(this!==i)throw s("Illegal invocation");a(i,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})):t({global:!0,simple:!0,forced:o},{self:i})}catch(e){}})),Yle=z(((e,t)=>{var i=Lt(),r=Map.prototype;t.exports={Map:Map,set:i(r.set),get:i(r.get),has:i(r.has),remove:i(r.delete),proto:r}})),$le=z(((e,t)=>{var i=Lt(),r=Set.prototype;t.exports={Set:Set,add:i(r.add),has:i(r.has),remove:i(r.delete),proto:r}})),Jle=z(((e,t)=>{var i=Qt(),r=Dt(),n=Nu(),s=GF(),a=HR(),o=Bu(),l=i.structuredClone;t.exports=!!l&&!r((function(){if(a&&n>92||o&&n>94||s&&n>97)return!1;var e=new ArrayBuffer(8),t=l(e,{transfer:[e]});return 0!=e.byteLength||8!=t.byteLength}))})),oce=z((()=>{var e,t=qn(),i=Le(),r=Qt(),n=Sn(),s=Lt(),a=Dt(),o=Lm(),l=yi(),h=Um(),u=Ra(),c=Ei(),p=kd(),d=Cc(),f=$r(),m=Mc(),g=Ci(),y=Fu(),v=ea(),T=Yi(),x=zu(),b=zv(),E=Yle(),_=$le(),w=PN(),S=Jle(),M=r.Object,I=r.Array,D=r.Date,A=r.Error,R=r.EvalError,C=r.RangeError,O=r.ReferenceError,P=r.SyntaxError,N=r.TypeError,L=r.URIError,F=r.PerformanceMark,U=r.WebAssembly,k=U&&U.CompileError||A,B=U&&U.LinkError||A,z=U&&U.RuntimeError||A,G=n("DOMException"),H=E.Map,V=E.has,j=E.get,W=E.set,Y=_.Set,X=_.add,q=n("Object","keys"),Z=s([].push),J=s((!0).valueOf),K=s(1..valueOf),$=s("".valueOf),Q=s(D.prototype.getTime),ee=o("structuredClone"),te="DataCloneError",ie="Transferring",re=function(e){return!a((function(){var t=new r.Set([7]),i=e(t),n=e(M(7));return i==t||!i.has(7)||"object"!=typeof n||7!=n}))&&e},ne=function(e,t){return!a((function(){var i=new t,r=e({a:i,b:i});return!(r&&r.a===r.b&&r.a instanceof t&&r.a.stack===i.stack)}))},se=r.structuredClone,ae=t||!ne(se,A)||!ne(se,G)||(e=se,!!a((function(){var t=e(new r.AggregateError([1],ee,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=ee||3!=t.cause}))),oe=!se&&re((function(e){return new F(ee,{detail:e}).detail})),le=re(se)||oe,he=function(e){throw new G("Uncloneable type: "+e,te)},ue=function(e,t){throw new G((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",te)},ce=function(e,t){return le||ue(t),le(e)},pe=function(e,t){if(p(e)&&he("Symbol"),!c(e))return e;if(t){if(V(t,e))return j(t,e)}else t=new H;var i,s,a,o,h,u,d,f,x,E,_,S=m(e),F=!1;switch(S){case"Array":a=I(T(e)),F=!0;break;case"Object":a={},F=!0;break;case"Map":a=new H,F=!0;break;case"Set":a=new Y,F=!0;break;case"RegExp":a=new RegExp(e.source,b(e));break;case"Error":switch(s=e.name){case"AggregateError":a=n("AggregateError")([]);break;case"EvalError":a=R();break;case"RangeError":a=C();break;case"ReferenceError":a=O();break;case"SyntaxError":a=P();break;case"TypeError":a=N();break;case"URIError":a=L();break;case"CompileError":a=k();break;case"LinkError":a=B();break;case"RuntimeError":a=z();break;default:a=A()}F=!0;break;case"DOMException":a=new G(e.message,e.name),F=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":i=r[S],c(i)||ue(S),a=new i(pe(e.buffer,t),e.byteOffset,"DataView"===S?e.byteLength:e.length);break;case"DOMQuad":try{a=new DOMQuad(pe(e.p1,t),pe(e.p2,t),pe(e.p3,t),pe(e.p4,t))}catch(t){a=ce(e,S)}break;case"File":if(le)try{a=le(e),m(a)!==S&&(a=void 0)}catch(e){}if(!a)try{a=new File([e],e.name,e)}catch(e){}a||ue(S);break;case"FileList":if(o=function(){var e;try{e=new r.DataTransfer}catch(t){try{e=new r.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}(),o){for(h=0,u=T(e);h<u;h++)o.items.add(pe(e[h],t));a=o.files}else a=ce(e,S);break;case"ImageData":try{a=new ImageData(pe(e.data,t),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){a=ce(e,S)}break;default:if(le)a=le(e);else switch(S){case"BigInt":a=M(e.valueOf());break;case"Boolean":a=M(J(e));break;case"Number":a=M(K(e));break;case"String":a=M($(e));break;case"Date":a=new D(Q(e));break;case"ArrayBuffer":!(i=r.DataView)&&"function"!=typeof e.slice&&ue(S);try{if("function"!=typeof e.slice||e.resizable)for((u=e.byteLength,_="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,a=new ArrayBuffer(u,_),x=new i(e),E=new i(a),h=0);h<u;h++)E.setUint8(h,x.getUint8(h));else a=e.slice(0)}catch(e){throw new G("ArrayBuffer is detached",te)}break;case"SharedArrayBuffer":a=e;break;case"Blob":try{a=e.slice(0,e.size,e.type)}catch(e){ue(S)}break;case"DOMPoint":case"DOMPointReadOnly":i=r[S];try{a=i.fromPoint?i.fromPoint(e):new i(e.x,e.y,e.z,e.w)}catch(e){ue(S)}break;case"DOMRect":case"DOMRectReadOnly":i=r[S];try{a=i.fromRect?i.fromRect(e):new i(e.x,e.y,e.width,e.height)}catch(e){ue(S)}break;case"DOMMatrix":case"DOMMatrixReadOnly":i=r[S];try{a=i.fromMatrix?i.fromMatrix(e):new i(e)}catch(e){ue(S)}break;case"AudioData":case"VideoFrame":l(e.clone)||ue(S);try{a=e.clone()}catch(e){he(S)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":ue(S);default:he(S)}}if(W(t,e,a),F)switch(S){case"Array":case"Object":for(d=q(e),h=0,u=T(d);h<u;h++)f=d[h],y(a,f,pe(e[f],t));break;case"Map":e.forEach((function(e,i){W(a,pe(i,t),pe(e,t))}));break;case"Set":e.forEach((function(e){X(a,pe(e,t))}));break;case"Error":v(a,"message",pe(e.message,t)),g(e,"cause")&&v(a,"cause",pe(e.cause,t)),"AggregateError"==s&&(a.errors=pe(e.errors,t));case"DOMException":w&&v(a,"stack",pe(e.stack,t))}return a};i({global:!0,enumerable:!0,sham:!S,forced:ae},{structuredClone:function(e){var t,i=x(arguments.length,1)>1&&!u(arguments[1])?f(arguments[1]):void 0,n=i?i.transfer:void 0;return void 0!==n&&function(e,t){if(!c(e))throw N("Transfer option cannot be converted to a sequence");var i=[];d(e,(function(e){Z(i,f(e))}));var n,s,a,o,u,p,g=0,y=T(i);if(S)for(o=se(i,{transfer:i});g<y;)W(t,i[g],o[g++]);else for(;g<y;){if(n=i[g++],V(t,n))throw new G("Duplicate transferable",te);switch(s=m(n)){case"ImageBitmap":a=r.OffscreenCanvas,h(a)||ue(s,ie);try{(p=new a(n.width,n.height)).getContext("bitmaprenderer").transferFromImageBitmap(n),u=p.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":(!l(n.clone)||!l(n.close))&&ue(s,ie);try{u=n.clone(),n.close()}catch(e){}break;case"ArrayBuffer":l(n.transfer)||ue(s,ie),u=n.transfer();break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":ue(s,ie)}if(void 0===u)throw new G("This object cannot be transferred: "+s,te);W(t,n,u)}}(n,t=new H),pe(e,t)}})})),uce=z((()=>{var e=Le(),t=Qt(),i=AM()(t.setInterval,!0);e({global:!0,bind:!0,forced:t.setInterval!==i},{setInterval:i})})),dce=z((()=>{var e=Le(),t=Qt(),i=AM()(t.setTimeout,!0);e({global:!0,bind:!0,forced:t.setTimeout!==i},{setTimeout:i})})),fce=z((()=>{uce(),dce()})),kM=z(((e,t)=>{var i=Dt(),r=Ti(),n=Dr(),s=qn(),a=r("iterator");t.exports=!i((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,i="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),i+=r+e})),s&&!e.toJSON||!t.size&&(s||!n)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))})),Sce=z(((e,t)=>{var i=Lt(),r=2147483647,n=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",o=RangeError,l=i(s.exec),h=Math.floor,u=String.fromCharCode,c=i("".charCodeAt),p=i([].join),d=i([].push),f=i("".replace),m=i("".split),g=i("".toLowerCase),y=function(e){return e+22+75*(e<26)},v=function(e,t,i){var r=0;for(e=i?h(e/700):e>>1,e+=h(e/t);e>455;)e=h(e/35),r+=36;return h(r+36*e/(e+38))},T=function(e){var t=[];e=function(e){for(var t=[],i=0,r=e.length;i<r;){var n=c(e,i++);if(n>=55296&&n<=56319&&i<r){var s=c(e,i++);56320==(64512&s)?d(t,((1023&n)<<10)+(1023&s)+65536):(d(t,n),i--)}else d(t,n)}return t}(e);var i,n,s=e.length,l=128,f=0,m=72;for(i=0;i<e.length;i++)(n=e[i])<128&&d(t,u(n));var g=t.length,T=g;for(g&&d(t,"-");T<s;){var x=r;for(i=0;i<e.length;i++)(n=e[i])>=l&&n<x&&(x=n);var b=T+1;if(x-l>h((r-f)/b))throw o(a);for(f+=(x-l)*b,l=x,i=0;i<e.length;i++){if((n=e[i])<l&&++f>r)throw o(a);if(n==l){for(var E=f,_=36;;){var w=_<=m?1:_>=m+26?26:_-m;if(E<w)break;var S=E-w,M=36-w;d(t,u(y(w+S%M))),E=h(S/M),_+=36}d(t,u(y(E))),m=v(f,b,T==g),f=0,T++}}f++,l++}return p(t,"")};t.exports=function(e){var t,i,r=[],a=m(f(g(e),s,"."),".");for(t=0;t<a.length;t++)i=a[t],d(r,l(n,i)?"xn--"+T(i):i);return p(r,".")}})),vH=z(((e,t)=>{"use strict";H1();var i=Le(),r=Qt(),n=ri(),s=Lt(),a=Dr(),o=kM(),l=Fn(),h=Ds(),u=Sv(),c=so(),p=eR(),d=fs(),f=Ac(),m=yi(),g=Ci(),y=xl(),v=Mc(),T=$r(),x=Ei(),b=si(),E=no(),_=Bo(),w=C1(),S=xv(),M=zu(),I=Ti(),D=aR(),A=I("iterator"),R="URLSearchParams",C=R+"Iterator",O=d.set,P=d.getterFor(R),N=d.getterFor(C),L=Object.getOwnPropertyDescriptor,F=function(e){if(!a)return r[e];var t=L(r,e);return t&&t.value},U=F("fetch"),k=F("Request"),B=F("Headers"),z=k&&k.prototype,G=B&&B.prototype,H=r.RegExp,V=r.TypeError,j=r.decodeURIComponent,W=r.encodeURIComponent,Y=s("".charAt),X=s([].join),q=s([].push),Z=s("".replace),J=s([].shift),K=s([].splice),$=s("".split),Q=s("".slice),ee=/\+/g,te=Array(4),ie=function(e){return te[e-1]||(te[e-1]=H("((?:%[\\da-f]{2}){"+e+"})","gi"))},re=function(e){try{return j(e)}catch(t){return e}},ne=function(e){var t=Z(e,ee," "),i=4;try{return j(t)}catch(e){for(;i;)t=Z(t,ie(i--),re);return t}},se=/[!'()~]|%20/g,ae={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},oe=function(e){return ae[e]},le=function(e){return Z(W(e),se,oe)},he=p((function(e,t){O(this,{type:C,iterator:w(P(e).entries),kind:t})}),"Iterator",(function(){var e=N(this),t=e.kind,i=e.iterator.next(),r=i.value;return i.done||(i.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),i}),!0),ue=function(e){this.entries=[],this.url=null,void 0!==e&&(x(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?Q(e,1):e:b(e)))};ue.prototype={type:R,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,r,s,a,o,l,h=S(e);if(h)for(i=(t=w(e,h)).next;!(r=n(i,t)).done;){if(a=(s=w(T(r.value))).next,(o=n(a,s)).done||(l=n(a,s)).done||!n(a,s).done)throw V("Expected sequence with length 2");q(this.entries,{key:b(o.value),value:b(l.value)})}else for(var u in e)g(e,u)&&q(this.entries,{key:u,value:b(e[u])})},parseQuery:function(e){if(e)for(var t,i,r=$(e,"&"),n=0;n<r.length;)(t=r[n++]).length&&(i=$(t,"="),q(this.entries,{key:ne(J(i)),value:ne(X(i,"="))}))},serialize:function(){for(var e,t=this.entries,i=[],r=0;r<t.length;)e=t[r++],q(i,le(e.key)+"="+le(e.value));return X(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ce,pe,de,fe,me=function(){f(this,ge);var e=O(this,new ue(arguments.length>0?arguments[0]:void 0));a||(this.length=e.entries.length)},ge=me.prototype;u(ge,{append:function(e,t){M(arguments.length,2);var i=P(this);q(i.entries,{key:b(e),value:b(t)}),a||this.length++,i.updateURL()},delete:function(e){M(arguments.length,1);for(var t=P(this),i=t.entries,r=b(e),n=0;n<i.length;)i[n].key===r?K(i,n,1):n++;a||(this.length=i.length),t.updateURL()},get:function(e){M(arguments.length,1);for(var t=P(this).entries,i=b(e),r=0;r<t.length;r++)if(t[r].key===i)return t[r].value;return null},getAll:function(e){M(arguments.length,1);for(var t=P(this).entries,i=b(e),r=[],n=0;n<t.length;n++)t[n].key===i&&q(r,t[n].value);return r},has:function(e){M(arguments.length,1);for(var t=P(this).entries,i=b(e),r=0;r<t.length;)if(t[r++].key===i)return!0;return!1},set:function(e,t){M(arguments.length,1);for(var i,r=P(this),n=r.entries,s=!1,o=b(e),l=b(t),h=0;h<n.length;h++)(i=n[h]).key===o&&(s?K(n,h--,1):(s=!0,i.value=l));s||q(n,{key:o,value:l}),a||(this.length=n.length),r.updateURL()},sort:function(){var e=P(this);D(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=P(this).entries,r=y(e,arguments.length>1?arguments[1]:void 0),n=0;n<i.length;)r((t=i[n++]).value,t.key,this)},keys:function(){return new he(this,"keys")},values:function(){return new he(this,"values")},entries:function(){return new he(this,"entries")}},{enumerable:!0}),l(ge,A,ge.entries,{name:"entries"}),l(ge,"toString",(function(){return P(this).serialize()}),{enumerable:!0}),a&&h(ge,"size",{get:function(){return P(this).entries.length},configurable:!0,enumerable:!0}),c(me,R),i({global:!0,constructor:!0,forced:!o},{URLSearchParams:me}),!o&&m(B)&&(ce=s(G.has),pe=s(G.set),de=function(e){if(x(e)){var t,i=e.body;if(v(i)===R)return t=e.headers?new B(e.headers):new B,ce(t,"content-type")||pe(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),E(e,{body:_(0,b(i)),headers:_(0,t)})}return e},m(U)&&i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return U(e,arguments.length>1?de(arguments[1]):{})}}),m(k)&&(fe=function(e){return f(this,z),new k(e,arguments.length>1?de(arguments[1]):{})},z.constructor=fe,fe.prototype=z,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:fe}))),t.exports={URLSearchParams:me,getState:P}})),cue=z((()=>{"use strict";b5();var e,t=Le(),i=Dr(),r=kM(),n=Qt(),s=xl(),a=Lt(),o=Fn(),l=Ds(),h=Ac(),u=Ci(),c=vF(),p=QN(),d=gv(),f=ub().codeAt,m=Sce(),g=si(),y=so(),v=zu(),T=vH(),x=fs(),b=x.set,E=x.getterFor("URL"),_=T.URLSearchParams,w=T.getState,S=n.URL,M=n.TypeError,I=n.parseInt,D=Math.floor,A=Math.pow,R=a("".charAt),C=a(/./.exec),O=a([].join),P=a(1..toString),N=a([].pop),L=a([].push),F=a("".replace),U=a([].shift),k=a("".split),B=a("".slice),z=a("".toLowerCase),G=a([].unshift),H="Invalid scheme",V="Invalid host",j="Invalid port",W=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,q=/^0x/i,Z=/^[0-7]+$/,J=/^\d+$/,K=/^[\da-f]+$/i,$=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Q=/[\0\t\n\r #/:<>?@[\\\]^|]/,ee=/^[\u0000-\u0020]+/,te=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,re=function(e){var t,i,r,n;if("number"==typeof e){for(t=[],i=0;i<4;i++)G(t,e%256),e=D(e/256);return O(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,i=1,r=null,n=0,s=0;s<8;s++)0!==e[s]?(n>i&&(t=r,i=n),r=null,n=0):(null===r&&(r=s),++n);return n>i&&(t=r,i=n),t}(e),i=0;i<8;i++)n&&0===e[i]||(n&&(n=!1),r===i?(t+=i?":":"::",n=!0):(t+=P(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},ne={},se=c({},ne,{" ":1,'"':1,"<":1,">":1,"`":1}),ae=c({},se,{"#":1,"?":1,"{":1,"}":1}),oe=c({},ae,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),le=function(e,t){var i=f(e,0);return i>32&&i<127&&!u(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ue=function(e,t){var i;return 2==e.length&&C(W,R(e,0))&&(":"==(i=R(e,1))||!t&&"|"==i)},ce=function(e){var t;return e.length>1&&ue(B(e,0,2))&&(2==e.length||"/"===(t=R(e,2))||"\\"===t||"?"===t||"#"===t)},pe=function(e){return"."===e||"%2e"===z(e)},de=function(e){return".."===(e=z(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},fe={},me={},ge={},ye={},ve={},Te={},xe={},be={},Ee={},_e={},we={},Se={},Me={},Ie={},De={},Ae={},Re={},Ce={},Oe={},Pe={},Ne={},Fe=function(e,t,i){var r,n,s,a=g(e);if(t){if(n=this.parse(a))throw M(n);this.searchParams=null}else{if(void 0!==i&&(r=new Fe(i,!0)),n=this.parse(a,null,r))throw M(n);(s=w(new _)).bindURL(this),this.searchParams=s}};Fe.prototype={type:"URL",parse:function(t,i,r){var n,s,a,o,l=this,h=i||fe,c=0,f="",m=!1,y=!1,v=!1;for(t=g(t),i||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,t=F(t,ee,""),t=F(t,te,"$1")),t=F(t,ie,""),n=p(t);c<=n.length;){switch(s=n[c],h){case fe:if(!s||!C(W,s)){if(i)return H;h=ge;continue}f+=z(s),h=me;break;case me:if(s&&(C(Y,s)||"+"==s||"-"==s||"."==s))f+=z(s);else{if(":"!=s){if(i)return H;f="",h=ge,c=0;continue}if(i&&(l.isSpecial()!=u(he,f)||"file"==f&&(l.includesCredentials()||null!==l.port)||"file"==l.scheme&&!l.host))return;if(l.scheme=f,i)return void(l.isSpecial()&&he[l.scheme]==l.port&&(l.port=null));f="","file"==l.scheme?h=Ie:l.isSpecial()&&r&&r.scheme==l.scheme?h=ye:l.isSpecial()?h=be:"/"==n[c+1]?(h=ve,c++):(l.cannotBeABaseURL=!0,L(l.path,""),h=Oe)}break;case ge:if(!r||r.cannotBeABaseURL&&"#"!=s)return H;if(r.cannotBeABaseURL&&"#"==s){l.scheme=r.scheme,l.path=d(r.path),l.query=r.query,l.fragment="",l.cannotBeABaseURL=!0,h=Ne;break}h="file"==r.scheme?Ie:Te;continue;case ye:if("/"!=s||"/"!=n[c+1]){h=Te;continue}h=Ee,c++;break;case ve:if("/"==s){h=_e;break}h=Ce;continue;case Te:if(l.scheme=r.scheme,s==e)l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=d(r.path),l.query=r.query;else if("/"==s||"\\"==s&&l.isSpecial())h=xe;else if("?"==s)l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=d(r.path),l.query="",h=Pe;else{if("#"!=s){l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=d(r.path),l.path.length--,h=Ce;continue}l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=d(r.path),l.query=r.query,l.fragment="",h=Ne}break;case xe:if(!l.isSpecial()||"/"!=s&&"\\"!=s){if("/"!=s){l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,h=Ce;continue}h=_e}else h=Ee;break;case be:if(h=Ee,"/"!=s||"/"!=R(f,c+1))continue;c++;break;case Ee:if("/"!=s&&"\\"!=s){h=_e;continue}break;case _e:if("@"==s){m&&(f="%40"+f),m=!0,a=p(f);for(var T=0;T<a.length;T++){var x=a[T];if(":"!=x||v){var b=le(x,oe);v?l.password+=b:l.username+=b}else v=!0}f=""}else if(s==e||"/"==s||"?"==s||"#"==s||"\\"==s&&l.isSpecial()){if(m&&""==f)return"Invalid authority";c-=p(f).length+1,f="",h=we}else f+=s;break;case we:case Se:if(i&&"file"==l.scheme){h=Ae;continue}if(":"!=s||y){if(s==e||"/"==s||"?"==s||"#"==s||"\\"==s&&l.isSpecial()){if(l.isSpecial()&&""==f)return V;if(i&&""==f&&(l.includesCredentials()||null!==l.port))return;if(o=l.parseHost(f))return o;if(f="",h=Re,i)return;continue}"["==s?y=!0:"]"==s&&(y=!1),f+=s}else{if(""==f)return V;if(o=l.parseHost(f))return o;if(f="",h=Me,i==Se)return}break;case Me:if(!C(X,s)){if(s==e||"/"==s||"?"==s||"#"==s||"\\"==s&&l.isSpecial()||i){if(""!=f){var E=I(f,10);if(E>65535)return j;l.port=l.isSpecial()&&E===he[l.scheme]?null:E,f=""}if(i)return;h=Re;continue}return j}f+=s;break;case Ie:if(l.scheme="file","/"==s||"\\"==s)h=De;else{if(!r||"file"!=r.scheme){h=Ce;continue}if(s==e)l.host=r.host,l.path=d(r.path),l.query=r.query;else if("?"==s)l.host=r.host,l.path=d(r.path),l.query="",h=Pe;else{if("#"!=s){ce(O(d(n,c),""))||(l.host=r.host,l.path=d(r.path),l.shortenPath()),h=Ce;continue}l.host=r.host,l.path=d(r.path),l.query=r.query,l.fragment="",h=Ne}}break;case De:if("/"==s||"\\"==s){h=Ae;break}r&&"file"==r.scheme&&!ce(O(d(n,c),""))&&(ue(r.path[0],!0)?L(l.path,r.path[0]):l.host=r.host),h=Ce;continue;case Ae:if(s==e||"/"==s||"\\"==s||"?"==s||"#"==s){if(!i&&ue(f))h=Ce;else if(""==f){if(l.host="",i)return;h=Re}else{if(o=l.parseHost(f))return o;if("localhost"==l.host&&(l.host=""),i)return;f="",h=Re}continue}f+=s;break;case Re:if(l.isSpecial()){if(h=Ce,"/"!=s&&"\\"!=s)continue}else if(i||"?"!=s)if(i||"#"!=s){if(s!=e&&(h=Ce,"/"!=s))continue}else l.fragment="",h=Ne;else l.query="",h=Pe;break;case Ce:if(s==e||"/"==s||"\\"==s&&l.isSpecial()||!i&&("?"==s||"#"==s)){if(de(f)?(l.shortenPath(),"/"!=s&&!("\\"==s&&l.isSpecial())&&L(l.path,"")):pe(f)?"/"!=s&&!("\\"==s&&l.isSpecial())&&L(l.path,""):("file"==l.scheme&&!l.path.length&&ue(f)&&(l.host&&(l.host=""),f=R(f,0)+":"),L(l.path,f)),f="","file"==l.scheme&&(s==e||"?"==s||"#"==s))for(;l.path.length>1&&""===l.path[0];)U(l.path);"?"==s?(l.query="",h=Pe):"#"==s&&(l.fragment="",h=Ne)}else f+=le(s,ae);break;case Oe:"?"==s?(l.query="",h=Pe):"#"==s?(l.fragment="",h=Ne):s!=e&&(l.path[0]+=le(s,ne));break;case Pe:i||"#"!=s?s!=e&&("'"==s&&l.isSpecial()?l.query+="%27":l.query+="#"==s?"%23":le(s,ne)):(l.fragment="",h=Ne);break;case Ne:s!=e&&(l.fragment+=le(s,se))}c++}},parseHost:function(e){var t,i,r;if("["==R(e,0)){if("]"!=R(e,e.length-1)||(t=function(e){var t,i,r,n,s,a,o,l=[0,0,0,0,0,0,0,0],h=0,u=null,c=0,p=function(){return R(e,c)};if(":"==p()){if(":"!=R(e,1))return;c+=2,u=++h}for(;p();){if(8==h)return;if(":"!=p()){for(t=i=0;i<4&&C(K,p());)t=16*t+I(p(),16),c++,i++;if("."==p()){if(0==i||(c-=i,h>6))return;for(r=0;p();){if(n=null,r>0){if(!("."==p()&&r<4))return;c++}if(!C(X,p()))return;for(;C(X,p());){if(s=I(p(),10),null===n)n=s;else{if(0==n)return;n=10*n+s}if(n>255)return;c++}l[h]=256*l[h]+n,(2==++r||4==r)&&h++}if(4!=r)return;break}if(":"==p()){if(c++,!p())return}else if(p())return;l[h++]=t}else{if(null!==u)return;c++,u=++h}}if(null!==u)for(a=h-u,h=7;0!=h&&a>0;)o=l[h],l[h--]=l[u+a-1],l[u+--a]=o;else if(8!=h)return;return l}(B(e,1,-1)),!t))return V;this.host=t}else if(this.isSpecial()){if(e=m(e),C($,e)||(t=function(e){var t,i,r,n,s,a,o,l=k(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(i=[],r=0;r<t;r++){if(""==(n=l[r]))return e;if(s=10,n.length>1&&"0"==R(n,0)&&(s=C(q,n)?16:8,n=B(n,8==s?1:2)),""===n)a=0;else{if(!C(10==s?J:8==s?Z:K,n))return e;a=I(n,s)}L(i,a)}for(r=0;r<t;r++)if(a=i[r],r==t-1){if(a>=A(256,5-t))return null}else if(a>255)return null;for(o=N(i),r=0;r<i.length;r++)o+=i[r]*A(256,3-r);return o}(e),null===t))return V;this.host=t}else{if(C(Q,e))return V;for(t="",i=p(e),r=0;r<i.length;r++)t+=le(i[r],ne);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return u(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&("file"!=this.scheme||1!=t||!ue(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,r=e.password,n=e.host,s=e.port,a=e.path,o=e.query,l=e.fragment,h=t+":";return null!==n?(h+="//",e.includesCredentials()&&(h+=i+(r?":"+r:"")+"@"),h+=re(n),null!==s&&(h+=":"+s)):"file"==t&&(h+="//"),h+=e.cannotBeABaseURL?a[0]:a.length?"/"+O(a,"/"):"",null!==o&&(h+="?"+o),null!==l&&(h+="#"+l),h},setHref:function(e){var t=this.parse(e);if(t)throw M(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new Be(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+re(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(g(e)+":",fe)},getUsername:function(){return this.username},setUsername:function(e){var t=p(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=le(t[i],oe)}},getPassword:function(){return this.password},setPassword:function(e){var t=p(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=le(t[i],oe)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?re(e):re(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,we)},getHostname:function(){var e=this.host;return null===e?"":re(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Se)},getPort:function(){var e=this.port;return null===e?"":g(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=g(e))?this.port=null:this.parse(e,Me))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+O(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Re))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=g(e))?this.query=null:("?"==R(e,0)&&(e=B(e,1)),this.query="",this.parse(e,Pe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=g(e))?("#"==R(e,0)&&(e=B(e,1)),this.fragment="",this.parse(e,Ne)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Ue,ke,Be=function(e){var t=h(this,ze),r=v(arguments.length,1)>1?arguments[1]:void 0,n=b(t,new Fe(e,!1,r));i||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ze=Be.prototype,Ge=function(e,t){return{get:function(){return E(this)[e]()},set:t&&function(e){return E(this)[t](e)},configurable:!0,enumerable:!0}};i&&(l(ze,"href",Ge("serialize","setHref")),l(ze,"origin",Ge("getOrigin")),l(ze,"protocol",Ge("getProtocol","setProtocol")),l(ze,"username",Ge("getUsername","setUsername")),l(ze,"password",Ge("getPassword","setPassword")),l(ze,"host",Ge("getHost","setHost")),l(ze,"hostname",Ge("getHostname","setHostname")),l(ze,"port",Ge("getPort","setPort")),l(ze,"pathname",Ge("getPathname","setPathname")),l(ze,"search",Ge("getSearch","setSearch")),l(ze,"searchParams",Ge("getSearchParams")),l(ze,"hash",Ge("getHash","setHash"))),o(ze,"toJSON",(function(){return E(this).serialize()}),{enumerable:!0}),o(ze,"toString",(function(){return E(this).serialize()}),{enumerable:!0}),S&&(Ue=S.createObjectURL,ke=S.revokeObjectURL,Ue&&o(Be,"createObjectURL",s(Ue,S)),ke&&o(Be,"revokeObjectURL",s(ke,S))),y(Be,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!i},{URL:Be})})),uue=z((()=>{cue()})),due=z((()=>{var e=Le(),t=Sn(),i=Dt(),r=zu(),n=si(),s=kM(),a=t("URL");e({target:"URL",stat:!0,forced:!(s&&i((function(){a.canParse()})))},{canParse:function(e){var t=r(arguments.length,1),i=n(e),s=t<2||void 0===arguments[1]?void 0:n(arguments[1]);try{return!!new a(i,s)}catch(e){return!1}}})})),fue=z((()=>{"use strict";var e=Le(),t=ri();e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return t(URL.prototype.toString,this)}})})),mue=z((()=>{vH()})),gue=z((()=>{"use strict";var e=Dr(),t=Lt(),i=Ds(),r=URLSearchParams.prototype,n=t(r.forEach);e&&!("size"in r)&&i(r,"size",{get:function(){var e=0;return n(this,(function(){e++})),e},configurable:!0,enumerable:!0})})),yue=z(((e,t)=>{yq(),Sq(),wq(),Rq(),Mq(),Dq(),Cq(),Aq(),Oq(),Pq(),Nq(),Lq(),Fq(),Hq(),Uq(),uY(),mY(),OY(),FY(),UY(),jY(),XY(),ZY(),QY(),eX(),rX(),nX(),oX(),lX(),hX(),pX(),mX(),SX(),wX(),MX(),DX(),H1(),ZX(),e$(),t$(),i$(),s$(),u$(),p$(),f$(),v$(),y$(),N$(),H$(),U$(),k$(),j$(),W$(),q$(),Y$(),X$(),Z$(),xZ(),NZ(),zZ(),WZ(),qZ(),XZ(),KZ(),JZ(),lK(),cK(),fK(),yK(),TK(),wK(),DK(),PK(),NK(),MN(),LK(),KK(),eJ(),iJ(),sJ(),oJ(),lJ(),hJ(),dJ(),gJ(),yJ(),TJ(),xJ(),IJ(),_J(),SJ(),MJ(),AJ(),OJ(),PJ(),jJ(),WJ(),XJ(),ZJ(),KJ(),JJ(),QJ(),eQ(),aQ(),fQ(),EQ(),SQ(),MQ(),PQ(),NQ(),HQ(),BQ(),GQ(),VQ(),qQ(),YQ(),XQ(),KQ(),JQ(),QQ(),tee(),ree(),nee(),aee(),lee(),uee(),pee(),dee(),fee(),mee(),bee(),xee(),Iee(),wee(),Ree(),Dee(),Aee(),Vte(),zte(),Wte(),$te(),Zte(),ire(),are(),ore(),hre(),pre(),dre(),fre(),mre(),gre(),vre(),xre(),_re(),Sre(),Gre(),zre(),ZR(),$re(),Kre(),eie(),iie(),sie(),aie(),uie(),vie(),Tie(),xie(),b5(),Lie(),Wie(),Yie(),Xie(),Jie(),Qie(),sne(),une(),dne(),Ene(),_ne(),wne(),Cne(),Lne(),kne(),jne(),Wne(),qne(),Yne(),Xne(),$ne(),Zne(),Kne(),Jne(),Qne(),ese(),tse(),rse(),Cse(),Ase(),Ose(),Pse(),Nse(),Lse(),Fse(),Hse(),Use(),kse(),Vse(),jse(),qse(),Jse(),eae(),rae(),nae(),aae(),lae(),cae(),hae(),dae(),yae(),Tae(),xae(),_ae(),wae(),Mae(),Cae(),Oae(),Uae(),kae(),Vae(),Xae(),Kae(),roe(),ioe(),noe(),aoe(),ooe(),poe(),Doe(),Aoe(),koe(),$oe(),rle(),lle(),xle(),Dle(),Ale(),Vle(),zle(),Wle(),oce(),fce(),uue(),due(),fue(),mue(),gue(),t.exports=Hw()})),Eue=z(((e,t)=>{var i=function(e){"use strict";var t,i=Object.prototype,r=i.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,i){return e[t]=i}}function u(e,t,i,r){var s=t&&t.prototype instanceof y?t:y,a=Object.create(s.prototype),o=new R(r||[]);return n(a,"_invoke",{value:M(e,i,o)}),a}function c(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p="suspendedStart",d="suspendedYield",f="executing",m="completed",g={};function y(){}function v(){}function T(){}var x={};h(x,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(C([])));E&&E!==i&&r.call(E,a)&&(x=E);var _=T.prototype=y.prototype=Object.create(x);function w(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function i(n,s,a,o){var l=c(e[n],e,s);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,a,o)}),(function(e){i("throw",e,a,o)})):t.resolve(u).then((function(e){h.value=e,a(h)}),(function(e){return i("throw",e,a,o)}))}o(l.arg)}var s;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return s=s?s.then(n,n):n()}})}function M(e,t,i){var r=p;return function(n,s){if(r===f)throw new Error("Generator is already running");if(r===m){if("throw"===n)throw s;return O()}for(i.method=n,i.arg=s;;){var a=i.delegate;if(a){var o=I(a,i);if(o){if(o===g)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;var l=c(e,t,i);if("normal"===l.type){if(r=i.done?m:d,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=m,i.method="throw",i.arg=l.arg)}}}function I(e,i){var r=i.method,n=e.iterator[r];if(n===t)return i.delegate=null,"throw"===r&&e.iterator.return&&(i.method="return",i.arg=t,I(e,i),"throw"===i.method)||"return"!==r&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var s=c(n,e.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,g;var a=s.arg;return a?a.done?(i[e.resultName]=a.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,g):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function C(e){if(e){var i=e[a];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,s=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return s.next=s}}return{next:O}}function O(){return{value:t,done:!0}}return v.prototype=T,n(_,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:v,configurable:!0}),v.displayName=h(T,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,h(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},w(S.prototype),h(S.prototype,o,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,r,n,s){void 0===s&&(s=Promise);var a=new S(u(t,i,r,n),s);return e.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(_),h(_,l,"Generator"),h(_,a,(function(){return this})),h(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var r in t)i.push(r);return i.reverse(),function e(){for(;i.length;){var r=i.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=C,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(r,n){return o.type="throw",o.arg=e,i.next=r,n&&(i.method="next",i.arg=t),!!n}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),h=r.call(a,"finallyLoc");if(l&&h){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var s=n;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),A(i),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var n=r.arg;A(i)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:C(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}("object"==typeof t?t.exports:{});try{regeneratorRuntime=i}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}})),Ede=z(((e,t)=>{!function(e,i){"use strict";"function"==typeof define&&define.amd?define(i):"object"==typeof t&&t.exports?t.exports=i():e.log=i()}(e,(function(){"use strict";var e=function(){},t="undefined",i=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function n(e,t){var i=e[t];if("function"==typeof i.bind)return i.bind(e);try{return Function.prototype.bind.call(i,e)}catch(t){return function(){return Function.prototype.apply.apply(i,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(t,i){for(var n=0;n<r.length;n++){var s=r[n];this[s]=n<t?e:this.methodFactory(s,t,i)}this.log=this.debug}function o(e,i,r){return function(){typeof console!==t&&(a.call(this,i,r),this[e].apply(this,arguments))}}function l(r,a,l){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&i?s:void 0!==console[r]?n(console,r):void 0!==console.log?n(console,"log"):e)}(r)||o.apply(this,arguments)}function h(e,i,n){var s,o=this;i=null==i?"WARN":i;var h="loglevel";function u(){var e;if(typeof window!==t&&h){try{e=window.localStorage[h]}catch(e){}if(typeof e===t)try{var i=window.document.cookie,r=i.indexOf(encodeURIComponent(h)+"=");-1!==r&&(e=/^([^;]+)/.exec(i.slice(r))[1])}catch(e){}return void 0===o.levels[e]&&(e=void 0),e}}"string"==typeof e?h+=":"+e:"symbol"==typeof e&&(h=void 0),o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||l,o.getLevel=function(){return s},o.setLevel=function(i,n){if("string"==typeof i&&void 0!==o.levels[i.toUpperCase()]&&(i=o.levels[i.toUpperCase()]),!("number"==typeof i&&i>=0&&i<=o.levels.SILENT))throw"log.setLevel() called with invalid level: "+i;if(s=i,!1!==n&&function(e){var i=(r[e]||"silent").toUpperCase();if(typeof window!==t&&h){try{return void(window.localStorage[h]=i)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"="+i+";"}catch(e){}}}(i),a.call(o,i,e),typeof console===t&&i<o.levels.SILENT)return"No console available for logging"},o.setDefaultLevel=function(e){i=e,u()||o.setLevel(e,!1)},o.resetLevel=function(){o.setLevel(i,!1),function(){if(typeof window!==t&&h){try{return void window.localStorage.removeItem(h)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)};var c=u();null==c&&(c=i),o.setLevel(c,!1)}var u=new h,c={};u.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=c[e];return t||(t=c[e]=new h(e,u.getLevel(),u.methodFactory)),t};var p=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=p),u},u.getLoggers=function(){return c},u.default=u,u}))})),lA=z(((e,t)=>{"use strict";t.exports=function(e,t,r){var n=e*t,s=i*e,a=s-(s-e),o=e-a,l=i*t,h=l-(l-t),u=t-h,c=o*u-(n-a*h-o*h-a*u);return r?(r[0]=c,r[1]=n,r):[c,n]};var i=+(Math.pow(2,27)+1)})),bk=z(((e,t)=>{"use strict";t.exports=function(e,t){var i=0|e.length,r=0|t.length;if(1===i&&1===r)return function(e,t){var i=e+t,r=i-e,n=e-(i-r)+(t-r);return n?[n,i]:[i]}(e[0],t[0]);var n,s,a=new Array(i+r),o=0,l=0,h=0,u=Math.abs,c=e[l],p=u(c),d=t[h],f=u(d);p<f?(s=c,(l+=1)<i&&(p=u(c=e[l]))):(s=d,(h+=1)<r&&(f=u(d=t[h]))),l<i&&p<f||h>=r?(n=c,(l+=1)<i&&(p=u(c=e[l]))):(n=d,(h+=1)<r&&(f=u(d=t[h])));for(var m,g,y=n+s,v=y-n,T=s-v,x=T,b=y;l<i&&h<r;)p<f?(n=c,(l+=1)<i&&(p=u(c=e[l]))):(n=d,(h+=1)<r&&(f=u(d=t[h]))),(T=(s=x)-(v=(y=n+s)-n))&&(a[o++]=T),x=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<i;)(T=(s=x)-(v=(y=(n=c)+s)-n))&&(a[o++]=T),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<i&&(c=e[l]);for(;h<r;)(T=(s=x)-(v=(y=(n=d)+s)-n))&&(a[o++]=T),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(h+=1)<r&&(d=t[h]);return x&&(a[o++]=x),b&&(a[o++]=b),o||(a[o++]=0),a.length=o,a}})),Kde=z(((e,t)=>{"use strict";t.exports=function(e,t,i){var r=e+t,n=r-e,s=t-n,a=e-(r-n);return i?(i[0]=a+s,i[1]=r,i):[a+s,r]}})),Ik=z(((e,t)=>{"use strict";var i=lA(),r=Kde();t.exports=function(e,t){var n=e.length;if(1===n){var s=i(e[0],t);return s[0]?s:[s[1]]}var a=new Array(2*n),o=[.1,.1],l=[.1,.1],h=0;i(e[0],t,o),o[0]&&(a[h++]=o[0]);for(var u=1;u<n;++u){i(e[u],t,l);var c=o[1];r(c,l[0],o),o[0]&&(a[h++]=o[0]);var p=l[1],d=o[1],f=p+d,m=d-(f-p);o[1]=f,m&&(a[h++]=m)}return o[1]&&(a[h++]=o[1]),0===h&&(a[h++]=0),a.length=h,a}})),efe=z(((e,t)=>{"use strict";t.exports=function(e){for(var t=e.length,i=e[e.length-1],r=t,n=t-2;n>=0;--n){var s=i;(l=(o=e[n])-((i=s+o)-s))&&(e[--r]=i,i=l)}var a=0;for(n=r;n<t;++n){var o,l;(l=(o=i)-((i=(s=e[n])+o)-s))&&(e[a++]=l)}return e[a++]=i,e.length=a,e}})),rfe=z(((e,t)=>{"use strict";t.exports=function(e,t){var i=0|e.length,r=0|t.length;if(1===i&&1===r)return function(e,t){var i=e+t,r=i-e,n=e-(i-r)+(t-r);return n?[n,i]:[i]}(e[0],-t[0]);var n,s,a=new Array(i+r),o=0,l=0,h=0,u=Math.abs,c=e[l],p=u(c),d=-t[h],f=u(d);p<f?(s=c,(l+=1)<i&&(p=u(c=e[l]))):(s=d,(h+=1)<r&&(f=u(d=-t[h]))),l<i&&p<f||h>=r?(n=c,(l+=1)<i&&(p=u(c=e[l]))):(n=d,(h+=1)<r&&(f=u(d=-t[h])));for(var m,g,y=n+s,v=y-n,T=s-v,x=T,b=y;l<i&&h<r;)p<f?(n=c,(l+=1)<i&&(p=u(c=e[l]))):(n=d,(h+=1)<r&&(f=u(d=-t[h]))),(T=(s=x)-(v=(y=n+s)-n))&&(a[o++]=T),x=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<i;)(T=(s=x)-(v=(y=(n=c)+s)-n))&&(a[o++]=T),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<i&&(c=e[l]);for(;h<r;)(T=(s=x)-(v=(y=(n=d)+s)-n))&&(a[o++]=T),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(h+=1)<r&&(d=-t[h]);return x&&(a[o++]=x),b&&(a[o++]=b),o||(a[o++]=0),a.length=o,a}})),nfe=z(((e,t)=>{"use strict";var i=lA(),r=bk(),n=Ik(),s=rfe();function a(e,t,i,r){return function(i,n,s){var a=e(e(t(n[1],s[0]),t(-s[1],n[0])),e(t(i[1],n[0]),t(-n[1],i[0]))),o=e(t(i[1],s[0]),t(-s[1],i[0])),l=r(a,o);return l[l.length-1]}}function o(e,t,i,r){return function(n,s,a,o){var l=e(e(i(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]),e(i(e(t(s[1],o[0]),t(-o[1],s[0])),-a[2]),i(e(t(s[1],a[0]),t(-a[1],s[0])),o[2]))),e(i(e(t(s[1],o[0]),t(-o[1],s[0])),n[2]),e(i(e(t(n[1],o[0]),t(-o[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),o[2])))),h=e(e(i(e(t(a[1],o[0]),t(-o[1],a[0])),n[2]),e(i(e(t(n[1],o[0]),t(-o[1],n[0])),-a[2]),i(e(t(n[1],a[0]),t(-a[1],n[0])),o[2]))),e(i(e(t(s[1],a[0]),t(-a[1],s[0])),n[2]),e(i(e(t(n[1],a[0]),t(-a[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),a[2])))),u=r(l,h);return u[u.length-1]}}function l(e,t,i,r){return function(n,s,a,o,l){var h=e(e(e(i(e(i(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(i(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),i(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),s[3]),e(i(e(i(e(t(o[1],l[0]),t(-l[1],o[0])),s[2]),e(i(e(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),i(e(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),-a[3]),i(e(i(e(t(a[1],l[0]),t(-l[1],a[0])),s[2]),e(i(e(t(s[1],l[0]),t(-l[1],s[0])),-a[2]),i(e(t(s[1],a[0]),t(-a[1],s[0])),l[2]))),o[3]))),e(i(e(i(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]),e(i(e(t(s[1],o[0]),t(-o[1],s[0])),-a[2]),i(e(t(s[1],a[0]),t(-a[1],s[0])),o[2]))),-l[3]),e(i(e(i(e(t(o[1],l[0]),t(-l[1],o[0])),s[2]),e(i(e(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),i(e(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),n[3]),i(e(i(e(t(o[1],l[0]),t(-l[1],o[0])),n[2]),e(i(e(t(n[1],l[0]),t(-l[1],n[0])),-o[2]),i(e(t(n[1],o[0]),t(-o[1],n[0])),l[2]))),-s[3])))),e(e(i(e(i(e(t(s[1],l[0]),t(-l[1],s[0])),n[2]),e(i(e(t(n[1],l[0]),t(-l[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),l[2]))),o[3]),e(i(e(i(e(t(s[1],o[0]),t(-o[1],s[0])),n[2]),e(i(e(t(n[1],o[0]),t(-o[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),o[2]))),-l[3]),i(e(i(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]),e(i(e(t(s[1],o[0]),t(-o[1],s[0])),-a[2]),i(e(t(s[1],a[0]),t(-a[1],s[0])),o[2]))),n[3]))),e(i(e(i(e(t(a[1],o[0]),t(-o[1],a[0])),n[2]),e(i(e(t(n[1],o[0]),t(-o[1],n[0])),-a[2]),i(e(t(n[1],a[0]),t(-a[1],n[0])),o[2]))),-s[3]),e(i(e(i(e(t(s[1],o[0]),t(-o[1],s[0])),n[2]),e(i(e(t(n[1],o[0]),t(-o[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),o[2]))),a[3]),i(e(i(e(t(s[1],a[0]),t(-a[1],s[0])),n[2]),e(i(e(t(n[1],a[0]),t(-a[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),a[2]))),-o[3]))))),u=e(e(e(i(e(i(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(i(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),i(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),n[3]),i(e(i(e(t(o[1],l[0]),t(-l[1],o[0])),n[2]),e(i(e(t(n[1],l[0]),t(-l[1],n[0])),-o[2]),i(e(t(n[1],o[0]),t(-o[1],n[0])),l[2]))),-a[3])),e(i(e(i(e(t(a[1],l[0]),t(-l[1],a[0])),n[2]),e(i(e(t(n[1],l[0]),t(-l[1],n[0])),-a[2]),i(e(t(n[1],a[0]),t(-a[1],n[0])),l[2]))),o[3]),i(e(i(e(t(a[1],o[0]),t(-o[1],a[0])),n[2]),e(i(e(t(n[1],o[0]),t(-o[1],n[0])),-a[2]),i(e(t(n[1],a[0]),t(-a[1],n[0])),o[2]))),-l[3]))),e(e(i(e(i(e(t(a[1],l[0]),t(-l[1],a[0])),s[2]),e(i(e(t(s[1],l[0]),t(-l[1],s[0])),-a[2]),i(e(t(s[1],a[0]),t(-a[1],s[0])),l[2]))),n[3]),i(e(i(e(t(a[1],l[0]),t(-l[1],a[0])),n[2]),e(i(e(t(n[1],l[0]),t(-l[1],n[0])),-a[2]),i(e(t(n[1],a[0]),t(-a[1],n[0])),l[2]))),-s[3])),e(i(e(i(e(t(s[1],l[0]),t(-l[1],s[0])),n[2]),e(i(e(t(n[1],l[0]),t(-l[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),l[2]))),a[3]),i(e(i(e(t(s[1],a[0]),t(-a[1],s[0])),n[2]),e(i(e(t(n[1],a[0]),t(-a[1],n[0])),-s[2]),i(e(t(n[1],s[0]),t(-s[1],n[0])),a[2]))),-l[3])))),c=r(h,u);return c[c.length-1]}}function h(e){return(3===e?a:4===e?o:l)(r,i,n,s)}var u=h(3),c=h(4),p=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,i){var r,n=(e[1]-i[1])*(t[0]-i[0]),s=(e[0]-i[0])*(t[1]-i[1]),a=n-s;if(n>0){if(s<=0)return a;r=n+s}else{if(!(n<0))return a;if(s>=0)return a;r=-(n+s)}var o=33306690738754716e-32*r;return a>=o||a<=-o?a:u(e,t,i)},function(e,t,i,r){var n=e[0]-r[0],s=t[0]-r[0],a=i[0]-r[0],o=e[1]-r[1],l=t[1]-r[1],h=i[1]-r[1],u=e[2]-r[2],p=t[2]-r[2],d=i[2]-r[2],f=s*h,m=a*l,g=a*o,y=n*h,v=n*l,T=s*o,x=u*(f-m)+p*(g-y)+d*(v-T),b=7771561172376103e-31*((Math.abs(f)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(y))*Math.abs(p)+(Math.abs(v)+Math.abs(T))*Math.abs(d));return x>b||-x>b?x:c(e,t,i,r)}];function d(e){var t=p[e.length];return t||(t=p[e.length]=h(e.length)),t.apply(void 0,e)}function f(e,t,i,r,n,s,a){return function(t,i,o,l,h){switch(arguments.length){case 0:case 1:return 0;case 2:return r(t,i);case 3:return n(t,i,o);case 4:return s(t,i,o,l);case 5:return a(t,i,o,l,h)}for(var u=new Array(arguments.length),c=0;c<arguments.length;++c)u[c]=arguments[c];return e(u)}}!function(){for(;p.length<=5;)p.push(h(p.length));t.exports=f.apply(void 0,[d].concat(p));for(var e=0;e<=5;++e)t.exports[e]=p[e]}()})),afe=z(((e,t)=>{"use strict";t.exports=function(e,t,r,n){var s=i(e,r,n),a=i(t,r,n);if(s>0&&a>0||s<0&&a<0)return!1;var o=i(r,e,t),l=i(n,e,t);return!(o>0&&l>0||o<0&&l<0)&&(0!==s||0!==a||0!==o||0!==l||function(e,t,i,r){for(var n=0;n<2;++n){var s=e[n],a=t[n],o=Math.min(s,a),l=Math.max(s,a),h=i[n],u=r[n],c=Math.min(h,u);if(Math.max(h,u)<o||l<c)return!1}return!0}(e,t,r,n))};var i=nfe()[3]})),lfe=z(((e,t)=>{"use strict";t.exports=function(e,t,o,l){if(!a(e,t,o,l))return[[0],[0],[0]];var h=r([o[1]],[-l[1]]),u=r([-o[0]],[l[0]]),c=r(r(n(u,e[1]),n(u,-t[1])),r(n(h,e[0]),n(h,-t[0]))),p=r(i(-e[0],t[1]),i(e[1],t[0])),d=r(i(-o[0],l[1]),i(o[1],l[0])),f=r(r(n(d,e[0]),n(d,-t[0])),r(n(p,-o[0]),n(p,l[0]))),m=r(r(n(d,e[1]),n(d,-t[1])),r(n(p,-o[1]),n(p,l[1])));return[s(f),s(m),s(c)]};var i=lA(),r=bk(),n=Ik(),s=efe(),a=afe()})),ufe=z(((e,t)=>{t.exports=function(e){var t=0,i=e.length;switch(i){case 1:t=e[0];break;case 2:t=e[0]+e[1];break;case 3:t=e[0]+e[1]+e[2];break;case 4:t=e[0]+e[1]+e[2]+e[3];break;default:for(var r=0;r<i;r++)t+=e[r]}return t}})),pfe=z(((e,t)=>{var i=lfe(),r=ufe();function n(e,t){return e[0]===t[0]&&e[1]===t[1]}t.exports=function(e,t){for(var u={},c=e.length,p=[],d=0;d<c;d++){var f=e[d],m=e[(d+1)%c];h(f,o),h(m,l);for(var g=0;g<c;g++)if(d!==g){var y=e[g],v=e[(g+1)%c];if(h(y,s),h(v,a),!(n(s,o)||n(s,l)||n(a,o)||n(a,l))){var T=i(o,l,s,a),x=T[2];if(1!==x.length||x[0]){var b=r(T[2]);if(T[0]=r(T[0])/b,T[1]=r(T[1])/b,T.pop(),!(n(T,o)||n(T,l)||n(T,s)||n(T,a))){var E=T+"",_=!u[E];_&&(u[E]=!0);var w=_;t&&(w=t(T,d,f,m,g,y,v,_)),w&&p.push(T)}}}}}return p};var s=[0,0],a=[0,0],o=[0,0],l=[0,0];function h(e,t){Array.isArray(e)?(t[0]=e[0],t[1]=e[1]):(t[0]=e.x,t[1]=e.y)}})),Ufe=z(((e,t)=>{function i(e){if(e)return function(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}(e)}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){var i=this;function r(){i.off(e,r),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},r.fn=t,this.on(e,r),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,n=0;n<i.length;n++)if((r=i[n])===t||r.fn===t){i.splice(n,1);break}return this},i.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),i=this._callbacks[e];if(i)for(var r=0,n=(i=i.slice(0)).length;r<n;++r)i[r].apply(this,t);return this},i.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},i.prototype.hasListeners=function(e){return!!this.listeners(e).length}})),Gfe=z(((e,t)=>{var i=Ufe();function r(){i.call(this)}r.prototype=new i,t.exports=r,r.Stream=r,r.prototype.pipe=function(e,t){var i=this;function r(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function n(){i.readable&&i.resume&&i.resume()}i.on("data",r),e.on("drain",n),!e._isStdio&&(!t||!1!==t.end)&&(i.on("end",a),i.on("close",o));var s=!1;function a(){s||(s=!0,e.end())}function o(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(h(),!this.hasListeners("error"))throw e}function h(){i.off("data",r),e.off("drain",n),i.off("end",a),i.off("close",o),i.off("error",l),e.off("error",l),i.off("end",h),i.off("close",h),e.off("end",h),e.off("close",h)}return i.on("error",l),e.on("error",l),i.on("end",h),i.on("close",h),e.on("end",h),e.on("close",h),e.emit("pipe",i),e}})),Vfe=z(((e,t)=>{var i,r;i=e,r=function(){"use strict";var e=Math.imul,t=Math.clz32;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var i,r=0;r<t.length;r++)(i=t[r]).enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(){return(o=a()?Reflect.construct:function(e,t,i){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return i&&s(n,i.prototype),n}).apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){function i(){return o(e,arguments,n(this).constructor)}if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),s(i,e)},l(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t=a();return function(){var i,r=n(e);if(t){var s=n(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,i)}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,s=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(s.push(r.value),!t||s.length!==t);a=!0);}catch(e){o=!0,n=e}finally{try{a||null==i.return||i.return()}finally{if(o)throw n}}return s}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return d(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}var f=function(e){var t=Math.abs,n=Math.max,a=Math.floor;function o(e,t){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(i=l.call(this,e)).sign=t,Object.setPrototypeOf(h(i),o.prototype),e>o.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return i}!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(o,e);var l=u(o);return function(e,t,i){t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1})}(o,[{key:"toDebugString",value:function(){var e,t=["BigInt["],i=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=p(e))){i&&(e=i);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw s}}}}(this);try{for(i.s();!(e=i.n()).done;){var r=e.value;t.push((r&&(r>>>0).toString(16))+", ")}}catch(e){i.e(e)}finally{i.f()}return t.push("]"),t.join("")}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10;if(2>e||36<e)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":e&e-1?o.__toStringGeneric(this,e,!1):o.__toStringBasePowerOfTwo(this,e)}},{key:"valueOf",value:function(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}},{key:"__copy",value:function(){for(var e=new o(this.length,this.sign),t=0;t<this.length;t++)e[t]=this[t];return e}},{key:"__trim",value:function(){for(var e=this.length,t=this[e-1];0===t;)t=this[--e-1],this.pop();return 0===e&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var e=0;e<this.length;e++)this[e]=0}},{key:"__clzmsd",value:function(){return o.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function(e,t,i){i>this.length&&(i=this.length);for(var r=32767&e,n=e>>>15,s=0,a=t,l=0;l<i;l++){var h=this.__digit(l),u=32767&h,c=h>>>15,p=o.__imul(u,r),d=o.__imul(u,n),f=o.__imul(c,r),m=a+p+s;s=m>>>30,m&=1073741823,s+=(m+=((32767&d)<<15)+((32767&f)<<15))>>>30,a=o.__imul(c,n)+(d>>>15)+(f>>>15),this.__setDigit(l,1073741823&m)}if(0!==s||0!==a)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(e,t,i){for(var r,n=0,s=0;s<i;s++)n=(r=this.__halfDigit(t+s)+e.__halfDigit(s)+n)>>>15,this.__setHalfDigit(t+s,32767&r);return n}},{key:"__inplaceSub",value:function(e,t,i){var r=0;if(1&t){t>>=1;for(var n=this.__digit(t),s=32767&n,a=0;a<i-1>>>1;a++){var o=e.__digit(a),l=(n>>>15)-(32767&o)-r;r=1&l>>>15,this.__setDigit(t+a,(32767&l)<<15|32767&s),r=1&(s=(32767&(n=this.__digit(t+a+1)))-(o>>>15)-r)>>>15}var h=e.__digit(a),u=(n>>>15)-(32767&h)-r;if(r=1&u>>>15,this.__setDigit(t+a,(32767&u)<<15|32767&s),t+a+1>=this.length)throw new RangeError("out of bounds");!(1&i)&&(r=1&(s=(32767&(n=this.__digit(t+a+1)))-(h>>>15)-r)>>>15,this.__setDigit(t+e.length,1073709056&n|32767&s))}else{t>>=1;for(var c=0;c<e.length-1;c++){var p=this.__digit(t+c),d=e.__digit(c),f=(32767&p)-(32767&d)-r,m=(p>>>15)-(d>>>15)-(r=1&f>>>15);r=1&m>>>15,this.__setDigit(t+c,(32767&m)<<15|32767&f)}var g=this.__digit(t+c),y=e.__digit(c),v=(32767&g)-(32767&y)-r;r=1&v>>>15;var T=0;!(1&i)&&(r=1&(T=(g>>>15)-(y>>>15)-r)>>>15),this.__setDigit(t+c,(32767&T)<<15|32767&v)}return r}},{key:"__inplaceRightShift",value:function(e){if(0!==e){for(var t,i=this.__digit(0)>>>e,r=this.length-1,n=0;n<r;n++)t=this.__digit(n+1),this.__setDigit(n,1073741823&t<<30-e|i),i=t>>>e;this.__setDigit(r,i)}}},{key:"__digit",value:function(e){return this[e]}},{key:"__unsignedDigit",value:function(e){return this[e]>>>0}},{key:"__setDigit",value:function(e,t){this[e]=0|t}},{key:"__setDigitGrow",value:function(e,t){this[e]=0|t}},{key:"__halfDigitLength",value:function(){var e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}},{key:"__halfDigit",value:function(e){return 32767&this[e>>>1]>>>15*(1&e)}},{key:"__setHalfDigit",value:function(e,t){var i=e>>>1,r=this.__digit(i),n=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(i,n)}}],[{key:"BigInt",value:function(e){var t=Number.isFinite;if("number"==typeof e){if(0===e)return o.__zero();if(o.__isOneDigitInt(e))return 0>e?o.__oneDigit(-e,!0):o.__oneDigit(e,!1);if(!t(e)||a(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return o.__fromDouble(e)}if("string"==typeof e){var r=o.__fromString(e);if(null===r)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return r}if("boolean"==typeof e)return!0===e?o.__oneDigit(1,!1):o.__zero();if("object"===i(e)){if(e.constructor===o)return e;var n=o.__toPrimitive(e);return o.BigInt(n)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(e){var t=e.length;if(0===t)return 0;if(1===t){var i=e.__unsignedDigit(0);return e.sign?-i:i}var r=e.__digit(t-1),n=o.__clz30(r),s=30*t-n;if(1024<s)return e.sign?-1/0:1/0;var a=s-1,l=r,h=t-1,u=n+3,c=32===u?0:l<<u;c>>>=12;var p=u-12,d=12<=u?0:l<<20+u,f=20+u;for(0<p&&0<h&&(h--,c|=(l=e.__digit(h))>>>30-p,d=l<<p+2,f=p+2);0<f&&0<h;)h--,l=e.__digit(h),d|=30<=f?l<<f-30:l>>>30-f,f-=30;var m=o.__decideRounding(e,f,h,l);if((1===m||0===m&&1==(1&d))&&0==(d=d+1>>>0)&&++c>>>20!=0&&(c=0,1023<++a))return e.sign?-1/0:1/0;var g=e.sign?-2147483648:0;return a=a+1023<<20,o.__kBitConversionInts[1]=g|a|c,o.__kBitConversionInts[0]=d,o.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(e){if(0===e.length)return e;var t=e.__copy();return t.sign=!e.sign,t}},{key:"bitwiseNot",value:function(e){return e.sign?o.__absoluteSubOne(e).__trim():o.__absoluteAddOne(e,!0)}},{key:"exponentiate",value:function(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return o.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return!e.sign||1&t.__digit(0)?e:o.unaryMinus(e);if(1<t.length)throw new RangeError("BigInt too big");var i=t.__unsignedDigit(0);if(1===i)return e;if(i>=o.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){var r=1+(0|i/30),n=new o(r,e.sign&&0!=(1&i));n.__initializeDigits();var s=1<<i%30;return n.__setDigit(r-1,s),n}var a=null,l=e;for(1&i&&(a=e),i>>=1;0!==i;i>>=1)l=o.multiply(l,l),1&i&&(a=null===a?l:o.multiply(a,l));return a}},{key:"multiply",value:function(e,t){if(0===e.length)return e;if(0===t.length)return t;var i=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&i--;var r=new o(i,e.sign!==t.sign);r.__initializeDigits();for(var n=0;n<e.length;n++)o.__multiplyAccumulate(t,e.__digit(n),r,n);return r.__trim()}},{key:"divide",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(e,t))return o.__zero();var i,r=e.sign!==t.sign,n=t.__unsignedDigit(0);if(1===t.length&&32767>=n){if(1===n)return r===e.sign?e:o.unaryMinus(e);i=o.__absoluteDivSmall(e,n,null)}else i=o.__absoluteDivLarge(e,t,!0,!1);return i.sign=r,i.__trim()}},{key:"remainder",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(e,t))return e;var i=t.__unsignedDigit(0);if(1===t.length&&32767>=i){if(1===i)return o.__zero();var r=o.__absoluteModSmall(e,i);return 0===r?o.__zero():o.__oneDigit(r,e.sign)}var n=o.__absoluteDivLarge(e,t,!1,!0);return n.sign=e.sign,n.__trim()}},{key:"add",value:function(e,t){var i=e.sign;return i===t.sign?o.__absoluteAdd(e,t,i):0<=o.__absoluteCompare(e,t)?o.__absoluteSub(e,t,i):o.__absoluteSub(t,e,!i)}},{key:"subtract",value:function(e,t){var i=e.sign;return i===t.sign?0<=o.__absoluteCompare(e,t)?o.__absoluteSub(e,t,i):o.__absoluteSub(t,e,!i):o.__absoluteAdd(e,t,i)}},{key:"leftShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?o.__rightShiftByAbsolute(e,t):o.__leftShiftByAbsolute(e,t)}},{key:"signedRightShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?o.__leftShiftByAbsolute(e,t):o.__rightShiftByAbsolute(e,t)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(e,t){return 0>o.__compareToBigInt(e,t)}},{key:"lessThanOrEqual",value:function(e,t){return 0>=o.__compareToBigInt(e,t)}},{key:"greaterThan",value:function(e,t){return 0<o.__compareToBigInt(e,t)}},{key:"greaterThanOrEqual",value:function(e,t){return 0<=o.__compareToBigInt(e,t)}},{key:"equal",value:function(e,t){if(e.sign!==t.sign||e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e.__digit(i)!==t.__digit(i))return!1;return!0}},{key:"notEqual",value:function(e,t){return!o.equal(e,t)}},{key:"bitwiseAnd",value:function(e,t){if(!e.sign&&!t.sign)return o.__absoluteAnd(e,t).__trim();if(e.sign&&t.sign){var i=n(e.length,t.length)+1,r=o.__absoluteSubOne(e,i),s=o.__absoluteSubOne(t);return r=o.__absoluteOr(r,s,r),o.__absoluteAddOne(r,!0,r).__trim()}if(e.sign){var a=[t,e];e=a[0],t=a[1]}return o.__absoluteAndNot(e,o.__absoluteSubOne(t)).__trim()}},{key:"bitwiseXor",value:function(e,t){if(!e.sign&&!t.sign)return o.__absoluteXor(e,t).__trim();if(e.sign&&t.sign){var i=n(e.length,t.length),r=o.__absoluteSubOne(e,i),s=o.__absoluteSubOne(t);return o.__absoluteXor(r,s,r).__trim()}var a=n(e.length,t.length)+1;if(e.sign){var l=[t,e];e=l[0],t=l[1]}var h=o.__absoluteSubOne(t,a);return h=o.__absoluteXor(h,e,h),o.__absoluteAddOne(h,!0,h).__trim()}},{key:"bitwiseOr",value:function(e,t){var i=n(e.length,t.length);if(!e.sign&&!t.sign)return o.__absoluteOr(e,t).__trim();if(e.sign&&t.sign){var r=o.__absoluteSubOne(e,i),s=o.__absoluteSubOne(t);return r=o.__absoluteAnd(r,s,r),o.__absoluteAddOne(r,!0,r).__trim()}if(e.sign){var a=[t,e];e=a[0],t=a[1]}var l=o.__absoluteSubOne(t,i);return l=o.__absoluteAndNot(l,e,l),o.__absoluteAddOne(l,!0,l).__trim()}},{key:"asIntN",value:function(e,t){if(0===t.length)return t;if(0>(e=a(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return o.__zero();if(e>=o.__kMaxLengthBits)return t;var i=0|(e+29)/30;if(t.length<i)return t;var r=t.__unsignedDigit(i-1),n=1<<(e-1)%30;if(t.length===i&&r<n)return t;if((r&n)!==n)return o.__truncateToNBits(e,t);if(!t.sign)return o.__truncateAndSubFromPowerOfTwo(e,t,!0);if(!(r&n-1)){for(var s=i-2;0<=s;s--)if(0!==t.__digit(s))return o.__truncateAndSubFromPowerOfTwo(e,t,!1);return t.length===i&&r===n?t:o.__truncateToNBits(e,t)}return o.__truncateAndSubFromPowerOfTwo(e,t,!1)}},{key:"asUintN",value:function(e,t){if(0===t.length)return t;if(0>(e=a(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return o.__zero();if(t.sign){if(e>o.__kMaxLengthBits)throw new RangeError("BigInt too big");return o.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=o.__kMaxLengthBits)return t;var i=0|(e+29)/30;if(t.length<i)return t;var r=e%30;if(t.length==i){if(0===r)return t;if(!(t.__digit(i-1)>>>r))return t}return o.__truncateToNBits(e,t)}},{key:"ADD",value:function(e,t){if(e=o.__toPrimitive(e),t=o.__toPrimitive(t),"string"==typeof e)return"string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=o.__toNumeric(e),t=o.__toNumeric(t),o.__isBigInt(e)&&o.__isBigInt(t))return o.add(e,t);if("number"==typeof e&&"number"==typeof t)return e+t;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(e,t){return o.__compare(e,t,0)}},{key:"LE",value:function(e,t){return o.__compare(e,t,1)}},{key:"GT",value:function(e,t){return o.__compare(e,t,2)}},{key:"GE",value:function(e,t){return o.__compare(e,t,3)}},{key:"EQ",value:function(e,t){for(;;){if(o.__isBigInt(e))return o.__isBigInt(t)?o.equal(e,t):o.EQ(t,e);if("number"==typeof e){if(o.__isBigInt(t))return o.__equalToNumber(t,e);if("object"!==i(t))return e==t;t=o.__toPrimitive(t)}else if("string"==typeof e){if(o.__isBigInt(t))return null!==(e=o.__fromString(e))&&o.equal(e,t);if("object"!==i(t))return e==t;t=o.__toPrimitive(t)}else if("boolean"==typeof e){if(o.__isBigInt(t))return o.__equalToNumber(t,+e);if("object"!==i(t))return e==t;t=o.__toPrimitive(t)}else if("symbol"===i(e)){if(o.__isBigInt(t))return!1;if("object"!==i(t))return e==t;t=o.__toPrimitive(t)}else{if("object"!==i(e))return e==t;if("object"===i(t)&&t.constructor!==o)return e==t;e=o.__toPrimitive(e)}}}},{key:"NE",value:function(e,t){return!o.EQ(e,t)}},{key:"DataViewGetBigInt64",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return o.asIntN(64,o.DataViewGetBigUint64(e,t,i))}},{key:"DataViewGetBigUint64",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=c(i?[4,0]:[0,4],2),n=r[0],s=r[1],a=e.getUint32(t+n,i),l=e.getUint32(t+s,i),h=new o(3,!1);return h.__setDigit(0,1073741823&l),h.__setDigit(1,(268435455&a)<<2|l>>>30),h.__setDigit(2,a>>>28),h.__trim()}},{key:"DataViewSetBigInt64",value:function(e,t,i){var r=3<arguments.length&&void 0!==arguments[3]&&arguments[3];o.DataViewSetBigUint64(e,t,i,r)}},{key:"DataViewSetBigUint64",value:function(e,t,i){var r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],n=0,s=0;if(0<(i=o.asUintN(64,i)).length&&(s=i.__digit(0),1<i.length)){var a=i.__digit(1);s|=a<<30,n=a>>>2,2<i.length&&(n|=i.__digit(2)<<28)}var l=c(r?[4,0]:[0,4],2),h=l[0],u=l[1];e.setUint32(t+h,n,r),e.setUint32(t+u,s,r)}},{key:"__zero",value:function(){return new o(0,!1)}},{key:"__oneDigit",value:function(e,t){var i=new o(1,t);return i.__setDigit(0,e),i}},{key:"__decideRounding",value:function(e,t,i,r){if(0<t)return-1;var n;if(0>t)n=-t-1;else{if(0===i)return-1;i--,r=e.__digit(i),n=29}var s=1<<n;if(!(r&s))return-1;if(0!=(r&(s-=1)))return 1;for(;0<i;)if(i--,0!==e.__digit(i))return 1;return 0}},{key:"__fromDouble",value:function(e){o.__kBitConversionDouble[0]=e;var t,i=(2047&o.__kBitConversionInts[1]>>>20)-1023,r=1+(0|i/30),n=new o(r,0>e),s=1048575&o.__kBitConversionInts[1]|1048576,a=o.__kBitConversionInts[0],l=i%30,h=0;if(l<20){var u=20-l;h=u+32,t=s>>>u,s=s<<32-u|a>>>u,a<<=32-u}else if(20===l)h=32,t=s,s=a,a=0;else{var c=l-20;h=32-c,t=s<<c|a>>>32-c,s=a<<c,a=0}n.__setDigit(r-1,t);for(var p=r-2;0<=p;p--)0<h?(h-=30,t=s>>>2,s=s<<30|a>>>2,a<<=30):t=0,n.__setDigit(p,t);return n.__trim()}},{key:"__isWhitespace",value:function(e){return 13>=e&&9<=e||(159>=e?32==e:131071>=e?160==e||5760==e:196607>=e?10>=(e&=131071)||40==e||41==e||47==e||95==e||4096==e:65279==e)}},{key:"__fromString",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,i=0,r=e.length,n=0;if(n===r)return o.__zero();for(var s=e.charCodeAt(n);o.__isWhitespace(s);){if(++n===r)return o.__zero();s=e.charCodeAt(n)}if(43===s){if(++n===r)return null;s=e.charCodeAt(n),i=1}else if(45===s){if(++n===r)return null;s=e.charCodeAt(n),i=-1}if(0===t){if(t=10,48===s){if(++n===r)return o.__zero();if(88===(s=e.charCodeAt(n))||120===s){if(t=16,++n===r)return null;s=e.charCodeAt(n)}else if(79===s||111===s){if(t=8,++n===r)return null;s=e.charCodeAt(n)}else if(66===s||98===s){if(t=2,++n===r)return null;s=e.charCodeAt(n)}}}else if(16===t&&48===s){if(++n===r)return o.__zero();if(88===(s=e.charCodeAt(n))||120===s){if(++n===r)return null;s=e.charCodeAt(n)}}if(0!==i&&10!==t)return null;for(;48===s;){if(++n===r)return o.__zero();s=e.charCodeAt(n)}var a=r-n,l=o.__kMaxBitsPerChar[t],h=o.__kBitsPerCharTableMultiplier-1;if(a>1073741824/l)return null;var u=new o(0|(29+(l*a+h>>>o.__kBitsPerCharTableShift))/30,!1),c=10>t?t:10,p=10<t?t-10:0;if(t&t-1){u.__initializeDigits();var d=!1,f=0;do{for(var m,g=0,y=1;;){if(m=void 0,s-48>>>0<c)m=s-48;else{if(!((32|s)-97>>>0<p)){d=!0;break}m=(32|s)-87}var v=y*t;if(1073741823<v)break;if(y=v,g=g*t+m,f++,++n===r){d=!0;break}s=e.charCodeAt(n)}var T=0|(l*f+(h=30*o.__kBitsPerCharTableMultiplier-1)>>>o.__kBitsPerCharTableShift)/30;u.__inplaceMultiplyAdd(y,g,T)}while(!d)}else{l>>=o.__kBitsPerCharTableShift;var x=[],b=[],E=!1;do{for(var _,w=0,S=0;;){if(_=void 0,s-48>>>0<c)_=s-48;else{if(!((32|s)-97>>>0<p)){E=!0;break}_=(32|s)-87}if(S+=l,w=w<<l|_,++n===r){E=!0;break}if(s=e.charCodeAt(n),30<S+l)break}x.push(w),b.push(S)}while(!E);o.__fillFromParts(u,x,b)}if(n!==r){if(!o.__isWhitespace(s))return null;for(n++;n<r;n++)if(s=e.charCodeAt(n),!o.__isWhitespace(s))return null}return u.sign=-1===i,u.__trim()}},{key:"__fillFromParts",value:function(e,t,i){for(var r=0,n=0,s=0,a=t.length-1;0<=a;a--){var o=t[a],l=i[a];n|=o<<s,30===(s+=l)?(e.__setDigit(r++,n),s=0,n=0):30<s&&(e.__setDigit(r++,1073741823&n),n=o>>>l-(s-=30))}if(0!==n){if(r>=e.length)throw new Error("implementation bug");e.__setDigit(r++,n)}for(;r<e.length;r++)e.__setDigit(r,0)}},{key:"__toStringBasePowerOfTwo",value:function(e,t){var i=e.length,r=t-1,n=r=(15&(r=(51&(r=(85&r>>>1)+(85&r))>>>2)+(51&r))>>>4)+(15&r),s=t-1,a=e.__digit(i-1),l=0|(30*i-o.__clz30(a)+n-1)/n;if(e.sign&&l++,268435456<l)throw new Error("string too long");for(var h=Array(l),u=l-1,c=0,p=0,d=0;d<i-1;d++){var f=e.__digit(d),m=(c|f<<p)&s;h[u--]=o.__kConversionChars[m];var g=n-p;for(c=f>>>g,p=30-g;p>=n;)h[u--]=o.__kConversionChars[c&s],c>>>=n,p-=n}var y=(c|a<<p)&s;for(h[u--]=o.__kConversionChars[y],c=a>>>n-p;0!==c;)h[u--]=o.__kConversionChars[c&s],c>>>=n;if(e.sign&&(h[u--]="-"),-1!==u)throw new Error("implementation bug");return h.join("")}},{key:"__toStringGeneric",value:function(e,t,i){var r=e.length;if(0===r)return"";if(1===r){var n=e.__unsignedDigit(0).toString(t);return!1===i&&e.sign&&(n="-"+n),n}var s,a,l=30*r-o.__clz30(e.__digit(r-1)),h=o.__kMaxBitsPerChar[t]-1,u=l*o.__kBitsPerCharTableMultiplier,c=1+(u=0|(u+=h-1)/h)>>1,p=o.exponentiate(o.__oneDigit(t,!1),o.__oneDigit(c,!1)),d=p.__unsignedDigit(0);if(1===p.length&&32767>=d){(s=new o(e.length,!1)).__initializeDigits();for(var f,m=0,g=2*e.length-1;0<=g;g--)f=m<<15|e.__halfDigit(g),s.__setHalfDigit(g,0|f/d),m=0|f%d;a=m.toString(t)}else{var y=o.__absoluteDivLarge(e,p,!0,!0);s=y.quotient;var v=y.remainder.__trim();a=o.__toStringGeneric(v,t,!0)}s.__trim();for(var T=o.__toStringGeneric(s,t,!0);a.length<c;)a="0"+a;return!1===i&&e.sign&&(T="-"+T),T+a}},{key:"__unequalSign",value:function(e){return e?-1:1}},{key:"__absoluteGreater",value:function(e){return e?-1:1}},{key:"__absoluteLess",value:function(e){return e?1:-1}},{key:"__compareToBigInt",value:function(e,t){var i=e.sign;if(i!==t.sign)return o.__unequalSign(i);var r=o.__absoluteCompare(e,t);return 0<r?o.__absoluteGreater(i):0>r?o.__absoluteLess(i):0}},{key:"__compareToNumber",value:function(e,i){if(o.__isOneDigitInt(i)){var r=e.sign,n=0>i;if(r!==n)return o.__unequalSign(r);if(0===e.length){if(n)throw new Error("implementation bug");return 0===i?0:-1}if(1<e.length)return o.__absoluteGreater(r);var s=t(i),a=e.__unsignedDigit(0);return a>s?o.__absoluteGreater(r):a<s?o.__absoluteLess(r):0}return o.__compareToDouble(e,i)}},{key:"__compareToDouble",value:function(e,t){if(t!=t)return t;if(t===1/0)return-1;if(t===-1/0)return 1;var i=e.sign;if(i!==0>t)return o.__unequalSign(i);if(0===t)throw new Error("implementation bug: should be handled elsewhere");if(0===e.length)return-1;o.__kBitConversionDouble[0]=t;var r=2047&o.__kBitConversionInts[1]>>>20;if(2047==r)throw new Error("implementation bug: handled elsewhere");var n=r-1023;if(0>n)return o.__absoluteGreater(i);var s=e.length,a=e.__digit(s-1),l=o.__clz30(a),h=30*s-l,u=n+1;if(h<u)return o.__absoluteLess(i);if(h>u)return o.__absoluteGreater(i);var c=1048576|1048575&o.__kBitConversionInts[1],p=o.__kBitConversionInts[0],d=29-l;if(d!==(0|(h-1)%30))throw new Error("implementation bug");var f,m=0;if(d<20){var g=20-d;m=g+32,f=c>>>g,c=c<<32-g|p>>>g,p<<=32-g}else if(20===d)m=32,f=c,c=p,p=0;else{var y=d-20;m=32-y,f=c<<y|p>>>32-y,c=p<<y,p=0}if((a>>>=0)>(f>>>=0))return o.__absoluteGreater(i);if(a<f)return o.__absoluteLess(i);for(var v=s-2;0<=v;v--){0<m?(m-=30,f=c>>>2,c=c<<30|p>>>2,p<<=30):f=0;var T=e.__unsignedDigit(v);if(T>f)return o.__absoluteGreater(i);if(T<f)return o.__absoluteLess(i)}if(0!==c||0!==p){if(0===m)throw new Error("implementation bug");return o.__absoluteLess(i)}return 0}},{key:"__equalToNumber",value:function(e,i){return o.__isOneDigitInt(i)?0===i?0===e.length:1===e.length&&e.sign===0>i&&e.__unsignedDigit(0)===t(i):0===o.__compareToDouble(e,i)}},{key:"__comparisonResultToBool",value:function(e,t){return 0===t?0>e:1===t?0>=e:2===t?0<e:3===t?0<=e:void 0}},{key:"__compare",value:function(e,t,i){if(e=o.__toPrimitive(e),t=o.__toPrimitive(t),"string"==typeof e&&"string"==typeof t)switch(i){case 0:return e<t;case 1:return e<=t;case 2:return e>t;case 3:return e>=t}if(o.__isBigInt(e)&&"string"==typeof t)return null!==(t=o.__fromString(t))&&o.__comparisonResultToBool(o.__compareToBigInt(e,t),i);if("string"==typeof e&&o.__isBigInt(t))return null!==(e=o.__fromString(e))&&o.__comparisonResultToBool(o.__compareToBigInt(e,t),i);if(e=o.__toNumeric(e),t=o.__toNumeric(t),o.__isBigInt(e)){if(o.__isBigInt(t))return o.__comparisonResultToBool(o.__compareToBigInt(e,t),i);if("number"!=typeof t)throw new Error("implementation bug");return o.__comparisonResultToBool(o.__compareToNumber(e,t),i)}if("number"!=typeof e)throw new Error("implementation bug");if(o.__isBigInt(t))return o.__comparisonResultToBool(o.__compareToNumber(t,e),2^i);if("number"!=typeof t)throw new Error("implementation bug");return 0===i?e<t:1===i?e<=t:2===i?e>t:3===i?e>=t:void 0}},{key:"__absoluteAdd",value:function(e,t,i){if(e.length<t.length)return o.__absoluteAdd(t,e,i);if(0===e.length)return e;if(0===t.length)return e.sign===i?e:o.unaryMinus(e);var r=e.length;(0===e.__clzmsd()||t.length===e.length&&0===t.__clzmsd())&&r++;for(var n,s=new o(r,i),a=0,l=0;l<t.length;l++)a=(n=e.__digit(l)+t.__digit(l)+a)>>>30,s.__setDigit(l,1073741823&n);for(;l<e.length;l++){var h=e.__digit(l)+a;a=h>>>30,s.__setDigit(l,1073741823&h)}return l<s.length&&s.__setDigit(l,a),s.__trim()}},{key:"__absoluteSub",value:function(e,t,i){if(0===e.length)return e;if(0===t.length)return e.sign===i?e:o.unaryMinus(e);for(var r,n=new o(e.length,i),s=0,a=0;a<t.length;a++)s=1&(r=e.__digit(a)-t.__digit(a)-s)>>>30,n.__setDigit(a,1073741823&r);for(;a<e.length;a++){var l=e.__digit(a)-s;s=1&l>>>30,n.__setDigit(a,1073741823&l)}return n.__trim()}},{key:"__absoluteAddOne",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length;null===i?i=new o(r,t):i.sign=t;for(var n,s=1,a=0;a<r;a++)s=(n=e.__digit(a)+s)>>>30,i.__setDigit(a,1073741823&n);return 0!==s&&i.__setDigitGrow(r,1),i}},{key:"__absoluteSubOne",value:function(e,t){for(var i,r=e.length,n=new o(t=t||r,!1),s=1,a=0;a<r;a++)s=1&(i=e.__digit(a)-s)>>>30,n.__setDigit(a,1073741823&i);if(0!==s)throw new Error("implementation bug");for(var l=r;l<t;l++)n.__setDigit(l,0);return n}},{key:"__absoluteAnd",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,n=t.length,s=n;if(r<n){s=r;var a=e,l=r;e=t,r=n,t=a,n=l}var h=s;null===i?i=new o(h,!1):h=i.length;for(var u=0;u<s;u++)i.__setDigit(u,e.__digit(u)&t.__digit(u));for(;u<h;u++)i.__setDigit(u,0);return i}},{key:"__absoluteAndNot",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,n=t.length,s=n;r<n&&(s=r);var a=r;null===i?i=new o(a,!1):a=i.length;for(var l=0;l<s;l++)i.__setDigit(l,e.__digit(l)&~t.__digit(l));for(;l<r;l++)i.__setDigit(l,e.__digit(l));for(;l<a;l++)i.__setDigit(l,0);return i}},{key:"__absoluteOr",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,n=t.length,s=n;if(r<n){s=r;var a=e,l=r;e=t,r=n,t=a,n=l}var h=r;null===i?i=new o(h,!1):h=i.length;for(var u=0;u<s;u++)i.__setDigit(u,e.__digit(u)|t.__digit(u));for(;u<r;u++)i.__setDigit(u,e.__digit(u));for(;u<h;u++)i.__setDigit(u,0);return i}},{key:"__absoluteXor",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,n=t.length,s=n;if(r<n){s=r;var a=e,l=r;e=t,r=n,t=a,n=l}var h=r;null===i?i=new o(h,!1):h=i.length;for(var u=0;u<s;u++)i.__setDigit(u,e.__digit(u)^t.__digit(u));for(;u<r;u++)i.__setDigit(u,e.__digit(u));for(;u<h;u++)i.__setDigit(u,0);return i}},{key:"__absoluteCompare",value:function(e,t){var i=e.length-t.length;if(0!=i)return i;for(var r=e.length-1;0<=r&&e.__digit(r)===t.__digit(r);)r--;return 0>r?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}},{key:"__multiplyAccumulate",value:function(e,t,i,r){if(0!==t){for(var n=32767&t,s=t>>>15,a=0,l=0,h=0;h<e.length;h++,r++){var u=i.__digit(r),c=e.__digit(h),p=32767&c,d=c>>>15,f=o.__imul(p,n),m=o.__imul(p,s),g=o.__imul(d,n);a=(u+=l+f+a)>>>30,u&=1073741823,a+=(u+=((32767&m)<<15)+((32767&g)<<15))>>>30,l=o.__imul(d,s)+(m>>>15)+(g>>>15),i.__setDigit(r,1073741823&u)}for(;0!==a||0!==l;r++){var y=i.__digit(r);y+=a+l,l=0,a=y>>>30,i.__setDigit(r,1073741823&y)}}}},{key:"__internalMultiplyAdd",value:function(e,t,i,r,n){for(var s=i,a=0,l=0;l<r;l++){var h=e.__digit(l),u=o.__imul(32767&h,t),c=o.__imul(h>>>15,t),p=u+((32767&c)<<15)+a+s;s=p>>>30,a=c>>>15,n.__setDigit(l,1073741823&p)}if(n.length>r)for(n.__setDigit(r++,s+a);r<n.length;)n.__setDigit(r++,0);else if(s+a!==0)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;null===i&&(i=new o(e.length,!1));for(var r=0,n=2*e.length-1;0<=n;n-=2){var s=(r<<15|e.__halfDigit(n))>>>0,a=0|s/t,l=0|(s=((r=0|s%t)<<15|e.__halfDigit(n-1))>>>0)/t;r=0|s%t,i.__setDigit(n>>>1,a<<15|l)}return i}},{key:"__absoluteModSmall",value:function(e,t){for(var i=0,r=2*e.length-1;0<=r;r--)i=0|((i<<15|e.__halfDigit(r))>>>0)%t;return i}},{key:"__absoluteDivLarge",value:function(e,t,i,r){var n=t.__halfDigitLength(),s=t.length,a=e.__halfDigitLength()-n,l=null;i&&(l=new o(a+2>>>1,!1)).__initializeDigits();var h=new o(n+2>>>1,!1);h.__initializeDigits();var u=o.__clz15(t.__halfDigit(n-1));0<u&&(t=o.__specialLeftShift(t,u,0));for(var c=o.__specialLeftShift(e,u,1),p=t.__halfDigit(n-1),d=0,f=a;0<=f;f--){var m=32767,g=c.__halfDigit(f+n);if(g!==p){var y=(g<<15|c.__halfDigit(f+n-1))>>>0;m=0|y/p;for(var v=0|y%p,T=t.__halfDigit(n-2),x=c.__halfDigit(f+n-2);o.__imul(m,T)>>>0>(v<<16|x)>>>0&&(m--,!(32767<(v+=p))););}o.__internalMultiplyAdd(t,m,0,s,h);var b=c.__inplaceSub(h,f,n+1);0!==b&&(b=c.__inplaceAdd(t,f,n),c.__setHalfDigit(f+n,32767&c.__halfDigit(f+n)+b),m--),i&&(1&f?d=m<<15:l.__setDigit(f>>>1,d|m))}if(r)return c.__inplaceRightShift(u),i?{quotient:l,remainder:c}:c;if(i)return l;throw new Error("unreachable")}},{key:"__clz15",value:function(e){return o.__clz30(e)-15}},{key:"__specialLeftShift",value:function(e,t,i){var r=e.length,n=new o(r+i,!1);if(0===t){for(var s=0;s<r;s++)n.__setDigit(s,e.__digit(s));return 0<i&&n.__setDigit(r,0),n}for(var a,l=0,h=0;h<r;h++)a=e.__digit(h),n.__setDigit(h,1073741823&a<<t|l),l=a>>>30-t;return 0<i&&n.__setDigit(r,l),n}},{key:"__leftShiftByAbsolute",value:function(e,t){var i=o.__toShiftAmount(t);if(0>i)throw new RangeError("BigInt too big");var r=0|i/30,n=i%30,s=e.length,a=0!==n&&e.__digit(s-1)>>>30-n!=0,l=s+r+(a?1:0),h=new o(l,e.sign);if(0===n){for(var u=0;u<r;u++)h.__setDigit(u,0);for(;u<l;u++)h.__setDigit(u,e.__digit(u-r))}else{for(var c=0,p=0;p<r;p++)h.__setDigit(p,0);for(var d,f=0;f<s;f++)d=e.__digit(f),h.__setDigit(f+r,1073741823&d<<n|c),c=d>>>30-n;if(a)h.__setDigit(s+r,c);else if(0!==c)throw new Error("implementation bug")}return h.__trim()}},{key:"__rightShiftByAbsolute",value:function(e,t){var i=e.length,r=e.sign,n=o.__toShiftAmount(t);if(0>n)return o.__rightShiftByMaximum(r);var s=0|n/30,a=n%30,l=i-s;if(0>=l)return o.__rightShiftByMaximum(r);var h=!1;if(r)if(e.__digit(s)&(1<<a)-1)h=!0;else for(var u=0;u<s;u++)if(0!==e.__digit(u)){h=!0;break}h&&0===a&&!~e.__digit(i-1)&&l++;var c=new o(l,r);if(0===a){c.__setDigit(l-1,0);for(var p=s;p<i;p++)c.__setDigit(p-s,e.__digit(p))}else{for(var d,f=e.__digit(s)>>>a,m=i-s-1,g=0;g<m;g++)d=e.__digit(g+s+1),c.__setDigit(g,1073741823&d<<30-a|f),f=d>>>a;c.__setDigit(m,f)}return h&&(c=o.__absoluteAddOne(c,!0,c)),c.__trim()}},{key:"__rightShiftByMaximum",value:function(e){return e?o.__oneDigit(1,!0):o.__zero()}},{key:"__toShiftAmount",value:function(e){if(1<e.length)return-1;var t=e.__unsignedDigit(0);return t>o.__kMaxLengthBits?-1:t}},{key:"__toPrimitive",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"default";if("object"!==i(e)||e.constructor===o)return e;if("undefined"!=typeof Symbol&&"symbol"===i(Symbol.toPrimitive)){var r=e[Symbol.toPrimitive];if(r){var n=r(t);if("object"!==i(n))return n;throw new TypeError("Cannot convert object to primitive value")}}var s=e.valueOf;if(s){var a=s.call(e);if("object"!==i(a))return a}var l=e.toString;if(l){var h=l.call(e);if("object"!==i(h))return h}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(e){return o.__isBigInt(e)?e:+e}},{key:"__isBigInt",value:function(e){return"object"===i(e)&&null!==e&&e.constructor===o}},{key:"__truncateToNBits",value:function(e,t){for(var i=0|(e+29)/30,r=new o(i,t.sign),n=i-1,s=0;s<n;s++)r.__setDigit(s,t.__digit(s));var a=t.__digit(n);if(e%30!=0){var l=32-e%30;a=a<<l>>>l}return r.__setDigit(n,a),r.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(e,t,i){for(var r,n=Math.min,s=0|(e+29)/30,a=new o(s,i),l=0,h=s-1,u=0,c=n(h,t.length);l<c;l++)u=1&(r=0-t.__digit(l)-u)>>>30,a.__setDigit(l,1073741823&r);for(;l<h;l++)a.__setDigit(l,0|1073741823&-u);var p,d=h<t.length?t.__digit(h):0,f=e%30;if(0===f)p=0-d-u,p&=1073741823;else{var m=32-f,g=1<<32-m;p=g-(d=d<<m>>>m)-u,p&=g-1}return a.__setDigit(h,p),a.__trim()}},{key:"__digitPow",value:function(e,t){for(var i=1;0<t;)1&t&&(i*=e),t>>>=1,e*=e;return i}},{key:"__isOneDigitInt",value:function(e){return(1073741823&e)===e}}]),o}(l(Array));return f.__kMaxLength=33554432,f.__kMaxLengthBits=f.__kMaxLength<<5,f.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],f.__kBitsPerCharTableShift=5,f.__kBitsPerCharTableMultiplier=1<<f.__kBitsPerCharTableShift,f.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],f.__kBitConversionBuffer=new ArrayBuffer(8),f.__kBitConversionDouble=new Float64Array(f.__kBitConversionBuffer),f.__kBitConversionInts=new Int32Array(f.__kBitConversionBuffer),f.__clz30=t?function(e){return t(e)-2}:function(e){var t=Math.LN2,i=Math.log;return 0===e?30:0|29-(0|i(e>>>0)/t)},f.__imul=e||function(e,t){return 0|e*t},f},"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(i=i||self).JSBI=r()})),Zc=z(((e,t)=>{(function(){var i,r="Expected a function",n="__lodash_hash_undefined__",s="__lodash_placeholder__",a=32,o=128,l=1/0,h=9007199254740991,u=NaN,c=4294967295,p=[["ary",o],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],d="[object Arguments]",f="[object Array]",m="[object Boolean]",g="[object Date]",y="[object Error]",v="[object Function]",T="[object GeneratorFunction]",x="[object Map]",b="[object Number]",E="[object Object]",_="[object Promise]",w="[object RegExp]",S="[object Set]",M="[object String]",I="[object Symbol]",D="[object WeakMap]",A="[object ArrayBuffer]",R="[object DataView]",C="[object Float32Array]",O="[object Float64Array]",P="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",k="[object Uint16Array]",B="[object Uint32Array]",z=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,j=/[&<>"']/g,W=RegExp(V.source),Y=RegExp(j.source),X=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(Q.source),te=/^\s+/,ie=/\s/,re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ne=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oe=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,ce=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,de=/^\[object .+?Constructor\]$/,fe=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,ve=/['\n\r\u2028\u2029\\]/g,Te="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",be="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",_e="A-Z\\xc0-\\xd6\\xd8-\\xde",we="\\ufe0e\\ufe0f",Se="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Me="["+Te+"]",Ie="["+Se+"]",De="["+xe+"]",Ae="\\d+",Re="["+be+"]",Ce="["+Ee+"]",Oe="[^"+Te+Se+Ae+be+Ee+_e+"]",Pe="\\ud83c[\\udffb-\\udfff]",Ne="[^"+Te+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+_e+"]",ke="\\u200d",Be="(?:"+Ce+"|"+Oe+")",ze="(?:"+Ue+"|"+Oe+")",Ge="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",He="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ve="(?:"+De+"|"+Pe+")?",je="["+we+"]?",We=je+Ve+"(?:"+ke+"(?:"+[Ne,Le,Fe].join("|")+")"+je+Ve+")*",Ye="(?:"+[Re,Le,Fe].join("|")+")"+We,Xe="(?:"+[Ne+De+"?",De,Le,Fe,Me].join("|")+")",qe=RegExp("['\u2019]","g"),Ze=RegExp(De,"g"),Je=RegExp(Pe+"(?="+Pe+")|"+Xe+We,"g"),Ke=RegExp([Ue+"?"+Ce+"+"+Ge+"(?="+[Ie,Ue,"$"].join("|")+")",ze+"+"+He+"(?="+[Ie,Ue+Be,"$"].join("|")+")",Ue+"?"+Be+"+"+Ge,Ue+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ye].join("|"),"g"),$e=RegExp("["+ke+Te+xe+we+"]"),Qe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,it={};it[C]=it[O]=it[P]=it[N]=it[L]=it[F]=it[U]=it[k]=it[B]=!0,it[d]=it[f]=it[A]=it[m]=it[R]=it[g]=it[y]=it[v]=it[x]=it[b]=it[E]=it[w]=it[S]=it[M]=it[D]=!1;var rt={};rt[d]=rt[f]=rt[A]=rt[R]=rt[m]=rt[g]=rt[C]=rt[O]=rt[P]=rt[N]=rt[L]=rt[x]=rt[b]=rt[E]=rt[w]=rt[S]=rt[M]=rt[I]=rt[F]=rt[U]=rt[k]=rt[B]=!0,rt[y]=rt[v]=rt[D]=!1;var nt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,at=parseInt,ot="object"==typeof global&&global&&global.Object===Object&&global,lt="object"==typeof self&&self&&self.Object===Object&&self,ht=ot||lt||Function("return this")(),ut="object"==typeof e&&e&&!e.nodeType&&e,ct=ut&&"object"==typeof t&&t&&!t.nodeType&&t,pt=ct&&ct.exports===ut,dt=pt&&ot.process,ft=function(){try{return ct&&ct.require&&ct.require("util").types||dt&&dt.binding&&dt.binding("util")}catch(e){}}(),mt=ft&&ft.isArrayBuffer,gt=ft&&ft.isDate,yt=ft&&ft.isMap,vt=ft&&ft.isRegExp,Tt=ft&&ft.isSet,xt=ft&&ft.isTypedArray;function bt(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function Et(e,t,i,r){for(var n=-1,s=null==e?0:e.length;++n<s;){var a=e[n];t(r,a,i(a),e)}return r}function _t(e,t){for(var i=-1,r=null==e?0:e.length;++i<r&&!1!==t(e[i],i,e););return e}function wt(e,t){for(var i=null==e?0:e.length;i--&&!1!==t(e[i],i,e););return e}function St(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(!t(e[i],i,e))return!1;return!0}function Mt(e,t){for(var i=-1,r=null==e?0:e.length,n=0,s=[];++i<r;){var a=e[i];t(a,i,e)&&(s[n++]=a)}return s}function It(e,t){return!(null==e||!e.length)&&Ut(e,t,0)>-1}function Dt(e,t,i){for(var r=-1,n=null==e?0:e.length;++r<n;)if(i(t,e[r]))return!0;return!1}function At(e,t){for(var i=-1,r=null==e?0:e.length,n=Array(r);++i<r;)n[i]=t(e[i],i,e);return n}function Rt(e,t){for(var i=-1,r=t.length,n=e.length;++i<r;)e[n+i]=t[i];return e}function Ct(e,t,i,r){var n=-1,s=null==e?0:e.length;for(r&&s&&(i=e[++n]);++n<s;)i=t(i,e[n],n,e);return i}function Ot(e,t,i,r){var n=null==e?0:e.length;for(r&&n&&(i=e[--n]);n--;)i=t(i,e[n],n,e);return i}function Pt(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(t(e[i],i,e))return!0;return!1}var Nt=Gt("length");function Lt(e,t,i){var r;return i(e,(function(e,i,n){if(t(e,i,n))return r=i,!1})),r}function Ft(e,t,i,r){for(var n=e.length,s=i+(r?1:-1);r?s--:++s<n;)if(t(e[s],s,e))return s;return-1}function Ut(e,t,i){return t==t?function(e,t,i){for(var r=i-1,n=e.length;++r<n;)if(e[r]===t)return r;return-1}(e,t,i):Ft(e,Bt,i)}function kt(e,t,i,r){for(var n=i-1,s=e.length;++n<s;)if(r(e[n],t))return n;return-1}function Bt(e){return e!=e}function zt(e,t){var i=null==e?0:e.length;return i?jt(e,t)/i:u}function Gt(e){return function(t){return null==t?i:t[e]}}function Ht(e){return function(t){return null==e?i:e[t]}}function Vt(e,t,i,r,n){return n(e,(function(e,n,s){i=r?(r=!1,e):t(i,e,n,s)})),i}function jt(e,t){for(var r,n=-1,s=e.length;++n<s;){var a=t(e[n]);a!==i&&(r=r===i?a:r+a)}return r}function Wt(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}function Yt(e){return e&&e.slice(0,li(e)+1).replace(te,"")}function Xt(e){return function(t){return e(t)}}function qt(e,t){return At(t,(function(t){return e[t]}))}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var i=-1,r=e.length;++i<r&&Ut(t,e[i],0)>-1;);return i}function Kt(e,t){for(var i=e.length;i--&&Ut(t,e[i],0)>-1;);return i}var $t=Ht({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Qt=Ht({"&":"&","<":"<",">":">",'"':""","'":"'"});function ei(e){return"\\"+nt[e]}function ti(e){return $e.test(e)}function ii(e){var t=-1,i=Array(e.size);return e.forEach((function(e,r){i[++t]=[r,e]})),i}function ri(e,t){return function(i){return e(t(i))}}function ni(e,t){for(var i=-1,r=e.length,n=0,a=[];++i<r;){var o=e[i];(o===t||o===s)&&(e[i]=s,a[n++]=i)}return a}function si(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}function ai(e){return ti(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Nt(e)}function oi(e){return ti(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function li(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hi=Ht({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ui=function e(t){var ie,Te=(t=null==t?ht:ui.defaults(ht.Object(),t,ui.pick(ht,et))).Array,xe=t.Date,be=t.Error,Ee=t.Function,_e=t.Math,we=t.Object,Se=t.RegExp,Me=t.String,Ie=t.TypeError,De=Te.prototype,Ae=Ee.prototype,Re=we.prototype,Ce=t["__core-js_shared__"],Oe=Ae.toString,Pe=Re.hasOwnProperty,Ne=0,Le=(ie=/[^.]+$/.exec(Ce&&Ce.keys&&Ce.keys.IE_PROTO||""))?"Symbol(src)_1."+ie:"",Fe=Re.toString,Ue=Oe.call(we),ke=ht._,Be=Se("^"+Oe.call(Pe).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=pt?t.Buffer:i,Ge=t.Symbol,He=t.Uint8Array,Ve=ze?ze.allocUnsafe:i,je=ri(we.getPrototypeOf,we),We=we.create,Ye=Re.propertyIsEnumerable,Xe=De.splice,Je=Ge?Ge.isConcatSpreadable:i,$e=Ge?Ge.iterator:i,nt=Ge?Ge.toStringTag:i,ot=function(){try{var e=os(we,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ut=xe&&xe.now!==ht.Date.now&&xe.now,ct=t.setTimeout!==ht.setTimeout&&t.setTimeout,dt=_e.ceil,ft=_e.floor,Nt=we.getOwnPropertySymbols,Ht=ze?ze.isBuffer:i,ci=t.isFinite,pi=De.join,di=ri(we.keys,we),fi=_e.max,mi=_e.min,gi=xe.now,yi=t.parseInt,vi=_e.random,Ti=De.reverse,xi=os(t,"DataView"),bi=os(t,"Map"),Ei=os(t,"Promise"),_i=os(t,"Set"),wi=os(t,"WeakMap"),Si=os(we,"create"),Mi=wi&&new wi,Ii={},Di=Ps(xi),Ai=Ps(bi),Ri=Ps(Ei),Ci=Ps(_i),Oi=Ps(wi),Pi=Ge?Ge.prototype:i,Ni=Pi?Pi.valueOf:i,Li=Pi?Pi.toString:i;function Fi(e){if(Ja(e)&&!Ba(e)&&!(e instanceof zi)){if(e instanceof Bi)return e;if(Pe.call(e,"__wrapped__"))return Ns(e)}return new Bi(e)}var Ui=function(){function e(){}return function(t){if(!Za(t))return{};if(We)return We(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function ki(){}function Bi(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function zi(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=c,this.__views__=[]}function Gi(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Hi(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Vi(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function ji(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Vi;++t<i;)this.add(e[t])}function Wi(e){var t=this.__data__=new Hi(e);this.size=t.size}function Yi(e,t){var i=Ba(e),r=!i&&ka(e),n=!i&&!r&&Va(e),s=!i&&!r&&!n&&no(e),a=i||r||n||s,o=a?Wt(e.length,Me):[],l=o.length;for(var h in e)(t||Pe.call(e,h))&&(!a||!("length"==h||n&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||fs(h,l)))&&o.push(h);return o}function Xi(e){var t=e.length;return t?e[Vr(0,t-1)]:i}function qi(e,t){return Rs(Sn(e),rr(t,0,e.length))}function Zi(e){return Rs(Sn(e))}function Ji(e,t,r){(r!==i&&!La(e[t],r)||r===i&&!(t in e))&&tr(e,t,r)}function Ki(e,t,r){var n=e[t];(!Pe.call(e,t)||!La(n,r)||r===i&&!(t in e))&&tr(e,t,r)}function $i(e,t){for(var i=e.length;i--;)if(La(e[i][0],t))return i;return-1}function Qi(e,t,i,r){return lr(e,(function(e,n,s){t(r,e,i(e),s)})),r}function er(e,t){return e&&Mn(t,Io(t),e)}function tr(e,t,i){"__proto__"==t&&ot?ot(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function ir(e,t){for(var r=-1,n=t.length,s=Te(n),a=null==e;++r<n;)s[r]=a?i:Eo(e,t[r]);return s}function rr(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function nr(e,t,r,n,s,a){var o,l=1&t,h=2&t,u=4&t;if(r&&(o=s?r(e,n,s,a):r(e)),o!==i)return o;if(!Za(e))return e;var c=Ba(e);if(c){if(o=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&Pe.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!l)return Sn(e,o)}else{var p=us(e),f=p==v||p==T;if(Va(e))return Tn(e,l);if(p==E||p==d||f&&!s){if(o=h||f?{}:ps(e),!l)return h?function(e,t){return Mn(e,hs(e),t)}(e,function(e,t){return e&&Mn(t,Do(t),e)}(o,e)):function(e,t){return Mn(e,ls(e),t)}(e,er(o,e))}else{if(!rt[p])return s?e:{};o=function(e,t,i){var r=e.constructor;switch(t){case A:return xn(e);case m:case g:return new r(+e);case R:return function(e,t){var i=t?xn(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case C:case O:case P:case N:case L:case F:case U:case k:case B:return bn(e,i);case x:return new r;case b:case M:return new r(e);case w:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case S:return new r;case I:return function(e){return Ni?we(Ni.call(e)):{}}(e)}}(e,p,l)}}a||(a=new Wi);var y=a.get(e);if(y)return y;a.set(e,o),to(e)?e.forEach((function(i){o.add(nr(i,t,r,i,e,a))})):Ka(e)&&e.forEach((function(i,n){o.set(n,nr(i,t,r,n,e,a))}));var _=c?i:(u?h?es:Qn:h?Do:Io)(e);return _t(_||e,(function(i,n){_&&(i=e[n=i]),Ki(o,n,nr(i,t,r,n,e,a))})),o}function sr(e,t,r){var n=r.length;if(null==e)return!n;for(e=we(e);n--;){var s=r[n],a=t[s],o=e[s];if(o===i&&!(s in e)||!a(o))return!1}return!0}function ar(e,t,n){if("function"!=typeof e)throw new Ie(r);return Ms((function(){e.apply(i,n)}),t)}function or(e,t,i,r){var n=-1,s=It,a=!0,o=e.length,l=[],h=t.length;if(!o)return l;i&&(t=At(t,Xt(i))),r?(s=Dt,a=!1):t.length>=200&&(s=Zt,a=!1,t=new ji(t));e:for(;++n<o;){var u=e[n],c=null==i?u:i(u);if(u=r||0!==u?u:0,a&&c==c){for(var p=h;p--;)if(t[p]===c)continue e;l.push(u)}else s(t,c,r)||l.push(u)}return l}Fi.templateSettings={escape:X,evaluate:q,interpolate:Z,variable:"",imports:{_:Fi}},Fi.prototype=ki.prototype,Fi.prototype.constructor=Fi,Bi.prototype=Ui(ki.prototype),Bi.prototype.constructor=Bi,zi.prototype=Ui(ki.prototype),zi.prototype.constructor=zi,Gi.prototype.clear=function(){this.__data__=Si?Si(null):{},this.size=0},Gi.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Gi.prototype.get=function(e){var t=this.__data__;if(Si){var r=t[e];return r===n?i:r}return Pe.call(t,e)?t[e]:i},Gi.prototype.has=function(e){var t=this.__data__;return Si?t[e]!==i:Pe.call(t,e)},Gi.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Si&&t===i?n:t,this},Hi.prototype.clear=function(){this.__data__=[],this.size=0},Hi.prototype.delete=function(e){var t=this.__data__,i=$i(t,e);return!(i<0)&&(i==t.length-1?t.pop():Xe.call(t,i,1),--this.size,!0)},Hi.prototype.get=function(e){var t=this.__data__,r=$i(t,e);return r<0?i:t[r][1]},Hi.prototype.has=function(e){return $i(this.__data__,e)>-1},Hi.prototype.set=function(e,t){var i=this.__data__,r=$i(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this},Vi.prototype.clear=function(){this.size=0,this.__data__={hash:new Gi,map:new(bi||Hi),string:new Gi}},Vi.prototype.delete=function(e){var t=ss(this,e).delete(e);return this.size-=t?1:0,t},Vi.prototype.get=function(e){return ss(this,e).get(e)},Vi.prototype.has=function(e){return ss(this,e).has(e)},Vi.prototype.set=function(e,t){var i=ss(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this},ji.prototype.add=ji.prototype.push=function(e){return this.__data__.set(e,n),this},ji.prototype.has=function(e){return this.__data__.has(e)},Wi.prototype.clear=function(){this.__data__=new Hi,this.size=0},Wi.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Wi.prototype.get=function(e){return this.__data__.get(e)},Wi.prototype.has=function(e){return this.__data__.has(e)},Wi.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Hi){var r=i.__data__;if(!bi||r.length<199)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new Vi(r)}return i.set(e,t),this.size=i.size,this};var lr=An(gr),hr=An(yr,!0);function ur(e,t){var i=!0;return lr(e,(function(e,r,n){return i=!!t(e,r,n)})),i}function cr(e,t,r){for(var n=-1,s=e.length;++n<s;){var a=e[n],o=t(a);if(null!=o&&(l===i?o==o&&!ro(o):r(o,l)))var l=o,h=a}return h}function pr(e,t){var i=[];return lr(e,(function(e,r,n){t(e,r,n)&&i.push(e)})),i}function dr(e,t,i,r,n){var s=-1,a=e.length;for(i||(i=ds),n||(n=[]);++s<a;){var o=e[s];t>0&&i(o)?t>1?dr(o,t-1,i,r,n):Rt(n,o):r||(n[n.length]=o)}return n}var fr=Rn(),mr=Rn(!0);function gr(e,t){return e&&fr(e,t,Io)}function yr(e,t){return e&&mr(e,t,Io)}function vr(e,t){return Mt(t,(function(t){return Ya(e[t])}))}function Tr(e,t){for(var r=0,n=(t=mn(t,e)).length;null!=e&&r<n;)e=e[Os(t[r++])];return r&&r==n?e:i}function xr(e,t,i){var r=t(e);return Ba(e)?r:Rt(r,i(e))}function br(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in we(e)?function(e){var t=Pe.call(e,nt),r=e[nt];try{e[nt]=i;var n=!0}catch(e){}var s=Fe.call(e);return n&&(t?e[nt]=r:delete e[nt]),s}(e):function(e){return Fe.call(e)}(e)}function Er(e,t){return e>t}function _r(e,t){return null!=e&&Pe.call(e,t)}function wr(e,t){return null!=e&&t in we(e)}function Sr(e,t,r){for(var n=r?Dt:It,s=e[0].length,a=e.length,o=a,l=Te(a),h=1/0,u=[];o--;){var c=e[o];o&&t&&(c=At(c,Xt(t))),h=mi(c.length,h),l[o]=!r&&(t||s>=120&&c.length>=120)?new ji(o&&c):i}c=e[0];var p=-1,d=l[0];e:for(;++p<s&&u.length<h;){var f=c[p],m=t?t(f):f;if(f=r||0!==f?f:0,!(d?Zt(d,m):n(u,m,r))){for(o=a;--o;){var g=l[o];if(!(g?Zt(g,m):n(e[o],m,r)))continue e}d&&d.push(m),u.push(f)}}return u}function Mr(e,t,r){var n=null==(e=_s(e,t=mn(t,e)))?e:e[Os(Ws(t))];return null==n?i:bt(n,e,r)}function Ir(e){return Ja(e)&&br(e)==d}function Dr(e,t,r,n,s){return e===t||(null==e||null==t||!Ja(e)&&!Ja(t)?e!=e&&t!=t:function(e,t,r,n,s,a){var o=Ba(e),l=Ba(t),h=o?f:us(e),u=l?f:us(t),c=(h=h==d?E:h)==E,p=(u=u==d?E:u)==E,v=h==u;if(v&&Va(e)){if(!Va(t))return!1;o=!0,c=!1}if(v&&!c)return a||(a=new Wi),o||no(e)?Kn(e,t,r,n,s,a):function(e,t,i,r,n,s,a){switch(i){case R:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!s(new He(e),new He(t)));case m:case g:case b:return La(+e,+t);case y:return e.name==t.name&&e.message==t.message;case w:case M:return e==t+"";case x:var o=ii;case S:var l=1&r;if(o||(o=si),e.size!=t.size&&!l)return!1;var h=a.get(e);if(h)return h==t;r|=2,a.set(e,t);var u=Kn(o(e),o(t),r,n,s,a);return a.delete(e),u;case I:if(Ni)return Ni.call(e)==Ni.call(t)}return!1}(e,t,h,r,n,s,a);if(!(1&r)){var T=c&&Pe.call(e,"__wrapped__"),_=p&&Pe.call(t,"__wrapped__");if(T||_){var D=T?e.value():e,C=_?t.value():t;return a||(a=new Wi),s(D,C,r,n,a)}}return!!v&&(a||(a=new Wi),function(e,t,r,n,s,a){var o=1&r,l=Qn(e),h=l.length;if(h!=Qn(t).length&&!o)return!1;for(var u=h;u--;){var c=l[u];if(!(o?c in t:Pe.call(t,c)))return!1}var p=a.get(e),d=a.get(t);if(p&&d)return p==t&&d==e;var f=!0;a.set(e,t),a.set(t,e);for(var m=o;++u<h;){var g=e[c=l[u]],y=t[c];if(n)var v=o?n(y,g,c,t,e,a):n(g,y,c,e,t,a);if(!(v===i?g===y||s(g,y,r,n,a):v)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var T=e.constructor,x=t.constructor;T!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof T&&T instanceof T&&"function"==typeof x&&x instanceof x)&&(f=!1)}return a.delete(e),a.delete(t),f}(e,t,r,n,s,a))}(e,t,r,n,Dr,s))}function Ar(e,t,r,n){var s=r.length,a=s,o=!n;if(null==e)return!a;for(e=we(e);s--;){var l=r[s];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<a;){var h=(l=r[s])[0],u=e[h],c=l[1];if(o&&l[2]){if(u===i&&!(h in e))return!1}else{var p=new Wi;if(n)var d=n(u,c,h,e,t,p);if(!(d===i?Dr(c,u,3,n,p):d))return!1}}return!0}function Rr(e){return!(!Za(e)||function(e){return!!Le&&Le in e}(e))&&(Ya(e)?Be:de).test(Ps(e))}function Cr(e){return"function"==typeof e?e:null==e?Qo:"object"==typeof e?Ba(e)?Fr(e[0],e[1]):Lr(e):ll(e)}function Or(e){if(!Ts(e))return di(e);var t=[];for(var i in we(e))Pe.call(e,i)&&"constructor"!=i&&t.push(i);return t}function Pr(e,t){return e<t}function Nr(e,t){var i=-1,r=Ga(e)?Te(e.length):[];return lr(e,(function(e,n,s){r[++i]=t(e,n,s)})),r}function Lr(e){var t=as(e);return 1==t.length&&t[0][2]?bs(t[0][0],t[0][1]):function(i){return i===e||Ar(i,e,t)}}function Fr(e,t){return gs(e)&&xs(t)?bs(Os(e),t):function(r){var n=Eo(r,e);return n===i&&n===t?_o(r,e):Dr(t,n,3)}}function Ur(e,t,r,n,s){e!==t&&fr(t,(function(a,o){if(s||(s=new Wi),Za(a))!function(e,t,r,n,s,a,o){var l=ws(e,r),h=ws(t,r),u=o.get(h);if(u)Ji(e,r,u);else{var c=a?a(l,h,r+"",e,t,o):i,p=c===i;if(p){var d=Ba(h),f=!d&&Va(h),m=!d&&!f&&no(h);c=h,d||f||m?Ba(l)?c=l:Ha(l)?c=Sn(l):f?(p=!1,c=Tn(h,!0)):m?(p=!1,c=bn(h,!0)):c=[]:Qa(h)||ka(h)?(c=l,ka(l)?c=po(l):(!Za(l)||Ya(l))&&(c=ps(h))):p=!1}p&&(o.set(h,c),s(c,h,n,a,o),o.delete(h)),Ji(e,r,c)}}(e,t,o,r,Ur,n,s);else{var l=n?n(ws(e,o),a,o+"",e,t,s):i;l===i&&(l=a),Ji(e,o,l)}}),Do)}function kr(e,t){var r=e.length;if(r)return fs(t+=t<0?r:0,r)?e[t]:i}function Br(e,t,i){t=t.length?At(t,(function(e){return Ba(e)?function(t){return Tr(t,1===e.length?e[0]:e)}:e})):[Qo];var r=-1;return t=At(t,Xt(ns())),function(e,t){var i=e.length;for(e.sort(t);i--;)e[i]=e[i].value;return e}(Nr(e,(function(e,i,n){return{criteria:At(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,i){for(var r=-1,n=e.criteria,s=t.criteria,a=n.length,o=i.length;++r<a;){var l=En(n[r],s[r]);if(l)return r>=o?l:l*("desc"==i[r]?-1:1)}return e.index-t.index}(e,t,i)}))}function zr(e,t,i){for(var r=-1,n=t.length,s={};++r<n;){var a=t[r],o=Tr(e,a);i(o,a)&&qr(s,mn(a,e),o)}return s}function Gr(e,t,i,r){var n=r?kt:Ut,s=-1,a=t.length,o=e;for(e===t&&(t=Sn(t)),i&&(o=At(e,Xt(i)));++s<a;)for(var l=0,h=t[s],u=i?i(h):h;(l=n(o,u,l,r))>-1;)o!==e&&Xe.call(o,l,1),Xe.call(e,l,1);return e}function Hr(e,t){for(var i=e?t.length:0,r=i-1;i--;){var n=t[i];if(i==r||n!==s){var s=n;fs(n)?Xe.call(e,n,1):on(e,n)}}return e}function Vr(e,t){return e+ft(vi()*(t-e+1))}function jr(e,t){var i="";if(!e||t<1||t>h)return i;do{t%2&&(i+=e),(t=ft(t/2))&&(e+=e)}while(t);return i}function Wr(e,t){return Is(Es(e,t,Qo),e+"")}function Yr(e){return Xi(Fo(e))}function Xr(e,t){var i=Fo(e);return Rs(i,rr(t,0,i.length))}function qr(e,t,r,n){if(!Za(e))return e;for(var s=-1,a=(t=mn(t,e)).length,o=a-1,l=e;null!=l&&++s<a;){var h=Os(t[s]),u=r;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(s!=o){var c=l[h];(u=n?n(c,h,l):i)===i&&(u=Za(c)?c:fs(t[s+1])?[]:{})}Ki(l,h,u),l=l[h]}return e}var Zr=Mi?function(e,t){return Mi.set(e,t),e}:Qo,Jr=ot?function(e,t){return ot(e,"toString",{configurable:!0,enumerable:!1,value:Jo(t),writable:!0})}:Qo;function Kr(e){return Rs(Fo(e))}function $r(e,t,i){var r=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(i=i>n?n:i)<0&&(i+=n),n=t>i?0:i-t>>>0,t>>>=0;for(var s=Te(n);++r<n;)s[r]=e[r+t];return s}function Qr(e,t){var i;return lr(e,(function(e,r,n){return!(i=t(e,r,n))})),!!i}function en(e,t,i){var r=0,n=null==e?r:e.length;if("number"==typeof t&&t==t&&n<=2147483647){for(;r<n;){var s=r+n>>>1,a=e[s];null!==a&&!ro(a)&&(i?a<=t:a<t)?r=s+1:n=s}return n}return tn(e,t,Qo,i)}function tn(e,t,r,n){var s=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(t=r(t))!=t,l=null===t,h=ro(t),u=t===i;s<a;){var c=ft((s+a)/2),p=r(e[c]),d=p!==i,f=null===p,m=p==p,g=ro(p);if(o)var y=n||m;else y=u?m&&(n||d):l?m&&d&&(n||!f):h?m&&d&&!f&&(n||!g):!f&&!g&&(n?p<=t:p<t);y?s=c+1:a=c}return mi(a,4294967294)}function rn(e,t){for(var i=-1,r=e.length,n=0,s=[];++i<r;){var a=e[i],o=t?t(a):a;if(!i||!La(o,l)){var l=o;s[n++]=0===a?0:a}}return s}function nn(e){return"number"==typeof e?e:ro(e)?u:+e}function sn(e){if("string"==typeof e)return e;if(Ba(e))return At(e,sn)+"";if(ro(e))return Li?Li.call(e):"";var t=e+"";return"0"==t&&1/e==-l?"-0":t}function an(e,t,i){var r=-1,n=It,s=e.length,a=!0,o=[],l=o;if(i)a=!1,n=Dt;else if(s>=200){var h=t?null:Wn(e);if(h)return si(h);a=!1,n=Zt,l=new ji}else l=t?[]:o;e:for(;++r<s;){var u=e[r],c=t?t(u):u;if(u=i||0!==u?u:0,a&&c==c){for(var p=l.length;p--;)if(l[p]===c)continue e;t&&l.push(c),o.push(u)}else n(l,c,i)||(l!==o&&l.push(c),o.push(u))}return o}function on(e,t){return null==(e=_s(e,t=mn(t,e)))||delete e[Os(Ws(t))]}function ln(e,t,i,r){return qr(e,t,i(Tr(e,t)),r)}function hn(e,t,i,r){for(var n=e.length,s=r?n:-1;(r?s--:++s<n)&&t(e[s],s,e););return i?$r(e,r?0:s,r?s+1:n):$r(e,r?s+1:0,r?n:s)}function un(e,t){var i=e;return i instanceof zi&&(i=i.value()),Ct(t,(function(e,t){return t.func.apply(t.thisArg,Rt([e],t.args))}),i)}function cn(e,t,i){var r=e.length;if(r<2)return r?an(e[0]):[];for(var n=-1,s=Te(r);++n<r;)for(var a=e[n],o=-1;++o<r;)o!=n&&(s[n]=or(s[n]||a,e[o],t,i));return an(dr(s,1),t,i)}function pn(e,t,r){for(var n=-1,s=e.length,a=t.length,o={};++n<s;){var l=n<a?t[n]:i;r(o,e[n],l)}return o}function dn(e){return Ha(e)?e:[]}function fn(e){return"function"==typeof e?e:Qo}function mn(e,t){return Ba(e)?e:gs(e,t)?[e]:Cs(fo(e))}var gn=Wr;function yn(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:$r(e,t,r)}var vn=lt||function(e){return ht.clearTimeout(e)};function Tn(e,t){if(t)return e.slice();var i=e.length,r=Ve?Ve(i):new e.constructor(i);return e.copy(r),r}function xn(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function bn(e,t){var i=t?xn(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function En(e,t){if(e!==t){var r=e!==i,n=null===e,s=e==e,a=ro(e),o=t!==i,l=null===t,h=t==t,u=ro(t);if(!l&&!u&&!a&&e>t||a&&o&&h&&!l&&!u||n&&o&&h||!r&&h||!s)return 1;if(!n&&!a&&!u&&e<t||u&&r&&s&&!n&&!a||l&&r&&s||!o&&s||!h)return-1}return 0}function _n(e,t,i,r){for(var n=-1,s=e.length,a=i.length,o=-1,l=t.length,h=fi(s-a,0),u=Te(l+h),c=!r;++o<l;)u[o]=t[o];for(;++n<a;)(c||n<s)&&(u[i[n]]=e[n]);for(;h--;)u[o++]=e[n++];return u}function wn(e,t,i,r){for(var n=-1,s=e.length,a=-1,o=i.length,l=-1,h=t.length,u=fi(s-o,0),c=Te(u+h),p=!r;++n<u;)c[n]=e[n];for(var d=n;++l<h;)c[d+l]=t[l];for(;++a<o;)(p||n<s)&&(c[d+i[a]]=e[n++]);return c}function Sn(e,t){var i=-1,r=e.length;for(t||(t=Te(r));++i<r;)t[i]=e[i];return t}function Mn(e,t,r,n){var s=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var l=t[a],h=n?n(r[l],e[l],l,r,e):i;h===i&&(h=e[l]),s?tr(r,l,h):Ki(r,l,h)}return r}function In(e,t){return function(i,r){var n=Ba(i)?Et:Qi,s=t?t():{};return n(i,e,ns(r,2),s)}}function Dn(e){return Wr((function(t,r){var n=-1,s=r.length,a=s>1?r[s-1]:i,o=s>2?r[2]:i;for(a=e.length>3&&"function"==typeof a?(s--,a):i,o&&ms(r[0],r[1],o)&&(a=s<3?i:a,s=1),t=we(t);++n<s;){var l=r[n];l&&e(t,l,n,a)}return t}))}function An(e,t){return function(i,r){if(null==i)return i;if(!Ga(i))return e(i,r);for(var n=i.length,s=t?n:-1,a=we(i);(t?s--:++s<n)&&!1!==r(a[s],s,a););return i}}function Rn(e){return function(t,i,r){for(var n=-1,s=we(t),a=r(t),o=a.length;o--;){var l=a[e?o:++n];if(!1===i(s[l],l,s))break}return t}}function Cn(e){return function(t){var r=ti(t=fo(t))?oi(t):i,n=r?r[0]:t.charAt(0),s=r?yn(r,1).join(""):t.slice(1);return n[e]()+s}}function On(e){return function(t){return Ct(Xo(Bo(t).replace(qe,"")),e,"")}}function Pn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var i=Ui(e.prototype),r=e.apply(i,t);return Za(r)?r:i}}function Nn(e){return function(t,r,n){var s=we(t);if(!Ga(t)){var a=ns(r,3);t=Io(t),r=function(e){return a(s[e],e,s)}}var o=e(t,r,n);return o>-1?s[a?t[o]:o]:i}}function Ln(e){return $n((function(t){var n=t.length,s=n,a=Bi.prototype.thru;for(e&&t.reverse();s--;){var o=t[s];if("function"!=typeof o)throw new Ie(r);if(a&&!l&&"wrapper"==is(o))var l=new Bi([],!0)}for(s=l?s:n;++s<n;){var h=is(o=t[s]),u="wrapper"==h?ts(o):i;l=u&&ys(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[is(u[0])].apply(l,u[3]):1==o.length&&ys(o)?l[h]():l.thru(o)}return function(){var e=arguments,i=e[0];if(l&&1==e.length&&Ba(i))return l.plant(i).value();for(var r=0,s=n?t[r].apply(this,e):i;++r<n;)s=t[r].call(this,s);return s}}))}function Fn(e,t,r,n,s,a,l,h,u,c){var p=t&o,d=1&t,f=2&t,m=24&t,g=512&t,y=f?i:Pn(e);return function o(){for(var v=arguments.length,T=Te(v),x=v;x--;)T[x]=arguments[x];if(m)var b=rs(o),E=function(e,t){for(var i=e.length,r=0;i--;)e[i]===t&&++r;return r}(T,b);if(n&&(T=_n(T,n,s,m)),a&&(T=wn(T,a,l,m)),v-=E,m&&v<c){var _=ni(T,b);return Vn(e,t,Fn,o.placeholder,r,T,_,h,u,c-v)}var w=d?r:this,S=f?w[e]:e;return v=T.length,h?T=function(e,t){for(var r=e.length,n=mi(t.length,r),s=Sn(e);n--;){var a=t[n];e[n]=fs(a,r)?s[a]:i}return e}(T,h):g&&v>1&&T.reverse(),p&&u<v&&(T.length=u),this&&this!==ht&&this instanceof o&&(S=y||Pn(S)),S.apply(w,T)}}function Un(e,t){return function(i,r){return function(e,t,i,r){return gr(e,(function(e,n,s){t(r,i(e),n,s)})),r}(i,e,t(r),{})}}function kn(e,t){return function(r,n){var s;if(r===i&&n===i)return t;if(r!==i&&(s=r),n!==i){if(s===i)return n;"string"==typeof r||"string"==typeof n?(r=sn(r),n=sn(n)):(r=nn(r),n=nn(n)),s=e(r,n)}return s}}function Bn(e){return $n((function(t){return t=At(t,Xt(ns())),Wr((function(i){var r=this;return e(t,(function(e){return bt(e,r,i)}))}))}))}function zn(e,t){var r=(t=t===i?" ":sn(t)).length;if(r<2)return r?jr(t,e):t;var n=jr(t,dt(e/ai(t)));return ti(t)?yn(oi(n),0,e).join(""):n.slice(0,e)}function Gn(e){return function(t,r,n){return n&&"number"!=typeof n&&ms(t,r,n)&&(r=n=i),t=lo(t),r===i?(r=t,t=0):r=lo(r),function(e,t,i,r){for(var n=-1,s=fi(dt((t-e)/(i||1)),0),a=Te(s);s--;)a[r?s:++n]=e,e+=i;return a}(t,r,n=n===i?t<r?1:-1:lo(n),e)}}function Hn(e){return function(t,i){return"string"==typeof t&&"string"==typeof i||(t=co(t),i=co(i)),e(t,i)}}function Vn(e,t,r,n,s,o,l,h,u,c){var p=8&t;t|=p?a:64,4&(t&=~(p?64:a))||(t&=-4);var d=[e,t,s,p?o:i,p?l:i,p?i:o,p?i:l,h,u,c],f=r.apply(i,d);return ys(e)&&Ss(f,d),f.placeholder=n,Ds(f,e,t)}function jn(e){var t=_e[e];return function(e,i){if(e=co(e),(i=null==i?0:mi(ho(i),292))&&ci(e)){var r=(fo(e)+"e").split("e");return+((r=(fo(t(r[0]+"e"+(+r[1]+i)))+"e").split("e"))[0]+"e"+(+r[1]-i))}return t(e)}}var Wn=_i&&1/si(new _i([,-0]))[1]==l?function(e){return new _i(e)}:nl;function Yn(e){return function(t){var i=us(t);return i==x?ii(t):i==S?function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=[e,e]})),i}(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Xn(e,t,n,l,h,u,c,p){var d=2&t;if(!d&&"function"!=typeof e)throw new Ie(r);var f=l?l.length:0;if(f||(t&=-97,l=h=i),c=c===i?c:fi(ho(c),0),p=p===i?p:ho(p),f-=h?h.length:0,64&t){var m=l,g=h;l=h=i}var y=d?i:ts(e),v=[e,t,n,l,h,m,g,u,c,p];if(y&&function(e,t){var i=e[1],r=t[1],n=i|r,a=n<131,l=r==o&&8==i||r==o&&256==i&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==i;if(!a&&!l)return e;1&r&&(e[2]=t[2],n|=1&i?0:4);var h=t[3];if(h){var u=e[3];e[3]=u?_n(u,h,t[4]):h,e[4]=u?ni(e[3],s):t[4]}(h=t[5])&&(u=e[5],e[5]=u?wn(u,h,t[6]):h,e[6]=u?ni(e[5],s):t[6]),(h=t[7])&&(e[7]=h),r&o&&(e[8]=null==e[8]?t[8]:mi(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=n}(v,y),e=v[0],t=v[1],n=v[2],l=v[3],h=v[4],!(p=v[9]=v[9]===i?d?0:e.length:fi(v[9]-f,0))&&24&t&&(t&=-25),t&&1!=t)T=8==t||16==t?function(e,t,r){var n=Pn(e);return function s(){for(var a=arguments.length,o=Te(a),l=a,h=rs(s);l--;)o[l]=arguments[l];var u=a<3&&o[0]!==h&&o[a-1]!==h?[]:ni(o,h);return(a-=u.length)<r?Vn(e,t,Fn,s.placeholder,i,o,u,i,i,r-a):bt(this&&this!==ht&&this instanceof s?n:e,this,o)}}(e,t,p):t!=a&&33!=t||h.length?Fn.apply(i,v):function(e,t,i,r){var n=1&t,s=Pn(e);return function t(){for(var a=-1,o=arguments.length,l=-1,h=r.length,u=Te(h+o),c=this&&this!==ht&&this instanceof t?s:e;++l<h;)u[l]=r[l];for(;o--;)u[l++]=arguments[++a];return bt(c,n?i:this,u)}}(e,t,n,l);else var T=function(e,t,i){var r=1&t,n=Pn(e);return function t(){return(this&&this!==ht&&this instanceof t?n:e).apply(r?i:this,arguments)}}(e,t,n);return Ds((y?Zr:Ss)(T,v),e,t)}function qn(e,t,r,n){return e===i||La(e,Re[r])&&!Pe.call(n,r)?t:e}function Zn(e,t,r,n,s,a){return Za(e)&&Za(t)&&(a.set(t,e),Ur(e,t,i,Zn,a),a.delete(t)),e}function Jn(e){return Qa(e)?i:e}function Kn(e,t,r,n,s,a){var o=1&r,l=e.length,h=t.length;if(l!=h&&!(o&&h>l))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var p=-1,d=!0,f=2&r?new ji:i;for(a.set(e,t),a.set(t,e);++p<l;){var m=e[p],g=t[p];if(n)var y=o?n(g,m,p,t,e,a):n(m,g,p,e,t,a);if(y!==i){if(y)continue;d=!1;break}if(f){if(!Pt(t,(function(e,t){if(!Zt(f,t)&&(m===e||s(m,e,r,n,a)))return f.push(t)}))){d=!1;break}}else if(m!==g&&!s(m,g,r,n,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function $n(e){return Is(Es(e,i,zs),e+"")}function Qn(e){return xr(e,Io,ls)}function es(e){return xr(e,Do,hs)}var ts=Mi?function(e){return Mi.get(e)}:nl;function is(e){for(var t=e.name+"",i=Ii[t],r=Pe.call(Ii,t)?i.length:0;r--;){var n=i[r],s=n.func;if(null==s||s==e)return n.name}return t}function rs(e){return(Pe.call(Fi,"placeholder")?Fi:e).placeholder}function ns(){var e=Fi.iteratee||el;return e=e===el?Cr:e,arguments.length?e(arguments[0],arguments[1]):e}function ss(e,t){var i=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?i["string"==typeof t?"string":"hash"]:i.map}function as(e){for(var t=Io(e),i=t.length;i--;){var r=t[i],n=e[r];t[i]=[r,n,xs(n)]}return t}function os(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return Rr(r)?r:i}var ls=Nt?function(e){return null==e?[]:(e=we(e),Mt(Nt(e),(function(t){return Ye.call(e,t)})))}:cl,hs=Nt?function(e){for(var t=[];e;)Rt(t,ls(e)),e=je(e);return t}:cl,us=br;function cs(e,t,i){for(var r=-1,n=(t=mn(t,e)).length,s=!1;++r<n;){var a=Os(t[r]);if(!(s=null!=e&&i(e,a)))break;e=e[a]}return s||++r!=n?s:!!(n=null==e?0:e.length)&&qa(n)&&fs(a,n)&&(Ba(e)||ka(e))}function ps(e){return"function"!=typeof e.constructor||Ts(e)?{}:Ui(je(e))}function ds(e){return Ba(e)||ka(e)||!!(Je&&e&&e[Je])}function fs(e,t){var i=typeof e;return!!(t=null==t?h:t)&&("number"==i||"symbol"!=i&&me.test(e))&&e>-1&&e%1==0&&e<t}function ms(e,t,i){if(!Za(i))return!1;var r=typeof t;return!!("number"==r?Ga(i)&&fs(t,i.length):"string"==r&&t in i)&&La(i[t],e)}function gs(e,t){if(Ba(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!ro(e))||K.test(e)||!J.test(e)||null!=t&&e in we(t)}function ys(e){var t=is(e),i=Fi[t];if("function"!=typeof i||!(t in zi.prototype))return!1;if(e===i)return!0;var r=ts(i);return!!r&&e===r[0]}(xi&&us(new xi(new ArrayBuffer(1)))!=R||bi&&us(new bi)!=x||Ei&&us(Ei.resolve())!=_||_i&&us(new _i)!=S||wi&&us(new wi)!=D)&&(us=function(e){var t=br(e),r=t==E?e.constructor:i,n=r?Ps(r):"";if(n)switch(n){case Di:return R;case Ai:return x;case Ri:return _;case Ci:return S;case Oi:return D}return t});var vs=Ce?Ya:pl;function Ts(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Re)}function xs(e){return e==e&&!Za(e)}function bs(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in we(r))}}function Es(e,t,r){return t=fi(t===i?e.length-1:t,0),function(){for(var i=arguments,n=-1,s=fi(i.length-t,0),a=Te(s);++n<s;)a[n]=i[t+n];n=-1;for(var o=Te(t+1);++n<t;)o[n]=i[n];return o[t]=r(a),bt(e,this,o)}}function _s(e,t){return t.length<2?e:Tr(e,$r(t,0,-1))}function ws(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ss=As(Zr),Ms=ct||function(e,t){return ht.setTimeout(e,t)},Is=As(Jr);function Ds(e,t,i){var r=t+"";return Is(e,function(e,t){var i=t.length;if(!i)return e;var r=i-1;return t[r]=(i>1?"& ":"")+t[r],t=t.join(i>2?", ":" "),e.replace(re,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return _t(p,(function(i){var r="_."+i[0];t&i[1]&&!It(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ne);return t?t[1].split(se):[]}(r),i)))}function As(e){var t=0,r=0;return function(){var n=gi(),s=16-(n-r);if(r=n,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Rs(e,t){var r=-1,n=e.length,s=n-1;for(t=t===i?n:t;++r<t;){var a=Vr(r,s),o=e[a];e[a]=e[r],e[r]=o}return e.length=t,e}var Cs=function(e){var t=Aa((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($,(function(e,i,r,n){t.push(r?n.replace(le,"$1"):i||e)})),t}),(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}();function Os(e){if("string"==typeof e||ro(e))return e;var t=e+"";return"0"==t&&1/e==-l?"-0":t}function Ps(e){if(null!=e){try{return Oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ns(e){if(e instanceof zi)return e.clone();var t=new Bi(e.__wrapped__,e.__chain__);return t.__actions__=Sn(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ls=Wr((function(e,t){return Ha(e)?or(e,dr(t,1,Ha,!0)):[]})),Fs=Wr((function(e,t){var r=Ws(t);return Ha(r)&&(r=i),Ha(e)?or(e,dr(t,1,Ha,!0),ns(r,2)):[]})),Us=Wr((function(e,t){var r=Ws(t);return Ha(r)&&(r=i),Ha(e)?or(e,dr(t,1,Ha,!0),i,r):[]}));function ks(e,t,i){var r=null==e?0:e.length;if(!r)return-1;var n=null==i?0:ho(i);return n<0&&(n=fi(r+n,0)),Ft(e,ns(t,3),n)}function Bs(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var s=n-1;return r!==i&&(s=ho(r),s=r<0?fi(n+s,0):mi(s,n-1)),Ft(e,ns(t,3),s,!0)}function zs(e){return null!=e&&e.length?dr(e,1):[]}function Gs(e){return e&&e.length?e[0]:i}var Hs=Wr((function(e){var t=At(e,dn);return t.length&&t[0]===e[0]?Sr(t):[]})),Vs=Wr((function(e){var t=Ws(e),r=At(e,dn);return t===Ws(r)?t=i:r.pop(),r.length&&r[0]===e[0]?Sr(r,ns(t,2)):[]})),js=Wr((function(e){var t=Ws(e),r=At(e,dn);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?Sr(r,i,t):[]}));function Ws(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Ys=Wr(Xs);function Xs(e,t){return e&&e.length&&t&&t.length?Gr(e,t):e}var qs=$n((function(e,t){var i=null==e?0:e.length,r=ir(e,t);return Hr(e,At(t,(function(e){return fs(e,i)?+e:e})).sort(En)),r}));function Zs(e){return null==e?e:Ti.call(e)}var Js=Wr((function(e){return an(dr(e,1,Ha,!0))})),Ks=Wr((function(e){var t=Ws(e);return Ha(t)&&(t=i),an(dr(e,1,Ha,!0),ns(t,2))})),$s=Wr((function(e){var t=Ws(e);return t="function"==typeof t?t:i,an(dr(e,1,Ha,!0),i,t)}));function Qs(e){if(!e||!e.length)return[];var t=0;return e=Mt(e,(function(e){if(Ha(e))return t=fi(e.length,t),!0})),Wt(t,(function(t){return At(e,Gt(t))}))}function ea(e,t){if(!e||!e.length)return[];var r=Qs(e);return null==t?r:At(r,(function(e){return bt(t,i,e)}))}var ta=Wr((function(e,t){return Ha(e)?or(e,t):[]})),ia=Wr((function(e){return cn(Mt(e,Ha))})),ra=Wr((function(e){var t=Ws(e);return Ha(t)&&(t=i),cn(Mt(e,Ha),ns(t,2))})),na=Wr((function(e){var t=Ws(e);return t="function"==typeof t?t:i,cn(Mt(e,Ha),i,t)})),sa=Wr(Qs),aa=Wr((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,ea(e,r)}));function oa(e){var t=Fi(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var ha=$n((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,s=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&n instanceof zi&&fs(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:la,args:[s],thisArg:i}),new Bi(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(s)})),ua=In((function(e,t,i){Pe.call(e,i)?++e[i]:tr(e,i,1)})),ca=Nn(ks),pa=Nn(Bs);function da(e,t){return(Ba(e)?_t:lr)(e,ns(t,3))}function fa(e,t){return(Ba(e)?wt:hr)(e,ns(t,3))}var ma=In((function(e,t,i){Pe.call(e,i)?e[i].push(t):tr(e,i,[t])})),ga=Wr((function(e,t,i){var r=-1,n="function"==typeof t,s=Ga(e)?Te(e.length):[];return lr(e,(function(e){s[++r]=n?bt(t,e,i):Mr(e,t,i)})),s})),ya=In((function(e,t,i){tr(e,i,t)}));function va(e,t){return(Ba(e)?At:Nr)(e,ns(t,3))}var Ta=In((function(e,t,i){e[i?0:1].push(t)}),(function(){return[[],[]]})),xa=Wr((function(e,t){if(null==e)return[];var i=t.length;return i>1&&ms(e,t[0],t[1])?t=[]:i>2&&ms(t[0],t[1],t[2])&&(t=[t[0]]),Br(e,dr(t,1),[])})),ba=ut||function(){return ht.Date.now()};function Ea(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Xn(e,o,i,i,i,i,t)}function _a(e,t){var n;if("function"!=typeof t)throw new Ie(r);return e=ho(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var wa=Wr((function(e,t,i){var r=1;if(i.length){var n=ni(i,rs(wa));r|=a}return Xn(e,r,t,i,n)})),Sa=Wr((function(e,t,i){var r=3;if(i.length){var n=ni(i,rs(Sa));r|=a}return Xn(t,r,e,i,n)}));function Ma(e,t,n){var s,a,o,l,h,u,c=0,p=!1,d=!1,f=!0;if("function"!=typeof e)throw new Ie(r);function m(t){var r=s,n=a;return s=a=i,c=t,l=e.apply(n,r)}function g(e){var r=e-u;return u===i||r>=t||r<0||d&&e-c>=o}function y(){var e=ba();if(g(e))return v(e);h=Ms(y,function(e){var i=t-(e-u);return d?mi(i,o-(e-c)):i}(e))}function v(e){return h=i,f&&s?m(e):(s=a=i,l)}function T(){var e=ba(),r=g(e);if(s=arguments,a=this,u=e,r){if(h===i)return function(e){return c=e,h=Ms(y,t),p?m(e):l}(u);if(d)return vn(h),h=Ms(y,t),m(u)}return h===i&&(h=Ms(y,t)),l}return t=co(t)||0,Za(n)&&(p=!!n.leading,o=(d="maxWait"in n)?fi(co(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),T.cancel=function(){h!==i&&vn(h),c=0,s=u=a=h=i},T.flush=function(){return h===i?l:v(ba())},T}var Ia=Wr((function(e,t){return ar(e,1,t)})),Da=Wr((function(e,t,i){return ar(e,co(t)||0,i)}));function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(r);var i=function(){var r=arguments,n=t?t.apply(this,r):r[0],s=i.cache;if(s.has(n))return s.get(n);var a=e.apply(this,r);return i.cache=s.set(n,a)||s,a};return i.cache=new(Aa.Cache||Vi),i}function Ra(e){if("function"!=typeof e)throw new Ie(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=Vi;var Ca=gn((function(e,t){var i=(t=1==t.length&&Ba(t[0])?At(t[0],Xt(ns())):At(dr(t,1),Xt(ns()))).length;return Wr((function(r){for(var n=-1,s=mi(r.length,i);++n<s;)r[n]=t[n].call(this,r[n]);return bt(e,this,r)}))})),Oa=Wr((function(e,t){var r=ni(t,rs(Oa));return Xn(e,a,i,t,r)})),Pa=Wr((function(e,t){var r=ni(t,rs(Pa));return Xn(e,64,i,t,r)})),Na=$n((function(e,t){return Xn(e,256,i,i,i,t)}));function La(e,t){return e===t||e!=e&&t!=t}var Fa=Hn(Er),Ua=Hn((function(e,t){return e>=t})),ka=Ir(function(){return arguments}())?Ir:function(e){return Ja(e)&&Pe.call(e,"callee")&&!Ye.call(e,"callee")},Ba=Te.isArray,za=mt?Xt(mt):function(e){return Ja(e)&&br(e)==A};function Ga(e){return null!=e&&qa(e.length)&&!Ya(e)}function Ha(e){return Ja(e)&&Ga(e)}var Va=Ht||pl,ja=gt?Xt(gt):function(e){return Ja(e)&&br(e)==g};function Wa(e){if(!Ja(e))return!1;var t=br(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Qa(e)}function Ya(e){if(!Za(e))return!1;var t=br(e);return t==v||t==T||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==ho(e)}function qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function Za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ja(e){return null!=e&&"object"==typeof e}var Ka=yt?Xt(yt):function(e){return Ja(e)&&us(e)==x};function $a(e){return"number"==typeof e||Ja(e)&&br(e)==b}function Qa(e){if(!Ja(e)||br(e)!=E)return!1;var t=je(e);if(null===t)return!0;var i=Pe.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Oe.call(i)==Ue}var eo=vt?Xt(vt):function(e){return Ja(e)&&br(e)==w},to=Tt?Xt(Tt):function(e){return Ja(e)&&us(e)==S};function io(e){return"string"==typeof e||!Ba(e)&&Ja(e)&&br(e)==M}function ro(e){return"symbol"==typeof e||Ja(e)&&br(e)==I}var no=xt?Xt(xt):function(e){return Ja(e)&&qa(e.length)&&!!it[br(e)]},so=Hn(Pr),ao=Hn((function(e,t){return e<=t}));function oo(e){if(!e)return[];if(Ga(e))return io(e)?oi(e):Sn(e);if($e&&e[$e])return function(e){for(var t,i=[];!(t=e.next()).done;)i.push(t.value);return i}(e[$e]());var t=us(e);return(t==x?ii:t==S?si:Fo)(e)}function lo(e){return e?(e=co(e))===l||e===-l?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ho(e){var t=lo(e),i=t%1;return t==t?i?t-i:t:0}function uo(e){return e?rr(ho(e),0,c):0}function co(e){if("number"==typeof e)return e;if(ro(e))return u;if(Za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var i=pe.test(e);return i||fe.test(e)?at(e.slice(2),i?2:8):ce.test(e)?u:+e}function po(e){return Mn(e,Do(e))}function fo(e){return null==e?"":sn(e)}var mo=Dn((function(e,t){if(Ts(t)||Ga(t))Mn(t,Io(t),e);else for(var i in t)Pe.call(t,i)&&Ki(e,i,t[i])})),go=Dn((function(e,t){Mn(t,Do(t),e)})),yo=Dn((function(e,t,i,r){Mn(t,Do(t),e,r)})),vo=Dn((function(e,t,i,r){Mn(t,Io(t),e,r)})),To=$n(ir),xo=Wr((function(e,t){e=we(e);var r=-1,n=t.length,s=n>2?t[2]:i;for(s&&ms(t[0],t[1],s)&&(n=1);++r<n;)for(var a=t[r],o=Do(a),l=-1,h=o.length;++l<h;){var u=o[l],c=e[u];(c===i||La(c,Re[u])&&!Pe.call(e,u))&&(e[u]=a[u])}return e})),bo=Wr((function(e){return e.push(i,Zn),bt(Ro,i,e)}));function Eo(e,t,r){var n=null==e?i:Tr(e,t);return n===i?r:n}function _o(e,t){return null!=e&&cs(e,t,wr)}var wo=Un((function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),e[t]=i}),Jo(Qo)),So=Un((function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),Pe.call(e,t)?e[t].push(i):e[t]=[i]}),ns),Mo=Wr(Mr);function Io(e){return Ga(e)?Yi(e):Or(e)}function Do(e){return Ga(e)?Yi(e,!0):function(e){if(!Za(e))return function(e){var t=[];if(null!=e)for(var i in we(e))t.push(i);return t}(e);var t=Ts(e),i=[];for(var r in e)"constructor"==r&&(t||!Pe.call(e,r))||i.push(r);return i}(e)}var Ao=Dn((function(e,t,i){Ur(e,t,i)})),Ro=Dn((function(e,t,i,r){Ur(e,t,i,r)})),Co=$n((function(e,t){var i={};if(null==e)return i;var r=!1;t=At(t,(function(t){return t=mn(t,e),r||(r=t.length>1),t})),Mn(e,es(e),i),r&&(i=nr(i,7,Jn));for(var n=t.length;n--;)on(i,t[n]);return i})),Oo=$n((function(e,t){return null==e?{}:function(e,t){return zr(e,t,(function(t,i){return _o(e,i)}))}(e,t)}));function Po(e,t){if(null==e)return{};var i=At(es(e),(function(e){return[e]}));return t=ns(t),zr(e,i,(function(e,i){return t(e,i[0])}))}var No=Yn(Io),Lo=Yn(Do);function Fo(e){return null==e?[]:qt(e,Io(e))}var Uo=On((function(e,t,i){return t=t.toLowerCase(),e+(i?ko(t):t)}));function ko(e){return Yo(fo(e).toLowerCase())}function Bo(e){return(e=fo(e))&&e.replace(ge,$t).replace(Ze,"")}var zo=On((function(e,t,i){return e+(i?"-":"")+t.toLowerCase()})),Go=On((function(e,t,i){return e+(i?" ":"")+t.toLowerCase()})),Ho=Cn("toLowerCase"),Vo=On((function(e,t,i){return e+(i?"_":"")+t.toLowerCase()})),jo=On((function(e,t,i){return e+(i?" ":"")+Yo(t)})),Wo=On((function(e,t,i){return e+(i?" ":"")+t.toUpperCase()})),Yo=Cn("toUpperCase");function Xo(e,t,r){return e=fo(e),(t=r?i:t)===i?function(e){return Qe.test(e)}(e)?function(e){return e.match(Ke)||[]}(e):function(e){return e.match(ae)||[]}(e):e.match(t)||[]}var qo=Wr((function(e,t){try{return bt(e,i,t)}catch(e){return Wa(e)?e:new be(e)}})),Zo=$n((function(e,t){return _t(t,(function(t){t=Os(t),tr(e,t,wa(e[t],e))})),e}));function Jo(e){return function(){return e}}var Ko=Ln(),$o=Ln(!0);function Qo(e){return e}function el(e){return Cr("function"==typeof e?e:nr(e,1))}var tl=Wr((function(e,t){return function(i){return Mr(i,e,t)}})),il=Wr((function(e,t){return function(i){return Mr(e,i,t)}}));function rl(e,t,i){var r=Io(t),n=vr(t,r);null==i&&(!Za(t)||!n.length&&r.length)&&(i=t,t=e,e=this,n=vr(t,Io(t)));var s=!(Za(i)&&"chain"in i&&!i.chain),a=Ya(e);return _t(n,(function(i){var r=t[i];e[i]=r,a&&(e.prototype[i]=function(){var t=this.__chain__;if(s||t){var i=e(this.__wrapped__);return(i.__actions__=Sn(this.__actions__)).push({func:r,args:arguments,thisArg:e}),i.__chain__=t,i}return r.apply(e,Rt([this.value()],arguments))})})),e}function nl(){}var sl=Bn(At),al=Bn(St),ol=Bn(Pt);function ll(e){return gs(e)?Gt(Os(e)):function(e){return function(t){return Tr(t,e)}}(e)}var hl=Gn(),ul=Gn(!0);function cl(){return[]}function pl(){return!1}var dl=kn((function(e,t){return e+t}),0),fl=jn("ceil"),ml=kn((function(e,t){return e/t}),1),gl=jn("floor"),yl=kn((function(e,t){return e*t}),1),vl=jn("round"),Tl=kn((function(e,t){return e-t}),0);return Fi.after=function(e,t){if("function"!=typeof t)throw new Ie(r);return e=ho(e),function(){if(--e<1)return t.apply(this,arguments)}},Fi.ary=Ea,Fi.assign=mo,Fi.assignIn=go,Fi.assignInWith=yo,Fi.assignWith=vo,Fi.at=To,Fi.before=_a,Fi.bind=wa,Fi.bindAll=Zo,Fi.bindKey=Sa,Fi.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ba(e)?e:[e]},Fi.chain=oa,Fi.chunk=function(e,t,r){t=(r?ms(e,t,r):t===i)?1:fi(ho(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var s=0,a=0,o=Te(dt(n/t));s<n;)o[a++]=$r(e,s,s+=t);return o},Fi.compact=function(e){for(var t=-1,i=null==e?0:e.length,r=0,n=[];++t<i;){var s=e[t];s&&(n[r++]=s)}return n},Fi.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Te(e-1),i=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Rt(Ba(i)?Sn(i):[i],dr(t,1))},Fi.cond=function(e){var t=null==e?0:e.length,i=ns();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new Ie(r);return[i(e[0]),e[1]]})):[],Wr((function(i){for(var r=-1;++r<t;){var n=e[r];if(bt(n[0],this,i))return bt(n[1],this,i)}}))},Fi.conforms=function(e){return function(e){var t=Io(e);return function(i){return sr(i,e,t)}}(nr(e,1))},Fi.constant=Jo,Fi.countBy=ua,Fi.create=function(e,t){var i=Ui(e);return null==t?i:er(i,t)},Fi.curry=function e(t,r,n){var s=Xn(t,8,i,i,i,i,i,r=n?i:r);return s.placeholder=e.placeholder,s},Fi.curryRight=function e(t,r,n){var s=Xn(t,16,i,i,i,i,i,r=n?i:r);return s.placeholder=e.placeholder,s},Fi.debounce=Ma,Fi.defaults=xo,Fi.defaultsDeep=bo,Fi.defer=Ia,Fi.delay=Da,Fi.difference=Ls,Fi.differenceBy=Fs,Fi.differenceWith=Us,Fi.drop=function(e,t,r){var n=null==e?0:e.length;return n?$r(e,(t=r||t===i?1:ho(t))<0?0:t,n):[]},Fi.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?$r(e,0,(t=n-(t=r||t===i?1:ho(t)))<0?0:t):[]},Fi.dropRightWhile=function(e,t){return e&&e.length?hn(e,ns(t,3),!0,!0):[]},Fi.dropWhile=function(e,t){return e&&e.length?hn(e,ns(t,3),!0):[]},Fi.fill=function(e,t,r,n){var s=null==e?0:e.length;return s?(r&&"number"!=typeof r&&ms(e,t,r)&&(r=0,n=s),function(e,t,r,n){var s=e.length;for((r=ho(r))<0&&(r=-r>s?0:s+r),(n=n===i||n>s?s:ho(n))<0&&(n+=s),n=r>n?0:uo(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Fi.filter=function(e,t){return(Ba(e)?Mt:pr)(e,ns(t,3))},Fi.flatMap=function(e,t){return dr(va(e,t),1)},Fi.flatMapDeep=function(e,t){return dr(va(e,t),l)},Fi.flatMapDepth=function(e,t,r){return r=r===i?1:ho(r),dr(va(e,t),r)},Fi.flatten=zs,Fi.flattenDeep=function(e){return null!=e&&e.length?dr(e,l):[]},Fi.flattenDepth=function(e,t){return null!=e&&e.length?dr(e,t=t===i?1:ho(t)):[]},Fi.flip=function(e){return Xn(e,512)},Fi.flow=Ko,Fi.flowRight=$o,Fi.fromPairs=function(e){for(var t=-1,i=null==e?0:e.length,r={};++t<i;){var n=e[t];r[n[0]]=n[1]}return r},Fi.functions=function(e){return null==e?[]:vr(e,Io(e))},Fi.functionsIn=function(e){return null==e?[]:vr(e,Do(e))},Fi.groupBy=ma,Fi.initial=function(e){return null!=e&&e.length?$r(e,0,-1):[]},Fi.intersection=Hs,Fi.intersectionBy=Vs,Fi.intersectionWith=js,Fi.invert=wo,Fi.invertBy=So,Fi.invokeMap=ga,Fi.iteratee=el,Fi.keyBy=ya,Fi.keys=Io,Fi.keysIn=Do,Fi.map=va,Fi.mapKeys=function(e,t){var i={};return t=ns(t,3),gr(e,(function(e,r,n){tr(i,t(e,r,n),e)})),i},Fi.mapValues=function(e,t){var i={};return t=ns(t,3),gr(e,(function(e,r,n){tr(i,r,t(e,r,n))})),i},Fi.matches=function(e){return Lr(nr(e,1))},Fi.matchesProperty=function(e,t){return Fr(e,nr(t,1))},Fi.memoize=Aa,Fi.merge=Ao,Fi.mergeWith=Ro,Fi.method=tl,Fi.methodOf=il,Fi.mixin=rl,Fi.negate=Ra,Fi.nthArg=function(e){return e=ho(e),Wr((function(t){return kr(t,e)}))},Fi.omit=Co,Fi.omitBy=function(e,t){return Po(e,Ra(ns(t)))},Fi.once=function(e){return _a(2,e)},Fi.orderBy=function(e,t,r,n){return null==e?[]:(Ba(t)||(t=null==t?[]:[t]),Ba(r=n?i:r)||(r=null==r?[]:[r]),Br(e,t,r))},Fi.over=sl,Fi.overArgs=Ca,Fi.overEvery=al,Fi.overSome=ol,Fi.partial=Oa,Fi.partialRight=Pa,Fi.partition=Ta,Fi.pick=Oo,Fi.pickBy=Po,Fi.property=ll,Fi.propertyOf=function(e){return function(t){return null==e?i:Tr(e,t)}},Fi.pull=Ys,Fi.pullAll=Xs,Fi.pullAllBy=function(e,t,i){return e&&e.length&&t&&t.length?Gr(e,t,ns(i,2)):e},Fi.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Gr(e,t,i,r):e},Fi.pullAt=qs,Fi.range=hl,Fi.rangeRight=ul,Fi.rearg=Na,Fi.reject=function(e,t){return(Ba(e)?Mt:pr)(e,Ra(ns(t,3)))},Fi.remove=function(e,t){var i=[];if(!e||!e.length)return i;var r=-1,n=[],s=e.length;for(t=ns(t,3);++r<s;){var a=e[r];t(a,r,e)&&(i.push(a),n.push(r))}return Hr(e,n),i},Fi.rest=function(e,t){if("function"!=typeof e)throw new Ie(r);return Wr(e,t=t===i?t:ho(t))},Fi.reverse=Zs,Fi.sampleSize=function(e,t,r){return t=(r?ms(e,t,r):t===i)?1:ho(t),(Ba(e)?qi:Xr)(e,t)},Fi.set=function(e,t,i){return null==e?e:qr(e,t,i)},Fi.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:qr(e,t,r,n)},Fi.shuffle=function(e){return(Ba(e)?Zi:Kr)(e)},Fi.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&ms(e,t,r)?(t=0,r=n):(t=null==t?0:ho(t),r=r===i?n:ho(r)),$r(e,t,r)):[]},Fi.sortBy=xa,Fi.sortedUniq=function(e){return e&&e.length?rn(e):[]},Fi.sortedUniqBy=function(e,t){return e&&e.length?rn(e,ns(t,2)):[]},Fi.split=function(e,t,r){return r&&"number"!=typeof r&&ms(e,t,r)&&(t=r=i),(r=r===i?c:r>>>0)?(e=fo(e))&&("string"==typeof t||null!=t&&!eo(t))&&!(t=sn(t))&&ti(e)?yn(oi(e),0,r):e.split(t,r):[]},Fi.spread=function(e,t){if("function"!=typeof e)throw new Ie(r);return t=null==t?0:fi(ho(t),0),Wr((function(i){var r=i[t],n=yn(i,0,t);return r&&Rt(n,r),bt(e,this,n)}))},Fi.tail=function(e){var t=null==e?0:e.length;return t?$r(e,1,t):[]},Fi.take=function(e,t,r){return e&&e.length?$r(e,0,(t=r||t===i?1:ho(t))<0?0:t):[]},Fi.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?$r(e,(t=n-(t=r||t===i?1:ho(t)))<0?0:t,n):[]},Fi.takeRightWhile=function(e,t){return e&&e.length?hn(e,ns(t,3),!1,!0):[]},Fi.takeWhile=function(e,t){return e&&e.length?hn(e,ns(t,3)):[]},Fi.tap=function(e,t){return t(e),e},Fi.throttle=function(e,t,i){var n=!0,s=!0;if("function"!=typeof e)throw new Ie(r);return Za(i)&&(n="leading"in i?!!i.leading:n,s="trailing"in i?!!i.trailing:s),Ma(e,t,{leading:n,maxWait:t,trailing:s})},Fi.thru=la,Fi.toArray=oo,Fi.toPairs=No,Fi.toPairsIn=Lo,Fi.toPath=function(e){return Ba(e)?At(e,Os):ro(e)?[e]:Sn(Cs(fo(e)))},Fi.toPlainObject=po,Fi.transform=function(e,t,i){var r=Ba(e),n=r||Va(e)||no(e);if(t=ns(t,4),null==i){var s=e&&e.constructor;i=n?r?new s:[]:Za(e)&&Ya(s)?Ui(je(e)):{}}return(n?_t:gr)(e,(function(e,r,n){return t(i,e,r,n)})),i},Fi.unary=function(e){return Ea(e,1)},Fi.union=Js,Fi.unionBy=Ks,Fi.unionWith=$s,Fi.uniq=function(e){return e&&e.length?an(e):[]},Fi.uniqBy=function(e,t){return e&&e.length?an(e,ns(t,2)):[]},Fi.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?an(e,i,t):[]},Fi.unset=function(e,t){return null==e||on(e,t)},Fi.unzip=Qs,Fi.unzipWith=ea,Fi.update=function(e,t,i){return null==e?e:ln(e,t,fn(i))},Fi.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ln(e,t,fn(r),n)},Fi.values=Fo,Fi.valuesIn=function(e){return null==e?[]:qt(e,Do(e))},Fi.without=ta,Fi.words=Xo,Fi.wrap=function(e,t){return Oa(fn(t),e)},Fi.xor=ia,Fi.xorBy=ra,Fi.xorWith=na,Fi.zip=sa,Fi.zipObject=function(e,t){return pn(e||[],t||[],Ki)},Fi.zipObjectDeep=function(e,t){return pn(e||[],t||[],qr)},Fi.zipWith=aa,Fi.entries=No,Fi.entriesIn=Lo,Fi.extend=go,Fi.extendWith=yo,rl(Fi,Fi),Fi.add=dl,Fi.attempt=qo,Fi.camelCase=Uo,Fi.capitalize=ko,Fi.ceil=fl,Fi.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=co(r))==r?r:0),t!==i&&(t=(t=co(t))==t?t:0),rr(co(e),t,r)},Fi.clone=function(e){return nr(e,4)},Fi.cloneDeep=function(e){return nr(e,5)},Fi.cloneDeepWith=function(e,t){return nr(e,5,t="function"==typeof t?t:i)},Fi.cloneWith=function(e,t){return nr(e,4,t="function"==typeof t?t:i)},Fi.conformsTo=function(e,t){return null==t||sr(e,t,Io(t))},Fi.deburr=Bo,Fi.defaultTo=function(e,t){return null==e||e!=e?t:e},Fi.divide=ml,Fi.endsWith=function(e,t,r){e=fo(e),t=sn(t);var n=e.length,s=r=r===i?n:rr(ho(r),0,n);return(r-=t.length)>=0&&e.slice(r,s)==t},Fi.eq=La,Fi.escape=function(e){return(e=fo(e))&&Y.test(e)?e.replace(j,Qt):e},Fi.escapeRegExp=function(e){return(e=fo(e))&&ee.test(e)?e.replace(Q,"\\$&"):e},Fi.every=function(e,t,r){var n=Ba(e)?St:ur;return r&&ms(e,t,r)&&(t=i),n(e,ns(t,3))},Fi.find=ca,Fi.findIndex=ks,Fi.findKey=function(e,t){return Lt(e,ns(t,3),gr)},Fi.findLast=pa,Fi.findLastIndex=Bs,Fi.findLastKey=function(e,t){return Lt(e,ns(t,3),yr)},Fi.floor=gl,Fi.forEach=da,Fi.forEachRight=fa,Fi.forIn=function(e,t){return null==e?e:fr(e,ns(t,3),Do)},Fi.forInRight=function(e,t){return null==e?e:mr(e,ns(t,3),Do)},Fi.forOwn=function(e,t){return e&&gr(e,ns(t,3))},Fi.forOwnRight=function(e,t){return e&&yr(e,ns(t,3))},Fi.get=Eo,Fi.gt=Fa,Fi.gte=Ua,Fi.has=function(e,t){return null!=e&&cs(e,t,_r)},Fi.hasIn=_o,Fi.head=Gs,Fi.identity=Qo,Fi.includes=function(e,t,i,r){e=Ga(e)?e:Fo(e),i=i&&!r?ho(i):0;var n=e.length;return i<0&&(i=fi(n+i,0)),io(e)?i<=n&&e.indexOf(t,i)>-1:!!n&&Ut(e,t,i)>-1},Fi.indexOf=function(e,t,i){var r=null==e?0:e.length;if(!r)return-1;var n=null==i?0:ho(i);return n<0&&(n=fi(r+n,0)),Ut(e,t,n)},Fi.inRange=function(e,t,r){return t=lo(t),r===i?(r=t,t=0):r=lo(r),function(e,t,i){return e>=mi(t,i)&&e<fi(t,i)}(e=co(e),t,r)},Fi.invoke=Mo,Fi.isArguments=ka,Fi.isArray=Ba,Fi.isArrayBuffer=za,Fi.isArrayLike=Ga,Fi.isArrayLikeObject=Ha,Fi.isBoolean=function(e){return!0===e||!1===e||Ja(e)&&br(e)==m},Fi.isBuffer=Va,Fi.isDate=ja,Fi.isElement=function(e){return Ja(e)&&1===e.nodeType&&!Qa(e)},Fi.isEmpty=function(e){if(null==e)return!0;if(Ga(e)&&(Ba(e)||"string"==typeof e||"function"==typeof e.splice||Va(e)||no(e)||ka(e)))return!e.length;var t=us(e);if(t==x||t==S)return!e.size;if(Ts(e))return!Or(e).length;for(var i in e)if(Pe.call(e,i))return!1;return!0},Fi.isEqual=function(e,t){return Dr(e,t)},Fi.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Dr(e,t,i,r):!!n},Fi.isError=Wa,Fi.isFinite=function(e){return"number"==typeof e&&ci(e)},Fi.isFunction=Ya,Fi.isInteger=Xa,Fi.isLength=qa,Fi.isMap=Ka,Fi.isMatch=function(e,t){return e===t||Ar(e,t,as(t))},Fi.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,Ar(e,t,as(t),r)},Fi.isNaN=function(e){return $a(e)&&e!=+e},Fi.isNative=function(e){if(vs(e))throw new be("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(e)},Fi.isNil=function(e){return null==e},Fi.isNull=function(e){return null===e},Fi.isNumber=$a,Fi.isObject=Za,Fi.isObjectLike=Ja,Fi.isPlainObject=Qa,Fi.isRegExp=eo,Fi.isSafeInteger=function(e){return Xa(e)&&e>=-h&&e<=h},Fi.isSet=to,Fi.isString=io,Fi.isSymbol=ro,Fi.isTypedArray=no,Fi.isUndefined=function(e){return e===i},Fi.isWeakMap=function(e){return Ja(e)&&us(e)==D},Fi.isWeakSet=function(e){return Ja(e)&&"[object WeakSet]"==br(e)},Fi.join=function(e,t){return null==e?"":pi.call(e,t)},Fi.kebabCase=zo,Fi.last=Ws,Fi.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var s=n;return r!==i&&(s=(s=ho(r))<0?fi(n+s,0):mi(s,n-1)),t==t?function(e,t,i){for(var r=i+1;r--;)if(e[r]===t)return r;return r}(e,t,s):Ft(e,Bt,s,!0)},Fi.lowerCase=Go,Fi.lowerFirst=Ho,Fi.lt=so,Fi.lte=ao,Fi.max=function(e){return e&&e.length?cr(e,Qo,Er):i},Fi.maxBy=function(e,t){return e&&e.length?cr(e,ns(t,2),Er):i},Fi.mean=function(e){return zt(e,Qo)},Fi.meanBy=function(e,t){return zt(e,ns(t,2))},Fi.min=function(e){return e&&e.length?cr(e,Qo,Pr):i},Fi.minBy=function(e,t){return e&&e.length?cr(e,ns(t,2),Pr):i},Fi.stubArray=cl,Fi.stubFalse=pl,Fi.stubObject=function(){return{}},Fi.stubString=function(){return""},Fi.stubTrue=function(){return!0},Fi.multiply=yl,Fi.nth=function(e,t){return e&&e.length?kr(e,ho(t)):i},Fi.noConflict=function(){return ht._===this&&(ht._=ke),this},Fi.noop=nl,Fi.now=ba,Fi.pad=function(e,t,i){e=fo(e);var r=(t=ho(t))?ai(e):0;if(!t||r>=t)return e;var n=(t-r)/2;return zn(ft(n),i)+e+zn(dt(n),i)},Fi.padEnd=function(e,t,i){e=fo(e);var r=(t=ho(t))?ai(e):0;return t&&r<t?e+zn(t-r,i):e},Fi.padStart=function(e,t,i){e=fo(e);var r=(t=ho(t))?ai(e):0;return t&&r<t?zn(t-r,i)+e:e},Fi.parseInt=function(e,t,i){return i||null==t?t=0:t&&(t=+t),yi(fo(e).replace(te,""),t||0)},Fi.random=function(e,t,r){if(r&&"boolean"!=typeof r&&ms(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=lo(e),t===i?(t=e,e=0):t=lo(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var s=vi();return mi(e+s*(t-e+st("1e-"+((s+"").length-1))),t)}return Vr(e,t)},Fi.reduce=function(e,t,i){var r=Ba(e)?Ct:Vt,n=arguments.length<3;return r(e,ns(t,4),i,n,lr)},Fi.reduceRight=function(e,t,i){var r=Ba(e)?Ot:Vt,n=arguments.length<3;return r(e,ns(t,4),i,n,hr)},Fi.repeat=function(e,t,r){return t=(r?ms(e,t,r):t===i)?1:ho(t),jr(fo(e),t)},Fi.replace=function(){var e=arguments,t=fo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fi.result=function(e,t,r){var n=-1,s=(t=mn(t,e)).length;for(s||(s=1,e=i);++n<s;){var a=null==e?i:e[Os(t[n])];a===i&&(n=s,a=r),e=Ya(a)?a.call(e):a}return e},Fi.round=vl,Fi.runInContext=e,Fi.sample=function(e){return(Ba(e)?Xi:Yr)(e)},Fi.size=function(e){if(null==e)return 0;if(Ga(e))return io(e)?ai(e):e.length;var t=us(e);return t==x||t==S?e.size:Or(e).length},Fi.snakeCase=Vo,Fi.some=function(e,t,r){var n=Ba(e)?Pt:Qr;return r&&ms(e,t,r)&&(t=i),n(e,ns(t,3))},Fi.sortedIndex=function(e,t){return en(e,t)},Fi.sortedIndexBy=function(e,t,i){return tn(e,t,ns(i,2))},Fi.sortedIndexOf=function(e,t){var i=null==e?0:e.length;if(i){var r=en(e,t);if(r<i&&La(e[r],t))return r}return-1},Fi.sortedLastIndex=function(e,t){return en(e,t,!0)},Fi.sortedLastIndexBy=function(e,t,i){return tn(e,t,ns(i,2),!0)},Fi.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var i=en(e,t,!0)-1;if(La(e[i],t))return i}return-1},Fi.startCase=jo,Fi.startsWith=function(e,t,i){return e=fo(e),i=null==i?0:rr(ho(i),0,e.length),t=sn(t),e.slice(i,i+t.length)==t},Fi.subtract=Tl,Fi.sum=function(e){return e&&e.length?jt(e,Qo):0},Fi.sumBy=function(e,t){return e&&e.length?jt(e,ns(t,2)):0},Fi.template=function(e,t,r){var n=Fi.templateSettings;r&&ms(e,t,r)&&(t=i),e=fo(e),t=yo({},t,n,qn);var s,a,o=yo({},t.imports,n.imports,qn),l=Io(o),h=qt(o,l),u=0,c=t.interpolate||ye,p="__p += '",d=Se((t.escape||ye).source+"|"+c.source+"|"+(c===Z?he:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),f="//# sourceURL="+(Pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tt+"]")+"\n";e.replace(d,(function(t,i,r,n,o,l){return r||(r=n),p+=e.slice(u,l).replace(ve,ei),i&&(s=!0,p+="' +\n__e("+i+") +\n'"),o&&(a=!0,p+="';\n"+o+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),p+="';\n";var m=Pe.call(t,"variable")&&t.variable;if(m){if(oe.test(m))throw new be("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(a?p.replace(z,""):p).replace(G,"$1").replace(H,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=qo((function(){return Ee(l,f+"return "+p).apply(i,h)}));if(g.source=p,Wa(g))throw g;return g},Fi.times=function(e,t){if((e=ho(e))<1||e>h)return[];var i=c,r=mi(e,c);t=ns(t),e-=c;for(var n=Wt(r,t);++i<e;)t(i);return n},Fi.toFinite=lo,Fi.toInteger=ho,Fi.toLength=uo,Fi.toLower=function(e){return fo(e).toLowerCase()},Fi.toNumber=co,Fi.toSafeInteger=function(e){return e?rr(ho(e),-h,h):0===e?e:0},Fi.toString=fo,Fi.toUpper=function(e){return fo(e).toUpperCase()},Fi.trim=function(e,t,r){if((e=fo(e))&&(r||t===i))return Yt(e);if(!e||!(t=sn(t)))return e;var n=oi(e),s=oi(t);return yn(n,Jt(n,s),Kt(n,s)+1).join("")},Fi.trimEnd=function(e,t,r){if((e=fo(e))&&(r||t===i))return e.slice(0,li(e)+1);if(!e||!(t=sn(t)))return e;var n=oi(e);return yn(n,0,Kt(n,oi(t))+1).join("")},Fi.trimStart=function(e,t,r){if((e=fo(e))&&(r||t===i))return e.replace(te,"");if(!e||!(t=sn(t)))return e;var n=oi(e);return yn(n,Jt(n,oi(t))).join("")},Fi.truncate=function(e,t){var r=30,n="...";if(Za(t)){var s="separator"in t?t.separator:s;r="length"in t?ho(t.length):r,n="omission"in t?sn(t.omission):n}var a=(e=fo(e)).length;if(ti(e)){var o=oi(e);a=o.length}if(r>=a)return e;var l=r-ai(n);if(l<1)return n;var h=o?yn(o,0,l).join(""):e.slice(0,l);if(s===i)return h+n;if(o&&(l+=h.length-l),eo(s)){if(e.slice(l).search(s)){var u,c=h;for(s.global||(s=Se(s.source,fo(ue.exec(s))+"g")),s.lastIndex=0;u=s.exec(c);)var p=u.index;h=h.slice(0,p===i?l:p)}}else if(e.indexOf(sn(s),l)!=l){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+n},Fi.unescape=function(e){return(e=fo(e))&&W.test(e)?e.replace(V,hi):e},Fi.uniqueId=function(e){var t=++Ne;return fo(e)+t},Fi.upperCase=Wo,Fi.upperFirst=Yo,Fi.each=da,Fi.eachRight=fa,Fi.first=Gs,rl(Fi,function(){var e={};return gr(Fi,(function(t,i){Pe.call(Fi.prototype,i)||(e[i]=t)})),e}(),{chain:!1}),Fi.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Fi[e].placeholder=Fi})),_t(["drop","take"],(function(e,t){zi.prototype[e]=function(r){r=r===i?1:fi(ho(r),0);var n=this.__filtered__&&!t?new zi(this):this.clone();return n.__filtered__?n.__takeCount__=mi(r,n.__takeCount__):n.__views__.push({size:mi(r,c),type:e+(n.__dir__<0?"Right":"")}),n},zi.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),_t(["filter","map","takeWhile"],(function(e,t){var i=t+1,r=1==i||3==i;zi.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ns(e,3),type:i}),t.__filtered__=t.__filtered__||r,t}})),_t(["head","last"],(function(e,t){var i="take"+(t?"Right":"");zi.prototype[e]=function(){return this[i](1).value()[0]}})),_t(["initial","tail"],(function(e,t){var i="drop"+(t?"":"Right");zi.prototype[e]=function(){return this.__filtered__?new zi(this):this[i](1)}})),zi.prototype.compact=function(){return this.filter(Qo)},zi.prototype.find=function(e){return this.filter(e).head()},zi.prototype.findLast=function(e){return this.reverse().find(e)},zi.prototype.invokeMap=Wr((function(e,t){return"function"==typeof e?new zi(this):this.map((function(i){return Mr(i,e,t)}))})),zi.prototype.reject=function(e){return this.filter(Ra(ns(e)))},zi.prototype.slice=function(e,t){e=ho(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zi(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=ho(t))<0?r.dropRight(-t):r.take(t-e)),r)},zi.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zi.prototype.toArray=function(){return this.take(c)},gr(zi.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),s=Fi[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);s&&(Fi.prototype[t]=function(){var t=this.__wrapped__,o=n?[1]:arguments,l=t instanceof zi,h=o[0],u=l||Ba(t),c=function(e){var t=s.apply(Fi,Rt([e],o));return n&&p?t[0]:t};u&&r&&"function"==typeof h&&1!=h.length&&(l=u=!1);var p=this.__chain__,d=!!this.__actions__.length,f=a&&!p,m=l&&!d;if(!a&&u){t=m?t:new zi(this);var g=e.apply(t,o);return g.__actions__.push({func:la,args:[c],thisArg:i}),new Bi(g,p)}return f&&m?e.apply(this,o):(g=this.thru(c),f?n?g.value()[0]:g.value():g)})})),_t(["pop","push","shift","sort","splice","unshift"],(function(e){var t=De[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Fi.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var n=this.value();return t.apply(Ba(n)?n:[],e)}return this[i]((function(i){return t.apply(Ba(i)?i:[],e)}))}})),gr(zi.prototype,(function(e,t){var i=Fi[t];if(i){var r=i.name+"";Pe.call(Ii,r)||(Ii[r]=[]),Ii[r].push({name:t,func:i})}})),Ii[Fn(i,2).name]=[{name:"wrapper",func:i}],zi.prototype.clone=function(){var e=new zi(this.__wrapped__);return e.__actions__=Sn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Sn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Sn(this.__views__),e},zi.prototype.reverse=function(){if(this.__filtered__){var e=new zi(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zi.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,i=Ba(e),r=t<0,n=i?e.length:0,s=function(e,t,i){for(var r=-1,n=i.length;++r<n;){var s=i[r],a=s.size;switch(s.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=mi(t,e+a);break;case"takeRight":e=fi(e,t-a)}}return{start:e,end:t}}(0,n,this.__views__),a=s.start,o=s.end,l=o-a,h=r?o:a-1,u=this.__iteratees__,c=u.length,p=0,d=mi(l,this.__takeCount__);if(!i||!r&&n==l&&d==l)return un(e,this.__actions__);var f=[];e:for(;l--&&p<d;){for(var m=-1,g=e[h+=t];++m<c;){var y=u[m],v=y.iteratee,T=y.type,x=v(g);if(2==T)g=x;else if(!x){if(1==T)continue e;break e}}f[p++]=g}return f},Fi.prototype.at=ha,Fi.prototype.chain=function(){return oa(this)},Fi.prototype.commit=function(){return new Bi(this.value(),this.__chain__)},Fi.prototype.next=function(){this.__values__===i&&(this.__values__=oo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Fi.prototype.plant=function(e){for(var t,r=this;r instanceof ki;){var n=Ns(r);n.__index__=0,n.__values__=i,t?s.__wrapped__=n:t=n;var s=n;r=r.__wrapped__}return s.__wrapped__=e,t},Fi.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zi){var t=e;return this.__actions__.length&&(t=new zi(this)),(t=t.reverse()).__actions__.push({func:la,args:[Zs],thisArg:i}),new Bi(t,this.__chain__)}return this.thru(Zs)},Fi.prototype.toJSON=Fi.prototype.valueOf=Fi.prototype.value=function(){return un(this.__wrapped__,this.__actions__)},Fi.prototype.first=Fi.prototype.head,$e&&(Fi.prototype[$e]=function(){return this}),Fi}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ht._=ui,define((function(){return ui}))):ct?((ct.exports=ui)._=ui,ut._=ui):ht._=ui}).call(e)})),Zfe=z(((e,t)=>{var i,r;i=e,r=function(){"use strict";function e(e,r,n,s,a){!function e(i,r,n,s,a){for(;s>n;){if(s-n>600){var o=s-n+1,l=r-n+1,h=Math.log(o),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(o-u)/o)*(l-o/2<0?-1:1);e(i,r,Math.max(n,Math.floor(r-l*u/o+c)),Math.min(s,Math.floor(r+(o-l)*u/o+c)),a)}var p=i[r],d=n,f=s;for(t(i,n,r),a(i[s],p)>0&&t(i,n,s);d<f;){for(t(i,d,f),d++,f--;a(i[d],p)<0;)d++;for(;a(i[f],p)>0;)f--}0===a(i[n],p)?t(i,n,f):t(i,++f,s),f<=r&&(n=f+1),r<=f&&(s=f-1)}}(e,r,n||0,s||e.length-1,a||i)}function t(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function i(e,t){return e<t?-1:e>t?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function s(e,t){a(e,0,e.children.length,t,e)}function a(e,t,i,r,n){n||(n=f(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var s=t;s<i;s++){var a=e.children[s];o(n,e.leaf?r(a):a)}return n}function o(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function l(e,t){return e.minX-t.minX}function h(e,t){return e.minY-t.minY}function u(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function c(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function d(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function f(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,i,r,n,s){for(var a=[i,r];a.length;)if(!((r=a.pop())-(i=a.pop())<=n)){var o=i+Math.ceil((r-i)/n/2)*n;e(t,o,i,r,s),a.push(i,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,i=[];if(!d(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var s=0;s<t.children.length;s++){var a=t.children[s],o=t.leaf?r(a):a;d(e,o)&&(t.leaf?i.push(a):p(e,o)?this._all(a,i):n.push(a))}t=n.pop()}return i},r.prototype.collides=function(e){var t=this.data;if(!d(e,t))return!1;for(var i=[];t;){for(var r=0;r<t.children.length;r++){var n=t.children[r],s=t.leaf?this.toBBox(n):n;if(d(e,s)){if(t.leaf||p(e,s))return!0;i.push(n)}}t=i.pop()}return!1},r.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},r.prototype.clear=function(){return this.data=f([]),this},r.prototype.remove=function(e,t){if(!e)return this;for(var i,r,s,a=this.data,o=this.toBBox(e),l=[],h=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],i=h.pop(),s=!0),a.leaf){var u=n(e,a.children,t);if(-1!==u)return a.children.splice(u,1),l.push(a),this._condense(l),this}s||a.leaf||!p(a,o)?r?(i++,a=r.children[i],s=!1):a=null:(l.push(a),h.push(i),i=0,r=a,a=a.children[0])}return this},r.prototype.toBBox=function(e){return e},r.prototype.compareMinX=function(e,t){return e.minX-t.minX},r.prototype.compareMinY=function(e,t){return e.minY-t.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(e){return this.data=e,this},r.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},r.prototype._build=function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return s(n=f(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=f([])).leaf=!1,n.height=r;var l=Math.ceil(a/o),h=l*Math.ceil(Math.sqrt(o));m(e,t,i,h,this.compareMinX);for(var u=t;u<=i;u+=h){var c=Math.min(u+h-1,i);m(e,u,c,l,this.compareMinY);for(var p=u;p<=c;p+=l){var d=Math.min(p+l-1,c);n.children.push(this._build(e,p,d,r-1))}}return s(n,this.toBBox),n},r.prototype._chooseSubtree=function(e,t,i,r){for(;r.push(t),!t.leaf&&r.length-1!==i;){for(var n=1/0,s=1/0,a=void 0,o=0;o<t.children.length;o++){var l=t.children[o],h=u(l),c=(p=e,d=l,(Math.max(d.maxX,p.maxX)-Math.min(d.minX,p.minX))*(Math.max(d.maxY,p.maxY)-Math.min(d.minY,p.minY))-h);c<s?(s=c,n=h<n?h:n,a=l):c===s&&h<n&&(n=h,a=l)}t=a||t.children[0]}var p,d;return t},r.prototype._insert=function(e,t,i){var r=i?e:this.toBBox(e),n=[],s=this._chooseSubtree(r,this.data,t,n);for(s.children.push(e),o(s,r);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},r.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=f(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,s(i,this.toBBox),s(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},r.prototype._splitRoot=function(e,t){this.data=f([e,t]),this.data.height=e.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,i){for(var r,n,s,o,l,h,c,p=1/0,d=1/0,f=t;f<=i-t;f++){var m=a(e,0,f,this.toBBox),g=a(e,f,i,this.toBBox),y=(n=m,s=g,o=Math.max(n.minX,s.minX),l=Math.max(n.minY,s.minY),h=Math.min(n.maxX,s.maxX),c=Math.min(n.maxY,s.maxY),Math.max(0,h-o)*Math.max(0,c-l)),v=u(m)+u(g);y<p?(p=y,r=f,d=v<d?v:d):y===p&&v<d&&(d=v,r=f)}return r||i-t},r.prototype._chooseSplitAxis=function(e,t,i){var r=e.leaf?this.compareMinX:l,n=e.leaf?this.compareMinY:h;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},r.prototype._allDistMargin=function(e,t,i,r){e.children.sort(r);for(var n=this.toBBox,s=a(e,0,t,n),l=a(e,i-t,i,n),h=c(s)+c(l),u=t;u<i-t;u++){var p=e.children[u];o(s,e.leaf?n(p):p),h+=c(s)}for(var d=i-t-1;d>=t;d--){var f=e.children[d];o(l,e.leaf?n(f):f),h+=c(l)}return h},r.prototype._adjustParentBBoxes=function(e,t,i){for(var r=i;r>=0;r--)o(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():s(e[t],this.toBBox)},r},"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(i=i||self).RBush=r()})),Kfe=z(((e,t)=>{var i,r;i=e,r=function(){"use strict";var e=function(e,i){if(void 0===e&&(e=[]),void 0===i&&(i=t),this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function t(e,t){return e<t?-1:e>t?1:0}return e.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(e){for(var t=this.data,i=this.compare,r=t[e];e>0;){var n=e-1>>1,s=t[n];if(i(r,s)>=0)break;t[e]=s,e=n}t[e]=r},e.prototype._down=function(e){for(var t=this.data,i=this.compare,r=this.length>>1,n=t[e];e<r;){var s=1+(e<<1),a=t[s],o=s+1;if(o<this.length&&i(t[o],a)<0&&(s=o,a=t[o]),i(a,n)>=0)break;t[e]=a,e=s}t[e]=n},e},"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(i=i||self).TinyQueue=r()})),Qfe=z(((e,t)=>{t.exports=function(e,t,i,r){var n=e[0],s=e[1],a=!1;void 0===i&&(i=0),void 0===r&&(r=t.length);for(var o=(r-i)/2,l=0,h=o-1;l<o;h=l++){var u=t[i+2*l+0],c=t[i+2*l+1],p=t[i+2*h+0],d=t[i+2*h+1];c>s!=d>s&&n<(p-u)*(s-c)/(d-c)+u&&(a=!a)}return a}})),tme=z(((e,t)=>{t.exports=function(e,t,i,r){var n=e[0],s=e[1],a=!1;void 0===i&&(i=0),void 0===r&&(r=t.length);for(var o=r-i,l=0,h=o-1;l<o;h=l++){var u=t[l+i][0],c=t[l+i][1],p=t[h+i][0],d=t[h+i][1];c>s!=d>s&&n<(p-u)*(s-c)/(d-c)+u&&(a=!a)}return a}})),nme=z(((e,t)=>{var i=Qfe(),r=tme();t.exports=function(e,t,n,s){return t.length>0&&Array.isArray(t[0])?r(e,t,n,s):i(e,t,n,s)},t.exports.nested=r,t.exports.flat=i})),ame=z(((e,t)=>{var i,r;i=e,r=function(e){"use strict";function t(e,t,i,r,n){let s,a,o,l,h=t[0],u=r[0],c=0,p=0;u>h==u>-h?(s=h,h=t[++c]):(s=u,u=r[++p]);let d=0;if(c<e&&p<i)for(u>h==u>-h?(o=s-((a=h+s)-h),h=t[++c]):(o=s-((a=u+s)-u),u=r[++p]),s=a,0!==o&&(n[d++]=o);c<e&&p<i;)u>h==u>-h?(o=s-((a=s+h)-(l=a-s))+(h-l),h=t[++c]):(o=s-((a=s+u)-(l=a-s))+(u-l),u=r[++p]),s=a,0!==o&&(n[d++]=o);for(;c<e;)o=s-((a=s+h)-(l=a-s))+(h-l),h=t[++c],s=a,0!==o&&(n[d++]=o);for(;p<i;)o=s-((a=s+u)-(l=a-s))+(u-l),u=r[++p],s=a,0!==o&&(n[d++]=o);return 0===s&&0!==d||(n[d++]=s),d}function i(e){return new Float64Array(e)}let r=i(4),n=i(8),s=i(12),a=i(16),o=i(4);e.orient2d=function(e,i,l,h,u,c){let p=(i-c)*(l-u),d=(e-u)*(h-c),f=p-d;if(0===p||0===d||p>0!=d>0)return f;let m=Math.abs(p+d);return Math.abs(f)>=33306690738754716e-32*m?f:-function(e,i,l,h,u,c,p){let d,f,m,g,y,v,T,x,b,E,_,w,S,M,I,D,A,R,C=e-u,O=l-u,P=i-c,N=h-c;y=(I=(x=C-(T=(v=134217729*C)-(v-C)))*(E=N-(b=(v=134217729*N)-(v-N)))-((M=C*N)-T*b-x*b-T*E))-(_=I-(A=(x=P-(T=(v=134217729*P)-(v-P)))*(E=O-(b=(v=134217729*O)-(v-O)))-((D=P*O)-T*b-x*b-T*E))),r[0]=I-(_+y)+(y-A),y=(S=M-((w=M+_)-(y=w-M))+(_-y))-(_=S-D),r[1]=S-(_+y)+(y-D),y=(R=w+_)-w,r[2]=w-(R-y)+(_-y),r[3]=R;let L=function(e,t){let i=t[0];for(let r=1;r<4;r++)i+=t[r];return i}(0,r),F=22204460492503146e-32*p;if(L>=F||-L>=F||(d=e-(C+(y=e-C))+(y-u),m=l-(O+(y=l-O))+(y-u),f=i-(P+(y=i-P))+(y-c),g=h-(N+(y=h-N))+(y-c),0===d&&0===f&&0===m&&0===g)||(F=11093356479670487e-47*p+33306690738754706e-32*Math.abs(L),(L+=C*g+N*d-(P*m+O*f))>=F||-L>=F))return L;y=(I=(x=d-(T=(v=134217729*d)-(v-d)))*(E=N-(b=(v=134217729*N)-(v-N)))-((M=d*N)-T*b-x*b-T*E))-(_=I-(A=(x=f-(T=(v=134217729*f)-(v-f)))*(E=O-(b=(v=134217729*O)-(v-O)))-((D=f*O)-T*b-x*b-T*E))),o[0]=I-(_+y)+(y-A),y=(S=M-((w=M+_)-(y=w-M))+(_-y))-(_=S-D),o[1]=S-(_+y)+(y-D),y=(R=w+_)-w,o[2]=w-(R-y)+(_-y),o[3]=R;let U=t(4,r,4,o,n);y=(I=(x=C-(T=(v=134217729*C)-(v-C)))*(E=g-(b=(v=134217729*g)-(v-g)))-((M=C*g)-T*b-x*b-T*E))-(_=I-(A=(x=P-(T=(v=134217729*P)-(v-P)))*(E=m-(b=(v=134217729*m)-(v-m)))-((D=P*m)-T*b-x*b-T*E))),o[0]=I-(_+y)+(y-A),y=(S=M-((w=M+_)-(y=w-M))+(_-y))-(_=S-D),o[1]=S-(_+y)+(y-D),y=(R=w+_)-w,o[2]=w-(R-y)+(_-y),o[3]=R;let k=t(U,n,4,o,s);y=(I=(x=d-(T=(v=134217729*d)-(v-d)))*(E=g-(b=(v=134217729*g)-(v-g)))-((M=d*g)-T*b-x*b-T*E))-(_=I-(A=(x=f-(T=(v=134217729*f)-(v-f)))*(E=m-(b=(v=134217729*m)-(v-m)))-((D=f*m)-T*b-x*b-T*E))),o[0]=I-(_+y)+(y-A),y=(S=M-((w=M+_)-(y=w-M))+(_-y))-(_=S-D),o[1]=S-(_+y)+(y-D),y=(R=w+_)-w,o[2]=w-(R-y)+(_-y),o[3]=R;let B=t(k,s,4,o,a);return a[B-1]}(e,i,l,h,u,c,m)},e.orient2dfast=function(e,t,i,r,n,s){return(t-s)*(i-n)-(e-n)*(r-s)},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?r(e):"function"==typeof define&&define.amd?define(["exports"],r):r((i=i||self).predicates={})})),pme=z(((e,t)=>{"use strict";var i=Zfe(),r=Kfe(),n=nme(),s=ame().orient2d;function a(e,t,r){t=Math.max(0,void 0===t?2:t),r=r||0;var s=function(e){for(var t=e[0],i=e[0],r=e[0],s=e[0],a=0;a<e.length;a++){var o=e[a];o[0]<t[0]&&(t=o),o[0]>r[0]&&(r=o),o[1]<i[1]&&(i=o),o[1]>s[1]&&(s=o)}var l=[t,i,r,s],h=l.slice();for(a=0;a<e.length;a++)n(e[a],l)||h.push(e[a]);return function(e){e.sort(T);for(var t=[],i=0;i<e.length;i++){for(;t.length>=2&&p(t[t.length-2],t[t.length-1],e[i])<=0;)t.pop();t.push(e[i])}for(var r=[],n=e.length-1;n>=0;n--){for(;r.length>=2&&p(r[r.length-2],r[r.length-1],e[n])<=0;)r.pop();r.push(e[n])}return r.pop(),t.pop(),t.concat(r)}(h)}(e),a=new i(16);a.toBBox=function(e){return{minX:e[0],minY:e[1],maxX:e[0],maxY:e[1]}},a.compareMinX=function(e,t){return e[0]-t[0]},a.compareMinY=function(e,t){return e[1]-t[1]},a.load(e);for(var l,h=[],u=0;u<s.length;u++){var c=s[u];a.remove(c),l=m(c,l),h.push(l)}var d=new i(16);for(u=0;u<h.length;u++)d.insert(f(h[u]));for(var y=t*t,v=r*r;h.length;){var x=h.shift(),b=x.p,E=x.next.p,_=g(b,E);if(!(_<v)){var w=_/y;(c=o(a,x.prev.p,b,E,x.next.next.p,w,d))&&Math.min(g(c,b),g(c,E))<=w&&(h.push(x),h.push(m(c,x)),a.remove(c),d.remove(x),d.insert(f(x)),d.insert(f(x.next)))}}x=l;var S=[];do{S.push(x.p),x=x.next}while(x!==l);return S.push(x.p),S}function o(e,t,i,n,s,a,o){for(var u=new r([],l),p=e.data;p;){for(var d=0;d<p.children.length;d++){var f=p.children[d],m=p.leaf?y(f,i,n):h(i,n,f);m>a||u.push({node:f,dist:m})}for(;u.length&&!u.peek().node.children;){var g=u.pop(),v=g.node,T=y(v,t,i),x=y(v,n,s);if(g.dist<T&&g.dist<x&&c(i,v,o)&&c(n,v,o))return v}(p=u.pop())&&(p=p.node)}return null}function l(e,t){return e.dist-t.dist}function h(e,t,i){if(u(e,i)||u(t,i))return 0;var r=v(e[0],e[1],t[0],t[1],i.minX,i.minY,i.maxX,i.minY);if(0===r)return 0;var n=v(e[0],e[1],t[0],t[1],i.minX,i.minY,i.minX,i.maxY);if(0===n)return 0;var s=v(e[0],e[1],t[0],t[1],i.maxX,i.minY,i.maxX,i.maxY);if(0===s)return 0;var a=v(e[0],e[1],t[0],t[1],i.minX,i.maxY,i.maxX,i.maxY);return 0===a?0:Math.min(r,n,s,a)}function u(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function c(e,t,i){for(var r=Math.min(e[0],t[0]),n=Math.min(e[1],t[1]),s=Math.max(e[0],t[0]),a=Math.max(e[1],t[1]),o=i.search({minX:r,minY:n,maxX:s,maxY:a}),l=0;l<o.length;l++)if(d(o[l].p,o[l].next.p,e,t))return!1;return!0}function p(e,t,i){return s(e[0],e[1],t[0],t[1],i[0],i[1])}function d(e,t,i,r){return e!==r&&t!==i&&p(e,t,i)>0!=p(e,t,r)>0&&p(i,r,e)>0!=p(i,r,t)>0}function f(e){var t=e.p,i=e.next.p;return e.minX=Math.min(t[0],i[0]),e.minY=Math.min(t[1],i[1]),e.maxX=Math.max(t[0],i[0]),e.maxY=Math.max(t[1],i[1]),e}function m(e,t){var i={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(i.next=t.next,i.prev=t,t.next.prev=i,t.next=i):(i.prev=i,i.next=i),i}function g(e,t){var i=e[0]-t[0],r=e[1]-t[1];return i*i+r*r}function y(e,t,i){var r=t[0],n=t[1],s=i[0]-r,a=i[1]-n;if(0!==s||0!==a){var o=((e[0]-r)*s+(e[1]-n)*a)/(s*s+a*a);o>1?(r=i[0],n=i[1]):o>0&&(r+=s*o,n+=a*o)}return(s=e[0]-r)*s+(a=e[1]-n)*a}function v(e,t,i,r,n,s,a,o){var l,h,u,c,p=i-e,d=r-t,f=a-n,m=o-s,g=e-n,y=t-s,v=p*p+d*d,T=p*f+d*m,x=f*f+m*m,b=p*g+d*y,E=f*g+m*y,_=v*x-T*T,w=_,S=_;0===_?(h=0,w=1,c=E,S=x):(c=v*E-T*b,(h=T*E-x*b)<0?(h=0,c=E,S=x):h>w&&(h=w,c=E+T,S=x)),c<0?(c=0,-b<0?h=0:-b>v?h=w:(h=-b,w=v)):c>S&&(c=S,-b+T<0?h=0:-b+T>v?h=w:(h=-b+T,w=v));var M=(1-(u=0===c?0:c/S))*n+u*a-((1-(l=0===h?0:h/w))*e+l*i),I=(1-u)*s+u*o-((1-l)*t+l*r);return M*M+I*I}function T(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}r.default&&(r=r.default),t.exports=a,t.exports.default=a})),Pme=z(((e,t)=>{t.exports=function(){var e,t=0,i=!1;function r(t,i){return e.list.push({type:t,data:i?JSON.parse(JSON.stringify(i)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return r("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return r("div_seg",{seg:e,pt:t}),r("chop",{seg:e,pt:t})},statusRemove:function(e){return r("pop_seg",{seg:e})},segmentUpdate:function(e){return r("seg_update",{seg:e})},segmentNew:function(e,t){return r("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return r("rem_seg",{seg:e})},tempStatus:function(e,t,i){return r("temp_status",{seg:e,above:t,below:i})},rewind:function(e){return r("rewind",{seg:e})},status:function(e,t,i){return r("status",{seg:e,above:t,below:i})},vert:function(t){return t===i?e:(i=t,r("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),r("log",{txt:e})},reset:function(){return r("reset")},selected:function(e){return r("selected",{segs:e})},chainStart:function(e){return r("chain_start",{seg:e})},chainRemoveHead:function(e,t){return r("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return r("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return r("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return r("chain_match",{index:e})},chainClose:function(e){return r("chain_close",{index:e})},chainAddHead:function(e,t){return r("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return r("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return r("chain_con",{index1:e,index2:t})},chainReverse:function(e){return r("chain_rev",{index:e})},chainJoin:function(e,t){return r("chain_join",{index1:e,index2:t})},done:function(){return r("done")}}}})),Lme=z(((e,t)=>{t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,i,r){var n=i[0],s=i[1],a=r[0],o=r[1],l=t[0];return(a-n)*(t[1]-s)-(o-s)*(l-n)>=-e},pointBetween:function(t,i,r){var n=t[1]-i[1],s=r[0]-i[0],a=t[0]-i[0],o=r[1]-i[1],l=a*s+n*o;return!(l<e)&&!(l-(s*s+o*o)>-e)},pointsSameX:function(t,i){return Math.abs(t[0]-i[0])<e},pointsSameY:function(t,i){return Math.abs(t[1]-i[1])<e},pointsSame:function(e,i){return t.pointsSameX(e,i)&&t.pointsSameY(e,i)},pointsCompare:function(e,i){return t.pointsSameX(e,i)?t.pointsSameY(e,i)?0:e[1]<i[1]?-1:1:e[0]<i[0]?-1:1},pointsCollinear:function(t,i,r){var n=t[0]-i[0],s=t[1]-i[1],a=i[0]-r[0],o=i[1]-r[1];return Math.abs(n*o-a*s)<e},linesIntersect:function(t,i,r,n){var s=i[0]-t[0],a=i[1]-t[1],o=n[0]-r[0],l=n[1]-r[1],h=s*l-a*o;if(Math.abs(h)<e)return!1;var u=t[0]-r[0],c=t[1]-r[1],p=(o*c-l*u)/h,d=(s*c-a*u)/h,f={alongA:0,alongB:0,pt:[t[0]+p*s,t[1]+p*a]};return f.alongA=p<=-e?-2:p<e?-1:p-1<=-e?0:p-1<e?1:2,f.alongB=d<=-e?-2:d<e?-1:d-1<=-e?0:d-1<e?1:2,f},pointInsideRegion:function(t,i){for(var r=t[0],n=t[1],s=i[i.length-1][0],a=i[i.length-1][1],o=!1,l=0;l<i.length;l++){var h=i[l][0],u=i[l][1];u-n>e!=a-n>e&&(s-h)*(n-u)/(a-u)+h-r>e&&(o=!o),s=h,a=u}return o}};return t}})),Hme=z(((e,t)=>{t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return!(null===t||t===e.root)},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,i){for(var r=e.root,n=e.root.next;null!==n;){if(i(n))return t.prev=n.prev,t.next=n,n.prev.next=t,void(n.prev=t);r=n,n=n.next}r.next=t,t.prev=r,t.next=null},findTransition:function(t){for(var i=e.root,r=e.root.next;null!==r&&!t(r);)i=r,r=r.next;return{before:i===e.root?null:i,after:r,insert:function(e){return e.prev=i,e.next=r,i.next=e,null!==r&&(r.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}})),Bme=z(((e,t)=>{var i=Hme();t.exports=function(e,t,r){function n(e,t){return{id:r?r.segmentId():-1,start:e,end:t,myFill:{above:null,below:null},otherFill:null}}function s(e,t,i){return{id:r?r.segmentId():-1,start:e,end:t,myFill:{above:i.myFill.above,below:i.myFill.below},otherFill:null}}var a=i.create();function o(e,i){a.insertBefore(e,(function(r){var n=function(e,i,r,n,s,a){var o=t.pointsCompare(i,s);return 0!==o?o:t.pointsSame(r,a)?0:e!==n?e?1:-1:t.pointAboveOrOnLine(r,n?s:a,n?a:s)?1:-1}(e.isStart,e.pt,i,r.isStart,r.pt,r.other.pt);return n<0}))}function l(e,t){var r=function(e,t){var r=i.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return o(r,e.end),r}(e,t);return function(e,t,r){var n=i.node({isStart:!1,pt:t.end,seg:t,primary:r,other:e,status:null});e.other=n,o(n,e.pt)}(r,e,t),r}function h(e,t){var i=s(t,e.seg.end,e.seg);return function(e,t){r&&r.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt)}(e,t),l(i,e.primary)}function u(n,s){var o=i.create();function l(e){return o.findTransition((function(i){var r=function(e,i){var r=e.seg.start,n=e.seg.end,s=i.seg.start,a=i.seg.end;return t.pointsCollinear(r,s,a)?t.pointsCollinear(n,s,a)||t.pointAboveOrOnLine(n,s,a)?1:-1:t.pointAboveOrOnLine(r,s,a)?1:-1}(e,i.ev);return r>0}))}function u(e,i){var n=e.seg,s=i.seg,a=n.start,o=n.end,l=s.start,u=s.end;r&&r.checkIntersection(n,s);var c=t.linesIntersect(a,o,l,u);if(!1===c){if(!t.pointsCollinear(a,o,l)||t.pointsSame(a,u)||t.pointsSame(o,l))return!1;var p=t.pointsSame(a,l),d=t.pointsSame(o,u);if(p&&d)return i;var f=!p&&t.pointBetween(a,l,u),m=!d&&t.pointBetween(o,l,u);if(p)return m?h(i,o):h(e,u),i;f&&(d||(m?h(i,o):h(e,u)),h(i,a))}else 0===c.alongA&&(-1===c.alongB?h(e,l):0===c.alongB?h(e,c.pt):1===c.alongB&&h(e,u)),0===c.alongB&&(-1===c.alongA?h(i,a):0===c.alongA?h(i,c.pt):1===c.alongA&&h(i,o));return!1}for(var c=[];!a.isEmpty();){var p=a.getHead();if(r&&r.vert(p.pt[0]),p.isStart){let t=function(){if(f){var e=u(p,f);if(e)return e}return!!m&&u(p,m)};r&&r.segmentNew(p.seg,p.primary);var d=l(p),f=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(p.seg,!!f&&f.seg,!!m&&m.seg);var g,y=t();if(y)e?(g=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above):y.seg.otherFill=p.seg.myFill,r&&r.segmentUpdate(y.seg),p.other.remove(),p.remove();if(a.getHead()!==p){r&&r.rewind(p.seg);continue}if(e)g=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:n,p.seg.myFill.above=g?!p.seg.myFill.below:p.seg.myFill.below;else if(null===p.seg.otherFill){var v;v=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?s:n,p.seg.otherFill={above:v,below:v}}r&&r.status(p.seg,!!f&&f.seg,!!m&&m.seg),p.other.status=d.insert(i.node({ev:p}))}else{var T=p.status;if(null===T)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(o.exists(T.prev)&&o.exists(T.next)&&u(T.prev.ev,T.next.ev),r&&r.statusRemove(T.ev.seg),T.remove(),!p.primary){var x=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=x}c.push(p.seg)}a.getHead().remove()}return r&&r.done(),c}return e?{addRegion:function(e){for(var i,r=e[e.length-1],s=0;s<e.length;s++){i=r,r=e[s];var a=t.pointsCompare(i,r);0!==a&&l(n(a<0?i:r,a<0?r:i),!0)}},calculate:function(e){return u(e,!1)}}:{calculate:function(e,t,i,r){return e.forEach((function(e){l(s(e.start,e.end,e),!0)})),i.forEach((function(e){l(s(e.start,e.end,e),!1)})),u(t,r)}}}})),Gme=z(((e,t)=>{t.exports=function(e,t,i){var r=[],n=[];return e.forEach((function(e){var s=e.start,a=e.end;if(t.pointsSame(s,a))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{i&&i.chainStart(e);for(var o={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},h=o,u=0;u<r.length;u++){var c=(g=r[u])[0],p=(g[1],g[g.length-1]);if(g[g.length-2],t.pointsSame(c,s)){if(w(u,!0,!0))break}else if(t.pointsSame(c,a)){if(w(u,!0,!1))break}else if(t.pointsSame(p,s)){if(w(u,!1,!0))break}else if(t.pointsSame(p,a)&&w(u,!1,!1))break}if(h===o)return r.push([s,a]),void(i&&i.chainNew(s,a));if(h===l){i&&i.chainMatch(o.index);var d=o.index,f=o.matches_pt1?a:s,m=o.matches_head,g=r[d],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],T=m?g[g.length-1]:g[0],x=m?g[g.length-2]:g[1];return t.pointsCollinear(v,y,f)&&(m?(i&&i.chainRemoveHead(o.index,f),g.shift()):(i&&i.chainRemoveTail(o.index,f),g.pop()),y=v),t.pointsSame(T,f)?(r.splice(d,1),t.pointsCollinear(x,T,y)&&(m?(i&&i.chainRemoveTail(o.index,y),g.pop()):(i&&i.chainRemoveHead(o.index,y),g.shift())),i&&i.chainClose(o.index),void n.push(g)):void(m?(i&&i.chainAddHead(o.index,f),g.unshift(f)):(i&&i.chainAddTail(o.index,f),g.push(f)))}var b=o.index,E=l.index;i&&i.chainConnect(b,E);var _=r[b].length<r[E].length;o.matches_head?l.matches_head?_?(S(b),M(b,E)):(S(E),M(E,b)):M(E,b):l.matches_head?M(b,E):_?(S(b),M(E,b)):(S(E),M(b,E))}function w(e,t,i){return h.index=e,h.matches_head=t,h.matches_pt1=i,h===o?(h=l,!1):(h=null,!0)}function S(e){i&&i.chainReverse(e),r[e].reverse()}function M(e,n){var s=r[e],a=r[n],o=s[s.length-1],l=s[s.length-2],h=a[0],u=a[1];t.pointsCollinear(l,o,h)&&(i&&i.chainRemoveTail(e,o),s.pop(),o=l),t.pointsCollinear(o,h,u)&&(i&&i.chainRemoveHead(n,h),a.shift()),i&&i.chainJoin(e,n),r[e]=s.concat(a),r.splice(n,1)}})),n}})),zme=z(((e,t)=>{function i(e,t,i){var r=[];return e.forEach((function(e){var n=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[n]&&r.push({id:i?i.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[n],below:2===t[n]},otherFill:null})})),i&&i.selected(r),r}var r={union:function(e,t){return i(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return i(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return i(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return i(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return i(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};t.exports=r})),Wme=z(((e,t)=>{var i={toPolygon:function(e,t){function i(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function i(t){var i=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[i]})}for(var r=i(t[0]),n=1;n<t.length;n++)r=e.selectDifference(e.combine(r,i(t[n])));return r}if("Polygon"===t.type)return e.polygon(i(t.coordinates));if("MultiPolygon"===t.type){for(var r=e.segments({inverted:!1,regions:[]}),n=0;n<t.coordinates.length;n++)r=e.selectUnion(e.combine(r,i(t.coordinates[n])));return e.polygon(r)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,i){function r(e,i){return t.pointInsideRegion([.5*(e[0][0]+e[1][0]),.5*(e[0][1]+e[1][1])],i)}function n(e){return{region:e,children:[]}}i=e.polygon(e.segments(i));var s=n(null);function a(e,t){for(var i=0;i<e.children.length;i++)if(r(t,(o=e.children[i]).region))return void a(o,t);var s=n(t);for(i=0;i<e.children.length;i++){var o;r((o=e.children[i]).region,t)&&(s.children.push(o),e.children.splice(i,1),i--)}e.children.push(s)}for(var o=0;o<i.regions.length;o++){var l=i.regions[o];l.length<3||a(s,l)}function h(e,t){for(var i=0,r=e[e.length-1][0],n=e[e.length-1][1],s=[],a=0;a<e.length;a++){var o=e[a][0],l=e[a][1];s.push([o,l]),i+=l*r-o*n,r=o,n=l}return i<0!==t&&s.reverse(),s.push([s[0][0],s[0][1]]),s}var u=[];function c(e){var t=[h(e.region,!1)];u.push(t);for(var i=0;i<e.children.length;i++)t.push(p(e.children[i]))}function p(e){for(var t=0;t<e.children.length;t++)c(e.children[t]);return h(e.region,!0)}for(o=0;o<s.children.length;o++)c(s.children[o]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};t.exports=i})),$me=z(((e,t)=>{var i,r=Pme(),n=Lme(),s=Bme(),a=Gme(),o=zme(),l=Wme(),h=!1,u=n();function c(e,t,r){var n=i.segments(e),s=i.segments(t),a=r(i.combine(n,s));return i.polygon(a)}i={buildLog:function(e){return!0===e?h=r():!1===e&&(h=!1),!1!==h&&h.list},epsilon:function(e){return u.epsilon(e)},segments:function(e){var t=s(!0,u,h);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:s(!1,u,h).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:o.union(e.combined,h),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:o.intersect(e.combined,h),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:o.difference(e.combined,h),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:o.differenceRev(e.combined,h),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:o.xor(e.combined,h),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:a(e.segments,u,h),inverted:e.inverted}},polygonFromGeoJSON:function(e){return l.toPolygon(i,e)},polygonToGeoJSON:function(e){return l.fromPolygon(i,u,e)},union:function(e,t){return c(e,t,i.selectUnion)},intersect:function(e,t){return c(e,t,i.selectIntersect)},difference:function(e,t){return c(e,t,i.selectDifference)},differenceRev:function(e,t){return c(e,t,i.selectDifferenceRev)},xor:function(e,t){return c(e,t,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),t.exports=i})),dge=z(((e,t)=>{var i,r;i=e,r=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}var r=function(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null};function n(e,t){return e>t?1:e<t?-1:0}function s(e,t,i){for(var n=new r(null,null),s=n,a=n;;){var o=i(e,t.key);if(o<0){if(null===t.left)break;if(i(e,t.left.key)<0){var l=t.left;if(t.left=l.right,l.right=t,null===(t=l).left)break}a.left=t,a=t,t=t.left}else{if(!(o>0))break;if(null===t.right)break;if(i(e,t.right.key)>0&&(l=t.right,t.right=l.left,l.left=t,null===(t=l).right))break;s.right=t,s=t,t=t.right}}return s.right=t.left,a.left=t.right,t.left=n.right,t.right=n.left,t}function a(e,t,i,n){var a=new r(e,t);if(null===i)return a.left=a.right=null,a;var o=n(e,(i=s(e,i,n)).key);return o<0?(a.left=i.left,a.right=i,i.left=null):o>=0&&(a.right=i.right,a.left=i,i.right=null),a}function o(e,t,i){var r=null,n=null;if(t){var a=i((t=s(e,t,i)).key,e);0===a?(r=t.left,n=t.right):a<0?(n=t.right,t.right=null,r=t):(r=t.left,t.left=null,n=t)}return{left:r,right:n}}function l(e,t,i,r,n){if(e){r(t+(i?"\u2514\u2500\u2500 ":"\u251c\u2500\u2500 ")+n(e)+"\n");var s=t+(i?" ":"\u2502 ");e.left&&l(e.left,s,!1,r,n),e.right&&l(e.right,s,!0,r,n)}}var h=function(){function e(e){void 0===e&&(e=n),this._root=null,this._size=0,this._comparator=e}return e.prototype.insert=function(e,t){return this._size++,this._root=a(e,t,this._root,this._comparator)},e.prototype.add=function(e,t){var i=new r(e,t);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,a=s(e,this._root,n),o=n(e,a.key);return 0===o?this._root=a:(o<0?(i.left=a.left,i.right=a,a.left=null):o>0&&(i.right=a.right,i.left=a,a.right=null),this._size++,this._root=i),this._root},e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},e.prototype._remove=function(e,t,i){var r;return null===t?null:0===i(e,(t=s(e,t,i)).key)?(null===t.left?r=t.right:(r=s(e,t.left,i)).right=t.right,this._size--,r):t},e.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=s(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},e.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(0===r)return t;t=r<0?t.left:t.right}return null},e.prototype.find=function(e){return this._root&&(this._root=s(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},e.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(0===r)return!0;t=r<0?t.left:t.right}return!1},e.prototype.forEach=function(e,t){for(var i=this._root,r=[],n=!1;!n;)null!==i?(r.push(i),i=i.left):0!==r.length?(i=r.pop(),e.call(t,i),i=i.right):n=!0;return this},e.prototype.range=function(e,t,i,r){for(var n=[],s=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(s((a=n.pop()).key,t)>0)break;if(s(a.key,e)>=0&&i.call(r,a))return this;a=a.right}return this},e.prototype.keys=function(){var e=[];return this.forEach((function(t){var i=t.key;return e.push(i)})),e},e.prototype.values=function(){var e=[];return this.forEach((function(t){var i=t.data;return e.push(i)})),e},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},e.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},e.prototype.at=function(e){for(var t=this._root,i=!1,r=0,n=[];!i;)if(t)n.push(t),t=t.left;else if(n.length>0){if(t=n.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},e.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var n=r(e.key,t.key);if(0===n)break;n<0?(i=t,t=t.left):t=t.right}return i},e.prototype.prev=function(e){var t=this._root,i=null;if(null!==e.left){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var n=r(e.key,t.key);if(0===n)break;n<0?t=t.left:(i=t,t=t.right)}return i},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return function(e){for(var t=e,i=[],n=!1,s=new r(null,null),a=s;!n;)t?(i.push(t),t=t.left):i.length>0?t=(t=a=a.next=i.pop()).right:n=!0;return a.next=null,s.next}(this._root)},e.prototype.load=function(e,t,i){void 0===t&&(t=[]),void 0===i&&(i=!1);var n=e.length,s=this._comparator;if(i&&p(e,t,0,n-1,s),null===this._root)this._root=u(e,t,0,n),this._size=n;else{var a=function(e,t,i){for(var n=new r(null,null),s=n,a=e,o=t;null!==a&&null!==o;)i(a.key,o.key)<0?(s.next=a,a=a.next):(s.next=o,o=o.next),s=s.next;return null!==a?s.next=a:null!==o&&(s.next=o),n.next}(this.toList(),function(e,t){for(var i=new r(null,null),n=i,s=0;s<e.length;s++)n=n.next=new r(e[s],t[s]);return n.next=null,i.next}(e,t),s);n=this._size+n,this._root=c({head:a},0,n)}return this},e.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var t=[];return l(this._root,"",!0,(function(e){return t.push(e)}),e),t.join("")},e.prototype.update=function(e,t,i){var r=this._comparator,n=o(e,this._root,r),l=n.left,h=n.right;r(e,t)<0?h=a(t,i,h,r):l=a(t,i,l,r),this._root=function(e,t,i){return null===t?e:(null===e||((t=s(e.key,t,i)).left=e),t)}(l,h,r)},e.prototype.split=function(e){return o(e,this._root,this._comparator)},e}();function u(e,t,i,n){var s=n-i;if(s>0){var a=i+Math.floor(s/2),o=e[a],l=t[a],h=new r(o,l);return h.left=u(e,t,i,a),h.right=u(e,t,a+1,n),h}return null}function c(e,t,i){var r=i-t;if(r>0){var n=t+Math.floor(r/2),s=c(e,t,n),a=e.head;return a.left=s,e.head=e.head.next,a.right=c(e,n+1,i),a}return null}function p(e,t,i,r,n){if(!(i>=r)){for(var s=e[i+r>>1],a=i-1,o=r+1;;){do{a++}while(n(e[a],s)<0);do{o--}while(n(e[o],s)>0);if(a>=o)break;var l=e[a];e[a]=e[o],e[o]=l,l=t[a],t[a]=t[o],t[o]=l}p(e,t,i,o,n),p(e,t,o+1,r,n)}}var d=function(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},f=function(e,t){if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;var i=e.ll.x<t.ll.x?t.ll.x:e.ll.x,r=e.ur.x<t.ur.x?e.ur.x:t.ur.x;return{ll:{x:i,y:e.ll.y<t.ll.y?t.ll.y:e.ll.y},ur:{x:r,y:e.ur.y<t.ur.y?e.ur.y:t.ur.y}}},m=Number.EPSILON;void 0===m&&(m=Math.pow(2,-52));var g=m*m,y=function(e,t){if(-m<e&&e<m&&-m<t&&t<m)return 0;var i=e-t;return i*i<g*e*t?0:e<t?-1:1},v=function(){function t(){e(this,t),this.reset()}return i(t,[{key:"reset",value:function(){this.xRounder=new T,this.yRounder=new T}},{key:"round",value:function(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}]),t}(),T=function(){function t(){e(this,t),this.tree=new h,this.round(0)}return i(t,[{key:"round",value:function(e){var t=this.tree.add(e),i=this.tree.prev(t);if(null!==i&&0===y(t.key,i.key))return this.tree.remove(e),i.key;var r=this.tree.next(t);return null!==r&&0===y(t.key,r.key)?(this.tree.remove(e),r.key):e}}]),t}(),x=new v,b=function(e,t){return e.x*t.y-e.y*t.x},E=function(e,t){return e.x*t.x+e.y*t.y},_=function(e,t,i){var r={x:t.x-e.x,y:t.y-e.y},n={x:i.x-e.x,y:i.y-e.y},s=b(r,n);return y(s,0)},w=function(e){return Math.sqrt(E(e,e))},S=function(e,t,i){var r={x:t.x-e.x,y:t.y-e.y},n={x:i.x-e.x,y:i.y-e.y};return b(n,r)/w(n)/w(r)},M=function(e,t,i){var r={x:t.x-e.x,y:t.y-e.y},n={x:i.x-e.x,y:i.y-e.y};return E(n,r)/w(n)/w(r)},I=function(e,t,i){return 0===t.y?null:{x:e.x+t.x/t.y*(i-e.y),y:i}},D=function(e,t,i){return 0===t.x?null:{x:i,y:e.y+t.y/t.x*(i-e.x)}},A=function(){function t(i,r){e(this,t),void 0===i.events?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=r}return i(t,null,[{key:"compare",value:function(e,i){var r=t.comparePoints(e.point,i.point);return 0!==r?r:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:C.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}}]),i(t,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var t=e.point.events,i=0,r=t.length;i<r;i++){var n=t[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,t=0;t<e;t++){var i=this.point.events[t];if(void 0===i.segment.consumedBy)for(var r=t+1;r<e;r++){var n=this.point.events[r];void 0===n.consumedBy&&i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],t=0,i=this.point.events.length;t<i;t++){var r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}},{key:"getLeftmostComparator",value:function(e){var t=this,i=new Map,r=function(r){var n=r.otherSE;i.set(r,{sine:S(t.point,e.point,n.point),cosine:M(t.point,e.point,n.point)})};return function(e,t){i.has(e)||r(e),i.has(t)||r(t);var n=i.get(e),s=n.sine,a=n.cosine,o=i.get(t),l=o.sine,h=o.cosine;return s>=0&&l>=0?a<h?1:a>h?-1:0:s<0&&l<0?a<h?-1:a>h?1:0:l<s?-1:l>s?1:0}}}]),t}(),R=0,C=function(){function t(i,r,n,s){e(this,t),this.id=++R,this.leftSE=i,i.segment=this,i.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=i,this.rings=n,this.windings=s}return i(t,null,[{key:"compare",value:function(e,t){var i=e.leftSE.point.x,r=t.leftSE.point.x,n=e.rightSE.point.x,s=t.rightSE.point.x;if(s<i)return 1;if(n<r)return-1;var a=e.leftSE.point.y,o=t.leftSE.point.y,l=e.rightSE.point.y,h=t.rightSE.point.y;if(i<r){if(o<a&&o<l)return 1;if(o>a&&o>l)return-1;var u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return-1;var c=t.comparePoint(e.rightSE.point);return 0!==c?c:-1}if(i>r){if(a<o&&a<h)return-1;if(a>o&&a>h)return 1;var p=t.comparePoint(e.leftSE.point);if(0!==p)return p;var d=e.comparePoint(t.rightSE.point);return d<0?1:d>0?-1:1}if(a<o)return-1;if(a>o)return 1;if(n<s){var f=t.comparePoint(e.rightSE.point);if(0!==f)return f}if(n>s){var m=e.comparePoint(t.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(n!==s){var g=l-a,y=n-i,v=h-o,T=s-r;if(g>y&&v<T)return 1;if(g<y&&v>T)return-1}return n>s?1:n<s||l<h?-1:l>h?1:e.id<t.id?-1:e.id>t.id?1:0}}]),i(t,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;var n=(e.y-t.y)/r.y,s=t.x+n*r.x;if(e.x===s)return 0;var a=(e.x-t.x)/r.x,o=t.y+a*r.y;return e.y===o?0:e.y<o?-1:1}},{key:"getIntersection",value:function(e){var t=this.bbox(),i=e.bbox(),r=f(t,i);if(null===r)return null;var n=this.leftSE.point,s=this.rightSE.point,a=e.leftSE.point,o=e.rightSE.point,l=d(t,a)&&0===this.comparePoint(a),h=d(i,n)&&0===e.comparePoint(n),u=d(t,o)&&0===this.comparePoint(o),c=d(i,s)&&0===e.comparePoint(s);if(h&&l)return c&&!u?s:!c&&u?o:null;if(h)return u&&n.x===o.x&&n.y===o.y?null:n;if(l)return c&&s.x===a.x&&s.y===a.y?null:a;if(c&&u)return null;if(c)return s;if(u)return o;var p=function(e,t,i,r){if(0===t.x)return D(i,r,e.x);if(0===r.x)return D(e,t,i.x);if(0===t.y)return I(i,r,e.y);if(0===r.y)return I(e,t,i.y);var n=b(t,r);if(0==n)return null;var s={x:i.x-e.x,y:i.y-e.y},a=b(s,t)/n,o=b(s,r)/n;return{x:(e.x+o*t.x+(i.x+a*r.x))/2,y:(e.y+o*t.y+(i.y+a*r.y))/2}}(n,this.vector(),a,e.vector());return null!==p&&d(r,p)?x.round(p.x,p.y):null}},{key:"split",value:function(e){var i=[],r=void 0!==e.events,n=new A(e,!0),s=new A(e,!1),a=this.rightSE;this.replaceRightSE(s),i.push(s),i.push(n);var o=new t(n,a,this.rings.slice(),this.windings.slice());return A.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),A.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(n.checkForConsuming(),s.checkForConsuming()),i}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}},{key:"consume",value:function(e){for(var i=this,r=e;i.consumedBy;)i=i.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var n=t.compare(i,r);if(0!==n){if(n>0){var s=i;i=r,r=s}if(i.prev===r){var a=i;i=r,r=a}for(var o=0,l=r.rings.length;o<l;o++){var h=r.rings[o],u=r.windings[o],c=i.rings.indexOf(h);-1===c?(i.rings.push(h),i.windings.push(u)):i.windings[c]+=u}r.rings=null,r.windings=null,r.consumedBy=i,r.leftSE.consumedBy=i.leftSE,r.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var t=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys,n=0,s=this.rings.length;n<s;n++){var a=this.rings[n],o=this.windings[n],l=t.indexOf(a);-1===l?(t.push(a),i.push(o)):i[l]+=o}for(var h=[],u=[],c=0,p=t.length;c<p;c++)if(0!==i[c]){var d=t[c],f=d.poly;if(-1===u.indexOf(f))if(d.isExterior)h.push(f);else{-1===u.indexOf(f)&&u.push(f);var m=h.indexOf(d.poly);-1!==m&&h.splice(m,1)}}for(var g=0,y=h.length;g<y;g++){var v=h[g].multiPoly;-1===r.indexOf(v)&&r.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(G.type){case"union":var i=0===e.length,r=0===t.length;this._isInResult=i!==r;break;case"intersection":var n,s;e.length<t.length?(n=e.length,s=t.length):(n=t.length,s=e.length),this._isInResult=s===G.numMultiPolys&&n<s;break;case"xor":var a=Math.abs(e.length-t.length);this._isInResult=a%2==1;break;case"difference":var o=function(e){return 1===e.length&&e[0].isSubject};this._isInResult=o(e)!==o(t);break;default:throw new Error("Unrecognized operation type found ".concat(G.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,r){var n,s,a,o=A.comparePoints(e,i);if(o<0)n=e,s=i,a=1;else{if(!(o>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,s=e,a=-1}return new t(new A(n,!0),new A(s,!1),[r],[a])}}]),t}(),O=function(){function t(i,r,n){if(e(this,t),!Array.isArray(i)||0===i.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=n,this.segments=[],"number"!=typeof i[0][0]||"number"!=typeof i[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=x.round(i[0][0],i[0][1]);this.bbox={ll:{x:s.x,y:s.y},ur:{x:s.x,y:s.y}};for(var a=s,o=1,l=i.length;o<l;o++){if("number"!=typeof i[o][0]||"number"!=typeof i[o][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var h=x.round(i[o][0],i[o][1]);h.x===a.x&&h.y===a.y||(this.segments.push(C.fromRing(a,h,this)),h.x<this.bbox.ll.x&&(this.bbox.ll.x=h.x),h.y<this.bbox.ll.y&&(this.bbox.ll.y=h.y),h.x>this.bbox.ur.x&&(this.bbox.ur.x=h.x),h.y>this.bbox.ur.y&&(this.bbox.ur.y=h.y),a=h)}(s.x!==a.x||s.y!==a.y)&&this.segments.push(C.fromRing(a,s,this))}return i(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,i=this.segments.length;t<i;t++){var r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}]),t}(),P=function(){function t(i,r){if(e(this,t),!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new O(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,s=i.length;n<s;n++){var a=new O(i[n],this,!1);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=r}return i(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),t=0,i=this.interiorRings.length;t<i;t++)for(var r=this.interiorRings[t].getSweepEvents(),n=0,s=r.length;n<s;n++)e.push(r[n]);return e}}]),t}(),N=function(){function t(i,r){if(e(this,t),!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof i[0][0][0]&&(i=[i])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,s=i.length;n<s;n++){var a=new P(i[n],this);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=r}return i(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,i=this.polys.length;t<i;t++)for(var r=this.polys[t].getSweepEvents(),n=0,s=r.length;n<s;n++)e.push(r[n]);return e}}]),t}(),L=function(){function t(i){e(this,t),this.events=i;for(var r=0,n=i.length;r<n;r++)i[r].segment.ringOut=this;this.poly=null}return i(t,null,[{key:"factory",value:function(e){for(var i=[],r=0,n=e.length;r<n;r++){var s=e[r];if(s.isInResult()&&!s.ringOut){for(var a=null,o=s.leftSE,l=s.rightSE,h=[o],u=o.point,c=[];a=o,o=l,h.push(o),o.point!==u;)for(;;){var p=o.getAvailableLinkedEvents();if(0===p.length){var d=h[0].point,f=h[h.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var m=null,g=0,y=c.length;g<y;g++)if(c[g].point===o.point){m=g;break}if(null===m){c.push({index:h.length,point:o.point});var v=o.getLeftmostComparator(a);l=p.sort(v)[0].otherSE;break}var T=c.splice(m)[0],x=h.splice(T.index);x.unshift(x[0].otherSE),i.push(new t(x.reverse()))}i.push(new t(h))}}return i}}]),i(t,[{key:"getGeom",value:function(){for(var e=this.events[0].point,t=[e],i=1,r=this.events.length-1;i<r;i++){var n=this.events[i].point,s=this.events[i+1].point;0!==_(n,e,s)&&(t.push(n),e=n)}if(1===t.length)return null;var a=t[0],o=t[1];0===_(a,e,o)&&t.shift(),t.push(t[0]);for(var l=this.isExteriorRing()?1:-1,h=this.isExteriorRing()?0:t.length-1,u=this.isExteriorRing()?t.length:-1,c=[],p=h;p!=u;p+=l)c.push([t[p].x,t[p].y]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],t=1,i=this.events.length;t<i;t++){var r=this.events[t];A.compare(e,r)>0&&(e=r)}for(var n=e.segment.prevInResult(),s=n?n.prevInResult():null;;){if(!n)return null;if(!s)return n.ringOut;if(s.ringOut!==n.ringOut)return s.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=s.prevInResult(),s=n?n.prevInResult():null}}}]),t}(),F=function(){function t(i){e(this,t),this.exteriorRing=i,i.poly=this,this.interiorRings=[]}return i(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(var t=0,i=this.interiorRings.length;t<i;t++){var r=this.interiorRings[t].getGeom();null!==r&&e.push(r)}return e}}]),t}(),U=function(){function t(i){e(this,t),this.rings=i,this.polys=this._composePolys(i)}return i(t,[{key:"getGeom",value:function(){for(var e=[],t=0,i=this.polys.length;t<i;t++){var r=this.polys[t].getGeom();null!==r&&e.push(r)}return e}},{key:"_composePolys",value:function(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i];if(!n.poly)if(n.isExteriorRing())t.push(new F(n));else{var s=n.enclosingRing();s.poly||t.push(new F(s)),s.poly.addInterior(n)}}return t}}]),t}(),k=function(){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C.compare;e(this,t),this.queue=i,this.tree=new h(r),this.segments=[]}return i(t,[{key:"process",value:function(e){var t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;var r=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!r)throw new Error("Unable to find segment #".concat(t.id," ")+"[".concat(t.leftSE.point.x,", ").concat(t.leftSE.point.y,"] -> ")+"[".concat(t.rightSE.point.x,", ").concat(t.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=r,s=r,a=void 0,o=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===o;)null===(s=this.tree.next(s))?o=null:void 0===s.key.consumedBy&&(o=s.key);if(e.isLeft){var l=null;if(a){var h=a.getIntersection(t);if(null!==h&&(t.isAnEndpoint(h)||(l=h),!a.isAnEndpoint(h)))for(var u=this._splitSafely(a,h),c=0,p=u.length;c<p;c++)i.push(u[c])}var d=null;if(o){var f=o.getIntersection(t);if(null!==f&&(t.isAnEndpoint(f)||(d=f),!o.isAnEndpoint(f)))for(var m=this._splitSafely(o,f),g=0,y=m.length;g<y;g++)i.push(m[g])}if(null!==l||null!==d){var v;v=null===l?d:null===d||A.comparePoints(l,d)<=0?l:d,this.queue.remove(t.rightSE),i.push(t.rightSE);for(var T=t.split(v),x=0,b=T.length;x<b;x++)i.push(T[x])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=a)}else{if(a&&o){var E=a.getIntersection(o);if(null!==E){if(!a.isAnEndpoint(E))for(var _=this._splitSafely(a,E),w=0,S=_.length;w<S;w++)i.push(_[w]);if(!o.isAnEndpoint(E))for(var M=this._splitSafely(o,E),I=0,D=M.length;I<D;I++)i.push(M[I])}}this.tree.remove(t)}return i}},{key:"_splitSafely",value:function(e,t){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var r=e.split(t);return r.push(i),void 0===e.consumedBy&&this.tree.insert(e),r}}]),t}(),B="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,z="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,G=new(function(){function t(){e(this,t)}return i(t,[{key:"run",value:function(e,t,i){G.type=e,x.reset();for(var r=[new N(t,!0)],n=0,s=i.length;n<s;n++)r.push(new N(i[n],!1));if(G.numMultiPolys=r.length,"difference"===G.type)for(var a=r[0],o=1;o<r.length;)null!==f(r[o].bbox,a.bbox)?o++:r.splice(o,1);if("intersection"===G.type)for(var l=0,u=r.length;l<u;l++)for(var c=r[l],p=l+1,d=r.length;p<d;p++)if(null===f(c.bbox,r[p].bbox))return[];for(var m=new h(A.compare),g=0,y=r.length;g<y;g++)for(var v=r[g].getSweepEvents(),T=0,b=v.length;T<b;T++)if(m.insert(v[T]),m.size>B)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var E=new k(m),_=m.size,w=m.pop();w;){var S=w.key;if(m.size===_){var M=S.segment;throw new Error("Unable to pop() ".concat(S.isLeft?"left":"right"," SweepEvent ")+"[".concat(S.point.x,", ").concat(S.point.y,"] from segment #").concat(M.id," ")+"[".concat(M.leftSE.point.x,", ").concat(M.leftSE.point.y,"] -> ")+"[".concat(M.rightSE.point.x,", ").concat(M.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(m.size>B)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(E.segments.length>z)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var I=E.process(S),D=0,R=I.length;D<R;D++){var C=I[D];void 0===C.consumedBy&&m.insert(C)}_=m.size,w=m.pop()}x.reset();var O=L.factory(E.segments);return new U(O).getGeom()}}]),t}()),H={union:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return G.run("union",e,i)},intersection:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return G.run("intersection",e,i)},xor:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return G.run("xor",e,i)},difference:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return G.run("difference",e,i)}};return H},"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(i="undefined"!=typeof globalThis?globalThis:i||self).polygonClipping=r()}));!function(){if("undefined"!=typeof document&&!document.getElementById("97f60fe1269eb73877b23e4200f4093e62a1b580431265f40f0b19e354ae916c")){var e=document.createElement("style");e.id="97f60fe1269eb73877b23e4200f4093e62a1b580431265f40f0b19e354ae916c",e.textContent='@import"https://at.alicdn.com/t/c/font_2809422_kipm6ycaet.css";@import"https://at.alicdn.com/t/c/font_2802048_dc945363jlf.css";.axesRenderer{width:100px;height:100px;position:absolute;display:block;bottom:1px;left:10px;background:#ffffff00}.overview-map{width:200px;height:200px;top:10px;left:10px;position:absolute;z-index:1;border:1px #50505090 solid;background-color:#80808030}.statsOutput{position:absolute;opacity:.6;top:1px;left:1px}#navCube{position:absolute;bottom:10px;right:10px;z-index:1;pointer-events:none;cursor:pointer}#navCube:hover{opacity:1}.css3d-navcube .navcube-plane{backface-visibility:hidden;z-index:1;transition:all .2s}.css3d-navcube .navcube-plane.outer{opacity:.7;background:linear-gradient(-45deg,transparent 15px,#efefef 0) bottom right,linear-gradient(-135deg,transparent 15px,#efefef 0) top right,linear-gradient(135deg,transparent 15px,#efefef 0) top left,linear-gradient(45deg,transparent 15px,#efefef 0) bottom left;background-size:70% 70%;background-repeat:no-repeat}.css3d-navcube .navcube-plane.inner{margin:2px;font-size:30px;text-align:center;line-height:100px;background:linear-gradient(-45deg,transparent 14px,#2c7be5 0) bottom right,linear-gradient(-135deg,transparent 14px,#2c7be5 0) top right,linear-gradient(135deg,transparent 14px,#2c7be5 0) top left,linear-gradient(45deg,transparent 14px,#2c7be5 0) bottom left;background-size:70% 70%;background-repeat:no-repeat}.css3d-navcube .navcube-plane:hover{opacity:1!important}.css3d-navcube .navcube-edge{opacity:0;z-index:2;transition:all .2s}.css3d-navcube .navcube-edge:hover{opacity:1!important}.css3d-navcube .navcube-corner{opacity:.7;backface-visibility:hidden;box-sizing:content-box;transform-origin:50% 33%;top:4px;z-index:3;transition:all .2s}.css3d-navcube .navcube-corner-plane{opacity:0;backface-visibility:hidden;transform-origin:bottom;top:-6.5px;z-index:3;transition:all .2s}.css3d-navcube .highlight{opacity:1}#viewCube{width:150px;height:150px;position:absolute;bottom:10px;right:10px;z-index:1}.progress-bar{z-index:3;bottom:20%;left:25%;position:absolute;color:#ffffffa0;width:50%;user-select:none}.progress-bar.hidden{display:none}.progress-bar .progress-bar-item{width:100%;text-align:center;padding:2px}.pop-panel{z-index:99999999;top:calc(70% - 100px);left:calc(90% - 160px);position:absolute;background:#ffffff;color:#333;border-radius:4px;width:160px;box-shadow:0 12px 48px 16px #00000008,0 9px 28px #0000000d,0 6px 16px -8px #00000014}.pop-panel .pop-panel-header{font-size:16px;font-weight:bolder;padding:16px 24px 8px;color:#333;border-bottom:1px solid #EFEFEF;cursor:move;user-select:none}.pop-panel .pop-panel-body{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 24px}.pop-panel .pop-panel-body .pop-panel-item{display:inline-block;cursor:pointer;margin-right:16px;font-size:16px}.pop-panel .pop-panel-body .pop-panel-item .gemini-viewer-icon{font-size:24px}.pop-panel .pop-panel-body .pop-panel-item:last-child{margin-right:0}.pop-panel .pop-panel-body .pop-panel-item:hover,.pop-panel .pop-panel-body .pop-panel-item.active{color:#2c7be5}.pop-panel .pop-panel-body .pop-panel-item.disable{color:#999;cursor:not-allowed}.model-layout-switch-bar{position:absolute;bottom:0;width:100%;height:24px;background:#ffffff;opacity:.7;display:flex;font-size:14px;line-height:1;overflow-x:scroll;overflow-y:hidden;z-index:1}.model-layout-switch-bar .model-layout-switch-bar-content{white-space:nowrap}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item{position:relative;display:inline-block;padding:3px 10px 0;color:#000;height:22px;cursor:pointer;transform:translate(0)}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item:before{content:"";position:absolute;inset:0;z-index:-1;background:#fff;border:1px solid #000;border-top:0px}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item:hover{color:#8080f0}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item:nth-child(n+2){margin-left:-1px}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item.activate{color:#fff!important}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item.activate:before{background:#212830!important}.model-layout-switch-bar.hidden{display:none}.model-layout-switch-bar::-webkit-scrollbar{display:none}.follow-tooltip{z-index:99999999;position:absolute;left:-500px;padding:6px;background:rgba(25,25,25,.3);color:#fffc;font-size:12px;border-radius:2px}.context-menu{position:absolute;box-sizing:border-box;background-color:#fff;width:200px;padding:2px;border-radius:2px;box-shadow:0 4px 8px #0003,0 6px 20px #00000030;cursor:pointer;z-index:2}.context-menu ul{list-style:none;padding:0}.context-menu ul:last-child li{border-bottom:0px}.context-menu li{height:2rem;padding:.5rem;box-sizing:border-box}.context-menu li:hover{background-color:#d3d3d3}.context-menu li.disabled{color:#ccc;cursor:not-allowed}.context-menu li:last-child{border-bottom:1px solid #000}.toolbar{position:absolute;display:flex;box-sizing:border-box;height:68px;left:50%;bottom:40px;padding:8px 20px;border:rgba(153,153,153,.8) 1px solid;border-radius:4px;background:rgba(255,255,255,.8);transform:translate(-50%);align-items:center;z-index:10;user-select:none}.toolbar .toolbar-group{display:flex;padding:0 2px;box-sizing:border-box}.toolbar .toolbar-group-division{width:1px;background-color:#999c;height:60%}.toolbar .toolbar-menu{display:flex;box-sizing:border-box;flex-direction:column;word-break:break-word;width:50px;height:50px;padding:3px 1px;margin:0 2px;transition:all .3s;cursor:pointer;color:#666;border-radius:4px}.toolbar .toolbar-menu.active{color:#2c7be5}.toolbar .toolbar-menu .icon{width:24px;height:24px;margin:auto;font-size:24px;line-height:normal}.toolbar .toolbar-menu span{display:block;width:100%;margin:auto;font-size:.75em;text-align:center;user-select:none}.toolbar .toolbar-menu-active{color:#2c7be5;background-color:#fffc}.toolbar .toolbar-parent-menu{position:relative}.toolbar .toolbar-parent-menu-active .toolbar-sub-menu{display:block}.toolbar .toolbar-parent-menu-active .toolbar-sub-menu-list{background:rgba(255,255,255,.8)}.toolbar .toolbar-parent-menu:after{content:"";position:absolute;box-sizing:border-box;width:0;height:0;right:2px;top:2px;border-width:4px;border-style:solid;border-top-color:#666;border-right-color:#666;border-bottom-color:transparent;border-left-color:transparent;border-radius:1px}.toolbar .toolbar-sub-menu{display:none;position:absolute;min-width:50px;bottom:100%}.toolbar .toolbar-sub-menu .toolbar-sub-menu-list{margin-bottom:2px;border-radius:4px}.toolbar .toolbar-sub-menu .toolbar-sub-menu-list .toolbar-menu{margin:0}.bottom-bar{position:absolute;bottom:0;right:0;display:flex;color:#666;z-index:3;overflow:hidden;user-select:none}.bottom-bar i{font-size:18px;padding:3px;align-self:center;opacity:.4;cursor:pointer;line-height:1}.bottom-bar i:hover,.bottom-bar i.active{color:#2c7be5;opacity:1}.bottom-bar .fps{width:4rem}.bottom-bar span{align-self:center;padding:4px;font-size:14px}#gemini-viewer-threejs-statistics-tooltip,#gemini-viewer-threejs-tips-tooltip,#gemini-viewer-threejs-cameraInfo-tooltip{position:absolute;right:5px;bottom:30px;background:#666666;color:#fff;padding:8px 8px 5px;font-size:.8rem;border-radius:4px;z-index:3;opacity:.9;user-select:none}#gemini-viewer-threejs-statistics-tooltip p,#gemini-viewer-threejs-tips-tooltip p,#gemini-viewer-threejs-cameraInfo-tooltip p{padding-bottom:3px;margin:3px}#gemini-viewer-threejs-statistics-tooltip p span,#gemini-viewer-threejs-tips-tooltip p span,#gemini-viewer-threejs-cameraInfo-tooltip p span{float:left;margin-right:10px}.gemini-spinner{display:flex;flex-flow:row nowrap;align-items:center;justify-content:space-between;width:2em;position:absolute;pointer-events:none;top:50%;left:50%;transform:translate(-50%,-50%)}.gemini-spinner.hidden{display:none}.gemini-spinner span{width:.3em;height:1em;background-color:#3cefff}.gemini-spinner span:nth-of-type(1){animation:grow 1s -.45s ease-in-out infinite}.gemini-spinner span:nth-of-type(2){animation:grow 1s -.3s ease-in-out infinite}.gemini-spinner span:nth-of-type(3){animation:grow 1s -.15s ease-in-out infinite}.gemini-spinner span:nth-of-type(4){animation:grow 1s ease-in-out infinite}@keyframes grow{0%,to{transform:scaleY(1)}50%{transform:scaleY(2)}}.anchor{position:absolute;top:0;left:0;opacity:0;width:20px;height:20px;transform:translate(-50%,-50%);pointer-events:none;user-select:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAADjRJREFUeF7tXQnQttUYvq4Zxr5MqBgaihRlKakUU7SYSBQljUhaxijtso2MTCrRn8YoldKIUlIIJRplSyKyqzGyJDSDLGHmMtfvvOb19n7fe7Zn+/7nnnnn+/7/O8t9zrne+5xzn3sh1hCS9GUA20UO9xqS20eWHXQxDpr7BOZHAMyfrBEA8+dllAAJX65BFB0lwCgBxjPAHAyMW8C4BQxCghczOW4B4xYwbgHjFjDqAWYxMJ4BxjNA8fY6iAbGM8B4BhjPAGvKGUDSYwA8FcAmAJ4EYOPw8/6R4upvAH4I4Efh580AbiJ5W2T9wRRbEWcASTuFBX/a1KLfq/Iq/HsKDN8NgLiych+tNzdYAEh6JoAXAdgtLHrrkwfAkuEyAJeTvL4LBkr7HBQAJK0fFtwLH/u0WzpHsfWvMRAMCJK3xlbqutwgACDplVMLf++uJ21B//+aAsL5PecVvQaApB0BHA3AP4dIVwE4maR/9pJ6CYBwij8GwOt7OWvpTJ0O4KQ+3iJ6BwBJXnQvvq9yK4l8hTQIDIbeUG8AsALEfeyi9mpb6AUAJL0bwBtjZ3CFlDuR5LFdj6VzAEi6EMCeXU9ER/1fRHKvjvpe3W1nAJC0NoDPAnhGwxNwF4DbZz6/m/q3u183fNaZ+n3yfw9smL8bALyA5B0N9zO3+U4AIMmL/gUAazU0aKtor/CH5M9K+pD0BAC7hI9Vzk3QnQB2JmkwtEqtA0DS7gAuqTxKn7C96F8EcBXJP1Zuf3Vzkh4WdBI7ADAYat9U9iD5ySZ4X6rNVgEg6TAA76s4wKsBnBa+6X6saY0k+bHJkuFQAM+r2PHhJE+t2N6yTbUGAEkHADiz0sBu8sKTPKdSe0XNSHpNAIKfoGvQgSQ/VKOhRW20AoDwcvfNRcxE/P034Rvvxf97RPnWiki6XwCBJcKjKnS8ZRsvjI0DILzg3VI4IX5gsahf1Ud16vTYghr7DQEMpQ9XGzT9stgoACQ9BMD3Cw9LlhyvI3ljIYharS5pMwAfALBlQcc+3G5K8k8FbXR3BpDkE+1LCpj3+/o+JH2XHxxJsg7ho8FwJZf/S0n65tQINSYBJH0QwEEFXJ9F0gfHwZMkH+heWzCQM0geXFB/yaqNAEDS8QDeUsDwsSRPLKjfu6qS/NbhN49cehfJt+ZWXqpedQCEV70SY8ltSX619kD70J6kbQBcV8DLTrWNS5oAgBc/y4KHZHV+Cia7saqSlNm4tZxV1dFVJzwYc7w/c3BPJPnTzLqDqiZpQwA/yWT6kJpGJdUAEO6/Ft05+vFdSX4mc0IGWU3SCwF8OoN5Xw23qaUPqQkAf/NzbPiOJPnejIkYfBVJRwA4JWMgp5M8JKPePapUAUDBwa+x602NyWmjjYLrcpUDYS0A5Bz87Ky5C8l/tDHRs31IesTUdnUbyd93xMd9g+1CalzCKgfCYgAEp42PJE6edftbtaXeDWrZ59ryJiz6owHcZ4bnuwH8CoD3WFsqfall/r4BIPXtYF+SRc4nNQBwMYA9EgFwCsmjEuskFZe0c7A1tAuZXcpyyC5edvmy7Z4tmBojSe8BcGRiB5eQfGlinf8rXgSA8NL340Tk+knX3/5GXK0l+U3ehievLpmYOXXPBXAqSdsiVKdwi7IUSHlKtiTdqOTFsBQAhwNIPcE3ouaVZN9/q0q9+H6bb4Jsg2BrneNJOoZAVcpUFx9BMtvKqhQAKVE3PFn+9mxd25hD0tMB+PHJLuNtkF3BDyb5nZqdBaOSr4dYB7FNF4W1zQZAppXP/rXNuCS9HMDHYmercrm9SX68ZpvBvOzsxDazrYdKAJD64nc1SVvTViNJbwdwXLUG8xo6juQ78qrOryXJ1s0phqbZL4UlALClj2PwxNJuJG3gUYXCKf/zVRorb+RZJC26q5AkB8Bw5JFYupnkprGFp8tlASBD8/dbAOuRrGK6XeFZNWeuFtV5HMlfLCoU8/dgcv5LAI+MKR/KZGkGcwHg+6rvrbF0Acl9YgsvVy5c8+z1k3JdqtH1ojasDfWj1j8XFYz5uySbkr0ipmwocxTJ5HeFXAD4TvyqBOaq2blL8jaya0LfbRY9geSba3SY4UdxHslk3UcuAL4NwFavsbRODefHgifUWD5Ly1lP4GtusbIoOM/aiTWWbiS5eWzhSblkAEiy6PVeF6u3vpbkc1IZm1e+59/+Ccvnktyv0ni/AuDZkW1ZK/hYkta0RlMOAGySlKIXr6L5G8C3f3rSn1/j7SBDM2gP4yR7zBwApKp/Nybp94IiknQBgL2LGmmvctZ+PMuepI1CuNpYzpPVwjkAsJbKzpAxdBfJB8UUXK6MJLfxawDFbZXyElnf9gXrRZZdtpikvwCIDVJxDsn9U/rNAYBdtWJ17j8n6QALRSRpXwDnFTXSfuUqyiFJDnDx+Ej2ryeZ5IrGEEc/sv3VxbYA8IDICteRjD3ELNlkBRezSHarFnsbSavLi0jStQC2jWzkrwC+FVl2dTEDINdGPaafi0m+LKbggi2gSR5L2VuqftEr3aRRSZ8AUGT0sdwAmwZAsfWqpAcDaMw7tqnVB3ALyVjRvZz0y7W2jhpa0wAoFoOSbL/XiPVQ1AzlF7qbpA0+i0iSjVzeWdTIMpWbBsABJM8qYV6SM378oKSNDuuuXWptLMlexY2Fi2kaAMUeP5K2BvC1DhexpOvNSy2Lm1aAjQAoWd7Fddd4AIxbQKHDydC3gPEQuFhKLFti6IfA8RpYDoBBXwNHRVA5ABpXBNm2P4X8DhCbgLGWKjjVPCplPE2VPZpkitncXD4SVcF2VklKX5fzGGRdc2yI91qPQQ4112oQ5QqoKL4BmIfEx6AbSPqtJppyAGBPYKdxi6Faz8F+DrXnrgNPDoFuJblBDUYTn4PPJ+mX02jKAYDTnJwQ3QOwYWnM/vBNSAFeAnuNFE1+l5/HRchVkBI36U0kk0LR5QAgNbbNYSRXlU5z0xqxUv5m6tcyCXPM4ZTQ8cma1xwAOAiU/eZjkzNfSdK++sW0BhqF2vYyNiycnW7WT3W7TwZAEMc2e35Kwoo+vEYWjwFIgZpm4c5O8oeEOf4eyeR8BbkASL2WVfOi7bkUqOkYkur1nOV9lQsA5/M9KQGdZ5MsCZb8v64kbQXgcwAemtB/G0V9/96+VuAISX5GTzHwPIbkyakDzQVAqm+ADTq8P9VyDrXPnKVQn2izWgEjgnOoz1kpQTeTfQI8eVkACOeArt3DHSjRWUT6QNW2uDC3/XYPD0yOASL+C701NkCE3wRSE0E1ESLGV8yuAkVUue9Pi7DBhIgJUqAvQaIch/+iFmMG2AFzz9p5DQYVJCoAINVP0NWqOIvObvwhcIStZ5uOHeAI3zZ0KXYBnzOGnKwiyf6A0/1mHwIDAByBs2+BIq2qPrABIHjhz2wqrP0gA0UGEPQ1VKyB4Ouif+Y6ldox03kMrGRpNJ/BIEPFBgD4abi3waKDZ7HtCV6ckMLuUgCfAuCUbQZBoxSCWQ8zWHQAQU64eN8gdmg7J2BwNbO7mT8T+wK7nv3ZH5L+2RqF3IKOC5jk1RuypMc+FC05nqIzwKTVjLBxk6qXk9yttdnuYUeSHA/Qip9UygoLN9tJFQAEKZBrvbpiEkSmrmBBQslia+sJrzUBYL11btKoRq6GqQvSZvmM+D8T9vqZNCpIASeNyk0bt2ITRs6575ckkOxn2rip80DOgXB19TFx5EIZVCVP0HQv1baACgfCSRMrNoFkYcJIz0+Vg1+jAAhbgS1TrdbMpWTjxtyO2qpXwZztRJK2yK5K1SXAlCS4MCRtymV4xSSULEgQOZk7J63aK3cil6vXGACCJEjxIprH5xnOAdRVbsHSCZfkEDE26z6ooK1kb5+UvpoGwNoh0uVaKUzNlPWTs0Oh31jQRutVg3rXvoGpCSGneb0TgCOt3tHUABoFQJAC9iNMil03Z7AOhGzzr1Wpdu9NTdxS7YZXPTt0HJoQUHup5rYgeUOTY2gcAAEEuwO4pMJAbIhhIJxWO/NYKW/BmMOL7k+NZBZ7kGzcIbYVAAQQOJ9fdn67mQWyMYZBcE7pwtWoH8y4vPDJjhlL9H84yRSXsOxhtAaAAIIDbFSRze09K14dJMIVtUzOY3kLptu7hG98SoavRV1Uy66yqCP/vVUABBDkGJMuGouTUvmw6Dy/lzV1aApZPPx66XzEPtylJHVaNAb/PTv/X0zj88q0DoAAApuSebFSHB9SxugAy84AbjAU5SoIMfu96M48Xhz4eolB+IFnu5IcwCmTM122EwAEENgY48MJVjq5Y7wLwO0zH+fimfyf2103fNaZ+n3yf7Gx+nP5s/XRfiQ7iYfcGQAmsyXJOX9LFCW5E9+HemeQPLhLRjoHQJAGqV5GXc5Zrb6z073WYqCTQ+BSzAezMnsd71hzgD1s6yoAJ5P0z86pFxJgehYk2ajkmAYPiF1Nug96J5E8vSsGenMLWDQBQZ1qEBgMK4G86F783uU96J0EmJEG3g6GvC30StwPRgLMMirJzie+i9t8OjZjaVeSww9Xzm9sHcT5XTER22+vJcAcIFiBNAGCtXF9Iiu2Jgvv6B6DoEEBYGZ7sErZEsGA2KSj2b7Z33QvPMmkGL0d8XuPbgcLgDlnBYet23TqU3ursGh3WJzJx2HZenGVKwHTigDAnK3C7/GWCk8OPye/xya8dAJGJ6ryN9yf1b+nZuYuWZi26q5IAMybvJAhNfbcUCXpY1uLWNLPCID5szcCoARVfaw7SoD5qzJKgFEC9PH7Wp+nUQKMEiAlpN14Bqj/Hey2xVECjBJglABzMDAeAsdDYLeiua3exy1g3ALGLWDcAlY7dMTQGnML+A8qtnUcTFYqYAAAAABJRU5ErkJggg==) no-repeat center center;background-size:100% 100%;background-blend-mode:lighten;filter:invert(61%) sepia(87%) saturate(845%) hue-rotate(120deg) brightness(94%) contrast(101%);transition:opacity .5s ease-in-out}.anchor.active{opacity:1}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}\n',document.head.appendChild(e)}}();var JLe=fetch;window.fetch=(...e)=>Promise.resolve(JLe(...e));var IBr=ps(j9(),1),_Br=ps(yue(),1),SBr=ps(Eue(),1),Ot={};fw(Ot,{ACESFilmicToneMapping:()=>ope,AddEquation:()=>Na,AddOperation:()=>ipe,AdditiveAnimationBlendMode:()=>EB,AdditiveBlending:()=>Op,AlphaFormat:()=>fpe,AlwaysDepth:()=>Zhe,AlwaysStencilFunc:()=>Rpe,AmbientLight:()=>Gl,AmbientLightProbe:()=>CU,AnimationClip:()=>mo,AnimationLoader:()=>xU,AnimationMixer:()=>UU,AnimationObjectGroup:()=>FU,AnimationUtils:()=>rTt,ArcCurve:()=>Mg,ArrayCamera:()=>KD,ArrowHelper:()=>jc,Audio:()=>vC,AudioAnalyser:()=>NU,AudioContext:()=>Ax,AudioListener:()=>OU,AudioLoader:()=>MU,AxesHelper:()=>KU,BackSide:()=>$n,BasicDepthPacking:()=>Spe,BasicShadowMap:()=>Kft,Bone:()=>Ll,BooleanKeyframeTrack:()=>Wp,Box2:()=>ns,Box3:()=>Rt,Box3Helper:()=>$U,BoxBufferGeometry:()=>JU,BoxGeometry:()=>js,BoxHelper:()=>Fx,BufferAttribute:()=>Wt,BufferGeometry:()=>ot,BufferGeometryLoader:()=>gC,ByteType:()=>cpe,Cache:()=>Gg,Camera:()=>Fp,CameraHelper:()=>Lx,CanvasTexture:()=>vU,CapsuleBufferGeometry:()=>QU,CapsuleGeometry:()=>Cg,CatmullRomCurve3:()=>tC,CineonToneMapping:()=>ape,CircleBufferGeometry:()=>eB,CircleGeometry:()=>Ag,ClampToEdgeWrapping:()=>vn,Clock:()=>Vl,Color:()=>Ve,ColorKeyframeTrack:()=>Rx,ColorManagement:()=>ia,CompressedArrayTexture:()=>gU,CompressedTexture:()=>Ex,CompressedTextureLoader:()=>IU,ConeBufferGeometry:()=>tB,ConeGeometry:()=>Og,CubeCamera:()=>$D,CubeReflectionMapping:()=>df,CubeRefractionMapping:()=>ff,CubeTexture:()=>Rg,CubeTextureLoader:()=>Mx,CubeUVReflectionMapping:()=>Ky,CubicBezierCurve:()=>Tx,CubicBezierCurve3:()=>rC,CubicInterpolant:()=>uC,CullFaceBack:()=>T4,CullFaceFront:()=>Ghe,CullFaceFrontBack:()=>Zft,CullFaceNone:()=>khe,Curve:()=>Ua,CurvePath:()=>nC,CustomBlending:()=>Yp,CustomToneMapping:()=>lpe,CylinderBufferGeometry:()=>rB,CylinderGeometry:()=>Hl,Cylindrical:()=>zU,Data3DTexture:()=>mx,DataArrayTexture:()=>By,DataTexture:()=>Pl,DataTextureLoader:()=>zg,DataUtils:()=>tE,DecrementStencilOp:()=>omt,DecrementWrapStencilOp:()=>cmt,DefaultLoadingManager:()=>vo,DepthFormat:()=>pf,DepthStencilFormat:()=>Np,DepthTexture:()=>gf,DirectionalLight:()=>Ns,DirectionalLightHelper:()=>Nx,DiscreteInterpolant:()=>hC,DodecahedronBufferGeometry:()=>iB,DodecahedronGeometry:()=>Pg,DoubleSide:()=>bi,DstAlphaFactor:()=>$y,DstColorFactor:()=>Zy,DynamicCopyUsage:()=>_mt,DynamicDrawUsage:()=>ymt,DynamicReadUsage:()=>bmt,EdgesGeometry:()=>Jo,EllipseCurve:()=>Gp,EqualDepth:()=>Jhe,EqualStencilFunc:()=>dmt,EquirectangularReflectionMapping:()=>Sg,EquirectangularRefractionMapping:()=>cx,Euler:()=>_r,EventDispatcher:()=>Zo,ExtrudeBufferGeometry:()=>nB,ExtrudeGeometry:()=>Vp,FileLoader:()=>di,Float16BufferAttribute:()=>nU,Float32BufferAttribute:()=>dt,Float64BufferAttribute:()=>sU,FloatType:()=>La,Fog:()=>Zu,FogExp2:()=>Vy,FramebufferTexture:()=>mU,FrontSide:()=>Xi,Frustum:()=>na,GLBufferAttribute:()=>GU,GLSL1:()=>wmt,GLSL3:()=>X4,GreaterDepth:()=>epe,GreaterEqualDepth:()=>Qhe,GreaterEqualStencilFunc:()=>vmt,GreaterStencilFunc:()=>mmt,GridHelper:()=>Px,Group:()=>ar,HalfFloatType:()=>$o,HemisphereLight:()=>bf,HemisphereLightHelper:()=>YU,HemisphereLightProbe:()=>DU,IcosahedronBufferGeometry:()=>sB,IcosahedronGeometry:()=>Lg,ImageBitmapLoader:()=>Cx,ImageLoader:()=>Vg,ImageUtils:()=>fx,IncrementStencilOp:()=>amt,IncrementWrapStencilOp:()=>lmt,InstancedBufferAttribute:()=>kp,InstancedBufferGeometry:()=>mC,InstancedInterleavedBuffer:()=>kU,InstancedMesh:()=>sn,Int16BufferAttribute:()=>rU,Int32BufferAttribute:()=>iU,Int8BufferAttribute:()=>Q4,IntType:()=>hpe,InterleavedBuffer:()=>Bp,InterleavedBufferAttribute:()=>ho,Interpolant:()=>jp,InterpolateDiscrete:()=>Lp,InterpolateLinear:()=>$u,InterpolateSmooth:()=>zD,InvertStencilOp:()=>umt,KeepStencilOp:()=>jD,KeyframeTrack:()=>Qo,LOD:()=>eC,LatheBufferGeometry:()=>aB,LatheGeometry:()=>vf,Layers:()=>ky,LessDepth:()=>Khe,LessEqualDepth:()=>qD,LessEqualStencilFunc:()=>fmt,LessStencilFunc:()=>pmt,Light:()=>kl,LightProbe:()=>Wy,Line:()=>Sr,Line3:()=>Ga,LineBasicMaterial:()=>br,LineCurve:()=>jy,LineCurve3:()=>iC,LineDashedMaterial:()=>kg,LineLoop:()=>zy,LineSegments:()=>Kr,LinearEncoding:()=>Nl,LinearFilter:()=>hi,LinearInterpolant:()=>wx,LinearMipMapLinearFilter:()=>rmt,LinearMipMapNearestFilter:()=>tmt,LinearMipmapLinearFilter:()=>Ha,LinearMipmapNearestFilter:()=>jg,LinearSRGBColorSpace:()=>Uy,LinearToneMapping:()=>npe,Loader:()=>pi,LoaderUtils:()=>qs,LoadingManager:()=>eh,LoopOnce:()=>xpe,LoopPingPong:()=>_pe,LoopRepeat:()=>Ipe,LuminanceAlphaFormat:()=>mpe,LuminanceFormat:()=>xC,MOUSE:()=>TC,Material:()=>qr,MaterialLoader:()=>qy,MathUtils:()=>fr,Matrix3:()=>Ui,Matrix4:()=>Be,MaxEquation:()=>_4,Mesh:()=>Je,MeshBasicMaterial:()=>Xt,MeshDepthMaterial:()=>Up,MeshDistanceMaterial:()=>vx,MeshLambertMaterial:()=>Bl,MeshMatcapMaterial:()=>cC,MeshNormalMaterial:()=>Tf,MeshPhongMaterial:()=>Ws,MeshPhysicalMaterial:()=>Ul,MeshStandardMaterial:()=>Ef,MeshToonMaterial:()=>lC,MinEquation:()=>I4,MirroredRepeatWrapping:()=>Pp,MixOperation:()=>rpe,MultiplyBlending:()=>x4,MultiplyOperation:()=>Bx,NearestFilter:()=>Oi,NearestMipMapLinearFilter:()=>emt,NearestMipMapNearestFilter:()=>Qft,NearestMipmapLinearFilter:()=>Cp,NearestMipmapNearestFilter:()=>mf,NeverDepth:()=>$he,NeverStencilFunc:()=>hmt,NoBlending:()=>zi,NoColorSpace:()=>imt,NoToneMapping:()=>Yu,NormalAnimationBlendMode:()=>_C,NormalBlending:()=>xg,NotEqualDepth:()=>tpe,NotEqualStencilFunc:()=>gmt,NumberKeyframeTrack:()=>Vc,Object3D:()=>qt,ObjectLoader:()=>RU,ObjectSpaceNormalMap:()=>wpe,OctahedronBufferGeometry:()=>oB,OctahedronGeometry:()=>yf,OneFactor:()=>Xy,OneMinusDstAlphaFactor:()=>qhe,OneMinusDstColorFactor:()=>Yhe,OneMinusSrcAlphaFactor:()=>yB,OneMinusSrcColorFactor:()=>Whe,OrthographicCamera:()=>Ni,PCFShadowMap:()=>vB,PCFSoftShadowMap:()=>Yy,PMREMGenerator:()=>Hp,Path:()=>Ju,PerspectiveCamera:()=>Vr,Plane:()=>Ri,PlaneBufferGeometry:()=>lB,PlaneGeometry:()=>En,PlaneHelper:()=>ZU,PointLight:()=>zc,PointLightHelper:()=>qU,Points:()=>Bi,PointsMaterial:()=>Rn,PolarGridHelper:()=>XU,PolyhedronBufferGeometry:()=>cB,PolyhedronGeometry:()=>Gc,PositionalAudio:()=>PU,PropertyBinding:()=>Cr,PropertyMixer:()=>yC,QuadraticBezierCurve:()=>bx,QuadraticBezierCurve3:()=>xx,Quaternion:()=>Br,QuaternionKeyframeTrack:()=>Ba,QuaternionLinearInterpolant:()=>pC,RED_GREEN_RGTC2_Format:()=>q4,RED_RGTC1_Format:()=>bpe,REVISION:()=>EC,RGBADepthPacking:()=>Qy,RGBAFormat:()=>zs,RGBAIntegerFormat:()=>Epe,RGBA_ASTC_10x10_Format:()=>V4,RGBA_ASTC_10x5_Format:()=>B4,RGBA_ASTC_10x6_Format:()=>k4,RGBA_ASTC_10x8_Format:()=>G4,RGBA_ASTC_12x10_Format:()=>z4,RGBA_ASTC_12x12_Format:()=>j4,RGBA_ASTC_4x4_Format:()=>A4,RGBA_ASTC_5x4_Format:()=>O4,RGBA_ASTC_5x5_Format:()=>P4,RGBA_ASTC_6x5_Format:()=>N4,RGBA_ASTC_6x6_Format:()=>L4,RGBA_ASTC_8x5_Format:()=>F4,RGBA_ASTC_8x6_Format:()=>H4,RGBA_ASTC_8x8_Format:()=>U4,RGBA_BPTC_Format:()=>VD,RGBA_ETC2_EAC_Format:()=>C4,RGBA_PVRTC_2BPPV1_Format:()=>M4,RGBA_PVRTC_4BPPV1_Format:()=>R4,RGBA_S3TC_DXT1_Format:()=>BD,RGBA_S3TC_DXT3_Format:()=>kD,RGBA_S3TC_DXT5_Format:()=>GD,RGB_ETC1_Format:()=>Tpe,RGB_ETC2_Format:()=>D4,RGB_PVRTC_2BPPV1_Format:()=>w4,RGB_PVRTC_4BPPV1_Format:()=>S4,RGB_S3TC_DXT1_Format:()=>UD,RGFormat:()=>vpe,RGIntegerFormat:()=>ype,RawShaderMaterial:()=>oC,Ray:()=>Ko,Raycaster:()=>ka,RectAreaLight:()=>dC,RedFormat:()=>IC,RedIntegerFormat:()=>gpe,ReinhardToneMapping:()=>spe,RepeatWrapping:()=>yn,ReplaceStencilOp:()=>smt,ReverseSubtractEquation:()=>zhe,RingBufferGeometry:()=>uB,RingGeometry:()=>Fg,SIGNED_RED_GREEN_RGTC2_Format:()=>Y4,SIGNED_RED_RGTC1_Format:()=>W4,SRGBColorSpace:()=>Uc,Scene:()=>wn,ShaderChunk:()=>Zr,ShaderLib:()=>Bc,ShaderMaterial:()=>Zt,ShadowMaterial:()=>aC,Shape:()=>Fa,ShapeBufferGeometry:()=>hB,ShapeGeometry:()=>Qu,ShapePath:()=>Hx,ShapeUtils:()=>Ps,ShortType:()=>upe,Skeleton:()=>Fl,SkeletonHelper:()=>WU,SkinnedMesh:()=>Ku,Source:()=>kc,Sphere:()=>$i,SphereBufferGeometry:()=>pB,SphereGeometry:()=>po,Spherical:()=>xf,SphericalHarmonics3:()=>fC,SplineCurve:()=>Dg,SpotLight:()=>th,SpotLightHelper:()=>jU,Sprite:()=>QD,SpriteMaterial:()=>yx,SrcAlphaFactor:()=>Ux,SrcAlphaSaturateFactor:()=>Xhe,SrcColorFactor:()=>jhe,StaticCopyUsage:()=>Imt,StaticDrawUsage:()=>hx,StaticReadUsage:()=>Tmt,StereoCamera:()=>AU,StreamCopyUsage:()=>Smt,StreamDrawUsage:()=>Emt,StreamReadUsage:()=>xmt,StringKeyframeTrack:()=>qp,SubtractEquation:()=>Vhe,SubtractiveBlending:()=>b4,TOUCH:()=>$ft,TangentSpaceNormalMap:()=>_f,TetrahedronBufferGeometry:()=>dB,TetrahedronGeometry:()=>Hg,Texture:()=>Pi,TextureLoader:()=>gs,TorusBufferGeometry:()=>fB,TorusGeometry:()=>zp,TorusKnotBufferGeometry:()=>mB,TorusKnotGeometry:()=>Ug,Triangle:()=>pn,TriangleFanDrawMode:()=>Jy,TriangleStripDrawMode:()=>Gx,TrianglesDrawMode:()=>TB,TubeBufferGeometry:()=>gB,TubeGeometry:()=>Bg,TwoPassDoubleSide:()=>Jft,UVMapping:()=>bC,Uint16BufferAttribute:()=>wg,Uint32BufferAttribute:()=>gx,Uint8BufferAttribute:()=>eU,Uint8ClampedBufferAttribute:()=>tU,Uniform:()=>Ox,UniformsGroup:()=>BU,UniformsLib:()=>At,UniformsUtils:()=>dn,UnsignedByteType:()=>Xu,UnsignedInt248Type:()=>Ap,UnsignedIntType:()=>hf,UnsignedShort4444Type:()=>ppe,UnsignedShort5551Type:()=>dpe,UnsignedShortType:()=>kx,VSMShadowMap:()=>Py,Vector2:()=>ce,Vector3:()=>D,Vector4:()=>jr,VectorKeyframeTrack:()=>fo,VideoTexture:()=>fU,WebGL1Renderer:()=>JD,WebGL3DRenderTarget:()=>K4,WebGLArrayRenderTarget:()=>Z4,WebGLCubeRenderTarget:()=>ZD,WebGLMultipleRenderTargets:()=>J4,WebGLRenderTarget:()=>Wr,WebGLRenderer:()=>go,WebGLUtils:()=>Hpe,WireframeGeometry:()=>sC,WrapAroundEnding:()=>ux,ZeroCurvatureEnding:()=>Eg,ZeroFactor:()=>If,ZeroSlopeEnding:()=>Tg,ZeroStencilOp:()=>nmt,_SRGBAFormat:()=>YD,sRGBEncoding:()=>yr});var EC="149",TC={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},$ft={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},khe=0,T4=1,Ghe=2,Zft=3,Kft=0,vB=1,Yy=2,Py=3,Xi=0,$n=1,bi=2,Jft=2,zi=0,xg=1,Op=2,b4=3,x4=4,Yp=5,Na=100,Vhe=101,zhe=102,I4=103,_4=104,If=200,Xy=201,jhe=202,Whe=203,Ux=204,yB=205,$y=206,qhe=207,Zy=208,Yhe=209,Xhe=210,$he=0,Zhe=1,Khe=2,qD=3,Jhe=4,Qhe=5,epe=6,tpe=7,Bx=0,rpe=1,ipe=2,Yu=0,npe=1,spe=2,ape=3,ope=4,lpe=5,bC=300,df=301,ff=302,Sg=303,cx=304,Ky=306,yn=1e3,vn=1001,Pp=1002,Oi=1003,mf=1004,Qft=1004,Cp=1005,emt=1005,hi=1006,jg=1007,tmt=1007,Ha=1008,rmt=1008,Xu=1009,cpe=1010,upe=1011,kx=1012,hpe=1013,hf=1014,La=1015,$o=1016,ppe=1017,dpe=1018,Ap=1020,fpe=1021,zs=1023,xC=1024,mpe=1025,pf=1026,Np=1027,IC=1028,gpe=1029,vpe=1030,ype=1031,Epe=1033,UD=33776,BD=33777,kD=33778,GD=33779,S4=35840,w4=35841,R4=35842,M4=35843,Tpe=36196,D4=37492,C4=37496,A4=37808,O4=37809,P4=37810,N4=37811,L4=37812,F4=37813,H4=37814,U4=37815,B4=37816,k4=37817,G4=37818,V4=37819,z4=37820,j4=37821,VD=36492,bpe=36283,W4=36284,q4=36285,Y4=36286,xpe=2200,Ipe=2201,_pe=2202,Lp=2300,$u=2301,zD=2302,Eg=2400,Tg=2401,ux=2402,_C=2500,EB=2501,TB=0,Gx=1,Jy=2,Nl=3e3,yr=3001,Spe=3200,Qy=3201,_f=0,wpe=1,imt="",Uc="srgb",Uy="srgb-linear",nmt=0,jD=7680,smt=7681,amt=7682,omt=7683,lmt=34055,cmt=34056,umt=5386,hmt=512,pmt=513,dmt=514,fmt=515,mmt=516,gmt=517,vmt=518,Rpe=519,hx=35044,ymt=35048,Emt=35040,Tmt=35045,bmt=35049,xmt=35041,Imt=35046,_mt=35050,Smt=35042,wmt="100",X4="300 es",YD=1035,Zo=class{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,r=i.length;t<r;t++)i[t].call(this,e);e.target=null}}},ra=["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"],Tue=1234567,Ig=Math.PI/180,px=180/Math.PI;function Xo(){let e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(ra[255&e]+ra[e>>8&255]+ra[e>>16&255]+ra[e>>24&255]+"-"+ra[255&t]+ra[t>>8&255]+"-"+ra[t>>16&15|64]+ra[t>>24&255]+"-"+ra[63&i|128]+ra[i>>8&255]+"-"+ra[i>>16&255]+ra[i>>24&255]+ra[255&r]+ra[r>>8&255]+ra[r>>16&255]+ra[r>>24&255]).toLowerCase()}function is(e,t,i){return Math.max(t,Math.min(i,e))}function bB(e,t){return(e%t+t)%t}function Rmt(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)}function Mmt(e,t,i){return e!==t?(i-e)/(t-e):0}function sx(e,t,i){return(1-i)*e+i*t}function Dmt(e,t,i,r){return sx(e,t,1-Math.exp(-i*r))}function Cmt(e,t=1){return t-Math.abs(bB(e,2*t)-t)}function Amt(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)}function Omt(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)}function Pmt(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Nmt(e,t){return e+Math.random()*(t-e)}function Lmt(e){return e*(.5-Math.random())}function Fmt(e){void 0!==e&&(Tue=e);let t=Tue+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}function Hmt(e){return e*Ig}function Umt(e){return e*px}function $4(e){return 0==(e&e-1)&&0!==e}function Mpe(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function XD(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function Bmt(e,t,i,r,n){let s=Math.cos,a=Math.sin,o=s(i/2),l=a(i/2),h=s((t+r)/2),u=a((t+r)/2),c=s((t-r)/2),p=a((t-r)/2),d=s((r-t)/2),f=a((r-t)/2);switch(n){case"XYX":e.set(o*u,l*c,l*p,o*h);break;case"YZY":e.set(l*p,o*u,l*c,o*h);break;case"ZXZ":e.set(l*c,l*p,o*u,o*h);break;case"XZX":e.set(o*u,l*f,l*d,o*h);break;case"YXY":e.set(l*d,o*u,l*f,o*h);break;case"ZYZ":e.set(l*f,l*d,o*u,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function Dp(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function hn(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}var fr=Object.freeze({__proto__:null,DEG2RAD:Ig,RAD2DEG:px,ceilPowerOfTwo:Mpe,clamp:is,damp:Dmt,degToRad:Hmt,denormalize:Dp,euclideanModulo:bB,floorPowerOfTwo:XD,generateUUID:Xo,inverseLerp:Mmt,isPowerOfTwo:$4,lerp:sx,mapLinear:Rmt,normalize:hn,pingpong:Cmt,radToDeg:Umt,randFloat:Nmt,randFloatSpread:Lmt,randInt:Pmt,seededRandom:Fmt,setQuaternionFromProperEuler:Bmt,smootherstep:Omt,smoothstep:Amt}),ce=class{constructor(e=0,t=0){ce.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),r=Math.sin(t),n=this.x-e.x,s=this.y-e.y;return this.x=n*i-s*r+e.x,this.y=n*r+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ui=class{constructor(){Ui.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,r,n,s,a,o,l){let h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=n,h[5]=o,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,r=t.elements,n=this.elements,s=i[0],a=i[3],o=i[6],l=i[1],h=i[4],u=i[7],c=i[2],p=i[5],d=i[8],f=r[0],m=r[3],g=r[6],y=r[1],v=r[4],T=r[7],x=r[2],b=r[5],E=r[8];return n[0]=s*f+a*y+o*x,n[3]=s*m+a*v+o*b,n[6]=s*g+a*T+o*E,n[1]=l*f+h*y+u*x,n[4]=l*m+h*v+u*b,n[7]=l*g+h*T+u*E,n[2]=c*f+p*y+d*x,n[5]=c*m+p*v+d*b,n[8]=c*g+p*T+d*E,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8];return t*s*h-t*a*l-i*n*h+i*a*o+r*n*l-r*s*o}invert(){let e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=h*s-a*l,c=a*o-h*n,p=l*n-s*o,d=t*u+i*c+r*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);let f=1/d;return e[0]=u*f,e[1]=(r*l-h*i)*f,e[2]=(a*i-r*s)*f,e[3]=c*f,e[4]=(h*t-r*o)*f,e[5]=(r*n-a*t)*f,e[6]=p*f,e[7]=(i*o-l*t)*f,e[8]=(s*t-i*n)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,n,s,a){let o=Math.cos(n),l=Math.sin(n);return this.set(i*o,i*l,-i*(o*s+l*a)+s+e,-r*l,r*o,-r*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(GH.makeScale(e,t)),this}rotate(e){return this.premultiply(GH.makeRotation(-e)),this}translate(e,t){return this.premultiply(GH.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}},GH=new Ui;function Dpe(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var kmt={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Ny(e,t){return new kmt[e](t)}function dx(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function _g(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function WD(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var VH={[Uc]:{[Uy]:_g},[Uy]:{[Uc]:WD}},ia={legacyMode:!0,get workingColorSpace(){return Uy},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,i){if(this.legacyMode||t===i||!t||!i)return e;if(VH[t]&&void 0!==VH[t][i]){let r=VH[t][i];return e.r=r(e.r),e.g=r(e.g),e.b=r(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},Cpe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},xs={r:0,g:0,b:0},Lc={h:0,s:0,l:0},QM={h:0,s:0,l:0};function zH(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}function eD(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}var Ve=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Uc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,ia.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=ia.workingColorSpace){return this.r=e,this.g=t,this.b=i,ia.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=ia.workingColorSpace){if(e=bB(e,1),t=is(t,0,1),i=is(i,0,1),0===t)this.r=this.g=this.b=i;else{let r=i<=.5?i*(1+t):i+t-i*t,n=2*i-r;this.r=zH(n,r,e+1/3),this.g=zH(n,r,e),this.b=zH(n,r,e-1/3)}return ia.toWorkingColorSpace(this,r),this}setStyle(e,t=Uc){function i(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e,n=r[1],s=r[2];switch(n){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,ia.toWorkingColorSpace(this,t),i(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,ia.toWorkingColorSpace(this,t),i(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){let r=parseFloat(e[1])/360,n=parseFloat(e[2])/100,s=parseFloat(e[3])/100;return i(e[4]),this.setHSL(r,n,s,t)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let e=r[1],i=e.length;if(3===i)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,ia.toWorkingColorSpace(this,t),this;if(6===i)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,ia.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=Uc){let i=Cpe[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=_g(e.r),this.g=_g(e.g),this.b=_g(e.b),this}copyLinearToSRGB(e){return this.r=WD(e.r),this.g=WD(e.g),this.b=WD(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Uc){return ia.fromWorkingColorSpace(eD(this,xs),e),is(255*xs.r,0,255)<<16^is(255*xs.g,0,255)<<8^is(255*xs.b,0,255)<<0}getHexString(e=Uc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ia.workingColorSpace){ia.fromWorkingColorSpace(eD(this,xs),t);let i,r,n=xs.r,s=xs.g,a=xs.b,o=Math.max(n,s,a),l=Math.min(n,s,a),h=(l+o)/2;if(l===o)i=0,r=0;else{let e=o-l;switch(r=h<=.5?e/(o+l):e/(2-o-l),o){case n:i=(s-a)/e+(s<a?6:0);break;case s:i=(a-n)/e+2;break;case a:i=(n-s)/e+4}i/=6}return e.h=i,e.s=r,e.l=h,e}getRGB(e,t=ia.workingColorSpace){return ia.fromWorkingColorSpace(eD(this,xs),t),e.r=xs.r,e.g=xs.g,e.b=xs.b,e}getStyle(e=Uc){return ia.fromWorkingColorSpace(eD(this,xs),e),e!==Uc?`color(${e} ${xs.r} ${xs.g} ${xs.b})`:`rgb(${255*xs.r|0},${255*xs.g|0},${255*xs.b|0})`}offsetHSL(e,t,i){return this.getHSL(Lc),Lc.h+=e,Lc.s+=t,Lc.l+=i,this.setHSL(Lc.h,Lc.s,Lc.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Lc),e.getHSL(QM);let i=sx(Lc.h,QM.h,t),r=sx(Lc.s,QM.s,t),n=sx(Lc.l,QM.l,t);return this.setHSL(i,r,n),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};Ve.NAMES=Cpe;var my,fx=class{static getDataURL(e){if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===my&&(my=dx("canvas")),my.width=e.width,my.height=e.height;let i=my.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=my}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=dx("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height),n=r.data;for(let e=0;e<n.length;e++)n[e]=255*_g(n[e]/255);return i.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*_g(t[e]/255)):t[e]=_g(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},kc=class{constructor(e=null){this.isSource=!0,this.uuid=Xo(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let i={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,i=r.length;t<i;t++)r[t].isDataTexture?e.push(jH(r[t].image)):e.push(jH(r[t]))}else e=jH(r);i.url=e}return t||(e.images[this.uuid]=i),i}};function jH(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?fx.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Gmt=0,Pi=class extends Zo{constructor(e=Pi.DEFAULT_IMAGE,t=Pi.DEFAULT_MAPPING,i=vn,r=vn,n=hi,s=Ha,a=zs,o=Xu,l=Pi.DEFAULT_ANISOTROPY,h=Nl){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Gmt++}),this.uuid=Xo(),this.name="",this.source=new kc(e),this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=r,this.magFilter=n,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new ce(0,0),this.repeat=new ce(1,1),this.center=new ce(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ui,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),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.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,repeat:[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,type:this.type,encoding:this.encoding,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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==bC)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case yn:e.x=e.x-Math.floor(e.x);break;case vn:e.x=e.x<0?0:1;break;case Pp: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 yn:e.y=e.y-Math.floor(e.y);break;case vn:e.y=e.y<0?0:1;break;case Pp:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}};Pi.DEFAULT_IMAGE=null,Pi.DEFAULT_MAPPING=bC,Pi.DEFAULT_ANISOTROPY=1;var jr=class{constructor(e=0,t=0,i=0,r=1){jr.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,r=this.z,n=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r+s[12]*n,this.y=s[1]*t+s[5]*i+s[9]*r+s[13]*n,this.z=s[2]*t+s[6]*i+s[10]*r+s[14]*n,this.w=s[3]*t+s[7]*i+s[11]*r+s[15]*n,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,n,s=e.elements,a=s[0],o=s[4],l=s[8],h=s[1],u=s[5],c=s[9],p=s[2],d=s[6],f=s[10];if(Math.abs(o-h)<.01&&Math.abs(l-p)<.01&&Math.abs(c-d)<.01){if(Math.abs(o+h)<.1&&Math.abs(l+p)<.1&&Math.abs(c+d)<.1&&Math.abs(a+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let e=(a+1)/2,s=(u+1)/2,m=(f+1)/2,g=(o+h)/4,y=(l+p)/4,v=(c+d)/4;return e>s&&e>m?e<.01?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(e),r=g/i,n=y/i):s>m?s<.01?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(s),i=g/r,n=v/r):m<.01?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(m),i=y/n,r=v/n),this.set(i,r,n,t),this}let m=Math.sqrt((d-c)*(d-c)+(l-p)*(l-p)+(h-o)*(h-o));return Math.abs(m)<.001&&(m=1),this.x=(d-c)/m,this.y=(l-p)/m,this.z=(h-o)/m,this.w=Math.acos((a+u+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Wr=class extends Zo{constructor(e=1,t=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new jr(0,0,e,t),this.scissorTest=!1,this.viewport=new jr(0,0,e,t);let r={width:e,height:t,depth:1};this.texture=new Pi(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:hi,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null,this.samples=void 0!==i.samples?i.samples:0}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new kc(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},By=class extends Pi{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Oi,this.minFilter=Oi,this.wrapR=vn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Z4=class extends Wr{constructor(e=1,t=1,i=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new By(null,e,t,i),this.texture.isRenderTargetTexture=!0}},mx=class extends Pi{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Oi,this.minFilter=Oi,this.wrapR=vn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},K4=class extends Wr{constructor(e=1,t=1,i=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new mx(null,e,t,i),this.texture.isRenderTargetTexture=!0}},J4=class extends Wr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;let n=this.texture;this.texture=[];for(let s=0;s<i;s++)this.texture[s]=n.clone(),this.texture[s].isRenderTargetTexture=!0}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,n=this.texture.length;r<n;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=i;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,i=e.texture.length;t<i;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}},Br=class{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,n,s,a){let o=i[r+0],l=i[r+1],h=i[r+2],u=i[r+3],c=n[s+0],p=n[s+1],d=n[s+2],f=n[s+3];if(0===a)return e[t+0]=o,e[t+1]=l,e[t+2]=h,void(e[t+3]=u);if(1===a)return e[t+0]=c,e[t+1]=p,e[t+2]=d,void(e[t+3]=f);if(u!==f||o!==c||l!==p||h!==d){let e=1-a,t=o*c+l*p+h*d+u*f,i=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){let n=Math.sqrt(r),s=Math.atan2(n,t*i);e=Math.sin(e*s)/n,a=Math.sin(a*s)/n}let n=a*i;if(o=o*e+c*n,l=l*e+p*n,h=h*e+d*n,u=u*e+f*n,e===1-a){let e=1/Math.sqrt(o*o+l*l+h*h+u*u);o*=e,l*=e,h*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,r,n,s){let a=i[r],o=i[r+1],l=i[r+2],h=i[r+3],u=n[s],c=n[s+1],p=n[s+2],d=n[s+3];return e[t]=a*d+h*u+o*p-l*c,e[t+1]=o*d+h*c+l*u-a*p,e[t+2]=l*d+h*p+a*c-o*u,e[t+3]=h*d-a*u-o*c-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){let i=e._x,r=e._y,n=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(i/2),h=a(r/2),u=a(n/2),c=o(i/2),p=o(r/2),d=o(n/2);switch(s){case"XYZ":this._x=c*h*u+l*p*d,this._y=l*p*u-c*h*d,this._z=l*h*d+c*p*u,this._w=l*h*u-c*p*d;break;case"YXZ":this._x=c*h*u+l*p*d,this._y=l*p*u-c*h*d,this._z=l*h*d-c*p*u,this._w=l*h*u+c*p*d;break;case"ZXY":this._x=c*h*u-l*p*d,this._y=l*p*u+c*h*d,this._z=l*h*d+c*p*u,this._w=l*h*u-c*p*d;break;case"ZYX":this._x=c*h*u-l*p*d,this._y=l*p*u+c*h*d,this._z=l*h*d-c*p*u,this._w=l*h*u+c*p*d;break;case"YZX":this._x=c*h*u+l*p*d,this._y=l*p*u+c*h*d,this._z=l*h*d-c*p*u,this._w=l*h*u-c*p*d;break;case"XZY":this._x=c*h*u-l*p*d,this._y=l*p*u-c*h*d,this._z=l*h*d+c*p*u,this._w=l*h*u+c*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],r=t[4],n=t[8],s=t[1],a=t[5],o=t[9],l=t[2],h=t[6],u=t[10],c=i+a+u;if(c>0){let e=.5/Math.sqrt(c+1);this._w=.25/e,this._x=(h-o)*e,this._y=(n-l)*e,this._z=(s-r)*e}else if(i>a&&i>u){let e=2*Math.sqrt(1+i-a-u);this._w=(h-o)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(n+l)/e}else if(a>u){let e=2*Math.sqrt(1+a-i-u);this._w=(n-l)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(o+h)/e}else{let e=2*Math.sqrt(1+u-i-a);this._w=(s-r)/e,this._x=(n+l)/e,this._y=(o+h)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(is(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(0===i)return this;let r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,r=e._y,n=e._z,s=e._w,a=t._x,o=t._y,l=t._z,h=t._w;return this._x=i*h+s*a+r*l-n*o,this._y=r*h+s*o+n*a-i*l,this._z=n*h+s*l+i*o-r*a,this._w=s*h-i*a-r*o-n*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let i=this._x,r=this._y,n=this._z,s=this._w,a=s*e._w+i*e._x+r*e._y+n*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=i,this._y=r,this._z=n,this;let o=1-a*a;if(o<=Number.EPSILON){let e=1-t;return this._w=e*s+t*this._w,this._x=e*i+t*this._x,this._y=e*r+t*this._y,this._z=e*n+t*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(o),h=Math.atan2(l,a),u=Math.sin((1-t)*h)/l,c=Math.sin(t*h)/l;return this._w=s*u+this._w*c,this._x=i*u+this._x*c,this._y=r*u+this._y*c,this._z=n*u+this._z*c,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),n=2*Math.PI*Math.random();return this.set(t*Math.cos(r),i*Math.sin(n),i*Math.cos(n),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},D=class{constructor(e=0,t=0,i=0){D.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(bue.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(bue.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6]*r,this.y=n[1]*t+n[4]*i+n[7]*r,this.z=n[2]*t+n[5]*i+n[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,r=this.z,n=e.elements,s=1/(n[3]*t+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*t+n[4]*i+n[8]*r+n[12])*s,this.y=(n[1]*t+n[5]*i+n[9]*r+n[13])*s,this.z=(n[2]*t+n[6]*i+n[10]*r+n[14])*s,this}applyQuaternion(e){let t=this.x,i=this.y,r=this.z,n=e.x,s=e.y,a=e.z,o=e.w,l=o*t+s*r-a*i,h=o*i+a*t-n*r,u=o*r+n*i-s*t,c=-n*t-s*i-a*r;return this.x=l*o+c*-n+h*-a-u*-s,this.y=h*o+c*-s+u*-n-l*-a,this.z=u*o+c*-a+l*-s-h*-n,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r,this.y=n[1]*t+n[5]*i+n[9]*r,this.z=n[2]*t+n[6]*i+n[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,r=e.y,n=e.z,s=t.x,a=t.y,o=t.z;return this.x=r*o-n*a,this.y=n*s-i*o,this.z=i*a-r*s,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return WH.copy(this).projectOnVector(e),this.sub(WH)}reflect(e){return this.sub(WH.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(is(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-ap(e,2));return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},WH=new D,bue=new Br,Rt=class{constructor(e=new D(1/0,1/0,1/0),t=new D(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,r=1/0,n=-1/0,s=-1/0,a=-1/0;for(let o=0,l=e.length;o<l;o+=3){let l=e[o],h=e[o+1],u=e[o+2];l<t&&(t=l),h<i&&(i=h),u<r&&(r=u),l>n&&(n=l),h>s&&(s=h),u>a&&(a=u)}return this.min.set(t,i,r),this.max.set(n,s,a),this}setFromBufferAttribute(e){let t=1/0,i=1/0,r=1/0,n=-1/0,s=-1/0,a=-1/0;for(let o=0,l=e.count;o<l;o++){let l=e.getX(o),h=e.getY(o),u=e.getZ(o);l<t&&(t=l),h<i&&(i=h),u<r&&(r=u),l>n&&(n=l),h>s&&(s=h),u>a&&(a=u)}return this.min.set(t,i,r),this.max.set(n,s,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=cg.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(void 0!==i)if(t&&null!=i.attributes&&void 0!==i.attributes.position){let t=i.attributes.position;for(let i=0,r=t.count;i<r;i++)cg.fromBufferAttribute(t,i).applyMatrix4(e.matrixWorld),this.expandByPoint(cg)}else null===i.boundingBox&&i.computeBoundingBox(),qH.copy(i.boundingBox),qH.applyMatrix4(e.matrixWorld),this.union(qH);let r=e.children;for(let n=0,s=r.length;n<s;n++)this.expandByObject(r[n],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,cg),cg.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(qb),tD.subVectors(this.max,qb),gy.subVectors(e.a,qb),vy.subVectors(e.b,qb),yy.subVectors(e.c,qb),af.subVectors(vy,gy),of.subVectors(yy,vy),ug.subVectors(gy,yy);let t=[0,-af.z,af.y,0,-of.z,of.y,0,-ug.z,ug.y,af.z,0,-af.x,of.z,0,-of.x,ug.z,0,-ug.x,-af.y,af.x,0,-of.y,of.x,0,-ug.y,ug.x,0];return!(!YH(t,gy,vy,yy,tD)||(t=[1,0,0,0,1,0,0,0,1],!YH(t,gy,vy,yy,tD)))&&(rD.crossVectors(af,of),t=[rD.x,rD.y,rD.z],YH(t,gy,vy,yy,tD))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return cg.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(cg).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(xp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xp)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},xp=[new D,new D,new D,new D,new D,new D,new D,new D],cg=new D,qH=new Rt,gy=new D,vy=new D,yy=new D,af=new D,of=new D,ug=new D,qb=new D,tD=new D,rD=new D,hg=new D;function YH(e,t,i,r,n){for(let s=0,a=e.length-3;s<=a;s+=3){hg.fromArray(e,s);let a=n.x*Math.abs(hg.x)+n.y*Math.abs(hg.y)+n.z*Math.abs(hg.z),o=t.dot(hg),l=i.dot(hg),h=r.dot(hg);if(Math.max(-Math.max(o,l,h),Math.min(o,l,h))>a)return!1}return!0}var Vmt=new Rt,Yb=new D,XH=new D,$i=class{constructor(e=new D,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;void 0!==t?i.copy(t):Vmt.setFromPoints(e).getCenter(i);let r=0;for(let n=0,s=e.length;n<s;n++)r=Math.max(r,i.distanceToSquared(e[n]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Yb.subVectors(e,this.center);let t=Yb.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),i=.5*(e-this.radius);this.center.addScaledVector(Yb,i/e),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(XH.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Yb.copy(e.center).add(XH)),this.expandByPoint(Yb.copy(e.center).sub(XH))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}},Ip=new D,$H=new D,iD=new D,lf=new D,ZH=new D,nD=new D,KH=new D,Ko=class{constructor(e=new D,t=new D(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ip)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Ip.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ip.copy(this.direction).multiplyScalar(t).add(this.origin),Ip.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){$H.copy(e).add(t).multiplyScalar(.5),iD.copy(t).sub(e).normalize(),lf.copy(this.origin).sub($H);let n,s,a,o,l=.5*e.distanceTo(t),h=-this.direction.dot(iD),u=lf.dot(this.direction),c=-lf.dot(iD),p=lf.lengthSq(),d=Math.abs(1-h*h);if(d>0)if(n=h*c-u,s=h*u-c,o=l*d,n>=0)if(s>=-o)if(s<=o){let e=1/d;n*=e,s*=e,a=n*(n+h*s+2*u)+s*(h*n+s+2*c)+p}else s=l,n=Math.max(0,-(h*s+u)),a=-n*n+s*(s+2*c)+p;else s=-l,n=Math.max(0,-(h*s+u)),a=-n*n+s*(s+2*c)+p;else s<=-o?(n=Math.max(0,-(-h*l+u)),s=n>0?-l:Math.min(Math.max(-l,-c),l),a=-n*n+s*(s+2*c)+p):s<=o?(n=0,s=Math.min(Math.max(-l,-c),l),a=s*(s+2*c)+p):(n=Math.max(0,-(h*l+u)),s=n>0?l:Math.min(Math.max(-l,-c),l),a=-n*n+s*(s+2*c)+p);else s=h>0?-l:l,n=Math.max(0,-(h*s+u)),a=-n*n+s*(s+2*c)+p;return i&&i.copy(this.direction).multiplyScalar(n).add(this.origin),r&&r.copy(iD).multiplyScalar(s).add($H),a}intersectSphere(e,t){Ip.subVectors(e.center,this.origin);let i=Ip.dot(this.direction),r=Ip.dot(Ip)-i*i,n=e.radius*e.radius;if(r>n)return null;let s=Math.sqrt(n-r),a=i-s,o=i+s;return a<0&&o<0?null:a<0?this.at(o,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,n,s,a,o,l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,c=this.origin;return l>=0?(i=(e.min.x-c.x)*l,r=(e.max.x-c.x)*l):(i=(e.max.x-c.x)*l,r=(e.min.x-c.x)*l),h>=0?(n=(e.min.y-c.y)*h,s=(e.max.y-c.y)*h):(n=(e.max.y-c.y)*h,s=(e.min.y-c.y)*h),i>s||n>r||((n>i||isNaN(i))&&(i=n),(s<r||isNaN(r))&&(r=s),u>=0?(a=(e.min.z-c.z)*u,o=(e.max.z-c.z)*u):(a=(e.max.z-c.z)*u,o=(e.min.z-c.z)*u),i>o||a>r)||((a>i||i!=i)&&(i=a),(o<r||r!=r)&&(r=o),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return null!==this.intersectBox(e,Ip)}intersectTriangle(e,t,i,r,n){ZH.subVectors(t,e),nD.subVectors(i,e),KH.crossVectors(ZH,nD);let s,a=this.direction.dot(KH);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}lf.subVectors(this.origin,e);let o=s*this.direction.dot(nD.crossVectors(lf,nD));if(o<0)return null;let l=s*this.direction.dot(ZH.cross(lf));if(l<0||o+l>a)return null;let h=-s*lf.dot(KH);return h<0?null:this.at(h/a,n)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}},Be=class{constructor(){Be.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=n,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=h,g[10]=u,g[14]=c,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Be).fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,r=1/Ey.setFromMatrixColumn(e,0).length(),n=1/Ey.setFromMatrixColumn(e,1).length(),s=1/Ey.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*n,t[5]=i[5]*n,t[6]=i[6]*n,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,r=e.y,n=e.z,s=Math.cos(i),a=Math.sin(i),o=Math.cos(r),l=Math.sin(r),h=Math.cos(n),u=Math.sin(n);if("XYZ"===e.order){let e=s*h,i=s*u,r=a*h,n=a*u;t[0]=o*h,t[4]=-o*u,t[8]=l,t[1]=i+r*l,t[5]=e-n*l,t[9]=-a*o,t[2]=n-e*l,t[6]=r+i*l,t[10]=s*o}else if("YXZ"===e.order){let e=o*h,i=o*u,r=l*h,n=l*u;t[0]=e+n*a,t[4]=r*a-i,t[8]=s*l,t[1]=s*u,t[5]=s*h,t[9]=-a,t[2]=i*a-r,t[6]=n+e*a,t[10]=s*o}else if("ZXY"===e.order){let e=o*h,i=o*u,r=l*h,n=l*u;t[0]=e-n*a,t[4]=-s*u,t[8]=r+i*a,t[1]=i+r*a,t[5]=s*h,t[9]=n-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){let e=s*h,i=s*u,r=a*h,n=a*u;t[0]=o*h,t[4]=r*l-i,t[8]=e*l+n,t[1]=o*u,t[5]=n*l+e,t[9]=i*l-r,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){let e=s*o,i=s*l,r=a*o,n=a*l;t[0]=o*h,t[4]=n-e*u,t[8]=r*u+i,t[1]=u,t[5]=s*h,t[9]=-a*h,t[2]=-l*h,t[6]=i*u+r,t[10]=e-n*u}else if("XZY"===e.order){let e=s*o,i=s*l,r=a*o,n=a*l;t[0]=o*h,t[4]=-u,t[8]=l*h,t[1]=e*u+n,t[5]=s*h,t[9]=i*u-r,t[2]=r*u-i,t[6]=a*h,t[10]=n*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(zmt,e,jmt)}lookAt(e,t,i){let r=this.elements;return qo.subVectors(e,t),0===qo.lengthSq()&&(qo.z=1),qo.normalize(),cf.crossVectors(i,qo),0===cf.lengthSq()&&(1===Math.abs(i.z)?qo.x+=1e-4:qo.z+=1e-4,qo.normalize(),cf.crossVectors(i,qo)),cf.normalize(),sD.crossVectors(qo,cf),r[0]=cf.x,r[4]=sD.x,r[8]=qo.x,r[1]=cf.y,r[5]=sD.y,r[9]=qo.y,r[2]=cf.z,r[6]=sD.z,r[10]=qo.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,r=t.elements,n=this.elements,s=i[0],a=i[4],o=i[8],l=i[12],h=i[1],u=i[5],c=i[9],p=i[13],d=i[2],f=i[6],m=i[10],g=i[14],y=i[3],v=i[7],T=i[11],x=i[15],b=r[0],E=r[4],_=r[8],w=r[12],S=r[1],M=r[5],I=r[9],D=r[13],A=r[2],R=r[6],C=r[10],O=r[14],P=r[3],N=r[7],L=r[11],F=r[15];return n[0]=s*b+a*S+o*A+l*P,n[4]=s*E+a*M+o*R+l*N,n[8]=s*_+a*I+o*C+l*L,n[12]=s*w+a*D+o*O+l*F,n[1]=h*b+u*S+c*A+p*P,n[5]=h*E+u*M+c*R+p*N,n[9]=h*_+u*I+c*C+p*L,n[13]=h*w+u*D+c*O+p*F,n[2]=d*b+f*S+m*A+g*P,n[6]=d*E+f*M+m*R+g*N,n[10]=d*_+f*I+m*C+g*L,n[14]=d*w+f*D+m*O+g*F,n[3]=y*b+v*S+T*A+x*P,n[7]=y*E+v*M+T*R+x*N,n[11]=y*_+v*I+T*C+x*L,n[15]=y*w+v*D+T*O+x*F,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],r=e[8],n=e[12],s=e[1],a=e[5],o=e[9],l=e[13],h=e[2],u=e[6],c=e[10],p=e[14];return e[3]*(+n*o*u-r*l*u-n*a*c+i*l*c+r*a*p-i*o*p)+e[7]*(+t*o*p-t*l*c+n*s*c-r*s*p+r*l*h-n*o*h)+e[11]*(+t*l*u-t*a*p-n*s*u+i*s*p+n*a*h-i*l*h)+e[15]*(-r*a*h-t*o*u+t*a*c+r*s*u-i*s*c+i*o*h)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,i){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],p=e[11],d=e[12],f=e[13],m=e[14],g=e[15],y=u*m*l-f*c*l+f*o*p-a*m*p-u*o*g+a*c*g,v=d*c*l-h*m*l-d*o*p+s*m*p+h*o*g-s*c*g,T=h*f*l-d*u*l+d*a*p-s*f*p-h*a*g+s*u*g,x=d*u*o-h*f*o-d*a*c+s*f*c+h*a*m-s*u*m,b=t*y+i*v+r*T+n*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let E=1/b;return e[0]=y*E,e[1]=(f*c*n-u*m*n-f*r*p+i*m*p+u*r*g-i*c*g)*E,e[2]=(a*m*n-f*o*n+f*r*l-i*m*l-a*r*g+i*o*g)*E,e[3]=(u*o*n-a*c*n-u*r*l+i*c*l+a*r*p-i*o*p)*E,e[4]=v*E,e[5]=(h*m*n-d*c*n+d*r*p-t*m*p-h*r*g+t*c*g)*E,e[6]=(d*o*n-s*m*n-d*r*l+t*m*l+s*r*g-t*o*g)*E,e[7]=(s*c*n-h*o*n+h*r*l-t*c*l-s*r*p+t*o*p)*E,e[8]=T*E,e[9]=(d*u*n-h*f*n-d*i*p+t*f*p+h*i*g-t*u*g)*E,e[10]=(s*f*n-d*a*n+d*i*l-t*f*l-s*i*g+t*a*g)*E,e[11]=(h*a*n-s*u*n-h*i*l+t*u*l+s*i*p-t*a*p)*E,e[12]=x*E,e[13]=(h*f*r-d*u*r+d*i*c-t*f*c-h*i*m+t*u*m)*E,e[14]=(d*a*r-s*f*r-d*i*o+t*f*o+s*i*m-t*a*m)*E,e[15]=(s*u*r-h*a*r+h*i*o-t*u*o-s*i*c+t*a*c)*E,this}scale(e){let t=this.elements,i=e.x,r=e.y,n=e.z;return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),r=Math.sin(t),n=1-i,s=e.x,a=e.y,o=e.z,l=n*s,h=n*a;return this.set(l*s+i,l*a-r*o,l*o+r*a,0,l*a+r*o,h*a+i,h*o-r*s,0,l*o-r*a,h*o+r*s,n*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,n,s){return this.set(1,i,n,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){let r=this.elements,n=t._x,s=t._y,a=t._z,o=t._w,l=n+n,h=s+s,u=a+a,c=n*l,p=n*h,d=n*u,f=s*h,m=s*u,g=a*u,y=o*l,v=o*h,T=o*u,x=i.x,b=i.y,E=i.z;return r[0]=(1-(f+g))*x,r[1]=(p+T)*x,r[2]=(d-v)*x,r[3]=0,r[4]=(p-T)*b,r[5]=(1-(c+g))*b,r[6]=(m+y)*b,r[7]=0,r[8]=(d+v)*E,r[9]=(m-y)*E,r[10]=(1-(c+f))*E,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){let r=this.elements,n=Ey.set(r[0],r[1],r[2]).length(),s=Ey.set(r[4],r[5],r[6]).length(),a=Ey.set(r[8],r[9],r[10]).length();this.determinant()<0&&(n=-n),e.x=r[12],e.y=r[13],e.z=r[14],Fc.copy(this);let o=1/n,l=1/s,h=1/a;return Fc.elements[0]*=o,Fc.elements[1]*=o,Fc.elements[2]*=o,Fc.elements[4]*=l,Fc.elements[5]*=l,Fc.elements[6]*=l,Fc.elements[8]*=h,Fc.elements[9]*=h,Fc.elements[10]*=h,t.setFromRotationMatrix(Fc),i.x=n,i.y=s,i.z=a,this}makePerspective(e,t,i,r,n,s){let a=this.elements,o=2*n/(t-e),l=2*n/(i-r),h=(t+e)/(t-e),u=(i+r)/(i-r),c=-(s+n)/(s-n),p=-2*s*n/(s-n);return a[0]=o,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=c,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,r,n,s){let a=this.elements,o=1/(t-e),l=1/(i-r),h=1/(s-n),u=(t+e)*o,c=(i+r)*l,p=(s+n)*h;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-c,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},Ey=new D,Fc=new Be,zmt=new D(0,0,0),jmt=new D(1,1,1),cf=new D,sD=new D,qo=new D,xue=new Be,Iue=new Br,_r=class{constructor(e=0,t=0,i=0,r=_r.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let r=e.elements,n=r[0],s=r[4],a=r[8],o=r[1],l=r[5],h=r[9],u=r[2],c=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(is(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-is(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,n),this._z=0);break;case"ZXY":this._x=Math.asin(is(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,n));break;case"ZYX":this._y=Math.asin(-is(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(c,p),this._z=Math.atan2(o,n)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(is(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,n)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-is(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,l),this._y=Math.atan2(a,n)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return xue.makeRotationFromQuaternion(e),this.setFromRotationMatrix(xue,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Iue.setFromEuler(this),this.setFromQuaternion(Iue,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};_r.DEFAULT_ORDER="XYZ";var ky=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}},Wmt=0,_ue=new D,Ty=new Br,_p=new Be,aD=new D,Xb=new D,qmt=new D,Ymt=new Br,Sue=new D(1,0,0),wue=new D(0,1,0),Rue=new D(0,0,1),Xmt={type:"added"},Mue={type:"removed"},qt=class extends Zo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Wmt++}),this.uuid=Xo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=qt.DEFAULT_UP.clone();let e=new D,t=new _r,i=new Br,r=new D(1,1,1);t._onChange((function(){i.setFromEuler(t,!1)})),i._onChange((function(){t.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Be},normalMatrix:{value:new Ui}}),this.matrix=new Be,this.matrixWorld=new Be,this.matrixAutoUpdate=qt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=qt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new ky,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Ty.setFromAxisAngle(e,t),this.quaternion.multiply(Ty),this}rotateOnWorldAxis(e,t){return Ty.setFromAxisAngle(e,t),this.quaternion.premultiply(Ty),this}rotateX(e){return this.rotateOnAxis(Sue,e)}rotateY(e){return this.rotateOnAxis(wue,e)}rotateZ(e){return this.rotateOnAxis(Rue,e)}translateOnAxis(e,t){return _ue.copy(e).applyQuaternion(this.quaternion),this.position.add(_ue.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Sue,e)}translateY(e){return this.translateOnAxis(wue,e)}translateZ(e){return this.translateOnAxis(Rue,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(_p.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?aD.copy(e):aD.set(e,t,i);let r=this.parent;this.updateWorldMatrix(!0,!1),Xb.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_p.lookAt(Xb,aD,this.up):_p.lookAt(aD,Xb,this.up),this.quaternion.setFromRotationMatrix(_p),r&&(_p.extractRotation(r.matrixWorld),Ty.setFromRotationMatrix(_p),this.quaternion.premultiply(Ty.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Xmt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Mue)),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){let t=this.children[e];t.parent=null,t.dispatchEvent(Mue)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),_p.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),_p.multiply(e.parent.matrixWorld)),e.applyMatrix4(_p),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){let r=this.children[i].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t){let i=[];this[e]===t&&i.push(this);for(let r=0,n=this.children.length;r<n;r++){let n=this.children[r].getObjectsByProperty(e,t);n.length>0&&(i=i.concat(n))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xb,e,qmt),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xb,Ymt,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,r=t.length;i<r;i++){let r=t[i];(!0===r.matrixWorldAutoUpdate||!0===e)&&r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){let i=this.parent;if(!0===e&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){let e=this.children;for(let t=0,i=e.length;t<i;t++){let i=e[t];!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!1,!0)}}}toJSON(e){let t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let r={};function n(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=n(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let i=t.shapes;if(Array.isArray(i))for(let t=0,r=i.length;t<r;t++){let r=i[t];n(e.shapes,r)}else n(e.shapes,i)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(n(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let t=[];for(let i=0,r=this.material.length;i<r;i++)t.push(n(e.materials,this.material[i]));r.material=t}else r.material=n(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let i=this.animations[t];r.animations.push(n(e.animations,i))}}if(t){let t=s(e.geometries),r=s(e.materials),n=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),h=s(e.animations),u=s(e.nodes);t.length>0&&(i.geometries=t),r.length>0&&(i.materials=r),n.length>0&&(i.textures=n),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h),u.length>0&&(i.nodes=u)}return i.object=r,i;function s(e){let t=[];for(let i in e){let r=e[i];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let i=0;i<e.children.length;i++){let t=e.children[i];this.add(t.clone())}return this}};qt.DEFAULT_UP=new D(0,1,0),qt.DEFAULT_MATRIX_AUTO_UPDATE=!0,qt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Hc=new D,Sp=new D,JH=new D,wp=new D,by=new D,xy=new D,Due=new D,QH=new D,e4=new D,t4=new D,pn=class{constructor(e=new D,t=new D,i=new D){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),Hc.subVectors(e,t),r.cross(Hc);let n=r.lengthSq();return n>0?r.multiplyScalar(1/Math.sqrt(n)):r.set(0,0,0)}static getBarycoord(e,t,i,r,n){Hc.subVectors(r,t),Sp.subVectors(i,t),JH.subVectors(e,t);let s=Hc.dot(Hc),a=Hc.dot(Sp),o=Hc.dot(JH),l=Sp.dot(Sp),h=Sp.dot(JH),u=s*l-a*a;if(0===u)return n.set(-2,-1,-1);let c=1/u,p=(l*o-a*h)*c,d=(s*h-a*o)*c;return n.set(1-p-d,d,p)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,wp),wp.x>=0&&wp.y>=0&&wp.x+wp.y<=1}static getUV(e,t,i,r,n,s,a,o){return this.getBarycoord(e,t,i,r,wp),o.set(0,0),o.addScaledVector(n,wp.x),o.addScaledVector(s,wp.y),o.addScaledVector(a,wp.z),o}static isFrontFacing(e,t,i,r){return Hc.subVectors(i,t),Sp.subVectors(e,t),Hc.cross(Sp).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Hc.subVectors(this.c,this.b),Sp.subVectors(this.a,this.b),.5*Hc.cross(Sp).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return pn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return pn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,n){return pn.getUV(e,this.a,this.b,this.c,t,i,r,n)}containsPoint(e){return pn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return pn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i,r,n=this.a,s=this.b,a=this.c;by.subVectors(s,n),xy.subVectors(a,n),QH.subVectors(e,n);let o=by.dot(QH),l=xy.dot(QH);if(o<=0&&l<=0)return t.copy(n);e4.subVectors(e,s);let h=by.dot(e4),u=xy.dot(e4);if(h>=0&&u<=h)return t.copy(s);let c=o*u-h*l;if(c<=0&&o>=0&&h<=0)return i=o/(o-h),t.copy(n).addScaledVector(by,i);t4.subVectors(e,a);let p=by.dot(t4),d=xy.dot(t4);if(d>=0&&p<=d)return t.copy(a);let f=p*l-o*d;if(f<=0&&l>=0&&d<=0)return r=l/(l-d),t.copy(n).addScaledVector(xy,r);let m=h*d-p*u;if(m<=0&&u-h>=0&&p-d>=0)return Due.subVectors(a,s),r=(u-h)/(u-h+(p-d)),t.copy(s).addScaledVector(Due,r);let g=1/(m+f+c);return i=f*g,r=c*g,t.copy(n).addScaledVector(by,i).addScaledVector(xy,r)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},$mt=0,qr=class extends Zo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:$mt++}),this.uuid=Xo(),this.name="",this.type="Material",this.blending=xg,this.side=Xi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Ux,this.blendDst=yB,this.blendEquation=Na,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=qD,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Rpe,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jD,this.stencilZFail=jD,this.stencilZPass=jD,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let i=e[t];if(void 0===i){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}let r=this[t];void 0!==r?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){let t=[];for(let i in e){let r=e[i];delete r.metadata,t.push(r)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==xg&&(i.blending=this.blending),this.side!==Xi&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(i.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){let t=r(e.textures),n=r(e.images);t.length>0&&(i.textures=t),n.length>0&&(i.images=n)}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(null!==t){let e=t.length;i=new Array(e);for(let r=0;r!==e;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}},Xt=class extends qr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ve(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Bx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=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.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}},ms=new D,oD=new ce,Wt=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=hx,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,n=this.itemSize;r<n;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)oD.fromBufferAttribute(this,t),oD.applyMatrix3(e),this.setXY(t,oD.x,oD.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)ms.fromBufferAttribute(this,t),ms.applyMatrix3(e),this.setXYZ(t,ms.x,ms.y,ms.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)ms.fromBufferAttribute(this,t),ms.applyMatrix4(e),this.setXYZ(t,ms.x,ms.y,ms.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)ms.fromBufferAttribute(this,t),ms.applyNormalMatrix(e),this.setXYZ(t,ms.x,ms.y,ms.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)ms.fromBufferAttribute(this,t),ms.transformDirection(e),this.setXYZ(t,ms.x,ms.y,ms.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Dp(t,this.array)),t}setX(e,t){return this.normalized&&(t=hn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Dp(t,this.array)),t}setY(e,t){return this.normalized&&(t=hn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Dp(t,this.array)),t}setZ(e,t){return this.normalized&&(t=hn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Dp(t,this.array)),t}setW(e,t){return this.normalized&&(t=hn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=hn(t,this.array),i=hn(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=hn(t,this.array),i=hn(i,this.array),r=hn(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,n){return e*=this.itemSize,this.normalized&&(t=hn(t,this.array),i=hn(i,this.array),r=hn(r,this.array),n=hn(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=n,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let 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!==hx&&(e.usage=this.usage),(0!==this.updateRange.offset||-1!==this.updateRange.count)&&(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}},Q4=class extends Wt{constructor(e,t,i){super(new Int8Array(e),t,i)}},eU=class extends Wt{constructor(e,t,i){super(new Uint8Array(e),t,i)}},tU=class extends Wt{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}},rU=class extends Wt{constructor(e,t,i){super(new Int16Array(e),t,i)}},wg=class extends Wt{constructor(e,t,i){super(new Uint16Array(e),t,i)}},iU=class extends Wt{constructor(e,t,i){super(new Int32Array(e),t,i)}},gx=class extends Wt{constructor(e,t,i){super(new Uint32Array(e),t,i)}},nU=class extends Wt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}},dt=class extends Wt{constructor(e,t,i){super(new Float32Array(e),t,i)}},sU=class extends Wt{constructor(e,t,i){super(new Float64Array(e),t,i)}},Zmt=0,Al=new Be,r4=new qt,Iy=new D,Yo=new Rt,$b=new Rt,Os=new D,ot=class extends Zo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Zmt++}),this.uuid=Xo(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Dpe(e)?gx:wg)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let t=(new Ui).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}let r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Al.makeRotationFromQuaternion(e),this.applyMatrix4(Al),this}rotateX(e){return Al.makeRotationX(e),this.applyMatrix4(Al),this}rotateY(e){return Al.makeRotationY(e),this.applyMatrix4(Al),this}rotateZ(e){return Al.makeRotationZ(e),this.applyMatrix4(Al),this}translate(e,t,i){return Al.makeTranslation(e,t,i),this.applyMatrix4(Al),this}scale(e,t,i){return Al.makeScale(e,t,i),this.applyMatrix4(Al),this}lookAt(e){return r4.lookAt(e),r4.updateMatrix(),this.applyMatrix4(r4.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Iy).negate(),this.translate(Iy.x,Iy.y,Iy.z),this}setFromPoints(e){let t=[];for(let i=0,r=e.length;i<r;i++){let r=e[i];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new dt(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Rt);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new D(-1/0,-1/0,-1/0),new D(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){let e=t[i];Yo.setFromBufferAttribute(e),this.morphTargetsRelative?(Os.addVectors(this.boundingBox.min,Yo.min),this.boundingBox.expandByPoint(Os),Os.addVectors(this.boundingBox.max,Yo.max),this.boundingBox.expandByPoint(Os)):(this.boundingBox.expandByPoint(Yo.min),this.boundingBox.expandByPoint(Yo.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new $i);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new D,1/0);if(e){let i=this.boundingSphere.center;if(Yo.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let i=t[e];$b.setFromBufferAttribute(i),this.morphTargetsRelative?(Os.addVectors(Yo.min,$b.min),Yo.expandByPoint(Os),Os.addVectors(Yo.max,$b.max),Yo.expandByPoint(Os)):(Yo.expandByPoint($b.min),Yo.expandByPoint($b.max))}Yo.getCenter(i);let r=0;for(let t=0,n=e.count;t<n;t++)Os.fromBufferAttribute(e,t),r=Math.max(r,i.distanceToSquared(Os));if(t)for(let n=0,s=t.length;n<s;n++){let s=t[n],a=this.morphTargetsRelative;for(let t=0,n=s.count;t<n;t++)Os.fromBufferAttribute(s,t),a&&(Iy.fromBufferAttribute(e,t),Os.add(Iy)),r=Math.max(r,i.distanceToSquared(Os))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let i=e.array,r=t.position.array,n=t.normal.array,s=t.uv.array,a=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Wt(new Float32Array(4*a),4));let o=this.getAttribute("tangent").array,l=[],h=[];for(let S=0;S<a;S++)l[S]=new D,h[S]=new D;let u=new D,c=new D,p=new D,d=new ce,f=new ce,m=new ce,g=new D,y=new D;function v(e,t,i){u.fromArray(r,3*e),c.fromArray(r,3*t),p.fromArray(r,3*i),d.fromArray(s,2*e),f.fromArray(s,2*t),m.fromArray(s,2*i),c.sub(u),p.sub(u),f.sub(d),m.sub(d);let n=1/(f.x*m.y-m.x*f.y);isFinite(n)&&(g.copy(c).multiplyScalar(m.y).addScaledVector(p,-f.y).multiplyScalar(n),y.copy(p).multiplyScalar(f.x).addScaledVector(c,-m.x).multiplyScalar(n),l[e].add(g),l[t].add(g),l[i].add(g),h[e].add(y),h[t].add(y),h[i].add(y))}let T=this.groups;0===T.length&&(T=[{start:0,count:i.length}]);for(let S=0,M=T.length;S<M;++S){let e=T[S],t=e.start;for(let r=t,n=t+e.count;r<n;r+=3)v(i[r+0],i[r+1],i[r+2])}let x=new D,b=new D,E=new D,_=new D;function w(e){E.fromArray(n,3*e),_.copy(E);let t=l[e];x.copy(t),x.sub(E.multiplyScalar(E.dot(t))).normalize(),b.crossVectors(_,t);let i=b.dot(h[e])<0?-1:1;o[4*e]=x.x,o[4*e+1]=x.y,o[4*e+2]=x.z,o[4*e+3]=i}for(let S=0,M=T.length;S<M;++S){let e=T[S],t=e.start;for(let r=t,n=t+e.count;r<n;r+=3)w(i[r+0]),w(i[r+1]),w(i[r+2])}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new Wt(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);let r=new D,n=new D,s=new D,a=new D,o=new D,l=new D,h=new D,u=new D;if(e)for(let c=0,p=e.count;c<p;c+=3){let p=e.getX(c+0),d=e.getX(c+1),f=e.getX(c+2);r.fromBufferAttribute(t,p),n.fromBufferAttribute(t,d),s.fromBufferAttribute(t,f),h.subVectors(s,n),u.subVectors(r,n),h.cross(u),a.fromBufferAttribute(i,p),o.fromBufferAttribute(i,d),l.fromBufferAttribute(i,f),a.add(h),o.add(h),l.add(h),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,c=t.count;e<c;e+=3)r.fromBufferAttribute(t,e+0),n.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),h.subVectors(s,n),u.subVectors(r,n),h.cross(u),i.setXYZ(e+0,h.x,h.y,h.z),i.setXYZ(e+1,h.x,h.y,h.z),i.setXYZ(e+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Os.fromBufferAttribute(e,t),Os.normalize(),e.setXYZ(t,Os.x,Os.y,Os.z)}toNonIndexed(){function e(e,t){let i=e.array,r=e.itemSize,n=e.normalized,s=new i.constructor(t.length*r),a=0,o=0;for(let l=0,h=t.length;l<h;l++){a=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*r;for(let e=0;e<r;e++)s[o++]=i[a++]}return new Wt(s,r,n)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new ot,i=this.index.array,r=this.attributes;for(let a in r){let n=e(r[a],i);t.setAttribute(a,n)}let n=this.morphAttributes;for(let a in n){let r=[],s=n[a];for(let t=0,n=s.length;t<n;t++){let n=e(s[t],i);r.push(n)}t.morphAttributes[a]=r}t.morphTargetsRelative=this.morphTargetsRelative;let s=this.groups;for(let a=0,o=s.length;a<o;a++){let e=s[a];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){let e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let o in i){let t=i[o];e.data.attributes[o]=t.toJSON(e.data)}let r={},n=!1;for(let o in this.morphAttributes){let t=this.morphAttributes[o],i=[];for(let r=0,n=t.length;r<n;r++){let n=t[r];i.push(n.toJSON(e.data))}i.length>0&&(r[o]=i,n=!0)}n&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));let a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone(t));let r=e.attributes;for(let l in r){let e=r[l];this.setAttribute(l,e.clone(t))}let n=e.morphAttributes;for(let l in n){let e=[],i=n[l];for(let r=0,n=i.length;r<n;r++)e.push(i[r].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;let s=e.groups;for(let l=0,h=s.length;l<h;l++){let e=s[l];this.addGroup(e.start,e.count,e.materialIndex)}let a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}},Cue=new Be,_y=new Ko,i4=new $i,Zb=new D,Kb=new D,Jb=new D,n4=new D,lD=new D,cD=new ce,uD=new ce,hD=new ce,s4=new D,pD=new D,Je=class extends qt{constructor(e=new ot,t=new Xt){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let i=this.geometry,r=i.attributes.position,n=i.morphAttributes.position,s=i.morphTargetsRelative;t.fromBufferAttribute(r,e);let a=this.morphTargetInfluences;if(n&&a){lD.set(0,0,0);for(let i=0,r=n.length;i<r;i++){let r=a[i],o=n[i];0!==r&&(n4.fromBufferAttribute(o,e),s?lD.addScaledVector(n4,r):lD.addScaledVector(n4.sub(t),r))}t.add(lD)}return this.isSkinnedMesh&&this.boneTransform(e,t),t}raycast(e,t){let i=this.geometry,r=this.material,n=this.matrixWorld;if(void 0===r||(null===i.boundingSphere&&i.computeBoundingSphere(),i4.copy(i.boundingSphere),i4.applyMatrix4(n),!1===e.ray.intersectsSphere(i4))||(Cue.copy(n).invert(),_y.copy(e.ray).applyMatrix4(Cue),null!==i.boundingBox&&!1===_y.intersectsBox(i.boundingBox)))return;let s,a=i.index,o=i.attributes.position,l=i.attributes.uv,h=i.attributes.uv2,u=i.groups,c=i.drawRange;if(null!==a)if(Array.isArray(r))for(let p=0,d=u.length;p<d;p++){let i=u[p],n=r[i.materialIndex];for(let r=Math.max(i.start,c.start),o=Math.min(a.count,Math.min(i.start+i.count,c.start+c.count));r<o;r+=3){let o=a.getX(r),u=a.getX(r+1),c=a.getX(r+2);s=dD(this,n,e,_y,l,h,o,u,c),s&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=i.materialIndex,t.push(s))}}else for(let p=Math.max(0,c.start),d=Math.min(a.count,c.start+c.count);p<d;p+=3){let i=a.getX(p),n=a.getX(p+1),o=a.getX(p+2);s=dD(this,r,e,_y,l,h,i,n,o),s&&(s.faceIndex=Math.floor(p/3),t.push(s))}else if(void 0!==o)if(Array.isArray(r))for(let p=0,d=u.length;p<d;p++){let i=u[p],n=r[i.materialIndex];for(let r=Math.max(i.start,c.start),a=Math.min(o.count,Math.min(i.start+i.count,c.start+c.count));r<a;r+=3)s=dD(this,n,e,_y,l,h,r,r+1,r+2),s&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=i.materialIndex,t.push(s))}else for(let p=Math.max(0,c.start),d=Math.min(o.count,c.start+c.count);p<d;p+=3)s=dD(this,r,e,_y,l,h,p,p+1,p+2),s&&(s.faceIndex=Math.floor(p/3),t.push(s))}};function Kmt(e,t,i,r,n,s,a,o){let l;if(l=t.side===$n?r.intersectTriangle(a,s,n,!0,o):r.intersectTriangle(n,s,a,t.side===Xi,o),null===l)return null;pD.copy(o),pD.applyMatrix4(e.matrixWorld);let h=i.ray.origin.distanceTo(pD);return h<i.near||h>i.far?null:{distance:h,point:pD.clone(),object:e}}function dD(e,t,i,r,n,s,a,o,l){e.getVertexPosition(a,Zb),e.getVertexPosition(o,Kb),e.getVertexPosition(l,Jb);let h=Kmt(e,t,i,r,Zb,Kb,Jb,s4);if(h){n&&(cD.fromBufferAttribute(n,a),uD.fromBufferAttribute(n,o),hD.fromBufferAttribute(n,l),h.uv=pn.getUV(s4,Zb,Kb,Jb,cD,uD,hD,new ce)),s&&(cD.fromBufferAttribute(s,a),uD.fromBufferAttribute(s,o),hD.fromBufferAttribute(s,l),h.uv2=pn.getUV(s4,Zb,Kb,Jb,cD,uD,hD,new ce));let e={a:a,b:o,c:l,normal:new D,materialIndex:0};pn.getNormal(Zb,Kb,Jb,e.normal),h.face=e}return h}var js=class extends ot{constructor(e=1,t=1,i=1,r=1,n=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:n,depthSegments:s};let a=this;r=Math.floor(r),n=Math.floor(n),s=Math.floor(s);let o=[],l=[],h=[],u=[],c=0,p=0;function d(e,t,i,r,n,s,d,f,m,g,y){let v=s/m,T=d/g,x=s/2,b=d/2,E=f/2,_=m+1,w=g+1,S=0,M=0,I=new D;for(let a=0;a<w;a++){let s=a*T-b;for(let o=0;o<_;o++){let c=o*v-x;I[e]=c*r,I[t]=s*n,I[i]=E,l.push(I.x,I.y,I.z),I[e]=0,I[t]=0,I[i]=f>0?1:-1,h.push(I.x,I.y,I.z),u.push(o/m),u.push(1-a/g),S+=1}}for(let a=0;a<g;a++)for(let e=0;e<m;e++){let t=c+e+_*a,i=c+e+_*(a+1),r=c+(e+1)+_*(a+1),n=c+(e+1)+_*a;o.push(t,i,n),o.push(i,r,n),M+=6}a.addGroup(p,M,y),p+=M,c+=S}d("z","y","x",-1,-1,i,t,e,s,n,0),d("z","y","x",1,-1,i,t,-e,s,n,1),d("x","z","y",1,1,e,i,t,r,s,2),d("x","z","y",1,-1,e,i,-t,r,s,3),d("x","y","z",1,-1,e,t,i,r,n,4),d("x","y","z",-1,-1,e,t,-i,r,n,5),this.setIndex(o),this.setAttribute("position",new dt(l,3)),this.setAttribute("normal",new dt(h,3)),this.setAttribute("uv",new dt(u,2))}static fromJSON(e){return new js(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function Gy(e){let t={};for(let i in e){t[i]={};for(let r in e[i]){let n=e[i][r];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?t[i][r]=n.clone():Array.isArray(n)?t[i][r]=n.slice():t[i][r]=n}}return t}function Pa(e){let t={};for(let i=0;i<e.length;i++){let r=Gy(e[i]);for(let e in r)t[e]=r[e]}return t}function Jmt(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}function Ape(e){return null===e.getRenderTarget()&&e.outputEncoding===yr?Uc:Uy}var dn={clone:Gy,merge:Pa},Qmt="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",egt="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",Zt=class extends qr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Qmt,this.fragmentShader=egt,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Gy(e.uniforms),this.uniformsGroups=Jmt(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}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let r in this.uniforms){let i=this.uniforms[r].value;i&&i.isTexture?t.uniforms[r]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[r]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[r]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[r]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[r]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[r]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[r]={type:"m4",value:i.toArray()}:t.uniforms[r]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let i={};for(let r in this.extensions)!0===this.extensions[r]&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},Fp=class extends qt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Be,this.projectionMatrix=new Be,this.projectionMatrixInverse=new Be}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}},Vr=class extends Fp{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*px*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*Ig*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*px*Math.atan(Math.tan(.5*Ig*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,n,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*Ig*this.fov)/this.zoom,i=2*t,r=this.aspect*i,n=-.5*r,s=this.view;if(null!==this.view&&this.view.enabled){let e=s.fullWidth,a=s.fullHeight;n+=s.offsetX*r/e,t-=s.offsetY*i/a,r*=s.width/e,i*=s.height/a}let a=this.filmOffset;0!==a&&(n+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+r,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Sy=-90,wy=1,$D=class extends qt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;let r=new Vr(Sy,wy,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(1,0,0),this.add(r);let n=new Vr(Sy,wy,e,t);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(-1,0,0),this.add(n);let s=new Vr(Sy,wy,e,t);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(0,1,0),this.add(s);let a=new Vr(Sy,wy,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);let o=new Vr(Sy,wy,e,t);o.layers=this.layers,o.up.set(0,1,0),o.lookAt(0,0,1),this.add(o);let l=new Vr(Sy,wy,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();let i=this.renderTarget,[r,n,s,a,o,l]=this.children,h=e.getRenderTarget(),u=e.toneMapping,c=e.xr.enabled;e.toneMapping=Yu,e.xr.enabled=!1;let p=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,n),e.setRenderTarget(i,2),e.render(t,s),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,o),i.texture.generateMipmaps=p,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(h),e.toneMapping=u,e.xr.enabled=c,i.texture.needsPMREMUpdate=!0}},Rg=class extends Pi{constructor(e,t,i,r,n,s,a,o,l,h){super(e=void 0!==e?e:[],t=void 0!==t?t:df,i,r,n,s,a,o,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},ZD=class extends Wr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Rg(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:hi}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",n="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new js(5,5,5),a=new Zt({name:"CubemapFromEquirect",uniforms:Gy(i),vertexShader:r,fragmentShader:n,side:$n,blending:zi});a.uniforms.tEquirect.value=t;let o=new Je(s,a),l=t.minFilter;return t.minFilter===Ha&&(t.minFilter=hi),new $D(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){let n=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,i,r);e.setRenderTarget(n)}},a4=new D,tgt=new D,rgt=new Ui,Ri=class{constructor(e=new D(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let r=a4.subVectors(i,t).cross(tgt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let i=e.delta(a4),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let n=-(e.start.dot(this.normal)+this.constant)/r;return n<0||n>1?null:t.copy(i).multiplyScalar(n).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||rgt.getNormalMatrix(e),r=this.coplanarPoint(a4).applyMatrix4(e),n=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(n),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}},Ry=new $i,fD=new D,na=class{constructor(e=new Ri,t=new Ri,i=new Ri,r=new Ri,n=new Ri,s=new Ri){this.planes=[e,t,i,r,n,s]}set(e,t,i,r,n,s){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(n),a[5].copy(s),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],l=i[5],h=i[6],u=i[7],c=i[8],p=i[9],d=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];return t[0].setComponents(a-r,u-o,f-c,v-m).normalize(),t[1].setComponents(a+r,u+o,f+c,v+m).normalize(),t[2].setComponents(a+n,u+l,f+p,v+g).normalize(),t[3].setComponents(a-n,u-l,f-p,v-g).normalize(),t[4].setComponents(a-s,u-h,f-d,v-y).normalize(),t[5].setComponents(a+s,u+h,f+d,v+y).normalize(),this}intersectsObject(e){let t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Ry.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ry)}intersectsSprite(e){return Ry.center.set(0,0,0),Ry.radius=.7071067811865476,Ry.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ry)}intersectsSphere(e){let t=this.planes,i=e.center,r=-e.radius;for(let n=0;n<6;n++)if(t[n].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let r=t[i];if(fD.x=r.normal.x>0?e.max.x:e.min.x,fD.y=r.normal.y>0?e.max.y:e.min.y,fD.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(fD)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}};function Ope(){let e=null,t=!1,i=null,r=null;function n(t,s){i(t,s),r=e.requestAnimationFrame(n)}return{start:function(){!0!==t&&null!==i&&(r=e.requestAnimationFrame(n),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function igt(e,t){let i=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);let i=r.get(t);i&&(e.deleteBuffer(i.buffer),r.delete(t))},update:function(t,n){if(t.isGLBufferAttribute){let e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);let s=r.get(t);void 0===s?r.set(t,function(t,r){let n,s=t.array,a=t.usage,o=e.createBuffer();if(e.bindBuffer(r,o),e.bufferData(r,s,a),t.onUploadCallback(),s instanceof Float32Array)n=5126;else if(s instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!i)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");n=5131}else n=5123;else if(s instanceof Int16Array)n=5122;else if(s instanceof Uint32Array)n=5125;else if(s instanceof Int32Array)n=5124;else if(s instanceof Int8Array)n=5120;else if(s instanceof Uint8Array)n=5121;else{if(!(s instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+s);n=5121}return{buffer:o,type:n,bytesPerElement:s.BYTES_PER_ELEMENT,version:t.version}}(t,n)):s.version<t.version&&(function(t,r,n){let s=r.array,a=r.updateRange;e.bindBuffer(n,t),-1===a.count?e.bufferSubData(n,0,s):(i?e.bufferSubData(n,a.offset*s.BYTES_PER_ELEMENT,s,a.offset,a.count):e.bufferSubData(n,a.offset*s.BYTES_PER_ELEMENT,s.subarray(a.offset,a.offset+a.count)),a.count=-1),r.onUploadCallback()}(s.buffer,t,n),s.version=t.version)}}}var En=class extends ot{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};let n=e/2,s=t/2,a=Math.floor(i),o=Math.floor(r),l=a+1,h=o+1,u=e/a,c=t/o,p=[],d=[],f=[],m=[];for(let g=0;g<h;g++){let e=g*c-s;for(let t=0;t<l;t++){let i=t*u-n;d.push(i,-e,0),f.push(0,0,1),m.push(t/a),m.push(1-g/o)}}for(let g=0;g<o;g++)for(let e=0;e<a;e++){let t=e+l*g,i=e+l*(g+1),r=e+1+l*(g+1),n=e+1+l*g;p.push(t,i,n),p.push(i,r,n)}this.setIndex(p),this.setAttribute("position",new dt(d,3)),this.setAttribute("normal",new dt(f,3)),this.setAttribute("uv",new dt(m,2))}static fromJSON(e){return new En(e.width,e.height,e.widthSegments,e.heightSegments)}},ngt="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",sgt="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",agt="#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",ogt="#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",lgt="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",cgt="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",ugt="vec3 transformed = vec3( position );",hgt="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",pgt="vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",dgt="#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",fgt="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",mgt="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",ggt="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",vgt="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",ygt="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",Egt="#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",Tgt="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",bgt="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",xgt="#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",Igt="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",_gt="#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",Sgt="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",wgt="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",Rgt="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",Mgt="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",Dgt="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",Cgt="gl_FragColor = linearToOutputTexel( gl_FragColor );",Agt="vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",Ogt="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",Pgt="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",Ngt="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",Lgt="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",Fgt="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",Hgt="#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",Ugt="#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",Bgt="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",kgt="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",Ggt="#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",Vgt="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",zgt="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",jgt="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",Wgt="varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",qgt="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",Ygt="#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",Xgt="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",$gt="varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",Zgt="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Kgt="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",Jgt="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",Qgt="struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",e0t="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",t0t="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",r0t="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",i0t="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",n0t="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",s0t="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",a0t="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",o0t="#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",l0t="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",c0t="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",u0t="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",h0t="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",p0t="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",d0t="#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",f0t="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",m0t="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",g0t="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",v0t="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",y0t="#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",E0t="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",T0t="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",b0t="#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",x0t="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",I0t="#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",_0t="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",S0t="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",w0t="#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",R0t="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",M0t="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",D0t="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",C0t="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",A0t="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",O0t="#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",P0t="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",N0t="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",L0t="#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",F0t="#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",H0t="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",U0t="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",B0t="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",k0t="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",G0t="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",V0t="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",z0t="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",j0t="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",W0t="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",q0t="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",Y0t="#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",X0t="#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",$0t="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",Z0t="#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",K0t="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",J0t="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Q0t="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",evt="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",tvt="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",rvt="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",ivt="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",nvt="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",svt="#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",avt="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",ovt="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",lvt="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",cvt="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",uvt="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",hvt="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",pvt="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",dvt="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",fvt="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",mvt="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",gvt="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",vvt="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",yvt="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Evt="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Tvt="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",bvt="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",xvt="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",Ivt="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",_vt="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Svt="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",wvt="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",Rvt="#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Mvt="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Dvt="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Cvt="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",Avt="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Ovt="#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Pvt="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Nvt="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",Lvt="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Zr={alphamap_fragment:ngt,alphamap_pars_fragment:sgt,alphatest_fragment:agt,alphatest_pars_fragment:ogt,aomap_fragment:lgt,aomap_pars_fragment:cgt,begin_vertex:ugt,beginnormal_vertex:hgt,bsdfs:pgt,iridescence_fragment:dgt,bumpmap_pars_fragment:fgt,clipping_planes_fragment:mgt,clipping_planes_pars_fragment:ggt,clipping_planes_pars_vertex:vgt,clipping_planes_vertex:ygt,color_fragment:Egt,color_pars_fragment:Tgt,color_pars_vertex:bgt,color_vertex:xgt,common:Igt,cube_uv_reflection_fragment:_gt,defaultnormal_vertex:Sgt,displacementmap_pars_vertex:wgt,displacementmap_vertex:Rgt,emissivemap_fragment:Mgt,emissivemap_pars_fragment:Dgt,encodings_fragment:Cgt,encodings_pars_fragment:Agt,envmap_fragment:Ogt,envmap_common_pars_fragment:Pgt,envmap_pars_fragment:Ngt,envmap_pars_vertex:Lgt,envmap_physical_pars_fragment:Ygt,envmap_vertex:Fgt,fog_vertex:Hgt,fog_pars_vertex:Ugt,fog_fragment:Bgt,fog_pars_fragment:kgt,gradientmap_pars_fragment:Ggt,lightmap_fragment:Vgt,lightmap_pars_fragment:zgt,lights_lambert_fragment:jgt,lights_lambert_pars_fragment:Wgt,lights_pars_begin:qgt,lights_toon_fragment:Xgt,lights_toon_pars_fragment:$gt,lights_phong_fragment:Zgt,lights_phong_pars_fragment:Kgt,lights_physical_fragment:Jgt,lights_physical_pars_fragment:Qgt,lights_fragment_begin:e0t,lights_fragment_maps:t0t,lights_fragment_end:r0t,logdepthbuf_fragment:i0t,logdepthbuf_pars_fragment:n0t,logdepthbuf_pars_vertex:s0t,logdepthbuf_vertex:a0t,map_fragment:o0t,map_pars_fragment:l0t,map_particle_fragment:c0t,map_particle_pars_fragment:u0t,metalnessmap_fragment:h0t,metalnessmap_pars_fragment:p0t,morphcolor_vertex:d0t,morphnormal_vertex:f0t,morphtarget_pars_vertex:m0t,morphtarget_vertex:g0t,normal_fragment_begin:v0t,normal_fragment_maps:y0t,normal_pars_fragment:E0t,normal_pars_vertex:T0t,normal_vertex:b0t,normalmap_pars_fragment:x0t,clearcoat_normal_fragment_begin:I0t,clearcoat_normal_fragment_maps:_0t,clearcoat_pars_fragment:S0t,iridescence_pars_fragment:w0t,output_fragment:R0t,packing:M0t,premultiplied_alpha_fragment:D0t,project_vertex:C0t,dithering_fragment:A0t,dithering_pars_fragment:O0t,roughnessmap_fragment:P0t,roughnessmap_pars_fragment:N0t,shadowmap_pars_fragment:L0t,shadowmap_pars_vertex:F0t,shadowmap_vertex:H0t,shadowmask_pars_fragment:U0t,skinbase_vertex:B0t,skinning_pars_vertex:k0t,skinning_vertex:G0t,skinnormal_vertex:V0t,specularmap_fragment:z0t,specularmap_pars_fragment:j0t,tonemapping_fragment:W0t,tonemapping_pars_fragment:q0t,transmission_fragment:Y0t,transmission_pars_fragment:X0t,uv_pars_fragment:$0t,uv_pars_vertex:Z0t,uv_vertex:K0t,uv2_pars_fragment:J0t,uv2_pars_vertex:Q0t,uv2_vertex:evt,worldpos_vertex:tvt,background_vert:rvt,background_frag:ivt,backgroundCube_vert:nvt,backgroundCube_frag:svt,cube_vert:avt,cube_frag:ovt,depth_vert:lvt,depth_frag:cvt,distanceRGBA_vert:uvt,distanceRGBA_frag:hvt,equirect_vert:pvt,equirect_frag:dvt,linedashed_vert:fvt,linedashed_frag:mvt,meshbasic_vert:gvt,meshbasic_frag:vvt,meshlambert_vert:yvt,meshlambert_frag:Evt,meshmatcap_vert:Tvt,meshmatcap_frag:bvt,meshnormal_vert:xvt,meshnormal_frag:Ivt,meshphong_vert:_vt,meshphong_frag:Svt,meshphysical_vert:wvt,meshphysical_frag:Rvt,meshtoon_vert:Mvt,meshtoon_frag:Dvt,points_vert:Cvt,points_frag:Avt,shadow_vert:Ovt,shadow_frag:Pvt,sprite_vert:Nvt,sprite_frag:Lvt},At={common:{diffuse:{value:new Ve(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ui},uv2Transform:{value:new Ui},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ce(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ve(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ve(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Ui}},sprite:{diffuse:{value:new Ve(16777215)},opacity:{value:1},center:{value:new ce(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Ui}}},Bc={basic:{uniforms:Pa([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.fog]),vertexShader:Zr.meshbasic_vert,fragmentShader:Zr.meshbasic_frag},lambert:{uniforms:Pa([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new Ve(0)}}]),vertexShader:Zr.meshlambert_vert,fragmentShader:Zr.meshlambert_frag},phong:{uniforms:Pa([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new Ve(0)},specular:{value:new Ve(1118481)},shininess:{value:30}}]),vertexShader:Zr.meshphong_vert,fragmentShader:Zr.meshphong_frag},standard:{uniforms:Pa([At.common,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.roughnessmap,At.metalnessmap,At.fog,At.lights,{emissive:{value:new Ve(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Zr.meshphysical_vert,fragmentShader:Zr.meshphysical_frag},toon:{uniforms:Pa([At.common,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.gradientmap,At.fog,At.lights,{emissive:{value:new Ve(0)}}]),vertexShader:Zr.meshtoon_vert,fragmentShader:Zr.meshtoon_frag},matcap:{uniforms:Pa([At.common,At.bumpmap,At.normalmap,At.displacementmap,At.fog,{matcap:{value:null}}]),vertexShader:Zr.meshmatcap_vert,fragmentShader:Zr.meshmatcap_frag},points:{uniforms:Pa([At.points,At.fog]),vertexShader:Zr.points_vert,fragmentShader:Zr.points_frag},dashed:{uniforms:Pa([At.common,At.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Zr.linedashed_vert,fragmentShader:Zr.linedashed_frag},depth:{uniforms:Pa([At.common,At.displacementmap]),vertexShader:Zr.depth_vert,fragmentShader:Zr.depth_frag},normal:{uniforms:Pa([At.common,At.bumpmap,At.normalmap,At.displacementmap,{opacity:{value:1}}]),vertexShader:Zr.meshnormal_vert,fragmentShader:Zr.meshnormal_frag},sprite:{uniforms:Pa([At.sprite,At.fog]),vertexShader:Zr.sprite_vert,fragmentShader:Zr.sprite_frag},background:{uniforms:{uvTransform:{value:new Ui},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Zr.background_vert,fragmentShader:Zr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Zr.backgroundCube_vert,fragmentShader:Zr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Zr.cube_vert,fragmentShader:Zr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Zr.equirect_vert,fragmentShader:Zr.equirect_frag},distanceRGBA:{uniforms:Pa([At.common,At.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Zr.distanceRGBA_vert,fragmentShader:Zr.distanceRGBA_frag},shadow:{uniforms:Pa([At.lights,At.fog,{color:{value:new Ve(0)},opacity:{value:1}}]),vertexShader:Zr.shadow_vert,fragmentShader:Zr.shadow_frag}};Bc.physical={uniforms:Pa([Bc.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ce(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Ve(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ce},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ve(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ve(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Zr.meshphysical_vert,fragmentShader:Zr.meshphysical_frag};var mD={r:0,b:0,g:0};function Fvt(e,t,i,r,n,s,a){let o,l,h=new Ve(0),u=!0===s?0:1,c=null,p=0,d=null;function f(t,i){t.getRGB(mD,Ape(e)),r.buffers.color.setClear(mD.r,mD.g,mD.b,i,a)}return{getClearColor:function(){return h},setClearColor:function(e,t=1){h.set(e),u=t,f(h,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,f(h,u)},render:function(r,s){let a=!1,m=!0===s.isScene?s.background:null;m&&m.isTexture&&(m=(s.backgroundBlurriness>0?i:t).get(m));let g=e.xr,y=g.getSession&&g.getSession();y&&"additive"===y.environmentBlendMode&&(m=null),null===m?f(h,u):m&&m.isColor&&(f(m,1),a=!0),(e.autoClear||a)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.mapping===Ky)?(void 0===l&&(l=new Je(new js(1,1,1),new Zt({name:"BackgroundCubeMaterial",uniforms:Gy(Bc.backgroundCube.uniforms),vertexShader:Bc.backgroundCube.vertexShader,fragmentShader:Bc.backgroundCube.fragmentShader,side:$n,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=m,l.material.uniforms.flipEnvMap.value=m.isCubeTexture&&!1===m.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=s.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=s.backgroundIntensity,l.material.toneMapped=m.encoding!==yr,(c!==m||p!==m.version||d!==e.toneMapping)&&(l.material.needsUpdate=!0,c=m,p=m.version,d=e.toneMapping),l.layers.enableAll(),r.unshift(l,l.geometry,l.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new Je(new En(2,2),new Zt({name:"BackgroundMaterial",uniforms:Gy(Bc.background.uniforms),vertexShader:Bc.background.vertexShader,fragmentShader:Bc.background.fragmentShader,side:Xi,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=m,o.material.uniforms.backgroundIntensity.value=s.backgroundIntensity,o.material.toneMapped=m.encoding!==yr,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),(c!==m||p!==m.version||d!==e.toneMapping)&&(o.material.needsUpdate=!0,c=m,p=m.version,d=e.toneMapping),o.layers.enableAll(),r.unshift(o,o.geometry,o.material,0,0,null))}}}function Hvt(e,t,i,r){let n=e.getParameter(34921),s=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==s,o={},l=d(null),h=l,u=!1;function c(t){return r.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function p(t){return r.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function d(e){let t=[],i=[],r=[];for(let s=0;s<n;s++)t[s]=0,i[s]=0,r[s]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:r,object:e,attributes:{},index:null}}function f(){let e=h.newAttributes;for(let t=0,i=e.length;t<i;t++)e[t]=0}function m(e){g(e,0)}function g(i,n){let s=h.newAttributes,a=h.enabledAttributes,o=h.attributeDivisors;s[i]=1,0===a[i]&&(e.enableVertexAttribArray(i),a[i]=1),o[i]!==n&&((r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,n),o[i]=n)}function y(){let t=h.newAttributes,i=h.enabledAttributes;for(let r=0,n=i.length;r<n;r++)i[r]!==t[r]&&(e.disableVertexAttribArray(r),i[r]=0)}function v(t,i,n,s,a,o){!0!==r.isWebGL2||5124!==n&&5125!==n?e.vertexAttribPointer(t,i,n,s,a,o):e.vertexAttribIPointer(t,i,n,a,o)}function T(){x(),u=!0,h!==l&&(h=l,c(h.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(n,l,p,T,x){let b=!1;if(a){let t=function(t,i,n){let a=!0===n.wireframe,l=o[t.id];void 0===l&&(l={},o[t.id]=l);let h=l[i.id];void 0===h&&(h={},l[i.id]=h);let u=h[a];return void 0===u&&(u=d(r.isWebGL2?e.createVertexArray():s.createVertexArrayOES()),h[a]=u),u}(T,p,l);h!==t&&(h=t,c(h.object)),b=function(e,t,i,r){let n=h.attributes,s=t.attributes,a=0,o=i.getAttributes();for(let l in o)if(o[l].location>=0){let t=n[l],i=s[l];if(void 0===i&&("instanceMatrix"===l&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(i=e.instanceColor)),void 0===t||t.attribute!==i||i&&t.data!==i.data)return!0;a++}return h.attributesNum!==a||h.index!==r}(n,T,p,x),b&&function(e,t,i,r){let n={},s=t.attributes,a=0,o=i.getAttributes();for(let l in o)if(o[l].location>=0){let t=s[l];void 0===t&&("instanceMatrix"===l&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(t=e.instanceColor));let i={};i.attribute=t,t&&t.data&&(i.data=t.data),n[l]=i,a++}h.attributes=n,h.attributesNum=a,h.index=r}(n,T,p,x)}else{let e=!0===l.wireframe;(h.geometry!==T.id||h.program!==p.id||h.wireframe!==e)&&(h.geometry=T.id,h.program=p.id,h.wireframe=e,b=!0)}null!==x&&i.update(x,34963),(b||u)&&(u=!1,function(n,s,a,o){if(!1===r.isWebGL2&&(n.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();let l=o.attributes,h=a.getAttributes(),u=s.defaultAttributeValues;for(let t in h){let r=h[t];if(r.location>=0){let s=l[t];if(void 0===s&&("instanceMatrix"===t&&n.instanceMatrix&&(s=n.instanceMatrix),"instanceColor"===t&&n.instanceColor&&(s=n.instanceColor)),void 0!==s){let t=s.normalized,a=s.itemSize,l=i.get(s);if(void 0===l)continue;let h=l.buffer,u=l.type,c=l.bytesPerElement;if(s.isInterleavedBufferAttribute){let i=s.data,l=i.stride,p=s.offset;if(i.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)g(r.location+e,i.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(34962,h);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,u,t,l*c,(p+a/r.locationSize*e)*c)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)g(r.location+e,s.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(34962,h);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,u,t,a*c,a/r.locationSize*e*c)}}else if(void 0!==u){let i=u[t];if(void 0!==i)switch(i.length){case 2:e.vertexAttrib2fv(r.location,i);break;case 3:e.vertexAttrib3fv(r.location,i);break;case 4:e.vertexAttrib4fv(r.location,i);break;default:e.vertexAttrib1fv(r.location,i)}}}}y()}(n,l,p,T),null!==x&&e.bindBuffer(34963,i.get(x).buffer))},reset:T,resetDefaultState:x,dispose:function(){T();for(let e in o){let t=o[e];for(let e in t){let i=t[e];for(let e in i)p(i[e].object),delete i[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;let t=o[e.id];for(let i in t){let e=t[i];for(let t in e)p(e[t].object),delete e[t];delete t[i]}delete o[e.id]},releaseStatesOfProgram:function(e){for(let t in o){let i=o[t];if(void 0===i[e.id])continue;let r=i[e.id];for(let e in r)p(r[e].object),delete r[e];delete i[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:y}}function Uvt(e,t,i,r){let n,s=r.isWebGL2;this.setMode=function(e){n=e},this.render=function(t,r){e.drawArrays(n,t,r),i.update(r,n,1)},this.renderInstances=function(r,a,o){if(0===o)return;let l,h;if(s)l=e,h="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](n,r,a,o),i.update(a,n,o)}}function Bvt(e,t,i){let r;function n(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let s="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,a=void 0!==i.precision?i.precision:"highp",o=n(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);let l=s||t.has("WEBGL_draw_buffers"),h=!0===i.logarithmicDepthBuffer,u=e.getParameter(34930),c=e.getParameter(35660),p=e.getParameter(3379),d=e.getParameter(34076),f=e.getParameter(34921),m=e.getParameter(36347),g=e.getParameter(36348),y=e.getParameter(36349),v=c>0,T=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){let i=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:n,precision:a,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:c,maxTextureSize:p,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:T,floatVertexTextures:v&&T,maxSamples:s?e.getParameter(36183):0}}function kvt(e){let t=this,i=null,r=0,n=!1,s=!1,a=new Ri,o=new Ui,l={value:null,needsUpdate:!1};function h(e,i,r,n){let s=null!==e?e.length:0,h=null;if(0!==s){if(h=l.value,!0!==n||null===h){let t=r+4*s,n=i.matrixWorldInverse;o.getNormalMatrix(n),(null===h||h.length<t)&&(h=new Float32Array(t));for(let i=0,l=r;i!==s;++i,l+=4)a.copy(e[i]).applyMatrix4(n,o),a.normal.toArray(h,l),h[l+3]=a.constant}l.value=h,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,h}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let i=0!==e.length||t||0!==r||n;return n=t,r=e.length,i},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){i=h(e,t,0)},this.setState=function(a,o,u){let c=a.clippingPlanes,p=a.clipIntersection,d=a.clipShadows,f=e.get(a);if(!n||null===c||0===c.length||s&&!d)s?h(null):(l.value!==i&&(l.value=i,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0);else{let e=s?0:r,t=4*e,n=f.clippingState||null;l.value=n,n=h(c,o,t,u);for(let r=0;r!==t;++r)n[r]=i[r];f.clippingState=n,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=e}}}function Gvt(e){let t=new WeakMap;function i(e,t){return t===Sg?e.mapping=df:t===cx&&(e.mapping=ff),e}function r(e){let i=e.target;i.removeEventListener("dispose",r);let n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function(n){if(n&&n.isTexture&&!1===n.isRenderTargetTexture){let s=n.mapping;if(s===Sg||s===cx){if(t.has(n))return i(t.get(n).texture,n.mapping);{let s=n.image;if(s&&s.height>0){let a=new ZD(s.height/2);return a.fromEquirectangularTexture(e,n),t.set(n,a),n.addEventListener("dispose",r),i(a.texture,n.mapping)}return null}}}return n},dispose:function(){t=new WeakMap}}}var Ni=class extends Fp{constructor(e=-1,t=1,i=1,r=-1,n=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=n,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,n,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,n=i-e,s=i+e,a=r+t,o=r-t;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=e*this.view.offsetX,s=n+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}this.projectionMatrix.makeOrthographic(n,s,a,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}},Ly=4,Aue=[.125,.215,.35,.446,.526,.582],yg=20,o4=new Ni,Oue=new Ve,l4=null,vg=(1+Math.sqrt(5))/2,My=1/vg,Pue=[new D(1,1,1),new D(-1,1,1),new D(1,1,-1),new D(-1,1,-1),new D(0,vg,My),new D(0,vg,-My),new D(My,0,vg),new D(-My,0,vg),new D(vg,My,0),new D(-vg,My,0)],Hp=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){l4=this._renderer.getRenderTarget(),this._setSize(256);let n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(e,i,r,n),t>0&&this._blur(n,0,0,t),this._applyPMREM(n),this._cleanup(n),n}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Fue(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Lue(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(l4),e.scissorTest=!1,gD(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===df||e.mapping===ff?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),l4=this._renderer.getRenderTarget();let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:hi,minFilter:hi,generateMipmaps:!1,type:$o,format:zs,encoding:Nl,depthBuffer:!1},r=Nue(e,t,i);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Nue(e,t,i);let{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Vvt(r)),this._blurMaterial=zvt(r,e,t)}return r}_compileMaterial(e){let t=new Je(this._lodPlanes[0],e);this._renderer.compile(t,o4)}_sceneToCubeUV(e,t,i,r){let n=new Vr(90,1,t,i),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,h=o.toneMapping;o.getClearColor(Oue),o.toneMapping=Yu,o.autoClear=!1;let u=new Xt({name:"PMREM.Background",side:$n,depthWrite:!1,depthTest:!1}),c=new Je(new js,u),p=!1,d=e.background;d?d.isColor&&(u.color.copy(d),e.background=null,p=!0):(u.color.copy(Oue),p=!0);for(let f=0;f<6;f++){let t=f%3;0===t?(n.up.set(0,s[f],0),n.lookAt(a[f],0,0)):1===t?(n.up.set(0,0,s[f]),n.lookAt(0,a[f],0)):(n.up.set(0,s[f],0),n.lookAt(0,0,a[f]));let i=this._cubeSize;gD(r,t*i,f>2?i:0,i,i),o.setRenderTarget(r),p&&o.render(c,n),o.render(e,n)}c.geometry.dispose(),c.material.dispose(),o.toneMapping=h,o.autoClear=l,e.background=d}_textureToCubeUV(e,t){let i=this._renderer,r=e.mapping===df||e.mapping===ff;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=Fue()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Lue());let n=r?this._cubemapMaterial:this._equirectMaterial,s=new Je(this._lodPlanes[0],n);n.uniforms.envMap.value=e;let a=this._cubeSize;gD(t,0,0,3*a,2*a),i.setRenderTarget(t),i.render(s,o4)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){let t=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),i=Pue[(r-1)%Pue.length];this._blur(e,r-1,r,t,i)}t.autoClear=i}_blur(e,t,i,r,n){let s=this._pingPongRenderTarget;this._halfBlur(e,s,t,i,r,"latitudinal",n),this._halfBlur(s,e,i,i,r,"longitudinal",n)}_halfBlur(e,t,i,r,n,s,a){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");let h=new Je(this._lodPlanes[r],l),u=l.uniforms,c=this._sizeLods[i]-1,p=isFinite(n)?Math.PI/(2*c):2*Math.PI/(2*yg-1),d=n/p,f=isFinite(n)?1+Math.floor(3*d):yg;f>yg&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${f} samples when the maximum is set to ${yg}`);let m=[],g=0;for(let T=0;T<yg;++T){let e=T/d,t=Math.exp(-e*e/2);m.push(t),0===T?g+=t:T<f&&(g+=2*t)}for(let T=0;T<m.length;T++)m[T]=m[T]/g;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===s,a&&(u.poleAxis.value=a);let{_lodMax:y}=this;u.dTheta.value=p,u.mipInt.value=y-i;let v=this._sizeLods[r];gD(t,3*v*(r>y-Ly?r-y+Ly:0),4*(this._cubeSize-v),3*v,2*v),o.setRenderTarget(t),o.render(h,o4)}};function Vvt(e){let t=[],i=[],r=[],n=e,s=e-Ly+1+Aue.length;for(let a=0;a<s;a++){let s=Math.pow(2,n);i.push(s);let o=1/s;a>e-Ly?o=Aue[a-e+Ly-1]:0===a&&(o=0),r.push(o);let l=1/(s-2),h=-l,u=1+l,c=[h,h,u,h,u,u,h,h,u,u,h,u],p=6,d=6,f=3,m=2,g=1,y=new Float32Array(f*d*p),v=new Float32Array(m*d*p),T=new Float32Array(g*d*p);for(let e=0;e<p;e++){let t=e%3*2/3-1,i=e>2?0:-1,r=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];y.set(r,f*d*e),v.set(c,m*d*e);let n=[e,e,e,e,e,e];T.set(n,g*d*e)}let x=new ot;x.setAttribute("position",new Wt(y,f)),x.setAttribute("uv",new Wt(v,m)),x.setAttribute("faceIndex",new Wt(T,g)),t.push(x),n>Ly&&n--}return{lodPlanes:t,sizeLods:i,sigmas:r}}function Nue(e,t,i){let r=new Wr(e,t,i);return r.texture.mapping=Ky,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function gD(e,t,i,r,n){e.viewport.set(t,i,r,n),e.scissor.set(t,i,r,n)}function zvt(e,t,i){let r=new Float32Array(yg),n=new D(0,1,0);return new Zt({name:"SphericalGaussianBlur",defines:{n:yg,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:xB(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:zi,depthTest:!1,depthWrite:!1})}function Lue(){return new Zt({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:xB(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:zi,depthTest:!1,depthWrite:!1})}function Fue(){return new Zt({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:xB(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:zi,depthTest:!1,depthWrite:!1})}function xB(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function jvt(e){let t=new WeakMap,i=null;function r(e){let i=e.target;i.removeEventListener("dispose",r);let n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function(n){if(n&&n.isTexture){let s=n.mapping,a=s===Sg||s===cx,o=s===df||s===ff;if(a||o){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let r=t.get(n);return null===i&&(i=new Hp(e)),r=a?i.fromEquirectangular(n,r):i.fromCubemap(n,r),t.set(n,r),r.texture}if(t.has(n))return t.get(n).texture;{let s=n.image;if(a&&s&&s.height>0||o&&s&&function(e){let t=0;for(let i=0;i<6;i++)void 0!==e[i]&&t++;return 6===t}(s)){null===i&&(i=new Hp(e));let s=a?i.fromEquirectangular(n):i.fromCubemap(n);return t.set(n,s),n.addEventListener("dispose",r),s.texture}return null}}}return n},dispose:function(){t=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function Wvt(e){let t={};function i(i){if(void 0!==t[i])return t[i];let r;switch(i){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(i)}return t[i]=r,r}return{has:function(e){return null!==i(e)},init:function(e){e.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(e){let t=i(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function qvt(e,t,i,r){let n={},s=new WeakMap;function a(e){let o=e.target;null!==o.index&&t.remove(o.index);for(let i in o.attributes)t.remove(o.attributes[i]);o.removeEventListener("dispose",a),delete n[o.id];let l=s.get(o);l&&(t.remove(l),s.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,i.memory.geometries--}function o(e){let i=[],r=e.index,n=e.attributes.position,a=0;if(null!==r){let e=r.array;a=r.version;for(let t=0,r=e.length;t<r;t+=3){let r=e[t+0],n=e[t+1],s=e[t+2];i.push(r,n,n,s,s,r)}}else{let e=n.array;a=n.version;for(let t=0,r=e.length/3-1;t<r;t+=3){let e=t+0,r=t+1,n=t+2;i.push(e,r,r,n,n,e)}}let o=new(Dpe(i)?gx:wg)(i,1);o.version=a;let l=s.get(e);l&&t.remove(l),s.set(e,o)}return{get:function(e,t){return!0===n[t.id]||(t.addEventListener("dispose",a),n[t.id]=!0,i.memory.geometries++),t},update:function(e){let i=e.attributes;for(let n in i)t.update(i[n],34962);let r=e.morphAttributes;for(let n in r){let e=r[n];for(let i=0,r=e.length;i<r;i++)t.update(e[i],34962)}},getWireframeAttribute:function(e){let t=s.get(e);if(t){let i=e.index;null!==i&&t.version<i.version&&o(e)}else o(e);return s.get(e)}}}function Yvt(e,t,i,r){let n,s,a,o=r.isWebGL2;this.setMode=function(e){n=e},this.setIndex=function(e){s=e.type,a=e.bytesPerElement},this.render=function(t,r){e.drawElements(n,r,s,t*a),i.update(r,n,1)},this.renderInstances=function(r,l,h){if(0===h)return;let u,c;if(o)u=e,c="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),c="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](n,l,s,r*a,h),i.update(l,n,h)}}function Xvt(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,i,r){switch(t.calls++,i){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function $vt(e,t){return e[0]-t[0]}function Zvt(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Kvt(e,t,i){let r={},n=new Float32Array(8),s=new WeakMap,a=new jr,o=[];for(let l=0;l<8;l++)o[l]=[l,0];return{update:function(l,h,u,c){let p=l.morphTargetInfluences;if(!0===t.isWebGL2){let r=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,n=void 0!==r?r.length:0,o=s.get(h);if(void 0===o||o.count!==n){let e=function(){y.dispose(),s.delete(h),h.removeEventListener("dispose",e)};void 0!==o&&o.texture.dispose();let i=void 0!==h.morphAttributes.position,r=void 0!==h.morphAttributes.normal,l=void 0!==h.morphAttributes.color,u=h.morphAttributes.position||[],c=h.morphAttributes.normal||[],p=h.morphAttributes.color||[],d=0;!0===i&&(d=1),!0===r&&(d=2),!0===l&&(d=3);let f=h.attributes.position.count*d,m=1;f>t.maxTextureSize&&(m=Math.ceil(f/t.maxTextureSize),f=t.maxTextureSize);let g=new Float32Array(f*m*4*n),y=new By(g,f,m,n);y.type=La,y.needsUpdate=!0;let v=4*d;for(let t=0;t<n;t++){let e=u[t],n=c[t],s=p[t],o=f*m*4*t;for(let t=0;t<e.count;t++){let h=t*v;!0===i&&(a.fromBufferAttribute(e,t),g[o+h+0]=a.x,g[o+h+1]=a.y,g[o+h+2]=a.z,g[o+h+3]=0),!0===r&&(a.fromBufferAttribute(n,t),g[o+h+4]=a.x,g[o+h+5]=a.y,g[o+h+6]=a.z,g[o+h+7]=0),!0===l&&(a.fromBufferAttribute(s,t),g[o+h+8]=a.x,g[o+h+9]=a.y,g[o+h+10]=a.z,g[o+h+11]=4===s.itemSize?a.w:1)}}o={count:n,texture:y,size:new ce(f,m)},s.set(h,o),h.addEventListener("dispose",e)}let l=0;for(let e=0;e<p.length;e++)l+=p[e];let u=h.morphTargetsRelative?1:1-l;c.getUniforms().setValue(e,"morphTargetBaseInfluence",u),c.getUniforms().setValue(e,"morphTargetInfluences",p),c.getUniforms().setValue(e,"morphTargetsTexture",o.texture,i),c.getUniforms().setValue(e,"morphTargetsTextureSize",o.size)}else{let t=void 0===p?0:p.length,i=r[h.id];if(void 0===i||i.length!==t){i=[];for(let e=0;e<t;e++)i[e]=[e,0];r[h.id]=i}for(let e=0;e<t;e++){let t=i[e];t[0]=e,t[1]=p[e]}i.sort(Zvt);for(let e=0;e<8;e++)e<t&&i[e][1]?(o[e][0]=i[e][0],o[e][1]=i[e][1]):(o[e][0]=Number.MAX_SAFE_INTEGER,o[e][1]=0);o.sort($vt);let s=h.morphAttributes.position,a=h.morphAttributes.normal,l=0;for(let e=0;e<8;e++){let t=o[e],i=t[0],r=t[1];i!==Number.MAX_SAFE_INTEGER&&r?(s&&h.getAttribute("morphTarget"+e)!==s[i]&&h.setAttribute("morphTarget"+e,s[i]),a&&h.getAttribute("morphNormal"+e)!==a[i]&&h.setAttribute("morphNormal"+e,a[i]),n[e]=r,l+=r):(s&&!0===h.hasAttribute("morphTarget"+e)&&h.deleteAttribute("morphTarget"+e),a&&!0===h.hasAttribute("morphNormal"+e)&&h.deleteAttribute("morphNormal"+e),n[e]=0)}let u=h.morphTargetsRelative?1:1-l;c.getUniforms().setValue(e,"morphTargetBaseInfluence",u),c.getUniforms().setValue(e,"morphTargetInfluences",n)}}}}function Jvt(e,t,i,r){let n=new WeakMap;function s(e){let t=e.target;t.removeEventListener("dispose",s),i.remove(t.instanceMatrix),null!==t.instanceColor&&i.remove(t.instanceColor)}return{update:function(e){let a=r.render.frame,o=e.geometry,l=t.get(e,o);return n.get(l)!==a&&(t.update(l),n.set(l,a)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",s)&&e.addEventListener("dispose",s),i.update(e.instanceMatrix,34962),null!==e.instanceColor&&i.update(e.instanceColor,34962)),l},dispose:function(){n=new WeakMap}}}var Ppe=new Pi,Npe=new By,Lpe=new mx,Fpe=new Rg,Hue=[],Uue=[],Bue=new Float32Array(16),kue=new Float32Array(9),Gue=new Float32Array(4);function eE(e,t,i){let r=e[0];if(r<=0||r>0)return e;let n=t*i,s=Hue[n];if(void 0===s&&(s=new Float32Array(n),Hue[n]=s),0!==t){r.toArray(s,0);for(let r=1,n=0;r!==t;++r)n+=i,e[r].toArray(s,n)}return s}function Is(e,t){if(e.length!==t.length)return!1;for(let i=0,r=e.length;i<r;i++)if(e[i]!==t[i])return!1;return!0}function _s(e,t){for(let i=0,r=t.length;i<r;i++)e[i]=t[i]}function SC(e,t){let i=Uue[t];void 0===i&&(i=new Int32Array(t),Uue[t]=i);for(let r=0;r!==t;++r)i[r]=e.allocateTextureUnit();return i}function Qvt(e,t){let i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function eyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(Is(i,t))return;e.uniform2fv(this.addr,t),_s(i,t)}}function tyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(void 0!==t.r)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(Is(i,t))return;e.uniform3fv(this.addr,t),_s(i,t)}}function ryt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(Is(i,t))return;e.uniform4fv(this.addr,t),_s(i,t)}}function iyt(e,t){let i=this.cache,r=t.elements;if(void 0===r){if(Is(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),_s(i,t)}else{if(Is(i,r))return;Gue.set(r),e.uniformMatrix2fv(this.addr,!1,Gue),_s(i,r)}}function nyt(e,t){let i=this.cache,r=t.elements;if(void 0===r){if(Is(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),_s(i,t)}else{if(Is(i,r))return;kue.set(r),e.uniformMatrix3fv(this.addr,!1,kue),_s(i,r)}}function syt(e,t){let i=this.cache,r=t.elements;if(void 0===r){if(Is(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),_s(i,t)}else{if(Is(i,r))return;Bue.set(r),e.uniformMatrix4fv(this.addr,!1,Bue),_s(i,r)}}function ayt(e,t){let i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function oyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(Is(i,t))return;e.uniform2iv(this.addr,t),_s(i,t)}}function lyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(Is(i,t))return;e.uniform3iv(this.addr,t),_s(i,t)}}function cyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(Is(i,t))return;e.uniform4iv(this.addr,t),_s(i,t)}}function uyt(e,t){let i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function hyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(Is(i,t))return;e.uniform2uiv(this.addr,t),_s(i,t)}}function pyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(Is(i,t))return;e.uniform3uiv(this.addr,t),_s(i,t)}}function dyt(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(Is(i,t))return;e.uniform4uiv(this.addr,t),_s(i,t)}}function fyt(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTexture2D(t||Ppe,n)}function myt(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTexture3D(t||Lpe,n)}function gyt(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTextureCube(t||Fpe,n)}function vyt(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTexture2DArray(t||Npe,n)}function yyt(e){switch(e){case 5126:return Qvt;case 35664:return eyt;case 35665:return tyt;case 35666:return ryt;case 35674:return iyt;case 35675:return nyt;case 35676:return syt;case 5124:case 35670:return ayt;case 35667:case 35671:return oyt;case 35668:case 35672:return lyt;case 35669:case 35673:return cyt;case 5125:return uyt;case 36294:return hyt;case 36295:return pyt;case 36296:return dyt;case 35678:case 36198:case 36298:case 36306:case 35682:return fyt;case 35679:case 36299:case 36307:return myt;case 35680:case 36300:case 36308:case 36293:return gyt;case 36289:case 36303:case 36311:case 36292:return vyt}}function Eyt(e,t){e.uniform1fv(this.addr,t)}function Tyt(e,t){let i=eE(t,this.size,2);e.uniform2fv(this.addr,i)}function byt(e,t){let i=eE(t,this.size,3);e.uniform3fv(this.addr,i)}function xyt(e,t){let i=eE(t,this.size,4);e.uniform4fv(this.addr,i)}function Iyt(e,t){let i=eE(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,i)}function _yt(e,t){let i=eE(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,i)}function Syt(e,t){let i=eE(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,i)}function wyt(e,t){e.uniform1iv(this.addr,t)}function Ryt(e,t){e.uniform2iv(this.addr,t)}function Myt(e,t){e.uniform3iv(this.addr,t)}function Dyt(e,t){e.uniform4iv(this.addr,t)}function Cyt(e,t){e.uniform1uiv(this.addr,t)}function Ayt(e,t){e.uniform2uiv(this.addr,t)}function Oyt(e,t){e.uniform3uiv(this.addr,t)}function Pyt(e,t){e.uniform4uiv(this.addr,t)}function Nyt(e,t,i){let r=this.cache,n=t.length,s=SC(i,n);Is(r,s)||(e.uniform1iv(this.addr,s),_s(r,s));for(let a=0;a!==n;++a)i.setTexture2D(t[a]||Ppe,s[a])}function Lyt(e,t,i){let r=this.cache,n=t.length,s=SC(i,n);Is(r,s)||(e.uniform1iv(this.addr,s),_s(r,s));for(let a=0;a!==n;++a)i.setTexture3D(t[a]||Lpe,s[a])}function Fyt(e,t,i){let r=this.cache,n=t.length,s=SC(i,n);Is(r,s)||(e.uniform1iv(this.addr,s),_s(r,s));for(let a=0;a!==n;++a)i.setTextureCube(t[a]||Fpe,s[a])}function Hyt(e,t,i){let r=this.cache,n=t.length,s=SC(i,n);Is(r,s)||(e.uniform1iv(this.addr,s),_s(r,s));for(let a=0;a!==n;++a)i.setTexture2DArray(t[a]||Npe,s[a])}function Uyt(e){switch(e){case 5126:return Eyt;case 35664:return Tyt;case 35665:return byt;case 35666:return xyt;case 35674:return Iyt;case 35675:return _yt;case 35676:return Syt;case 5124:case 35670:return wyt;case 35667:case 35671:return Ryt;case 35668:case 35672:return Myt;case 35669:case 35673:return Dyt;case 5125:return Cyt;case 36294:return Ayt;case 36295:return Oyt;case 36296:return Pyt;case 35678:case 36198:case 36298:case 36306:case 35682:return Nyt;case 35679:case 36299:case 36307:return Lyt;case 35680:case 36300:case 36308:case 36293:return Fyt;case 36289:case 36303:case 36311:case 36292:return Hyt}}var aU=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=yyt(t.type)}},oU=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=Uyt(t.type)}},lU=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){let r=this.seq;for(let n=0,s=r.length;n!==s;++n){let s=r[n];s.setValue(e,t[s.id],i)}}},c4=/(\w+)(\])?(\[|\.)?/g;function Vue(e,t){e.seq.push(t),e.map[t.id]=t}function Byt(e,t,i){let r=e.name,n=r.length;for(c4.lastIndex=0;;){let s=c4.exec(r),a=c4.lastIndex,o=s[1],l="]"===s[2],h=s[3];if(l&&(o|=0),void 0===h||"["===h&&a+2===n){Vue(i,void 0===h?new aU(o,e,t):new oU(o,e,t));break}{let e=i.map[o];void 0===e&&(e=new lU(o),Vue(i,e)),i=e}}}var Hy=class{constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,35718);for(let r=0;r<i;++r){let i=e.getActiveUniform(t,r);Byt(i,e.getUniformLocation(t,i.name),this)}}setValue(e,t,i,r){let n=this.map[t];void 0!==n&&n.setValue(e,i,r)}setOptional(e,t,i){let r=t[i];void 0!==r&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let n=0,s=t.length;n!==s;++n){let s=t[n],a=i[s.id];!1!==a.needsUpdate&&s.setValue(e,a.value,r)}}static seqWithValue(e,t){let i=[];for(let r=0,n=e.length;r!==n;++r){let n=e[r];n.id in t&&i.push(n)}return i}};function zue(e,t,i){let r=e.createShader(t);return e.shaderSource(r,i),e.compileShader(r),r}var kyt=0;function Gyt(e,t){let i=e.split("\n"),r=[],n=Math.max(t-6,0),s=Math.min(t+6,i.length);for(let a=n;a<s;a++){let e=a+1;r.push(`${e===t?">":" "} ${e}: ${i[a]}`)}return r.join("\n")}function Vyt(e){switch(e){case Nl:return["Linear","( value )"];case yr:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function jue(e,t,i){let r=e.getShaderParameter(t,35713),n=e.getShaderInfoLog(t).trim();if(r&&""===n)return"";let s=/ERROR: 0:(\d+)/.exec(n);if(s){let r=parseInt(s[1]);return i.toUpperCase()+"\n\n"+n+"\n\n"+Gyt(e.getShaderSource(t),r)}return n}function zyt(e,t){let i=Vyt(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function jyt(e,t){let i;switch(t){case npe:i="Linear";break;case spe:i="Reinhard";break;case ape:i="OptimizedCineon";break;case ope:i="ACESFilmic";break;case lpe:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Wyt(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(nx).join("\n")}function qyt(e){let t=[];for(let i in e){let r=e[i];!1!==r&&t.push("#define "+i+" "+r)}return t.join("\n")}function Yyt(e,t){let i={},r=e.getProgramParameter(t,35721);for(let n=0;n<r;n++){let r=e.getActiveAttrib(t,n),s=r.name,a=1;35674===r.type&&(a=2),35675===r.type&&(a=3),35676===r.type&&(a=4),i[s]={type:r.type,location:e.getAttribLocation(t,s),locationSize:a}}return i}function nx(e){return""!==e}function Wue(e,t){let i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function que(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Xyt=/^[ \t]*#include +<([\w\d./]+)>/gm;function cU(e){return e.replace(Xyt,$yt)}function $yt(e,t){let i=Zr[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return cU(i)}var Zyt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Yue(e){return e.replace(Zyt,Kyt)}function Kyt(e,t,i,r){let n="";for(let s=parseInt(t);s<parseInt(i);s++)n+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return n}function Xue(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Jyt(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===vB?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===Yy?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===Py&&(t="SHADOWMAP_TYPE_VSM"),t}function Qyt(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case df:case ff:t="ENVMAP_TYPE_CUBE";break;case Ky:t="ENVMAP_TYPE_CUBE_UV"}return t}function eEt(e){let t="ENVMAP_MODE_REFLECTION";return e.envMap&&e.envMapMode===ff&&(t="ENVMAP_MODE_REFRACTION"),t}function tEt(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case Bx:t="ENVMAP_BLENDING_MULTIPLY";break;case rpe:t="ENVMAP_BLENDING_MIX";break;case ipe:t="ENVMAP_BLENDING_ADD"}return t}function rEt(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let i=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:r,maxMip:i}}function iEt(e,t,i,r){let n,s,a=e.getContext(),o=i.defines,l=i.vertexShader,h=i.fragmentShader,u=Jyt(i),c=Qyt(i),p=eEt(i),d=tEt(i),f=rEt(i),m=i.isWebGL2?"":Wyt(i),g=qyt(o),y=a.createProgram(),v=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(n=[g].filter(nx).join("\n"),n.length>0&&(n+="\n"),s=[m,g].filter(nx).join("\n"),s.length>0&&(s+="\n")):(n=[Xue(i),"#define SHADER_NAME "+i.shaderName,g,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(nx).join("\n"),s=[m,Xue(i),"#define SHADER_NAME "+i.shaderName,g,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+p:"",i.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Yu?"#define TONE_MAPPING":"",i.toneMapping!==Yu?Zr.tonemapping_pars_fragment:"",i.toneMapping!==Yu?jyt("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",Zr.encodings_pars_fragment,zyt("linearToOutputTexel",i.outputEncoding),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(nx).join("\n")),l=cU(l),l=Wue(l,i),l=que(l,i),h=cU(h),h=Wue(h,i),h=que(h,i),l=Yue(l),h=Yue(h),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(v="#version 300 es\n",n=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+n,s=["#define varying in",i.glslVersion===X4?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===X4?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+s);let T,x,b=v+s+h,E=zue(a,35633,v+n+l),_=zue(a,35632,b);if(a.attachShader(y,E),a.attachShader(y,_),void 0!==i.index0AttributeName?a.bindAttribLocation(y,0,i.index0AttributeName):!0===i.morphTargets&&a.bindAttribLocation(y,0,"position"),a.linkProgram(y),e.debug.checkShaderErrors){let e=a.getProgramInfoLog(y).trim(),t=a.getShaderInfoLog(E).trim(),i=a.getShaderInfoLog(_).trim(),r=!0,o=!0;if(!1===a.getProgramParameter(y,35714)){r=!1;let t=jue(a,E,"vertex"),i=jue(a,_,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(y,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+i)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):(""===t||""===i)&&(o=!1);o&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:n},fragmentShader:{log:i,prefix:s}})}return a.deleteShader(E),a.deleteShader(_),this.getUniforms=function(){return void 0===T&&(T=new Hy(a,y)),T},this.getAttributes=function(){return void 0===x&&(x=Yyt(a,y)),x},this.destroy=function(){r.releaseStatesOfProgram(this),a.deleteProgram(y),this.program=void 0},this.name=i.shaderName,this.id=kyt++,this.cacheKey=t,this.usedTimes=1,this.program=y,this.vertexShader=E,this.fragmentShader=_,this}var nEt=0,uU=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),n=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return!1===s.has(r)&&(s.add(r),r.usedTimes++),!1===s.has(n)&&(s.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,0===i.usedTimes&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return void 0===i&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return void 0===i&&(i=new hU(e),t.set(e,i)),i}},hU=class{constructor(e){this.id=nEt++,this.code=e,this.usedTimes=0}};function sEt(e,t,i,r,n,s,a){let o=new ky,l=new uU,h=[],u=n.isWebGL2,c=n.logarithmicDepthBuffer,p=n.vertexTextures,d=n.precision,f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(s,o,h,m,g){let y=m.fog,v=g.geometry,T=s.isMeshStandardMaterial?m.environment:null,x=(s.isMeshStandardMaterial?i:t).get(s.envMap||T),b=x&&x.mapping===Ky?x.image.height:null,E=f[s.type];null!==s.precision&&(d=n.getMaxPrecision(s.precision),d!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",d,"instead."));let _,w,S,M,I=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,D=void 0!==I?I.length:0,A=0;if(void 0!==v.morphAttributes.position&&(A=1),void 0!==v.morphAttributes.normal&&(A=2),void 0!==v.morphAttributes.color&&(A=3),E){let e=Bc[E];_=e.vertexShader,w=e.fragmentShader}else _=s.vertexShader,w=s.fragmentShader,l.update(s),S=l.getVertexShaderID(s),M=l.getFragmentShaderID(s);let R=e.getRenderTarget(),C=s.alphaTest>0,O=s.clearcoat>0,P=s.iridescence>0;return{isWebGL2:u,shaderID:E,shaderName:s.type,vertexShader:_,fragmentShader:w,defines:s.defines,customVertexShaderID:S,customFragmentShaderID:M,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:d,instancing:!0===g.isInstancedMesh,instancingColor:!0===g.isInstancedMesh&&null!==g.instanceColor,supportsVertexTextures:p,outputEncoding:null===R?e.outputEncoding:!0===R.isXRRenderTarget?R.texture.encoding:Nl,map:!!s.map,matcap:!!s.matcap,envMap:!!x,envMapMode:x&&x.mapping,envMapCubeUVHeight:b,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:s.normalMapType===wpe,tangentSpaceNormalMap:s.normalMapType===_f,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&s.map.encoding===yr,clearcoat:O,clearcoatMap:O&&!!s.clearcoatMap,clearcoatRoughnessMap:O&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:O&&!!s.clearcoatNormalMap,iridescence:P,iridescenceMap:P&&!!s.iridescenceMap,iridescenceThicknessMap:P&&!!s.iridescenceThicknessMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,opaque:!1===s.transparent&&s.blending===xg,alphaMap:!!s.alphaMap,alphaTest:C,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!v.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!v.attributes.color&&4===v.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!y,useFog:!0===s.fog,fogExp2:y&&y.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:c,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==v.morphAttributes.position,morphNormals:void 0!==v.morphAttributes.normal,morphColors:void 0!==v.morphAttributes.color,morphTargetsCount:D,morphTextureStride:A,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&h.length>0,shadowMapType:e.shadowMap.type,toneMapping:s.toneMapped?e.toneMapping:Yu,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===bi,flipSided:s.side===$n,useDepthPacking:!!s.depthPacking,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){let i=[];if(t.shaderID?i.push(t.shaderID):(i.push(t.customVertexShaderID),i.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)i.push(e),i.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.combine),e.push(t.vertexUvs),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(i,t),function(e,t){o.disableAll(),t.isWebGL2&&o.enable(0),t.supportsVertexTextures&&o.enable(1),t.instancing&&o.enable(2),t.instancingColor&&o.enable(3),t.map&&o.enable(4),t.matcap&&o.enable(5),t.envMap&&o.enable(6),t.lightMap&&o.enable(7),t.aoMap&&o.enable(8),t.emissiveMap&&o.enable(9),t.bumpMap&&o.enable(10),t.normalMap&&o.enable(11),t.objectSpaceNormalMap&&o.enable(12),t.tangentSpaceNormalMap&&o.enable(13),t.clearcoat&&o.enable(14),t.clearcoatMap&&o.enable(15),t.clearcoatRoughnessMap&&o.enable(16),t.clearcoatNormalMap&&o.enable(17),t.iridescence&&o.enable(18),t.iridescenceMap&&o.enable(19),t.iridescenceThicknessMap&&o.enable(20),t.displacementMap&&o.enable(21),t.specularMap&&o.enable(22),t.roughnessMap&&o.enable(23),t.metalnessMap&&o.enable(24),t.gradientMap&&o.enable(25),t.alphaMap&&o.enable(26),t.alphaTest&&o.enable(27),t.vertexColors&&o.enable(28),t.vertexAlphas&&o.enable(29),t.vertexUvs&&o.enable(30),t.vertexTangents&&o.enable(31),t.uvsVertexOnly&&o.enable(32),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.skinning&&o.enable(4),t.morphTargets&&o.enable(5),t.morphNormals&&o.enable(6),t.morphColors&&o.enable(7),t.premultipliedAlpha&&o.enable(8),t.shadowMapEnabled&&o.enable(9),t.physicallyCorrectLights&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.specularIntensityMap&&o.enable(15),t.specularColorMap&&o.enable(16),t.transmission&&o.enable(17),t.transmissionMap&&o.enable(18),t.thicknessMap&&o.enable(19),t.sheen&&o.enable(20),t.sheenColorMap&&o.enable(21),t.sheenRoughnessMap&&o.enable(22),t.decodeVideoTexture&&o.enable(23),t.opaque&&o.enable(24),e.push(o.mask)}(i,t),i.push(e.outputEncoding)),i.push(t.customProgramCacheKey),i.join()},getUniforms:function(e){let t,i=f[e.type];if(i){let e=Bc[i];t=dn.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,i){let r;for(let e=0,n=h.length;e<n;e++){let t=h[e];if(t.cacheKey===i){r=t,++r.usedTimes;break}}return void 0===r&&(r=new iEt(e,i,t,s),h.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){let t=h.indexOf(e);h[t]=h[h.length-1],h.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:h,dispose:function(){l.dispose()}}}function aEt(){let e=new WeakMap;return{get:function(t){let i=e.get(t);return void 0===i&&(i={},e.set(t,i)),i},remove:function(t){e.delete(t)},update:function(t,i,r){e.get(t)[i]=r},dispose:function(){e=new WeakMap}}}function oEt(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function $ue(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Zue(){let e=[],t=0,i=[],r=[],n=[];function s(i,r,n,s,a,o){let l=e[t];return void 0===l?(l={id:i.id,object:i,geometry:r,material:n,groupOrder:s,renderOrder:i.renderOrder,z:a,group:o},e[t]=l):(l.id=i.id,l.object=i,l.geometry=r,l.material=n,l.groupOrder=s,l.renderOrder=i.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:i,transmissive:r,transparent:n,init:function(){t=0,i.length=0,r.length=0,n.length=0},push:function(e,t,a,o,l,h){let u=s(e,t,a,o,l,h);a.transmission>0?r.push(u):!0===a.transparent?n.push(u):i.push(u)},unshift:function(e,t,a,o,l,h){let u=s(e,t,a,o,l,h);a.transmission>0?r.unshift(u):!0===a.transparent?n.unshift(u):i.unshift(u)},finish:function(){for(let i=t,r=e.length;i<r;i++){let t=e[i];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){i.length>1&&i.sort(e||oEt),r.length>1&&r.sort(t||$ue),n.length>1&&n.sort(t||$ue)}}}function lEt(){let e=new WeakMap;return{get:function(t,i){let r,n=e.get(t);return void 0===n?(r=new Zue,e.set(t,[r])):i>=n.length?(r=new Zue,n.push(r)):r=n[i],r},dispose:function(){e=new WeakMap}}}function cEt(){let e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new D,color:new Ve};break;case"SpotLight":i={position:new D,direction:new D,color:new Ve,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new D,color:new Ve,distance:0,decay:0};break;case"HemisphereLight":i={direction:new D,skyColor:new Ve,groundColor:new Ve};break;case"RectAreaLight":i={color:new Ve,position:new D,halfWidth:new D,halfHeight:new D}}return e[t.id]=i,i}}}function uEt(){let e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i,i}}}var hEt=0;function pEt(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function dEt(e,t){let i=new cEt,r=uEt(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let l=0;l<9;l++)n.probe.push(new D);let s=new D,a=new Be,o=new Be;return{setup:function(s,a){let o=0,l=0,h=0;for(let e=0;e<9;e++)n.probe[e].set(0,0,0);let u=0,c=0,p=0,d=0,f=0,m=0,g=0,y=0,v=0,T=0;s.sort(pEt);let x=!0!==a?Math.PI:1;for(let e=0,t=s.length;e<t;e++){let t=s[e],a=t.color,b=t.intensity,E=t.distance,_=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)o+=a.r*b*x,l+=a.g*b*x,h+=a.b*b*x;else if(t.isLightProbe)for(let e=0;e<9;e++)n.probe[e].addScaledVector(t.sh.coefficients[e],b);else if(t.isDirectionalLight){let e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),t.castShadow){let e=t.shadow,i=r.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,n.directionalShadow[u]=i,n.directionalShadowMap[u]=_,n.directionalShadowMatrix[u]=t.shadow.matrix,m++}n.directional[u]=e,u++}else if(t.isSpotLight){let e=i.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(a).multiplyScalar(b*x),e.distance=E,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,n.spot[p]=e;let s=t.shadow;if(t.map&&(n.spotLightMap[v]=t.map,v++,s.updateMatrices(t),t.castShadow&&T++),n.spotLightMatrix[p]=s.matrix,t.castShadow){let e=r.get(t);e.shadowBias=s.bias,e.shadowNormalBias=s.normalBias,e.shadowRadius=s.radius,e.shadowMapSize=s.mapSize,n.spotShadow[p]=e,n.spotShadowMap[p]=_,y++}p++}else if(t.isRectAreaLight){let e=i.get(t);e.color.copy(a).multiplyScalar(b),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),n.rectArea[d]=e,d++}else if(t.isPointLight){let e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),e.distance=t.distance,e.decay=t.decay,t.castShadow){let e=t.shadow,i=r.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,i.shadowCameraNear=e.camera.near,i.shadowCameraFar=e.camera.far,n.pointShadow[c]=i,n.pointShadowMap[c]=_,n.pointShadowMatrix[c]=t.shadow.matrix,g++}n.point[c]=e,c++}else if(t.isHemisphereLight){let e=i.get(t);e.skyColor.copy(t.color).multiplyScalar(b*x),e.groundColor.copy(t.groundColor).multiplyScalar(b*x),n.hemi[f]=e,f++}}d>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(n.rectAreaLTC1=At.LTC_FLOAT_1,n.rectAreaLTC2=At.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(n.rectAreaLTC1=At.LTC_HALF_1,n.rectAreaLTC2=At.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=o,n.ambient[1]=l,n.ambient[2]=h;let b=n.hash;(b.directionalLength!==u||b.pointLength!==c||b.spotLength!==p||b.rectAreaLength!==d||b.hemiLength!==f||b.numDirectionalShadows!==m||b.numPointShadows!==g||b.numSpotShadows!==y||b.numSpotMaps!==v)&&(n.directional.length=u,n.spot.length=p,n.rectArea.length=d,n.point.length=c,n.hemi.length=f,n.directionalShadow.length=m,n.directionalShadowMap.length=m,n.pointShadow.length=g,n.pointShadowMap.length=g,n.spotShadow.length=y,n.spotShadowMap.length=y,n.directionalShadowMatrix.length=m,n.pointShadowMatrix.length=g,n.spotLightMatrix.length=y+v-T,n.spotLightMap.length=v,n.numSpotLightShadowsWithMaps=T,b.directionalLength=u,b.pointLength=c,b.spotLength=p,b.rectAreaLength=d,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=g,b.numSpotShadows=y,b.numSpotMaps=v,n.version=hEt++)},setupView:function(e,t){let i=0,r=0,l=0,h=0,u=0,c=t.matrixWorldInverse;for(let p=0,d=e.length;p<d;p++){let t=e[p];if(t.isDirectionalLight){let e=n.directional[i];e.direction.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(c),i++}else if(t.isSpotLight){let e=n.spot[l];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(c),e.direction.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(c),l++}else if(t.isRectAreaLight){let e=n.rectArea[h];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(c),o.identity(),a.copy(t.matrixWorld),a.premultiply(c),o.extractRotation(a),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),h++}else if(t.isPointLight){let e=n.point[r];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(c),r++}else if(t.isHemisphereLight){let e=n.hemi[u];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(c),u++}}},state:n}}function Kue(e,t){let i=new dEt(e,t),r=[],n=[];return{init:function(){r.length=0,n.length=0},state:{lightsArray:r,shadowsArray:n,lights:i},setupLights:function(e){i.setup(r,e)},setupLightsView:function(e){i.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){n.push(e)}}}function fEt(e,t){let i=new WeakMap;return{get:function(r,n=0){let s,a=i.get(r);return void 0===a?(s=new Kue(e,t),i.set(r,[s])):n>=a.length?(s=new Kue(e,t),a.push(s)):s=a[n],s},dispose:function(){i=new WeakMap}}}var Up=class extends qr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Spe,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=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}},vx=class extends qr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new D,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},mEt="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",gEt="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function vEt(e,t,i){let r=new na,n=new ce,s=new ce,a=new jr,o=new Up({depthPacking:Qy}),l=new vx,h={},u=i.maxTextureSize,c={[Xi]:$n,[$n]:Xi,[bi]:bi},p=new Zt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ce},radius:{value:4}},vertexShader:mEt,fragmentShader:gEt}),d=p.clone();d.defines.HORIZONTAL_PASS=1;let f=new ot;f.setAttribute("position",new Wt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new Je(f,p),g=this;function y(i,r){let s=t.update(m);p.defines.VSM_SAMPLES!==i.blurSamples&&(p.defines.VSM_SAMPLES=i.blurSamples,d.defines.VSM_SAMPLES=i.blurSamples,p.needsUpdate=!0,d.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new Wr(n.x,n.y)),p.uniforms.shadow_pass.value=i.map.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,e.setRenderTarget(i.mapPass),e.clear(),e.renderBufferDirect(r,null,s,p,m,null),d.uniforms.shadow_pass.value=i.mapPass.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,e.setRenderTarget(i.map),e.clear(),e.renderBufferDirect(r,null,s,d,m,null)}function v(t,i,r,n,s,a){let u=null,p=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==p)u=p;else if(u=!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0||i.map&&i.alphaTest>0){let e=u.uuid,t=i.uuid,r=h[e];void 0===r&&(r={},h[e]=r);let n=r[t];void 0===n&&(n=u.clone(),r[t]=n),u=n}return u.visible=i.visible,u.wireframe=i.wireframe,u.side=a===Py?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:c[i.side],u.alphaMap=i.alphaMap,u.alphaTest=i.alphaTest,u.map=i.map,u.clipShadows=i.clipShadows,u.clippingPlanes=i.clippingPlanes,u.clipIntersection=i.clipIntersection,u.displacementMap=i.displacementMap,u.displacementScale=i.displacementScale,u.displacementBias=i.displacementBias,u.wireframeLinewidth=i.wireframeLinewidth,u.linewidth=i.linewidth,!0===r.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(r.matrixWorld),u.nearDistance=n,u.farDistance=s),u}function T(i,n,s,a,o){if(!1===i.visible)return;if(i.layers.test(n.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&o===Py)&&(!i.frustumCulled||r.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);let r=t.update(i),n=i.material;if(Array.isArray(n)){let t=r.groups;for(let l=0,h=t.length;l<h;l++){let h=t[l],u=n[h.materialIndex];if(u&&u.visible){let t=v(i,u,a,s.near,s.far,o);e.renderBufferDirect(s,null,r,t,i,h)}}}else if(n.visible){let t=v(i,n,a,s.near,s.far,o);e.renderBufferDirect(s,null,r,t,i,null)}}let l=i.children;for(let e=0,t=l.length;e<t;e++)T(l[e],n,s,a,o)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=vB,this.render=function(t,i,o){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===t.length)return;let l=e.getRenderTarget(),h=e.getActiveCubeFace(),c=e.getActiveMipmapLevel(),p=e.state;p.setBlending(zi),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(let d=0,f=t.length;d<f;d++){let l=t[d],h=l.shadow;if(void 0===h){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;n.copy(h.mapSize);let c=h.getFrameExtents();if(n.multiply(c),s.copy(h.mapSize),(n.x>u||n.y>u)&&(n.x>u&&(s.x=Math.floor(u/c.x),n.x=s.x*c.x,h.mapSize.x=s.x),n.y>u&&(s.y=Math.floor(u/c.y),n.y=s.y*c.y,h.mapSize.y=s.y)),null===h.map){let e=this.type!==Py?{minFilter:Oi,magFilter:Oi}:{};h.map=new Wr(n.x,n.y,e),h.map.texture.name=l.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();let f=h.getViewportCount();for(let e=0;e<f;e++){let t=h.getViewport(e);a.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),p.viewport(a),h.updateMatrices(l,e),r=h.getFrustum(),T(i,o,h.camera,l,this.type)}!0!==h.isPointLightShadow&&this.type===Py&&y(h,o),h.needsUpdate=!1}g.needsUpdate=!1,e.setRenderTarget(l,h,c)}}function yEt(e,t,i){let r=i.isWebGL2,n=new function(){let t=!1,i=new jr,r=null,n=new jr(0,0,0,0);return{setMask:function(i){r!==i&&!t&&(e.colorMask(i,i,i,i),r=i)},setLocked:function(e){t=e},setClear:function(t,r,s,a,o){!0===o&&(t*=a,r*=a,s*=a),i.set(t,r,s,a),!1===n.equals(i)&&(e.clearColor(t,r,s,a),n.copy(i))},reset:function(){t=!1,r=null,n.set(-1,0,0,0)}}},s=new function(){let t=!1,i=null,r=null,n=null;return{setTest:function(e){e?z(2929):G(2929)},setMask:function(r){i!==r&&!t&&(e.depthMask(r),i=r)},setFunc:function(t){if(r!==t){switch(t){case $he:e.depthFunc(512);break;case Zhe:e.depthFunc(519);break;case Khe:e.depthFunc(513);break;case qD:e.depthFunc(515);break;case Jhe:e.depthFunc(514);break;case Qhe:e.depthFunc(518);break;case epe:e.depthFunc(516);break;case tpe:e.depthFunc(517);break;default:e.depthFunc(515)}r=t}},setLocked:function(e){t=e},setClear:function(t){n!==t&&(e.clearDepth(t),n=t)},reset:function(){t=!1,i=null,r=null,n=null}}},a=new function(){let t=!1,i=null,r=null,n=null,s=null,a=null,o=null,l=null,h=null;return{setTest:function(e){t||(e?z(2960):G(2960))},setMask:function(r){i!==r&&!t&&(e.stencilMask(r),i=r)},setFunc:function(t,i,a){(r!==t||n!==i||s!==a)&&(e.stencilFunc(t,i,a),r=t,n=i,s=a)},setOp:function(t,i,r){(a!==t||o!==i||l!==r)&&(e.stencilOp(t,i,r),a=t,o=i,l=r)},setLocked:function(e){t=e},setClear:function(t){h!==t&&(e.clearStencil(t),h=t)},reset:function(){t=!1,i=null,r=null,n=null,s=null,a=null,o=null,l=null,h=null}}},o=new WeakMap,l=new WeakMap,h={},u={},c=new WeakMap,p=[],d=null,f=!1,m=null,g=null,y=null,v=null,T=null,x=null,b=null,E=!1,_=null,w=null,S=null,M=null,I=null,D=e.getParameter(35661),A=!1,R=0,C=e.getParameter(7938);-1!==C.indexOf("WebGL")?(R=parseFloat(/^WebGL (\d)/.exec(C)[1]),A=R>=1):-1!==C.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(C)[1]),A=R>=2);let O=null,P={},N=e.getParameter(3088),L=e.getParameter(2978),F=(new jr).fromArray(N),U=(new jr).fromArray(L);function k(t,i,r){let n=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let a=0;a<r;a++)e.texImage2D(i+a,0,6408,1,1,0,6408,5121,n);return s}let B={};function z(t){!0!==h[t]&&(e.enable(t),h[t]=!0)}function G(t){!1!==h[t]&&(e.disable(t),h[t]=!1)}B[3553]=k(3553,3553,1),B[34067]=k(34067,34069,6),n.setClear(0,0,0,1),s.setClear(1),a.setClear(0),z(2929),s.setFunc(qD),W(!1),Y(T4),z(2884),j(zi);let H={[Na]:32774,[Vhe]:32778,[zhe]:32779};if(r)H[I4]=32775,H[_4]=32776;else{let e=t.get("EXT_blend_minmax");null!==e&&(H[I4]=e.MIN_EXT,H[_4]=e.MAX_EXT)}let V={[If]:0,[Xy]:1,[jhe]:768,[Ux]:770,[Xhe]:776,[Zy]:774,[$y]:772,[Whe]:769,[yB]:771,[Yhe]:775,[qhe]:773};function j(t,i,r,n,s,a,o,l){if(t!==zi){if(!1===f&&(z(3042),f=!0),t===Yp)s=s||i,a=a||r,o=o||n,(i!==g||s!==T)&&(e.blendEquationSeparate(H[i],H[s]),g=i,T=s),(r!==y||n!==v||a!==x||o!==b)&&(e.blendFuncSeparate(V[r],V[n],V[a],V[o]),y=r,v=n,x=a,b=o),m=t,E=!1;else if(t!==m||l!==E){if((g!==Na||T!==Na)&&(e.blendEquation(32774),g=Na,T=Na),l)switch(t){case xg:e.blendFuncSeparate(1,771,1,771);break;case Op:e.blendFunc(1,1);break;case b4:e.blendFuncSeparate(0,769,0,1);break;case x4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case xg:e.blendFuncSeparate(770,771,1,771);break;case Op:e.blendFunc(770,1);break;case b4:e.blendFuncSeparate(0,769,0,1);break;case x4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}y=null,v=null,x=null,b=null,m=t,E=l}}else!0===f&&(G(3042),f=!1)}function W(t){_!==t&&(t?e.frontFace(2304):e.frontFace(2305),_=t)}function Y(t){t!==khe?(z(2884),t!==w&&(t===T4?e.cullFace(1029):t===Ghe?e.cullFace(1028):e.cullFace(1032))):G(2884),w=t}function X(t,i,r){t?(z(32823),(M!==i||I!==r)&&(e.polygonOffset(i,r),M=i,I=r)):G(32823)}return{buffers:{color:n,depth:s,stencil:a},enable:z,disable:G,bindFramebuffer:function(t,i){return u[t]!==i&&(e.bindFramebuffer(t,i),u[t]=i,r&&(36009===t&&(u[36160]=i),36160===t&&(u[36009]=i)),!0)},drawBuffers:function(r,n){let s=p,a=!1;if(r)if(s=c.get(n),void 0===s&&(s=[],c.set(n,s)),r.isWebGLMultipleRenderTargets){let e=r.texture;if(s.length!==e.length||36064!==s[0]){for(let t=0,i=e.length;t<i;t++)s[t]=36064+t;s.length=e.length,a=!0}}else 36064!==s[0]&&(s[0]=36064,a=!0);else 1029!==s[0]&&(s[0]=1029,a=!0);a&&(i.isWebGL2?e.drawBuffers(s):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:j,setMaterial:function(e,t){e.side===bi?G(2884):z(2884);let i=e.side===$n;t&&(i=!i),W(i),e.blending===xg&&!1===e.transparent?j(zi):j(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),s.setFunc(e.depthFunc),s.setTest(e.depthTest),s.setMask(e.depthWrite),n.setMask(e.colorWrite);let r=e.stencilWrite;a.setTest(r),r&&(a.setMask(e.stencilWriteMask),a.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),a.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),X(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?z(32926):G(32926)},setFlipSided:W,setCullFace:Y,setLineWidth:function(t){t!==S&&(A&&e.lineWidth(t),S=t)},setPolygonOffset:X,setScissorTest:function(e){e?z(3089):G(3089)},activeTexture:function(t){void 0===t&&(t=33984+D-1),O!==t&&(e.activeTexture(t),O=t)},bindTexture:function(t,i,r){void 0===r&&(r=null===O?33984+D-1:O);let n=P[r];void 0===n&&(n={type:void 0,texture:void 0},P[r]=n),(n.type!==t||n.texture!==i)&&(O!==r&&(e.activeTexture(r),O=r),e.bindTexture(t,i||B[t]),n.type=t,n.texture=i)},unbindTexture:function(){let t=P[O];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},updateUBOMapping:function(t,i){let r=l.get(i);void 0===r&&(r=new WeakMap,l.set(i,r));let n=r.get(t);void 0===n&&(n=e.getUniformBlockIndex(i,t.name),r.set(t,n))},uniformBlockBinding:function(t,i){let r=l.get(i).get(t);o.get(i)!==r&&(e.uniformBlockBinding(i,r,t.__bindingPointIndex),o.set(i,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===F.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),F.copy(t))},viewport:function(t){!1===U.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),U.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===r&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),h={},O=null,P={},u={},c=new WeakMap,p=[],d=null,f=!1,m=null,g=null,y=null,v=null,T=null,x=null,b=null,E=!1,_=null,w=null,S=null,M=null,I=null,F.set(0,0,e.canvas.width,e.canvas.height),U.set(0,0,e.canvas.width,e.canvas.height),n.reset(),s.reset(),a.reset()}}}function EEt(e,t,i,r,n,s,a){let o,l=n.isWebGL2,h=n.maxTextures,u=n.maxCubemapSize,c=n.maxTextureSize,p=n.maxSamples,d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,f="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),m=new WeakMap,g=new WeakMap,y=!1;try{y="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function v(e,t){return y?new OffscreenCanvas(e,t):dx("canvas")}function T(e,t,i,r){let n=1;if((e.width>r||e.height>r)&&(n=r/Math.max(e.width,e.height)),n<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let r=t?XD:Math.floor,s=r(n*e.width),a=r(n*e.height);void 0===o&&(o=v(s,a));let l=i?v(s,a):o;return l.width=s,l.height=a,l.getContext("2d").drawImage(e,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+a+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return $4(e.width)&&$4(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==Oi&&e.minFilter!==hi}function E(t){e.generateMipmap(t)}function _(i,r,n,s,a=!1){if(!1===l)return r;if(null!==i){if(void 0!==e[i])return e[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let o=r;return 6403===r&&(5126===n&&(o=33326),5131===n&&(o=33325),5121===n&&(o=33321)),33319===r&&(5126===n&&(o=33328),5131===n&&(o=33327),5121===n&&(o=33323)),6408===r&&(5126===n&&(o=34836),5131===n&&(o=34842),5121===n&&(o=s===yr&&!1===a?35907:32856),32819===n&&(o=32854),32820===n&&(o=32855)),(33325===o||33326===o||33327===o||33328===o||34842===o||34836===o)&&t.get("EXT_color_buffer_float"),o}function w(e,t,i){return!0===b(e,i)||e.isFramebufferTexture&&e.minFilter!==Oi&&e.minFilter!==hi?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){return e===Oi||e===mf||e===Cp?9728:9729}function M(e){let t=e.target;t.removeEventListener("dispose",M),function(e){let t=r.get(e);if(void 0===t.__webglInit)return;let i=e.source,n=g.get(i);if(n){let r=n[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&D(e),0===Object.keys(n).length&&g.delete(i)}r.remove(e)}(t),t.isVideoTexture&&m.delete(t)}function I(t){let i=t.target;i.removeEventListener("dispose",I),function(t){let i=t.texture,n=r.get(t),s=r.get(i);if(void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),a.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let r=0;r<6;r++)e.deleteFramebuffer(n.__webglFramebuffer[r]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[r]);else{if(e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let o=0,l=i.length;o<l;o++){let t=r.get(i[o]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),a.memory.textures--),r.remove(i[o])}r.remove(i),r.remove(t)}(i)}function D(t){let i=r.get(t);e.deleteTexture(i.__webglTexture);let n=t.source;delete g.get(n)[i.__cacheKey],a.memory.textures--}let A=0;function R(e,t){let n=r.get(e);if(e.isVideoTexture&&function(e){let t=a.render.frame;m.get(e)!==t&&(m.set(e,t),e.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&n.__version!==e.version){let i=e.image;if(null===i)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==i.complete)return void L(n,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.bindTexture(3553,n.__webglTexture,33984+t)}let C={[yn]:10497,[vn]:33071,[Pp]:33648},O={[Oi]:9728,[mf]:9984,[Cp]:9986,[hi]:9729,[jg]:9985,[Ha]:9987};function P(i,s,a){if(a?(e.texParameteri(i,10242,C[s.wrapS]),e.texParameteri(i,10243,C[s.wrapT]),(32879===i||35866===i)&&e.texParameteri(i,32882,C[s.wrapR]),e.texParameteri(i,10240,O[s.magFilter]),e.texParameteri(i,10241,O[s.minFilter])):(e.texParameteri(i,10242,33071),e.texParameteri(i,10243,33071),(32879===i||35866===i)&&e.texParameteri(i,32882,33071),(s.wrapS!==vn||s.wrapT!==vn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(i,10240,S(s.magFilter)),e.texParameteri(i,10241,S(s.minFilter)),s.minFilter!==Oi&&s.minFilter!==hi&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){let a=t.get("EXT_texture_filter_anisotropic");if(s.magFilter===Oi||s.minFilter!==Cp&&s.minFilter!==Ha||s.type===La&&!1===t.has("OES_texture_float_linear")||!1===l&&s.type===$o&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||r.get(s).__currentAnisotropy)&&(e.texParameterf(i,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,n.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy)}}function N(t,i){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",M));let n=i.source,s=g.get(n);void 0===s&&(s={},g.set(n,s));let o=function(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.encoding),t.join()}(i);if(o!==t.__cacheKey){void 0===s[o]&&(s[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,r=!0),s[o].usedTimes++;let n=s[t.__cacheKey];void 0!==n&&(s[t.__cacheKey].usedTimes--,0===n.usedTimes&&D(i)),t.__cacheKey=o,t.__webglTexture=s[o].texture}return r}function L(t,n,a){let o=3553;(n.isDataArrayTexture||n.isCompressedArrayTexture)&&(o=35866),n.isData3DTexture&&(o=32879);let h=N(t,n),u=n.source;i.bindTexture(o,t.__webglTexture,33984+a);let p=r.get(u);if(u.version!==p.__version||!0===h){i.activeTexture(33984+a),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);let t=function(e){return!l&&(e.wrapS!==vn||e.wrapT!==vn||e.minFilter!==Oi&&e.minFilter!==hi)}(n)&&!1===x(n.image),r=T(n.image,t,!1,c);r=G(n,r);let d=x(r)||l,f=s.convert(n.format,n.encoding),m=s.convert(n.type),g=_(n.internalFormat,f,m,n.encoding,n.isVideoTexture);P(o,n,d);let y,v=n.mipmaps,S=l&&!0!==n.isVideoTexture,M=void 0===p.__version||!0===h,I=w(n,r,d);if(n.isDepthTexture)g=6402,l?g=n.type===La?36012:n.type===hf?33190:n.type===Ap?35056:33189:n.type===La&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===pf&&6402===g&&n.type!==kx&&n.type!==hf&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=hf,m=s.convert(n.type)),n.format===Np&&6402===g&&(g=34041,n.type!==Ap&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Ap,m=s.convert(n.type))),M&&(S?i.texStorage2D(3553,1,g,r.width,r.height):i.texImage2D(3553,0,g,r.width,r.height,0,f,m,null));else if(n.isDataTexture)if(v.length>0&&d){S&&M&&i.texStorage2D(3553,I,g,v[0].width,v[0].height);for(let e=0,t=v.length;e<t;e++)y=v[e],S?i.texSubImage2D(3553,e,0,0,y.width,y.height,f,m,y.data):i.texImage2D(3553,e,g,y.width,y.height,0,f,m,y.data);n.generateMipmaps=!1}else S?(M&&i.texStorage2D(3553,I,g,r.width,r.height),i.texSubImage2D(3553,0,0,0,r.width,r.height,f,m,r.data)):i.texImage2D(3553,0,g,r.width,r.height,0,f,m,r.data);else if(n.isCompressedTexture)if(n.isCompressedArrayTexture){S&&M&&i.texStorage3D(35866,I,g,v[0].width,v[0].height,r.depth);for(let e=0,t=v.length;e<t;e++)y=v[e],n.format!==zs?null!==f?S?i.compressedTexSubImage3D(35866,e,0,0,0,y.width,y.height,r.depth,f,y.data,0,0):i.compressedTexImage3D(35866,e,g,y.width,y.height,r.depth,0,y.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):S?i.texSubImage3D(35866,e,0,0,0,y.width,y.height,r.depth,f,m,y.data):i.texImage3D(35866,e,g,y.width,y.height,r.depth,0,f,m,y.data)}else{S&&M&&i.texStorage2D(3553,I,g,v[0].width,v[0].height);for(let e=0,t=v.length;e<t;e++)y=v[e],n.format!==zs?null!==f?S?i.compressedTexSubImage2D(3553,e,0,0,y.width,y.height,f,y.data):i.compressedTexImage2D(3553,e,g,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):S?i.texSubImage2D(3553,e,0,0,y.width,y.height,f,m,y.data):i.texImage2D(3553,e,g,y.width,y.height,0,f,m,y.data)}else if(n.isDataArrayTexture)S?(M&&i.texStorage3D(35866,I,g,r.width,r.height,r.depth),i.texSubImage3D(35866,0,0,0,0,r.width,r.height,r.depth,f,m,r.data)):i.texImage3D(35866,0,g,r.width,r.height,r.depth,0,f,m,r.data);else if(n.isData3DTexture)S?(M&&i.texStorage3D(32879,I,g,r.width,r.height,r.depth),i.texSubImage3D(32879,0,0,0,0,r.width,r.height,r.depth,f,m,r.data)):i.texImage3D(32879,0,g,r.width,r.height,r.depth,0,f,m,r.data);else if(n.isFramebufferTexture){if(M)if(S)i.texStorage2D(3553,I,g,r.width,r.height);else{let e=r.width,t=r.height;for(let r=0;r<I;r++)i.texImage2D(3553,r,g,e,t,0,f,m,null),e>>=1,t>>=1}}else if(v.length>0&&d){S&&M&&i.texStorage2D(3553,I,g,v[0].width,v[0].height);for(let e=0,t=v.length;e<t;e++)y=v[e],S?i.texSubImage2D(3553,e,0,0,f,m,y):i.texImage2D(3553,e,g,f,m,y);n.generateMipmaps=!1}else S?(M&&i.texStorage2D(3553,I,g,r.width,r.height),i.texSubImage2D(3553,0,0,0,f,m,r)):i.texImage2D(3553,0,g,f,m,r);b(n,d)&&E(o),p.__version=u.version,n.onUpdate&&n.onUpdate(n)}t.__version=n.version}function F(t,n,a,o,l){let h=s.convert(a.format,a.encoding),u=s.convert(a.type),c=_(a.internalFormat,h,u,a.encoding);r.get(n).__hasExternalTextures||(32879===l||35866===l?i.texImage3D(l,0,c,n.width,n.height,n.depth,0,h,u,null):i.texImage2D(l,0,c,n.width,n.height,0,h,u,null)),i.bindFramebuffer(36160,t),z(n)?d.framebufferTexture2DMultisampleEXT(36160,o,l,r.get(a).__webglTexture,0,B(n)):(3553===l||l>=34069&&l<=34074)&&e.framebufferTexture2D(36160,o,l,r.get(a).__webglTexture,0),i.bindFramebuffer(36160,null)}function U(t,i,r){if(e.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer){let n=33189;if(r||z(i)){let t=i.depthTexture;t&&t.isDepthTexture&&(t.type===La?n=36012:t.type===hf&&(n=33190));let r=B(i);z(i)?d.renderbufferStorageMultisampleEXT(36161,r,n,i.width,i.height):e.renderbufferStorageMultisample(36161,r,n,i.width,i.height)}else e.renderbufferStorage(36161,n,i.width,i.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(i.depthBuffer&&i.stencilBuffer){let n=B(i);r&&!1===z(i)?e.renderbufferStorageMultisample(36161,n,35056,i.width,i.height):z(i)?d.renderbufferStorageMultisampleEXT(36161,n,35056,i.width,i.height):e.renderbufferStorage(36161,34041,i.width,i.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{let t=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let n=0;n<t.length;n++){let a=t[n],o=s.convert(a.format,a.encoding),l=s.convert(a.type),h=_(a.internalFormat,o,l,a.encoding),u=B(i);r&&!1===z(i)?e.renderbufferStorageMultisample(36161,u,h,i.width,i.height):z(i)?d.renderbufferStorageMultisampleEXT(36161,u,h,i.width,i.height):e.renderbufferStorage(36161,h,i.width,i.height)}}e.bindRenderbuffer(36161,null)}function k(t){let n=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!n.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(n.depthTexture).__webglTexture||n.depthTexture.image.width!==n.width||n.depthTexture.image.height!==n.height)&&(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),R(n.depthTexture,0);let s=r.get(n.depthTexture).__webglTexture,a=B(n);if(n.depthTexture.format===pf)z(n)?d.framebufferTexture2DMultisampleEXT(36160,36096,3553,s,0,a):e.framebufferTexture2D(36160,36096,3553,s,0);else{if(n.depthTexture.format!==Np)throw new Error("Unknown depthTexture format");z(n)?d.framebufferTexture2DMultisampleEXT(36160,33306,3553,s,0,a):e.framebufferTexture2D(36160,33306,3553,s,0)}}(n.__webglFramebuffer,t)}else if(s){n.__webglDepthbuffer=[];for(let r=0;r<6;r++)i.bindFramebuffer(36160,n.__webglFramebuffer[r]),n.__webglDepthbuffer[r]=e.createRenderbuffer(),U(n.__webglDepthbuffer[r],t,!1)}else i.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),U(n.__webglDepthbuffer,t,!1);i.bindFramebuffer(36160,null)}function B(e){return Math.min(p,e.samples)}function z(e){let i=r.get(e);return l&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function G(e,i){let r=e.encoding,n=e.format,s=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===YD||r!==Nl&&(r===yr?!1===l?!0===t.has("EXT_sRGB")&&n===zs?(e.format=YD,e.minFilter=hi,e.generateMipmaps=!1):i=fx.sRGBToLinear(i):(n!==zs||s!==Xu)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",r)),i}this.allocateTextureUnit=function(){let e=A;return e>=h&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+h),A+=1,e},this.resetTextureUnits=function(){A=0},this.setTexture2D=R,this.setTexture2DArray=function(e,t){let n=r.get(e);e.version>0&&n.__version!==e.version?L(n,e,t):i.bindTexture(35866,n.__webglTexture,33984+t)},this.setTexture3D=function(e,t){let n=r.get(e);e.version>0&&n.__version!==e.version?L(n,e,t):i.bindTexture(32879,n.__webglTexture,33984+t)},this.setTextureCube=function(t,n){let a=r.get(t);t.version>0&&a.__version!==t.version?function(t,n,a){if(6!==n.image.length)return;let o=N(t,n),h=n.source;i.bindTexture(34067,t.__webglTexture,33984+a);let c=r.get(h);if(h.version!==c.__version||!0===o){i.activeTexture(33984+a),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);let t=n.isCompressedTexture||n.image[0].isCompressedTexture,r=n.image[0]&&n.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=t||r?r?n.image[e].image:n.image[e]:T(n.image[e],!1,!0,u),p[e]=G(n,p[e]);let d,f=p[0],m=x(f)||l,g=s.convert(n.format,n.encoding),y=s.convert(n.type),v=_(n.internalFormat,g,y,n.encoding),S=l&&!0!==n.isVideoTexture,M=void 0===c.__version||!0===o,I=w(n,f,m);if(P(34067,n,m),t){S&&M&&i.texStorage2D(34067,I,v,f.width,f.height);for(let e=0;e<6;e++){d=p[e].mipmaps;for(let t=0;t<d.length;t++){let r=d[t];n.format!==zs?null!==g?S?i.compressedTexSubImage2D(34069+e,t,0,0,r.width,r.height,g,r.data):i.compressedTexImage2D(34069+e,t,v,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):S?i.texSubImage2D(34069+e,t,0,0,r.width,r.height,g,y,r.data):i.texImage2D(34069+e,t,v,r.width,r.height,0,g,y,r.data)}}}else{d=n.mipmaps,S&&M&&(d.length>0&&I++,i.texStorage2D(34067,I,v,p[0].width,p[0].height));for(let e=0;e<6;e++)if(r){S?i.texSubImage2D(34069+e,0,0,0,p[e].width,p[e].height,g,y,p[e].data):i.texImage2D(34069+e,0,v,p[e].width,p[e].height,0,g,y,p[e].data);for(let t=0;t<d.length;t++){let r=d[t].image[e].image;S?i.texSubImage2D(34069+e,t+1,0,0,r.width,r.height,g,y,r.data):i.texImage2D(34069+e,t+1,v,r.width,r.height,0,g,y,r.data)}}else{S?i.texSubImage2D(34069+e,0,0,0,g,y,p[e]):i.texImage2D(34069+e,0,v,g,y,p[e]);for(let t=0;t<d.length;t++){let r=d[t];S?i.texSubImage2D(34069+e,t+1,0,0,g,y,r.image[e]):i.texImage2D(34069+e,t+1,v,g,y,r.image[e])}}}b(n,m)&&E(34067),c.__version=h.version,n.onUpdate&&n.onUpdate(n)}t.__version=n.version}(a,t,n):i.bindTexture(34067,a.__webglTexture,33984+n)},this.rebindTextures=function(e,t,i){let n=r.get(e);void 0!==t&&F(n.__webglFramebuffer,e,e.texture,36064,3553),void 0!==i&&k(e)},this.setupRenderTarget=function(t){let o=t.texture,h=r.get(t),u=r.get(o);t.addEventListener("dispose",I),!0!==t.isWebGLMultipleRenderTargets&&(void 0===u.__webglTexture&&(u.__webglTexture=e.createTexture()),u.__version=o.version,a.memory.textures++);let c=!0===t.isWebGLCubeRenderTarget,p=!0===t.isWebGLMultipleRenderTargets,d=x(t)||l;if(c){h.__webglFramebuffer=[];for(let t=0;t<6;t++)h.__webglFramebuffer[t]=e.createFramebuffer()}else{if(h.__webglFramebuffer=e.createFramebuffer(),p)if(n.drawBuffers){let i=t.texture;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(l&&t.samples>0&&!1===z(t)){let r=p?o:[o];h.__webglMultisampledFramebuffer=e.createFramebuffer(),h.__webglColorRenderbuffer=[],i.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);for(let i=0;i<r.length;i++){let n=r[i];h.__webglColorRenderbuffer[i]=e.createRenderbuffer(),e.bindRenderbuffer(36161,h.__webglColorRenderbuffer[i]);let a=s.convert(n.format,n.encoding),o=s.convert(n.type),l=_(n.internalFormat,a,o,n.encoding,!0===t.isXRRenderTarget),u=B(t);e.renderbufferStorageMultisample(36161,u,l,t.width,t.height),e.framebufferRenderbuffer(36160,36064+i,36161,h.__webglColorRenderbuffer[i])}e.bindRenderbuffer(36161,null),t.depthBuffer&&(h.__webglDepthRenderbuffer=e.createRenderbuffer(),U(h.__webglDepthRenderbuffer,t,!0)),i.bindFramebuffer(36160,null)}}if(c){i.bindTexture(34067,u.__webglTexture),P(34067,o,d);for(let e=0;e<6;e++)F(h.__webglFramebuffer[e],t,o,36064,34069+e);b(o,d)&&E(34067),i.unbindTexture()}else if(p){let e=t.texture;for(let n=0,s=e.length;n<s;n++){let s=e[n],a=r.get(s);i.bindTexture(3553,a.__webglTexture),P(3553,s,d),F(h.__webglFramebuffer,t,s,36064+n,3553),b(s,d)&&E(3553)}i.unbindTexture()}else{let e=3553;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(l?e=t.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),i.bindTexture(e,u.__webglTexture),P(e,o,d),F(h.__webglFramebuffer,t,o,36064,e),b(o,d)&&E(e),i.unbindTexture()}t.depthBuffer&&k(t)},this.updateRenderTargetMipmap=function(e){let t=x(e)||l,n=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let s=0,a=n.length;s<a;s++){let a=n[s];if(b(a,t)){let t=e.isWebGLCubeRenderTarget?34067:3553,n=r.get(a).__webglTexture;i.bindTexture(t,n),E(t),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(l&&t.samples>0&&!1===z(t)){let n=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],s=t.width,a=t.height,o=16384,l=[],h=t.stencilBuffer?33306:36096,u=r.get(t),c=!0===t.isWebGLMultipleRenderTargets;if(c)for(let t=0;t<n.length;t++)i.bindFramebuffer(36160,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,null),i.bindFramebuffer(36160,u.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,null,0);i.bindFramebuffer(36008,u.__webglMultisampledFramebuffer),i.bindFramebuffer(36009,u.__webglFramebuffer);for(let i=0;i<n.length;i++){l.push(36064+i),t.depthBuffer&&l.push(h);let p=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===p&&(t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024)),c&&e.framebufferRenderbuffer(36008,36064,36161,u.__webglColorRenderbuffer[i]),!0===p&&(e.invalidateFramebuffer(36008,[h]),e.invalidateFramebuffer(36009,[h])),c){let t=r.get(n[i]).__webglTexture;e.framebufferTexture2D(36009,36064,3553,t,0)}e.blitFramebuffer(0,0,s,a,0,0,s,a,o,9728),f&&e.invalidateFramebuffer(36008,l)}if(i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,null),c)for(let t=0;t<n.length;t++){i.bindFramebuffer(36160,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,u.__webglColorRenderbuffer[t]);let s=r.get(n[t]).__webglTexture;i.bindFramebuffer(36160,u.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,s,0)}i.bindFramebuffer(36009,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=k,this.setupFrameBufferTexture=F,this.useMultisampledRTT=z}function Hpe(e,t,i){let r=i.isWebGL2;return{convert:function(i,n=null){let s;if(i===Xu)return 5121;if(i===ppe)return 32819;if(i===dpe)return 32820;if(i===cpe)return 5120;if(i===upe)return 5122;if(i===kx)return 5123;if(i===hpe)return 5124;if(i===hf)return 5125;if(i===La)return 5126;if(i===$o)return r?5131:(s=t.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(i===fpe)return 6406;if(i===zs)return 6408;if(i===xC)return 6409;if(i===mpe)return 6410;if(i===pf)return 6402;if(i===Np)return 34041;if(i===YD)return s=t.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(i===IC)return 6403;if(i===gpe)return 36244;if(i===vpe)return 33319;if(i===ype)return 33320;if(i===Epe)return 36249;if(i===UD||i===BD||i===kD||i===GD)if(n===yr){if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(i===UD)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===BD)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===kD)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===GD)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=t.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(i===UD)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===BD)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===kD)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===GD)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===S4||i===w4||i===R4||i===M4){if(s=t.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(i===S4)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===w4)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===R4)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===M4)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===Tpe)return s=t.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===D4||i===C4){if(s=t.get("WEBGL_compressed_texture_etc"),null===s)return null;if(i===D4)return n===yr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===C4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(i===A4||i===O4||i===P4||i===N4||i===L4||i===F4||i===H4||i===U4||i===B4||i===k4||i===G4||i===V4||i===z4||i===j4){if(s=t.get("WEBGL_compressed_texture_astc"),null===s)return null;if(i===A4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===O4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===P4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===N4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===L4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===F4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===H4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===U4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===B4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===k4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===G4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===V4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===z4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===j4)return n===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(i===VD){if(s=t.get("EXT_texture_compression_bptc"),null===s)return null;if(i===VD)return n===yr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(i===bpe||i===W4||i===q4||i===Y4){if(s=t.get("EXT_texture_compression_rgtc"),null===s)return null;if(i===VD)return s.COMPRESSED_RED_RGTC1_EXT;if(i===W4)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===q4)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Y4)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return i===Ap?r?34042:(s=t.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[i]?e[i]:null}}}var KD=class extends Vr{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},ar=class extends qt{constructor(){super(),this.isGroup=!0,this.type="Group"}},TEt={type:"move"},ax=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ar,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ar,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new D,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new D),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ar,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new D,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new D),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let r=null,n=null,s=null,a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){s=!0;for(let s of e.hand.values()){let e=t.getJointPose(s,i),r=this._getHandJoint(l,s);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=e.radius),r.visible=null!==e}let r=l.joints["index-finger-tip"],n=l.joints["thumb-tip"],a=r.position.distanceTo(n.position),o=.02,h=.005;l.inputState.pinching&&a>o+h?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-h&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(n=t.getPose(e.gripSpace,i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(r=t.getPose(e.targetRaySpace,i),null===r&&null!==n&&(r=n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(TEt)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==n),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let i=new ar;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},gf=class extends Pi{constructor(e,t,i,r,n,s,a,o,l,h){if((h=void 0!==h?h:pf)!==pf&&h!==Np)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&h===pf&&(i=hf),void 0===i&&h===Np&&(i=Ap),super(null,r,n,s,a,o,h,i,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:Oi,this.minFilter=void 0!==o?o:Oi,this.flipY=!1,this.generateMipmaps=!1}},pU=class extends Zo{constructor(e,t){super();let i=this,r=null,n=1,s=null,a="local-floor",o=1,l=null,h=null,u=null,c=null,p=null,d=null,f=t.getContextAttributes(),m=null,g=null,y=[],v=[],T=new Set,x=new Map,b=new Vr;b.layers.enable(1),b.viewport=new jr;let E=new Vr;E.layers.enable(2),E.viewport=new jr;let _=[b,E],w=new KD;w.layers.enable(1),w.layers.enable(2);let S=null,M=null;function I(e){let t=v.indexOf(e.inputSource);if(-1===t)return;let i=y[t];void 0!==i&&i.dispatchEvent({type:e.type,data:e.inputSource})}function A(){r.removeEventListener("select",I),r.removeEventListener("selectstart",I),r.removeEventListener("selectend",I),r.removeEventListener("squeeze",I),r.removeEventListener("squeezestart",I),r.removeEventListener("squeezeend",I),r.removeEventListener("end",A),r.removeEventListener("inputsourceschange",R);for(let e=0;e<y.length;e++){let t=v[e];null!==t&&(v[e]=null,y[e].disconnect(t))}S=null,M=null,e.setRenderTarget(m),p=null,c=null,u=null,r=null,g=null,L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function R(e){for(let t=0;t<e.removed.length;t++){let i=e.removed[t],r=v.indexOf(i);r>=0&&(v[r]=null,y[r].disconnect(i))}for(let t=0;t<e.added.length;t++){let i=e.added[t],r=v.indexOf(i);if(-1===r){for(let e=0;e<y.length;e++){if(e>=v.length){v.push(i),r=e;break}if(null===v[e]){v[e]=i,r=e;break}}if(-1===r)break}let n=y[r];n&&n.connect(i)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new ax,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new ax,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new ax,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){n=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==c?c:p},this.getBinding=function(){return u},this.getFrame=function(){return d},this.getSession=function(){return r},this.setSession=function(h){return ct(this,null,(function*(){if(r=h,null!==r){if(m=e.getRenderTarget(),r.addEventListener("select",I),r.addEventListener("selectstart",I),r.addEventListener("selectend",I),r.addEventListener("squeeze",I),r.addEventListener("squeezestart",I),r.addEventListener("squeezeend",I),r.addEventListener("end",A),r.addEventListener("inputsourceschange",R),!0!==f.xrCompatible&&(yield t.makeXRCompatible()),void 0===r.renderState.layers||!1===e.capabilities.isWebGL2){let i={antialias:void 0!==r.renderState.layers||f.antialias,alpha:f.alpha,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:n};p=new XRWebGLLayer(r,t,i),r.updateRenderState({baseLayer:p}),g=new Wr(p.framebufferWidth,p.framebufferHeight,{format:zs,type:Xu,encoding:e.outputEncoding,stencilBuffer:f.stencil})}else{let i=null,s=null,a=null;f.depth&&(a=f.stencil?35056:33190,i=f.stencil?Np:pf,s=f.stencil?Ap:hf);let o={colorFormat:32856,depthFormat:a,scaleFactor:n};u=new XRWebGLBinding(r,t),c=u.createProjectionLayer(o),r.updateRenderState({layers:[c]}),g=new Wr(c.textureWidth,c.textureHeight,{format:zs,type:Xu,depthTexture:new gf(c.textureWidth,c.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:f.stencil,encoding:e.outputEncoding,samples:f.antialias?4:0}),e.properties.get(g).__ignoreDepthValues=c.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=yield r.requestReferenceSpace(a),L.setContext(r),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}}))};let C=new D,O=new D;function P(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;w.near=E.near=b.near=e.near,w.far=E.far=b.far=e.far,(S!==w.near||M!==w.far)&&(r.updateRenderState({depthNear:w.near,depthFar:w.far}),S=w.near,M=w.far);let t=e.parent,i=w.cameras;P(w,t);for(let r=0;r<i.length;r++)P(i[r],t);w.matrixWorld.decompose(w.position,w.quaternion,w.scale),e.matrix.copy(w.matrix),e.matrix.decompose(e.position,e.quaternion,e.scale);let n=e.children;for(let r=0,s=n.length;r<s;r++)n[r].updateMatrixWorld(!0);2===i.length?function(e,t,i){C.setFromMatrixPosition(t.matrixWorld),O.setFromMatrixPosition(i.matrixWorld);let r=C.distanceTo(O),n=t.projectionMatrix.elements,s=i.projectionMatrix.elements,a=n[14]/(n[10]-1),o=n[14]/(n[10]+1),l=(n[9]+1)/n[5],h=(n[9]-1)/n[5],u=(n[8]-1)/n[0],c=(s[8]+1)/s[0],p=a*u,d=a*c,f=r/(-u+c),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();let g=a+f,y=o+f,v=p-m,T=d+(r-m),x=l*o/y*g,b=h*o/y*g;e.projectionMatrix.makePerspective(v,T,x,b,g,y)}(w,b,E):w.projectionMatrix.copy(b.projectionMatrix)},this.getCamera=function(){return w},this.getFoveation=function(){if(null!==c||null!==p)return o},this.setFoveation=function(e){o=e,null!==c&&(c.fixedFoveation=e),null!==p&&void 0!==p.fixedFoveation&&(p.fixedFoveation=e)},this.getPlanes=function(){return T};let N=null,L=new Ope;L.setAnimationLoop((function(t,r){if(h=r.getViewerPose(l||s),d=r,null!==h){let t=h.views;null!==p&&(e.setRenderTargetFramebuffer(g,p.framebuffer),e.setRenderTarget(g));let i=!1;t.length!==w.cameras.length&&(w.cameras.length=0,i=!0);for(let r=0;r<t.length;r++){let n=t[r],s=null;if(null!==p)s=p.getViewport(n);else{let t=u.getViewSubImage(c,n);s=t.viewport,0===r&&(e.setRenderTargetTextures(g,t.colorTexture,c.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(g))}let a=_[r];void 0===a&&(a=new Vr,a.layers.enable(r),a.viewport=new jr,_[r]=a),a.matrix.fromArray(n.transform.matrix),a.projectionMatrix.fromArray(n.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&w.matrix.copy(a.matrix),!0===i&&w.cameras.push(a)}}for(let e=0;e<y.length;e++){let t=v[e],i=y[e];null!==t&&void 0!==i&&i.update(t,r,l||s)}if(N&&N(t,r),r.detectedPlanes){i.dispatchEvent({type:"planesdetected",data:r.detectedPlanes});let e=null;for(let t of T)r.detectedPlanes.has(t)||(null===e&&(e=[]),e.push(t));if(null!==e)for(let t of e)T.delete(t),x.delete(t),i.dispatchEvent({type:"planeremoved",data:t});for(let t of r.detectedPlanes)if(T.has(t)){let e=x.get(t);t.lastChangedTime>e&&(x.set(t,t.lastChangedTime),i.dispatchEvent({type:"planechanged",data:t}))}else T.add(t),x.set(t,r.lastChangedTime),i.dispatchEvent({type:"planeadded",data:t})}d=null})),this.setAnimationLoop=function(e){N=e},this.dispose=function(){}}};function bEt(e,t){function i(i,r){i.opacity.value=r.opacity,r.color&&i.diffuse.value.copy(r.color),r.emissive&&i.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(i.map.value=r.map),r.alphaMap&&(i.alphaMap.value=r.alphaMap),r.bumpMap&&(i.bumpMap.value=r.bumpMap,i.bumpScale.value=r.bumpScale,r.side===$n&&(i.bumpScale.value*=-1)),r.displacementMap&&(i.displacementMap.value=r.displacementMap,i.displacementScale.value=r.displacementScale,i.displacementBias.value=r.displacementBias),r.emissiveMap&&(i.emissiveMap.value=r.emissiveMap),r.normalMap&&(i.normalMap.value=r.normalMap,i.normalScale.value.copy(r.normalScale),r.side===$n&&i.normalScale.value.negate()),r.specularMap&&(i.specularMap.value=r.specularMap),r.alphaTest>0&&(i.alphaTest.value=r.alphaTest);let n,s,a=t.get(r).envMap;if(a&&(i.envMap.value=a,i.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,i.reflectivity.value=r.reflectivity,i.ior.value=r.ior,i.refractionRatio.value=r.refractionRatio),r.lightMap){i.lightMap.value=r.lightMap;let t=!0!==e.physicallyCorrectLights?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*t}r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity),r.map?n=r.map:r.specularMap?n=r.specularMap:r.displacementMap?n=r.displacementMap:r.normalMap?n=r.normalMap:r.bumpMap?n=r.bumpMap:r.roughnessMap?n=r.roughnessMap:r.metalnessMap?n=r.metalnessMap:r.alphaMap?n=r.alphaMap:r.emissiveMap?n=r.emissiveMap:r.clearcoatMap?n=r.clearcoatMap:r.clearcoatNormalMap?n=r.clearcoatNormalMap:r.clearcoatRoughnessMap?n=r.clearcoatRoughnessMap:r.iridescenceMap?n=r.iridescenceMap:r.iridescenceThicknessMap?n=r.iridescenceThicknessMap:r.specularIntensityMap?n=r.specularIntensityMap:r.specularColorMap?n=r.specularColorMap:r.transmissionMap?n=r.transmissionMap:r.thicknessMap?n=r.thicknessMap:r.sheenColorMap?n=r.sheenColorMap:r.sheenRoughnessMap&&(n=r.sheenRoughnessMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),i.uvTransform.value.copy(n.matrix)),r.aoMap?s=r.aoMap:r.lightMap&&(s=r.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),i.uv2Transform.value.copy(s.matrix))}return{refreshFogUniforms:function(t,i){i.color.getRGB(t.fogColor.value,Ape(e)),i.isFog?(t.fogNear.value=i.near,t.fogFar.value=i.far):i.isFogExp2&&(t.fogDensity.value=i.density)},refreshMaterialUniforms:function(e,r,n,s,a){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(e,r):r.isMeshToonMaterial?(i(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,r)):r.isMeshPhongMaterial?(i(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,r)):r.isMeshStandardMaterial?(i(e,r),function(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}(e,r),r.isMeshPhysicalMaterial&&function(e,t,i){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap)),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===$n&&e.clearcoatNormalScale.value.negate())),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap)),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=i.texture,e.transmissionSamplerSize.value.set(i.width,i.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,r,a)):r.isMeshMatcapMaterial?(i(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,r)):r.isMeshDepthMaterial?i(e,r):r.isMeshDistanceMaterial?(i(e,r),function(e,t){e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?i(e,r):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,i,r){let n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*r,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r,n,s):r.isSpriteMaterial?function(e,t){let i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function xEt(e,t,i,r){let n={},s={},a=[],o=i.isWebGL2?e.getParameter(35375):0;function l(e,t,i){let r=e.value;if(void 0===i[t]){if("number"==typeof r)i[t]=r;else{let e=Array.isArray(r)?r:[r],n=[];for(let t=0;t<e.length;t++)n.push(e[t].clone());i[t]=n}return!0}if("number"==typeof r){if(i[t]!==r)return i[t]=r,!0}else{let e=Array.isArray(i[t])?i[t]:[i[t]],n=Array.isArray(r)?r:[r];for(let t=0;t<e.length;t++){let i=e[t];if(!1===i.equals(n[t]))return i.copy(n[t]),!0}}return!1}function h(e){let t={boundary:0,storage:0};return"number"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){let i=t.target;i.removeEventListener("dispose",u);let r=a.indexOf(i.__bindingPointIndex);a.splice(r,1),e.deleteBuffer(n[i.id]),delete n[i.id],delete s[i.id]}return{bind:function(e,t){let i=t.program;r.uniformBlockBinding(e,i)},update:function(i,c){let p=n[i.id];void 0===p&&(function(e){let t=e.uniforms,i=0,r=0;for(let n=0,s=t.length;n<s;n++){let e=t[n],s={boundary:0,storage:0},a=Array.isArray(e.value)?e.value:[e.value];for(let t=0,i=a.length;t<i;t++){let e=h(a[t]);s.boundary+=e.boundary,s.storage+=e.storage}e.__data=new Float32Array(s.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=i,n>0&&(r=i%16,0!==r&&16-r-s.boundary<0&&(i+=16-r,e.__offset=i)),i+=s.storage}r=i%16,r>0&&(i+=16-r),e.__size=i,e.__cache={}}(i),p=function(t){let i=function(){for(let e=0;e<o;e++)if(-1===a.indexOf(e))return a.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=i;let r=e.createBuffer(),n=t.__size,s=t.usage;return e.bindBuffer(35345,r),e.bufferData(35345,n,s),e.bindBuffer(35345,null),e.bindBufferBase(35345,i,r),r}(i),n[i.id]=p,i.addEventListener("dispose",u));let d=c.program;r.updateUBOMapping(i,d);let f=t.render.frame;s[i.id]!==f&&(function(t){let i=n[t.id],r=t.uniforms,s=t.__cache;e.bindBuffer(35345,i);for(let n=0,a=r.length;n<a;n++){let t=r[n];if(!0===l(t,n,s)){let i=t.__offset,r=Array.isArray(t.value)?t.value:[t.value],n=0;for(let s=0;s<r.length;s++){let a=r[s],o=h(a);"number"==typeof a?(t.__data[0]=a,e.bufferSubData(35345,i+n,t.__data)):a.isMatrix3?(t.__data[0]=a.elements[0],t.__data[1]=a.elements[1],t.__data[2]=a.elements[2],t.__data[3]=a.elements[0],t.__data[4]=a.elements[3],t.__data[5]=a.elements[4],t.__data[6]=a.elements[5],t.__data[7]=a.elements[0],t.__data[8]=a.elements[6],t.__data[9]=a.elements[7],t.__data[10]=a.elements[8],t.__data[11]=a.elements[0]):(a.toArray(t.__data,n),n+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(35345,i,t.__data)}}e.bindBuffer(35345,null)}(i),s[i.id]=f)},dispose:function(){for(let t in n)e.deleteBuffer(n[t]);a=[],n={},s={}}}}function IEt(){let e=dx("canvas");return e.style.display="block",e}function go(e={}){this.isWebGLRenderer=!0;let t,i=void 0!==e.canvas?e.canvas:IEt(),r=void 0!==e.context?e.context:null,n=void 0===e.depth||e.depth,s=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,o=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,h=void 0!==e.powerPreference?e.powerPreference:"default",u=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;t=null!==r?r.getContextAttributes().alpha:void 0!==e.alpha&&e.alpha;let c=null,p=null,d=[],f=[];this.domElement=i,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Nl,this.physicallyCorrectLights=!1,this.toneMapping=Yu,this.toneMappingExposure=1;let m=this,g=!1,y=0,v=0,T=null,x=-1,b=null,E=new jr,_=new jr,w=null,S=i.width,M=i.height,I=1,A=null,R=null,C=new jr(0,0,S,M),O=new jr(0,0,S,M),P=!1,N=new na,L=!1,F=!1,U=null,k=new Be,B=new ce,z=new D,G={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function H(){return null===T?I:1}let V,j,W,Y,X,q,Z,J,K,$,Q,ee,te,ie,re,ne,se,ae,oe,le,he,ue,pe,de,fe=r;function me(e,t){for(let r=0;r<e.length;r++){let n=e[r],s=i.getContext(n,t);if(null!==s)return s}return null}try{let e={alpha:!0,depth:n,stencil:s,antialias:a,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${EC}`),i.addEventListener("webglcontextlost",ve,!1),i.addEventListener("webglcontextrestored",Te,!1),i.addEventListener("webglcontextcreationerror",xe,!1),null===fe){let t=["webgl2","webgl","experimental-webgl"];if(!0===m.isWebGL1Renderer&&t.shift(),fe=me(t,e),null===fe)throw me(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===fe.getShaderPrecisionFormat&&(fe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ge(){V=new Wvt(fe),j=new Bvt(fe,V,e),V.init(j),ue=new Hpe(fe,V,j),W=new yEt(fe,V,j),Y=new Xvt,X=new aEt,q=new EEt(fe,V,W,X,j,ue,Y),Z=new Gvt(m),J=new jvt(m),K=new igt(fe,j),pe=new Hvt(fe,V,K,j),$=new qvt(fe,K,Y,pe),Q=new Jvt(fe,$,K,Y),oe=new Kvt(fe,j,q),ne=new kvt(X),ee=new sEt(m,Z,J,V,j,pe,ne),te=new bEt(m,X),ie=new lEt,re=new fEt(V,j),ae=new Fvt(m,Z,J,W,Q,t,o),se=new vEt(m,Q,j),de=new xEt(fe,Y,j,W),le=new Uvt(fe,V,Y,j),he=new Yvt(fe,V,Y,j),Y.programs=ee.programs,m.capabilities=j,m.extensions=V,m.properties=X,m.renderLists=ie,m.shadowMap=se,m.state=W,m.info=Y}ge();let ye=new pU(m,fe);function ve(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function Te(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;let e=Y.autoReset,t=se.enabled,i=se.autoUpdate,r=se.needsUpdate,n=se.type;ge(),Y.autoReset=e,se.enabled=t,se.autoUpdate=i,se.needsUpdate=r,se.type=n}function xe(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function be(e){let t=e.target;t.removeEventListener("dispose",be),function(e){(function(e){let t=X.get(e).programs;void 0!==t&&(t.forEach((function(e){ee.releaseProgram(e)})),e.isShaderMaterial&&ee.releaseShaderCache(e))})(e),X.remove(e)}(t)}this.xr=ye,this.getContext=function(){return fe},this.getContextAttributes=function(){return fe.getContextAttributes()},this.forceContextLoss=function(){let e=V.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=V.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){void 0!==e&&(I=e,this.setSize(S,M,!1))},this.getSize=function(e){return e.set(S,M)},this.setSize=function(e,t,r){ye.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(S=e,M=t,i.width=Math.floor(e*I),i.height=Math.floor(t*I),!1!==r&&(i.style.width=e+"px",i.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(S*I,M*I).floor()},this.setDrawingBufferSize=function(e,t,r){S=e,M=t,I=r,i.width=Math.floor(e*r),i.height=Math.floor(t*r),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(C)},this.setViewport=function(e,t,i,r){e.isVector4?C.set(e.x,e.y,e.z,e.w):C.set(e,t,i,r),W.viewport(E.copy(C).multiplyScalar(I).floor())},this.getScissor=function(e){return e.copy(O)},this.setScissor=function(e,t,i,r){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,i,r),W.scissor(_.copy(O).multiplyScalar(I).floor())},this.getScissorTest=function(){return P},this.setScissorTest=function(e){W.setScissorTest(P=e)},this.setOpaqueSort=function(e){A=e},this.setTransparentSort=function(e){R=e},this.getClearColor=function(e){return e.copy(ae.getClearColor())},this.setClearColor=function(){ae.setClearColor.apply(ae,arguments)},this.getClearAlpha=function(){return ae.getClearAlpha()},this.setClearAlpha=function(){ae.setClearAlpha.apply(ae,arguments)},this.clear=function(e=!0,t=!0,i=!0){let r=0;e&&(r|=16384),t&&(r|=256),i&&(r|=1024),fe.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){i.removeEventListener("webglcontextlost",ve,!1),i.removeEventListener("webglcontextrestored",Te,!1),i.removeEventListener("webglcontextcreationerror",xe,!1),ie.dispose(),re.dispose(),X.dispose(),Z.dispose(),J.dispose(),Q.dispose(),pe.dispose(),de.dispose(),ee.dispose(),ye.dispose(),ye.removeEventListener("sessionstart",_e),ye.removeEventListener("sessionend",we),U&&(U.dispose(),U=null),Se.stop()},this.renderBufferDirect=function(e,t,i,r,n,s){null===t&&(t=G);let a=n.isMesh&&n.matrixWorld.determinant()<0,o=function(e,t,i,r,n){!0!==t.isScene&&(t=G),q.resetTextureUnits();let s=t.fog,a=r.isMeshStandardMaterial?t.environment:null,o=null===T?m.outputEncoding:!0===T.isXRRenderTarget?T.texture.encoding:Nl,l=(r.isMeshStandardMaterial?J:Z).get(r.envMap||a),h=!0===r.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,u=!!r.normalMap&&!!i.attributes.tangent,c=!!i.morphAttributes.position,d=!!i.morphAttributes.normal,f=!!i.morphAttributes.color,g=r.toneMapped?m.toneMapping:Yu,y=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,v=void 0!==y?y.length:0,E=X.get(r),_=p.state.lights;if(!0===L&&(!0===F||e!==b)){let t=e===b&&r.id===x;ne.setState(r,e,t)}let w=!1;r.version===E.__version?(E.needsLights&&E.lightsStateVersion!==_.state.version||E.outputEncoding!==o||n.isInstancedMesh&&!1===E.instancing||!n.isInstancedMesh&&!0===E.instancing||n.isSkinnedMesh&&!1===E.skinning||!n.isSkinnedMesh&&!0===E.skinning||E.envMap!==l||!0===r.fog&&E.fog!==s||void 0!==E.numClippingPlanes&&(E.numClippingPlanes!==ne.numPlanes||E.numIntersection!==ne.numIntersection)||E.vertexAlphas!==h||E.vertexTangents!==u||E.morphTargets!==c||E.morphNormals!==d||E.morphColors!==f||E.toneMapping!==g||!0===j.isWebGL2&&E.morphTargetsCount!==v)&&(w=!0):(w=!0,E.__version=r.version);let S=E.currentProgram;!0===w&&(S=Re(r,t,n));let D=!1,A=!1,R=!1,C=S.getUniforms(),O=E.uniforms;if(W.useProgram(S.program)&&(D=!0,A=!0,R=!0),r.id!==x&&(x=r.id,A=!0),D||b!==e){if(C.setValue(fe,"projectionMatrix",e.projectionMatrix),j.logarithmicDepthBuffer&&C.setValue(fe,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),b!==e&&(b=e,A=!0,R=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){let t=C.map.cameraPosition;void 0!==t&&t.setValue(fe,z.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&C.setValue(fe,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||n.isSkinnedMesh)&&C.setValue(fe,"viewMatrix",e.matrixWorldInverse)}if(n.isSkinnedMesh){C.setOptional(fe,n,"bindMatrix"),C.setOptional(fe,n,"bindMatrixInverse");let e=n.skeleton;e&&(j.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),C.setValue(fe,"boneTexture",e.boneTexture,q),C.setValue(fe,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}let P=i.morphAttributes;if((void 0!==P.position||void 0!==P.normal||void 0!==P.color&&!0===j.isWebGL2)&&oe.update(n,i,r,S),(A||E.receiveShadow!==n.receiveShadow)&&(E.receiveShadow=n.receiveShadow,C.setValue(fe,"receiveShadow",n.receiveShadow)),r.isMeshGouraudMaterial&&null!==r.envMap&&(O.envMap.value=l,O.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),A&&(C.setValue(fe,"toneMappingExposure",m.toneMappingExposure),E.needsLights&&function(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(O,R),s&&!0===r.fog&&te.refreshFogUniforms(O,s),te.refreshMaterialUniforms(O,r,I,M,U),Hy.upload(fe,E.uniformsList,O,q)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Hy.upload(fe,E.uniformsList,O,q),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&C.setValue(fe,"center",n.center),C.setValue(fe,"modelViewMatrix",n.modelViewMatrix),C.setValue(fe,"normalMatrix",n.normalMatrix),C.setValue(fe,"modelMatrix",n.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,i=e.length;t<i;t++)if(j.isWebGL2){let i=e[t];de.update(i,S),de.bind(i,S)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return S}(e,t,i,r,n);W.setMaterial(r,a);let l=i.index,h=1;!0===r.wireframe&&(l=$.getWireframeAttribute(i),h=2);let u=i.drawRange,c=i.attributes.position,d=u.start*h,f=(u.start+u.count)*h;null!==s&&(d=Math.max(d,s.start*h),f=Math.min(f,(s.start+s.count)*h)),null!==l?(d=Math.max(d,0),f=Math.min(f,l.count)):null!=c&&(d=Math.max(d,0),f=Math.min(f,c.count));let g=f-d;if(g<0||g===1/0)return;pe.setup(n,r,o,i,l);let y,v=le;if(null!==l&&(y=K.get(l),v=he,v.setIndex(y)),n.isMesh)!0===r.wireframe?(W.setLineWidth(r.wireframeLinewidth*H()),v.setMode(1)):v.setMode(4);else if(n.isLine){let e=r.linewidth;void 0===e&&(e=1),W.setLineWidth(e*H()),n.isLineSegments?v.setMode(1):n.isLineLoop?v.setMode(2):v.setMode(3)}else n.isPoints?v.setMode(0):n.isSprite&&v.setMode(4);if(n.isInstancedMesh)v.renderInstances(d,g,n.count);else if(i.isInstancedBufferGeometry){let e=void 0!==i._maxInstanceCount?i._maxInstanceCount:1/0,t=Math.min(i.instanceCount,e);v.renderInstances(d,g,t)}else v.render(d,g)},this.compile=function(e,t){function i(e,t,i){!0===e.transparent&&e.side===bi&&!1===e.forceSinglePass?(e.side=$n,e.needsUpdate=!0,Re(e,t,i),e.side=Xi,e.needsUpdate=!0,Re(e,t,i),e.side=bi):Re(e,t,i)}p=re.get(e),p.init(),f.push(p),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(p.pushLight(e),e.castShadow&&p.pushShadow(e))})),p.setupLights(m.physicallyCorrectLights),e.traverse((function(t){let r=t.material;if(r)if(Array.isArray(r))for(let n=0;n<r.length;n++)i(r[n],e,t);else i(r,e,t)})),f.pop(),p=null};let Ee=null;function _e(){Se.stop()}function we(){Se.start()}let Se=new Ope;function Me(e,t,i,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)i=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)p.pushLight(e),e.castShadow&&p.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||N.intersectsSprite(e)){r&&z.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);let t=Q.update(e),n=e.material;n.visible&&c.push(e,t,n,i,z.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==Y.render.frame&&(e.skeleton.update(),e.skeleton.frame=Y.render.frame),!e.frustumCulled||N.intersectsObject(e))){r&&z.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);let t=Q.update(e),n=e.material;if(Array.isArray(n)){let r=t.groups;for(let s=0,a=r.length;s<a;s++){let a=r[s],o=n[a.materialIndex];o&&o.visible&&c.push(e,t,o,i,z.z,a)}}else n.visible&&c.push(e,t,n,i,z.z,null)}let n=e.children;for(let s=0,a=n.length;s<a;s++)Me(n[s],t,i,r)}function Ie(e,t,i,r){let n=e.opaque,s=e.transmissive,o=e.transparent;p.setupLightsView(i),!0===L&&ne.setGlobalState(m.clippingPlanes,i),s.length>0&&function(e,t,i){let r=j.isWebGL2;null===U&&(U=new Wr(1,1,{generateMipmaps:!0,type:V.has("EXT_color_buffer_half_float")?$o:Xu,minFilter:Ha,samples:r&&!0===a?4:0})),m.getDrawingBufferSize(B),r?U.setSize(B.x,B.y):U.setSize(XD(B.x),XD(B.y));let n=m.getRenderTarget();m.setRenderTarget(U),m.clear();let s=m.toneMapping;m.toneMapping=Yu,De(e,t,i),m.toneMapping=s,q.updateMultisampleRenderTarget(U),q.updateRenderTargetMipmap(U),m.setRenderTarget(n)}(n,t,i),r&&W.viewport(E.copy(r)),n.length>0&&De(n,t,i),s.length>0&&De(s,t,i),o.length>0&&De(o,t,i),W.buffers.depth.setTest(!0),W.buffers.depth.setMask(!0),W.buffers.color.setMask(!0),W.setPolygonOffset(!1)}function De(e,t,i){let r=!0===t.isScene?t.overrideMaterial:null;for(let n=0,s=e.length;n<s;n++){let s=e[n],a=s.object,o=s.geometry,l=null===r?s.material:r,h=s.group;a.layers.test(i.layers)&&Ae(a,t,i,o,l,h)}}function Ae(e,t,i,r,n,s){e.onBeforeRender(m,t,i,r,n,s),e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),n.onBeforeRender(m,t,i,r,e,s),!0===n.transparent&&n.side===bi&&!1===n.forceSinglePass?(n.side=$n,n.needsUpdate=!0,m.renderBufferDirect(i,t,r,n,e,s),n.side=Xi,n.needsUpdate=!0,m.renderBufferDirect(i,t,r,n,e,s),n.side=bi):m.renderBufferDirect(i,t,r,n,e,s),e.onAfterRender(m,t,i,r,n,s)}function Re(e,t,i){!0!==t.isScene&&(t=G);let r=X.get(e),n=p.state.lights,s=p.state.shadowsArray,a=n.state.version,o=ee.getParameters(e,n.state,s,t,i),l=ee.getProgramCacheKey(o),h=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?J:Z).get(e.envMap||r.environment),void 0===h&&(e.addEventListener("dispose",be),h=new Map,r.programs=h);let u=h.get(l);if(void 0!==u){if(r.currentProgram===u&&r.lightsStateVersion===a)return Ce(e,o),u}else o.uniforms=ee.getUniforms(e),e.onBuild(i,o,m),e.onBeforeCompile(o,m),u=ee.acquireProgram(o,l),h.set(l,u),r.uniforms=o.uniforms;let c=r.uniforms;(!e.isShaderMaterial&&!e.isRawShaderMaterial||!0===e.clipping)&&(c.clippingPlanes=ne.uniform),Ce(e,o),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(c.ambientLightColor.value=n.state.ambient,c.lightProbe.value=n.state.probe,c.directionalLights.value=n.state.directional,c.directionalLightShadows.value=n.state.directionalShadow,c.spotLights.value=n.state.spot,c.spotLightShadows.value=n.state.spotShadow,c.rectAreaLights.value=n.state.rectArea,c.ltc_1.value=n.state.rectAreaLTC1,c.ltc_2.value=n.state.rectAreaLTC2,c.pointLights.value=n.state.point,c.pointLightShadows.value=n.state.pointShadow,c.hemisphereLights.value=n.state.hemi,c.directionalShadowMap.value=n.state.directionalShadowMap,c.directionalShadowMatrix.value=n.state.directionalShadowMatrix,c.spotShadowMap.value=n.state.spotShadowMap,c.spotLightMatrix.value=n.state.spotLightMatrix,c.spotLightMap.value=n.state.spotLightMap,c.pointShadowMap.value=n.state.pointShadowMap,c.pointShadowMatrix.value=n.state.pointShadowMatrix);let d=u.getUniforms(),f=Hy.seqWithValue(d.seq,c);return r.currentProgram=u,r.uniformsList=f,u}function Ce(e,t){let i=X.get(e);i.outputEncoding=t.outputEncoding,i.instancing=t.instancing,i.skinning=t.skinning,i.morphTargets=t.morphTargets,i.morphNormals=t.morphNormals,i.morphColors=t.morphColors,i.morphTargetsCount=t.morphTargetsCount,i.numClippingPlanes=t.numClippingPlanes,i.numIntersection=t.numClipIntersection,i.vertexAlphas=t.vertexAlphas,i.vertexTangents=t.vertexTangents,i.toneMapping=t.toneMapping}Se.setAnimationLoop((function(e){Ee&&Ee(e)})),"undefined"!=typeof self&&Se.setContext(self),this.setAnimationLoop=function(e){Ee=e,ye.setAnimationLoop(e),null===e?Se.stop():Se.start()},ye.addEventListener("sessionstart",_e),ye.addEventListener("sessionend",we),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===g)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===ye.enabled&&!0===ye.isPresenting&&(!0===ye.cameraAutoUpdate&&ye.updateCamera(t),t=ye.getCamera()),!0===e.isScene&&e.onBeforeRender(m,e,t,T),p=re.get(e,f.length),p.init(),f.push(p),k.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),N.setFromProjectionMatrix(k),F=this.localClippingEnabled,L=ne.init(this.clippingPlanes,F),c=ie.get(e,d.length),c.init(),d.push(c),Me(e,t,0,m.sortObjects),c.finish(),!0===m.sortObjects&&c.sort(A,R),!0===L&&ne.beginShadows();let i=p.state.shadowsArray;if(se.render(i,e,t),!0===L&&ne.endShadows(),!0===this.info.autoReset&&this.info.reset(),ae.render(c,e),p.setupLights(m.physicallyCorrectLights),t.isArrayCamera){let i=t.cameras;for(let t=0,r=i.length;t<r;t++){let r=i[t];Ie(c,e,r,r.viewport)}}else Ie(c,e,t);null!==T&&(q.updateMultisampleRenderTarget(T),q.updateRenderTargetMipmap(T)),!0===e.isScene&&e.onAfterRender(m,e,t),pe.resetDefaultState(),x=-1,b=null,f.pop(),p=f.length>0?f[f.length-1]:null,d.pop(),c=d.length>0?d[d.length-1]:null},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(e,t,i){X.get(e.texture).__webglTexture=t,X.get(e.depthTexture).__webglTexture=i;let r=X.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===i,r.__autoAllocateDepthBuffer||!0===V.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){let i=X.get(e);i.__webglFramebuffer=t,i.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,i=0){T=e,y=t,v=i;let r=!0,n=null,s=!1,a=!1;if(e){let i=X.get(e);void 0!==i.__useDefaultFramebuffer?(W.bindFramebuffer(36160,null),r=!1):void 0===i.__webglFramebuffer?q.setupRenderTarget(e):i.__hasExternalTextures&&q.rebindTextures(e,X.get(e.texture).__webglTexture,X.get(e.depthTexture).__webglTexture);let o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);let l=X.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(n=l[t],s=!0):n=j.isWebGL2&&e.samples>0&&!1===q.useMultisampledRTT(e)?X.get(e).__webglMultisampledFramebuffer:l,E.copy(e.viewport),_.copy(e.scissor),w=e.scissorTest}else E.copy(C).multiplyScalar(I).floor(),_.copy(O).multiplyScalar(I).floor(),w=P;if(W.bindFramebuffer(36160,n)&&j.drawBuffers&&r&&W.drawBuffers(e,n),W.viewport(E),W.scissor(_),W.setScissorTest(w),s){let r=X.get(e.texture);fe.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,i)}else if(a){let r=X.get(e.texture),n=t||0;fe.framebufferTextureLayer(36160,36064,r.__webglTexture,i||0,n)}x=-1},this.readRenderTargetPixels=function(e,t,i,r,n,s,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=X.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){W.bindFramebuffer(36160,o);try{let a=e.texture,o=a.format,l=a.type;if(o!==zs&&ue.convert(o)!==fe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");let h=l===$o&&(V.has("EXT_color_buffer_half_float")||j.isWebGL2&&V.has("EXT_color_buffer_float"));if(!(l===Xu||ue.convert(l)===fe.getParameter(35738)||l===La&&(j.isWebGL2||V.has("OES_texture_float")||V.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&i>=0&&i<=e.height-n&&fe.readPixels(t,i,r,n,ue.convert(o),ue.convert(l),s)}finally{let e=null!==T?X.get(T).__webglFramebuffer:null;W.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,i=0){let r=Math.pow(2,-i),n=Math.floor(t.image.width*r),s=Math.floor(t.image.height*r);q.setTexture2D(t,0),fe.copyTexSubImage2D(3553,i,0,0,e.x,e.y,n,s),W.unbindTexture()},this.copyTextureToTexture=function(e,t,i,r=0){let n=t.image.width,s=t.image.height,a=ue.convert(i.format),o=ue.convert(i.type);q.setTexture2D(i,0),fe.pixelStorei(37440,i.flipY),fe.pixelStorei(37441,i.premultiplyAlpha),fe.pixelStorei(3317,i.unpackAlignment),t.isDataTexture?fe.texSubImage2D(3553,r,e.x,e.y,n,s,a,o,t.image.data):t.isCompressedTexture?fe.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):fe.texSubImage2D(3553,r,e.x,e.y,a,o,t.image),0===r&&i.generateMipmaps&&fe.generateMipmap(3553),W.unbindTexture()},this.copyTextureToTexture3D=function(e,t,i,r,n=0){if(m.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");let s,a=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,l=e.max.z-e.min.z+1,h=ue.convert(r.format),u=ue.convert(r.type);if(r.isData3DTexture)q.setTexture3D(r,0),s=32879;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");q.setTexture2DArray(r,0),s=35866}fe.pixelStorei(37440,r.flipY),fe.pixelStorei(37441,r.premultiplyAlpha),fe.pixelStorei(3317,r.unpackAlignment);let c=fe.getParameter(3314),p=fe.getParameter(32878),d=fe.getParameter(3316),f=fe.getParameter(3315),g=fe.getParameter(32877),y=i.isCompressedTexture?i.mipmaps[0]:i.image;fe.pixelStorei(3314,y.width),fe.pixelStorei(32878,y.height),fe.pixelStorei(3316,e.min.x),fe.pixelStorei(3315,e.min.y),fe.pixelStorei(32877,e.min.z),i.isDataTexture||i.isData3DTexture?fe.texSubImage3D(s,n,t.x,t.y,t.z,a,o,l,h,u,y.data):i.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),fe.compressedTexSubImage3D(s,n,t.x,t.y,t.z,a,o,l,h,y.data)):fe.texSubImage3D(s,n,t.x,t.y,t.z,a,o,l,h,u,y),fe.pixelStorei(3314,c),fe.pixelStorei(32878,p),fe.pixelStorei(3316,d),fe.pixelStorei(3315,f),fe.pixelStorei(32877,g),0===n&&r.generateMipmaps&&fe.generateMipmap(s),W.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?q.setTextureCube(e,0):e.isData3DTexture?q.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?q.setTexture2DArray(e,0):q.setTexture2D(e,0),W.unbindTexture()},this.resetState=function(){y=0,v=0,T=null,W.reset(),pe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var JD=class extends go{};JD.prototype.isWebGL1Renderer=!0;var Dy,Vy=class{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ve(e),this.density=t}clone(){return new Vy(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}},Zu=class{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ve(e),this.near=t,this.far=i}clone(){return new Zu(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}},wn=class extends qt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}},Bp=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=hx,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Xo()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,n=this.stride;r<n;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Xo()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Xo()),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}}},Oa=new D,ho=class{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Oa.fromBufferAttribute(this,t),Oa.applyMatrix4(e),this.setXYZ(t,Oa.x,Oa.y,Oa.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Oa.fromBufferAttribute(this,t),Oa.applyNormalMatrix(e),this.setXYZ(t,Oa.x,Oa.y,Oa.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Oa.fromBufferAttribute(this,t),Oa.transformDirection(e),this.setXYZ(t,Oa.x,Oa.y,Oa.z);return this}setX(e,t){return this.normalized&&(t=hn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=hn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=hn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=hn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Dp(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Dp(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Dp(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Dp(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=hn(t,this.array),i=hn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=hn(t,this.array),i=hn(i,this.array),r=hn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=hn(t,this.array),i=hn(i,this.array),r=hn(r,this.array),n=hn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=n,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return new Wt(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ho(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},yx=class extends qr{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},Qb=new D,Cy=new D,Ay=new D,Oy=new ce,ex=new ce,Upe=new Be,vD=new D,tx=new D,yD=new D,Jue=new ce,u4=new ce,Que=new ce,QD=class extends qt{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Dy){Dy=new ot;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Bp(e,5);Dy.setIndex([0,1,2,0,2,3]),Dy.setAttribute("position",new ho(t,3,0,!1)),Dy.setAttribute("uv",new ho(t,2,3,!1))}this.geometry=Dy,this.material=void 0!==e?e:new yx,this.center=new ce(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Cy.setFromMatrixScale(this.matrixWorld),Upe.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Ay.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Cy.multiplyScalar(-Ay.z);let i,r,n=this.material.rotation;0!==n&&(r=Math.cos(n),i=Math.sin(n));let s=this.center;ED(vD.set(-.5,-.5,0),Ay,s,Cy,i,r),ED(tx.set(.5,-.5,0),Ay,s,Cy,i,r),ED(yD.set(.5,.5,0),Ay,s,Cy,i,r),Jue.set(0,0),u4.set(1,0),Que.set(1,1);let a=e.ray.intersectTriangle(vD,tx,yD,!1,Qb);if(null===a&&(ED(tx.set(-.5,.5,0),Ay,s,Cy,i,r),u4.set(0,1),a=e.ray.intersectTriangle(vD,yD,tx,!1,Qb),null===a))return;let o=e.ray.origin.distanceTo(Qb);o<e.near||o>e.far||t.push({distance:o,point:Qb.clone(),uv:pn.getUV(Qb,vD,tx,yD,Jue,u4,Que,new ce),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}};function ED(e,t,i,r,n,s){Oy.subVectors(e,i).addScalar(.5).multiply(r),void 0!==n?(ex.x=s*Oy.x-n*Oy.y,ex.y=n*Oy.x+s*Oy.y):ex.copy(Oy),e.copy(t),e.x+=ex.x,e.y+=ex.y,e.applyMatrix4(Upe)}var TD=new D,ehe=new D,eC=class extends qt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let i=0,r=t.length;i<r;i++){let e=t[i];this.addLevel(e.object.clone(),e.distance,e.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=0){t=Math.abs(t);let r,n=this.levels;for(r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,hysteresis:i,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){let t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r;i++){let r=t[i].distance;if(t[i].object.visible&&(r-=r*t[i].hysteresis),e<r)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){TD.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(TD);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){TD.setFromMatrixPosition(e.matrixWorld),ehe.setFromMatrixPosition(this.matrixWorld);let i,r,n=TD.distanceTo(ehe)/e.zoom;for(t[0].object.visible=!0,i=1,r=t.length;i<r;i++){let e=t[i].distance;if(t[i].object.visible&&(e-=e*t[i].hysteresis),!(n>=e))break;t[i-1].object.visible=!1,t[i].object.visible=!0}for(this._currentLevel=i-1;i<r;i++)t[i].object.visible=!1}}toJSON(e){let t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];let i=this.levels;for(let r=0,n=i.length;r<n;r++){let e=i[r];t.object.levels.push({object:e.object.uuid,distance:e.distance,hysteresis:e.hysteresis})}return t}},the=new D,rhe=new jr,ihe=new jr,_Et=new D,nhe=new Be,Ku=class extends Je{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Be,this.bindMatrixInverse=new Be}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new jr,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);let r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){let i=this.skeleton,r=this.geometry;rhe.fromBufferAttribute(r.attributes.skinIndex,e),ihe.fromBufferAttribute(r.attributes.skinWeight,e),the.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let n=0;n<4;n++){let e=ihe.getComponent(n);if(0!==e){let r=rhe.getComponent(n);nhe.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),t.addScaledVector(_Et.copy(the).applyMatrix4(nhe),e)}}return t.applyMatrix4(this.bindMatrixInverse)}},Ll=class extends qt{constructor(){super(),this.isBone=!0,this.type="Bone"}},Pl=class extends Pi{constructor(e=null,t=1,i=1,r,n,s,a,o,l=Oi,h=Oi,u,c){super(null,s,a,o,l,h,r,n,u,c),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},she=new Be,SEt=new Be,Fl=class{constructor(e=[],t=[]){this.uuid=Xo(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Be)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new Be;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let n=0,s=e.length;n<s;n++){let r=e[n]?e[n].matrixWorld:SEt;she.multiplyMatrices(r,t[n]),she.toArray(i,16*n)}null!==r&&(r.needsUpdate=!0)}clone(){return new Fl(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=Mpe(e),e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let i=new Pl(t,e,e,zs,La);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){let i=this.bones[t];if(i.name===e)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){let r=e.bones[i],n=t[r];void 0===n&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),n=new Ll),this.bones.push(n),this.boneInverses.push((new Be).fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){let e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,i=this.boneInverses;for(let r=0,n=t.length;r<n;r++){let n=t[r];e.bones.push(n.uuid);let s=i[r];e.boneInverses.push(s.toArray())}return e}},kp=class extends Wt{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},ahe=new Be,ohe=new Be,bD=[],wEt=new Be,rx=new Je,sn=class extends Je{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new kp(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1;for(let r=0;r<i;r++)this.setMatrixAt(r,wEt)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){let i=this.matrixWorld,r=this.count;if(rx.geometry=this.geometry,rx.material=this.material,void 0!==rx.material)for(let n=0;n<r;n++){this.getMatrixAt(n,ahe),ohe.multiplyMatrices(i,ahe),rx.matrixWorld=ohe,rx.raycast(e,bD);for(let e=0,i=bD.length;e<i;e++){let i=bD[e];i.instanceId=n,i.object=this,t.push(i)}bD.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new kp(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}},br=class extends qr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ve(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},lhe=new D,che=new D,uhe=new Be,h4=new Ko,xD=new $i,Sr=class extends qt{constructor(e=new ot,t=new br){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,i=[0];for(let e=1,r=t.count;e<r;e++)lhe.fromBufferAttribute(t,e-1),che.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=lhe.distanceTo(che);e.setAttribute("lineDistance",new dt(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Line.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),xD.copy(i.boundingSphere),xD.applyMatrix4(r),xD.radius+=n,!1===e.ray.intersectsSphere(xD))return;uhe.copy(r).invert(),h4.copy(e.ray).applyMatrix4(uhe);let a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=new D,h=new D,u=new D,c=new D,p=this.isLineSegments?2:1,d=i.index,f=i.attributes.position;if(null!==d)for(let m=Math.max(0,s.start),g=Math.min(d.count,s.start+s.count)-1;m<g;m+=p){let i=d.getX(m),r=d.getX(m+1);if(l.fromBufferAttribute(f,i),h.fromBufferAttribute(f,r),h4.distanceSqToSegment(l,h,c,u)>o)continue;c.applyMatrix4(this.matrixWorld);let n=e.ray.origin.distanceTo(c);n<e.near||n>e.far||t.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(let m=Math.max(0,s.start),g=Math.min(f.count,s.start+s.count)-1;m<g;m+=p){if(l.fromBufferAttribute(f,m),h.fromBufferAttribute(f,m+1),h4.distanceSqToSegment(l,h,c,u)>o)continue;c.applyMatrix4(this.matrixWorld);let i=e.ray.origin.distanceTo(c);i<e.near||i>e.far||t.push({distance:i,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}},hhe=new D,phe=new D,Kr=class extends Sr{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,i=[];for(let e=0,r=t.count;e<r;e+=2)hhe.fromBufferAttribute(t,e),phe.fromBufferAttribute(t,e+1),i[e]=0===e?0:i[e-1],i[e+1]=i[e]+hhe.distanceTo(phe);e.setAttribute("lineDistance",new dt(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},zy=class extends Sr{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}},Rn=class extends qr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},dhe=new Be,dU=new Ko,ID=new $i,_D=new D,Bi=class extends qt{constructor(e=new ot,t=new Rn){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Points.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),ID.copy(i.boundingSphere),ID.applyMatrix4(r),ID.radius+=n,!1===e.ray.intersectsSphere(ID))return;dhe.copy(r).invert(),dU.copy(e.ray).applyMatrix4(dhe);let a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=i.index,h=i.attributes.position;if(null!==l)for(let u=Math.max(0,s.start),c=Math.min(l.count,s.start+s.count);u<c;u++){let i=l.getX(u);_D.fromBufferAttribute(h,i),fhe(_D,i,o,r,e,t,this)}else for(let u=Math.max(0,s.start),c=Math.min(h.count,s.start+s.count);u<c;u++)_D.fromBufferAttribute(h,u),fhe(_D,u,o,r,e,t,this)}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function fhe(e,t,i,r,n,s,a){let o=dU.distanceSqToPoint(e);if(o<i){let i=new D;dU.closestPointToPoint(e,i),i.applyMatrix4(r);let l=n.ray.origin.distanceTo(i);if(l<n.near||l>n.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:i,index:t,face:null,object:a})}}var fU=class extends Pi{constructor(e,t,i,r,n,s,a,o,l){super(e,t,i,r,n,s,a,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:hi,this.magFilter=void 0!==n?n:hi,this.generateMipmaps=!1;let h=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){h.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e==0&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},mU=class extends Pi{constructor(e,t,i){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=i,this.magFilter=Oi,this.minFilter=Oi,this.generateMipmaps=!1,this.needsUpdate=!0}},Ex=class extends Pi{constructor(e,t,i,r,n,s,a,o,l,h,u,c){super(null,s,a,o,l,h,r,n,u,c),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},gU=class extends Ex{constructor(e,t,i,r,n,s){super(e,t,i,n,s),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=vn}},vU=class extends Pi{constructor(e,t,i,r,n,s,a,o,l){super(e,t,i,r,n,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},Ua=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t,i=[],r=this.getPoint(0),n=0;i.push(0);for(let s=1;s<=e;s++)t=this.getPoint(s/e),n+=t.distanceTo(r),i.push(n),r=t;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let i,r=this.getLengths(),n=0,s=r.length;i=t||e*r[s-1];let a,o=0,l=s-1;for(;o<=l;)if(n=Math.floor(o+(l-o)/2),a=r[n]-i,a<0)o=n+1;else{if(!(a>0)){l=n;break}l=n-1}if(n=l,r[n]===i)return n/(s-1);let h=r[n];return(n+(i-h)/(r[n+1]-h))/(s-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);let n=this.getPoint(i),s=this.getPoint(r),a=t||(n.isVector2?new ce:new D);return a.copy(s).sub(n).normalize(),a}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new D,r=[],n=[],s=[],a=new D,o=new Be;for(let p=0;p<=e;p++){let t=p/e;r[p]=this.getTangentAt(t,new D)}n[0]=new D,s[0]=new D;let l=Number.MAX_VALUE,h=Math.abs(r[0].x),u=Math.abs(r[0].y),c=Math.abs(r[0].z);h<=l&&(l=h,i.set(1,0,0)),u<=l&&(l=u,i.set(0,1,0)),c<=l&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),n[0].crossVectors(r[0],a),s[0].crossVectors(r[0],n[0]);for(let p=1;p<=e;p++){if(n[p]=n[p-1].clone(),s[p]=s[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();let e=Math.acos(is(r[p-1].dot(r[p]),-1,1));n[p].applyMatrix4(o.makeRotationAxis(a,e))}s[p].crossVectors(r[p],n[p])}if(!0===t){let t=Math.acos(is(n[0].dot(n[e]),-1,1));t/=e,r[0].dot(a.crossVectors(n[0],n[e]))>0&&(t=-t);for(let i=1;i<=e;i++)n[i].applyMatrix4(o.makeRotationAxis(r[i],t*i)),s[i].crossVectors(r[i],n[i])}return{tangents:r,normals:n,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},Gp=class extends Ua{constructor(e=0,t=0,i=1,r=1,n=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(e,t){let i=t||new ce,r=2*Math.PI,n=this.aEndAngle-this.aStartAngle,s=Math.abs(n)<Number.EPSILON;for(;n<0;)n+=r;for(;n>r;)n-=r;n<Number.EPSILON&&(n=s?0:r),!0===this.aClockwise&&!s&&(n===r?n=-r:n-=r);let a=this.aStartAngle+e*n,o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),i=o-this.aX,r=l-this.aY;o=i*e-r*t+this.aX,l=i*t+r*e+this.aY}return i.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},Mg=class extends Gp{constructor(e,t,i,r,n,s){super(e,t,i,i,r,n,s),this.isArcCurve=!0,this.type="ArcCurve"}};function IB(){let e=0,t=0,i=0,r=0;function n(n,s,a,o){e=n,t=a,i=-3*n+3*s-2*a-o,r=2*n-2*s+a+o}return{initCatmullRom:function(e,t,i,r,s){n(t,i,s*(i-e),s*(r-t))},initNonuniformCatmullRom:function(e,t,i,r,s,a,o){let l=(t-e)/s-(i-e)/(s+a)+(i-t)/a,h=(i-t)/a-(r-t)/(a+o)+(r-i)/o;l*=a,h*=a,n(t,i,l,h)},calc:function(n){let s=n*n;return e+t*n+i*s+r*(s*n)}}}var SD=new D,p4=new IB,d4=new IB,f4=new IB,tC=class extends Ua{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new D){let i,r,n=t,s=this.points,a=s.length,o=(a-(this.closed?0:1))*e,l=Math.floor(o),h=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===h&&l===a-1&&(l=a-2,h=1),this.closed||l>0?i=s[(l-1)%a]:(SD.subVectors(s[0],s[1]).add(s[0]),i=SD);let u=s[l%a],c=s[(l+1)%a];if(this.closed||l+2<a?r=s[(l+2)%a]:(SD.subVectors(s[a-1],s[a-2]).add(s[a-1]),r=SD),"centripetal"===this.curveType||"chordal"===this.curveType){let e="chordal"===this.curveType?.5:.25,t=Math.pow(i.distanceToSquared(u),e),n=Math.pow(u.distanceToSquared(c),e),s=Math.pow(c.distanceToSquared(r),e);n<1e-4&&(n=1),t<1e-4&&(t=n),s<1e-4&&(s=n),p4.initNonuniformCatmullRom(i.x,u.x,c.x,r.x,t,n,s),d4.initNonuniformCatmullRom(i.y,u.y,c.y,r.y,t,n,s),f4.initNonuniformCatmullRom(i.z,u.z,c.z,r.z,t,n,s)}else"catmullrom"===this.curveType&&(p4.initCatmullRom(i.x,u.x,c.x,r.x,this.tension),d4.initCatmullRom(i.y,u.y,c.y,r.y,this.tension),f4.initCatmullRom(i.z,u.z,c.z,r.z,this.tension));return n.set(p4.calc(h),d4.calc(h),f4.calc(h)),n}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push((new D).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};function mhe(e,t,i,r,n){let s=.5*(r-t),a=.5*(n-i),o=e*e;return(2*i-2*r+s+a)*(e*o)+(-3*i+3*r-2*s-a)*o+s*e+i}function REt(e,t){let i=1-e;return i*i*t}function MEt(e,t){return 2*(1-e)*e*t}function DEt(e,t){return e*e*t}function ox(e,t,i,r){return REt(e,t)+MEt(e,i)+DEt(e,r)}function CEt(e,t){let i=1-e;return i*i*i*t}function AEt(e,t){let i=1-e;return 3*i*i*e*t}function OEt(e,t){return 3*(1-e)*e*e*t}function PEt(e,t){return e*e*e*t}function lx(e,t,i,r,n){return CEt(e,t)+AEt(e,i)+OEt(e,r)+PEt(e,n)}var Tx=class extends Ua{constructor(e=new ce,t=new ce,i=new ce,r=new ce){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new ce){let i=t,r=this.v0,n=this.v1,s=this.v2,a=this.v3;return i.set(lx(e,r.x,n.x,s.x,a.x),lx(e,r.y,n.y,s.y,a.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},rC=class extends Ua{constructor(e=new D,t=new D,i=new D,r=new D){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new D){let i=t,r=this.v0,n=this.v1,s=this.v2,a=this.v3;return i.set(lx(e,r.x,n.x,s.x,a.x),lx(e,r.y,n.y,s.y,a.y),lx(e,r.z,n.z,s.z,a.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},jy=class extends Ua{constructor(e=new ce,t=new ce){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ce){let i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){let i=t||new ce;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},iC=class extends Ua{constructor(e=new D,t=new D){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new D){let i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},bx=class extends Ua{constructor(e=new ce,t=new ce,i=new ce){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new ce){let i=t,r=this.v0,n=this.v1,s=this.v2;return i.set(ox(e,r.x,n.x,s.x),ox(e,r.y,n.y,s.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},xx=class extends Ua{constructor(e=new D,t=new D,i=new D){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new D){let i=t,r=this.v0,n=this.v1,s=this.v2;return i.set(ox(e,r.x,n.x,s.x),ox(e,r.y,n.y,s.y),ox(e,r.z,n.z,s.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Dg=class extends Ua{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new ce){let i=t,r=this.points,n=(r.length-1)*e,s=Math.floor(n),a=n-s,o=r[0===s?s:s-1],l=r[s],h=r[s>r.length-2?r.length-1:s+1],u=r[s>r.length-3?r.length-1:s+2];return i.set(mhe(a,o.x,l.x,h.x,u.x),mhe(a,o.y,l.y,h.y,u.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push((new ce).fromArray(i))}return this}},_B=Object.freeze({__proto__:null,ArcCurve:Mg,CatmullRomCurve3:tC,CubicBezierCurve:Tx,CubicBezierCurve3:rC,EllipseCurve:Gp,LineCurve:jy,LineCurve3:iC,QuadraticBezierCurve:bx,QuadraticBezierCurve3:xx,SplineCurve:Dg}),nC=class extends Ua{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new jy(t,e))}getPoint(e,t){let i=e*this.getLength(),r=this.getCurveLengths(),n=0;for(;n<r.length;){if(r[n]>=i){let e=r[n]-i,s=this.curves[n],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}n++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t,i=[];for(let r=0,n=this.curves;r<n.length;r++){let s=n[r],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,o=s.getPoints(a);for(let e=0;e<o.length;e++){let r=o[e];t&&t.equals(r)||(i.push(r),t=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){let i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push((new _B[i.type]).fromJSON(i))}return this}},Ju=class extends nC{constructor(e){super(),this.type="Path",this.currentPoint=new ce,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let i=new jy(this.currentPoint.clone(),new ce(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){let n=new bx(this.currentPoint.clone(),new ce(e,t),new ce(i,r));return this.curves.push(n),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,n,s){let a=new Tx(this.currentPoint.clone(),new ce(e,t),new ce(i,r),new ce(n,s));return this.curves.push(a),this.currentPoint.set(n,s),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),i=new Dg(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,n,s){let a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,i,r,n,s),this}absarc(e,t,i,r,n,s){return this.absellipse(e,t,i,i,r,n,s),this}ellipse(e,t,i,r,n,s,a,o){let l=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+l,t+h,i,r,n,s,a,o),this}absellipse(e,t,i,r,n,s,a,o){let l=new Gp(e,t,i,r,n,s,a,o);if(this.curves.length>0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},vf=class extends ot{constructor(e=[new ce(0,-.5),new ce(.5,0),new ce(0,.5)],t=12,i=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=is(r,0,2*Math.PI);let n=[],s=[],a=[],o=[],l=[],h=1/t,u=new D,c=new ce,p=new D,d=new D,f=new D,m=0,g=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:m=e[y+1].x-e[y].x,g=e[y+1].y-e[y].y,p.x=1*g,p.y=-m,p.z=0*g,f.copy(p),p.normalize(),o.push(p.x,p.y,p.z);break;case e.length-1:o.push(f.x,f.y,f.z);break;default:m=e[y+1].x-e[y].x,g=e[y+1].y-e[y].y,p.x=1*g,p.y=-m,p.z=0*g,d.copy(p),p.x+=f.x,p.y+=f.y,p.z+=f.z,p.normalize(),o.push(p.x,p.y,p.z),f.copy(d)}for(let y=0;y<=t;y++){let n=i+y*h*r,p=Math.sin(n),d=Math.cos(n);for(let i=0;i<=e.length-1;i++){u.x=e[i].x*p,u.y=e[i].y,u.z=e[i].x*d,s.push(u.x,u.y,u.z),c.x=y/t,c.y=i/(e.length-1),a.push(c.x,c.y);let r=o[3*i+0]*p,n=o[3*i+1],h=o[3*i+0]*d;l.push(r,n,h)}}for(let y=0;y<t;y++)for(let t=0;t<e.length-1;t++){let i=t+y*e.length,r=i,s=i+e.length,a=i+e.length+1,o=i+1;n.push(r,s,o),n.push(a,o,s)}this.setIndex(n),this.setAttribute("position",new dt(s,3)),this.setAttribute("uv",new dt(a,2)),this.setAttribute("normal",new dt(l,3))}static fromJSON(e){return new vf(e.points,e.segments,e.phiStart,e.phiLength)}},Cg=class extends vf{constructor(e=1,t=1,i=4,r=8){let n=new Ju;n.absarc(0,-t/2,e,1.5*Math.PI,0),n.absarc(0,t/2,e,0,.5*Math.PI),super(n.getPoints(i),r),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:r}}static fromJSON(e){return new Cg(e.radius,e.length,e.capSegments,e.radialSegments)}},Ag=class extends ot{constructor(e=1,t=32,i=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);let n=[],s=[],a=[],o=[],l=new D,h=new ce;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let u=0,c=3;u<=t;u++,c+=3){let n=i+u/t*r;l.x=e*Math.cos(n),l.y=e*Math.sin(n),s.push(l.x,l.y,l.z),a.push(0,0,1),h.x=(s[c]/e+1)/2,h.y=(s[c+1]/e+1)/2,o.push(h.x,h.y)}for(let u=1;u<=t;u++)n.push(u,u+1,0);this.setIndex(n),this.setAttribute("position",new dt(s,3)),this.setAttribute("normal",new dt(a,3)),this.setAttribute("uv",new dt(o,2))}static fromJSON(e){return new Ag(e.radius,e.segments,e.thetaStart,e.thetaLength)}},Hl=class extends ot{constructor(e=1,t=1,i=1,r=32,n=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:n,openEnded:s,thetaStart:a,thetaLength:o};let l=this;r=Math.floor(r),n=Math.floor(n);let h=[],u=[],c=[],p=[],d=0,f=[],m=i/2,g=0;function y(i){let n=d,s=new ce,f=new D,y=0,v=!0===i?e:t,T=!0===i?1:-1;for(let e=1;e<=r;e++)u.push(0,m*T,0),c.push(0,T,0),p.push(.5,.5),d++;let x=d;for(let e=0;e<=r;e++){let t=e/r*o+a,i=Math.cos(t),n=Math.sin(t);f.x=v*n,f.y=m*T,f.z=v*i,u.push(f.x,f.y,f.z),c.push(0,T,0),s.x=.5*i+.5,s.y=.5*n*T+.5,p.push(s.x,s.y),d++}for(let e=0;e<r;e++){let t=n+e,r=x+e;!0===i?h.push(r,r+1,t):h.push(r+1,r,t),y+=3}l.addGroup(g,y,!0===i?1:2),g+=y}(function(){let s=new D,y=new D,v=0,T=(t-e)/i;for(let l=0;l<=n;l++){let h=[],g=l/n,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,n=t*o+a,l=Math.sin(n),f=Math.cos(n);y.x=v*l,y.y=-g*i+m,y.z=v*f,u.push(y.x,y.y,y.z),s.set(l,T,f).normalize(),c.push(s.x,s.y,s.z),p.push(t,1-g),h.push(d++)}f.push(h)}for(let e=0;e<r;e++)for(let t=0;t<n;t++){let i=f[t][e],r=f[t+1][e],n=f[t+1][e+1],s=f[t][e+1];h.push(i,r,s),h.push(r,n,s),v+=6}l.addGroup(g,v,0),g+=v})(),!1===s&&(e>0&&y(!0),t>0&&y(!1)),this.setIndex(h),this.setAttribute("position",new dt(u,3)),this.setAttribute("normal",new dt(c,3)),this.setAttribute("uv",new dt(p,2))}static fromJSON(e){return new Hl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},Og=class extends Hl{constructor(e=1,t=1,i=32,r=1,n=!1,s=0,a=2*Math.PI){super(0,e,t,i,r,n,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:n,thetaStart:s,thetaLength:a}}static fromJSON(e){return new Og(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},Gc=class extends ot{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};let n=[],s=[];function a(e,t,i,r){let n=r+1,s=[];for(let a=0;a<=n;a++){s[a]=[];let r=e.clone().lerp(i,a/n),o=t.clone().lerp(i,a/n),l=n-a;for(let e=0;e<=l;e++)s[a][e]=0===e&&a===n?r:r.clone().lerp(o,e/l)}for(let a=0;a<n;a++)for(let e=0;e<2*(n-a)-1;e++){let t=Math.floor(e/2);e%2==0?(o(s[a][t+1]),o(s[a+1][t]),o(s[a][t])):(o(s[a][t+1]),o(s[a+1][t+1]),o(s[a+1][t]))}}function o(e){n.push(e.x,e.y,e.z)}function l(t,i){let r=3*t;i.x=e[r+0],i.y=e[r+1],i.z=e[r+2]}function h(e,t,i,r){r<0&&1===e.x&&(s[t]=e.x-1),0===i.x&&0===i.z&&(s[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function c(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}(function(e){let i=new D,r=new D,n=new D;for(let s=0;s<t.length;s+=3)l(t[s+0],i),l(t[s+1],r),l(t[s+2],n),a(i,r,n,e)})(r),function(e){let t=new D;for(let i=0;i<n.length;i+=3)t.x=n[i+0],t.y=n[i+1],t.z=n[i+2],t.normalize().multiplyScalar(e),n[i+0]=t.x,n[i+1]=t.y,n[i+2]=t.z}(i),function(){let e=new D;for(let t=0;t<n.length;t+=3){e.x=n[t+0],e.y=n[t+1],e.z=n[t+2];let i=u(e)/2/Math.PI+.5,r=c(e)/Math.PI+.5;s.push(i,1-r)}(function(){let e=new D,t=new D,i=new D,r=new D,a=new ce,o=new ce,l=new ce;for(let c=0,p=0;c<n.length;c+=9,p+=6){e.set(n[c+0],n[c+1],n[c+2]),t.set(n[c+3],n[c+4],n[c+5]),i.set(n[c+6],n[c+7],n[c+8]),a.set(s[p+0],s[p+1]),o.set(s[p+2],s[p+3]),l.set(s[p+4],s[p+5]),r.copy(e).add(t).add(i).divideScalar(3);let d=u(r);h(a,p+0,e,d),h(o,p+2,t,d),h(l,p+4,i,d)}})(),function(){for(let e=0;e<s.length;e+=6){let t=s[e+0],i=s[e+2],r=s[e+4],n=Math.max(t,i,r),a=Math.min(t,i,r);n>.9&&a<.1&&(t<.2&&(s[e+0]+=1),i<.2&&(s[e+2]+=1),r<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new dt(n,3)),this.setAttribute("normal",new dt(n.slice(),3)),this.setAttribute("uv",new dt(s,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new Gc(e.vertices,e.indices,e.radius,e.details)}},Pg=class extends Gc{constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2,r=1/i;super([-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,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],[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],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Pg(e.radius,e.detail)}},wD=new D,RD=new D,m4=new D,MD=new pn,Jo=class extends ot{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){let i=Math.pow(10,4),r=Math.cos(Ig*t),n=e.getIndex(),s=e.getAttribute("position"),a=n?n.count:s.count,o=[0,0,0],l=["a","b","c"],h=new Array(3),u={},c=[];for(let e=0;e<a;e+=3){n?(o[0]=n.getX(e),o[1]=n.getX(e+1),o[2]=n.getX(e+2)):(o[0]=e,o[1]=e+1,o[2]=e+2);let{a:t,b:a,c:p}=MD;if(t.fromBufferAttribute(s,o[0]),a.fromBufferAttribute(s,o[1]),p.fromBufferAttribute(s,o[2]),MD.getNormal(m4),h[0]=`${Math.round(t.x*i)},${Math.round(t.y*i)},${Math.round(t.z*i)}`,h[1]=`${Math.round(a.x*i)},${Math.round(a.y*i)},${Math.round(a.z*i)}`,h[2]=`${Math.round(p.x*i)},${Math.round(p.y*i)},${Math.round(p.z*i)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let e=0;e<3;e++){let t=(e+1)%3,i=h[e],n=h[t],s=MD[l[e]],a=MD[l[t]],p=`${i}_${n}`,d=`${n}_${i}`;d in u&&u[d]?(m4.dot(u[d].normal)<=r&&(c.push(s.x,s.y,s.z),c.push(a.x,a.y,a.z)),u[d]=null):p in u||(u[p]={index0:o[e],index1:o[t],normal:m4.clone()})}}for(let e in u)if(u[e]){let{index0:t,index1:i}=u[e];wD.fromBufferAttribute(s,t),RD.fromBufferAttribute(s,i),c.push(wD.x,wD.y,wD.z),c.push(RD.x,RD.y,RD.z)}this.setAttribute("position",new dt(c,3))}}},Fa=class extends Ju{constructor(e){super(e),this.uuid=Xo(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){let i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push((new Ju).fromJSON(i))}return this}},NEt={triangulate:function(e,t,i=2){let r,n,s,a,o,l,h,u=t&&t.length,c=u?t[0]*i:e.length,p=Bpe(e,0,c,i,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=BEt(e,t,p,i)),e.length>80*i){r=s=e[0],n=a=e[1];for(let t=i;t<c;t+=i)o=e[t],l=e[t+1],o<r&&(r=o),l<n&&(n=l),o>s&&(s=o),l>a&&(a=l);h=Math.max(s-r,a-n),h=0!==h?32767/h:0}return Ix(p,d,i,r,n,h,0),d}};function Bpe(e,t,i,r,n){let s,a;if(n===ZEt(e,t,i,r)>0)for(s=t;s<i;s+=r)a=ghe(s,e[s],e[s+1],a);else for(s=i-r;s>=t;s-=r)a=ghe(s,e[s],e[s+1],a);return a&&wC(a,a.next)&&(Sx(a),a=a.next),a}function Ng(e,t){if(!e)return e;t||(t=e);let i,r=e;do{if(i=!1,r.steiner||!wC(r,r.next)&&0!==Un(r.prev,r,r.next))r=r.next;else{if(Sx(r),r=t=r.prev,r===r.next)break;i=!0}}while(i||r!==t);return t}function Ix(e,t,i,r,n,s,a){if(!e)return;!a&&s&&jEt(e,r,n,s);let o,l,h=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?FEt(e,r,n,s):LEt(e))t.push(o.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),Sx(e),e=l.next,h=l.next;else if((e=l)===h){a?1===a?Ix(e=HEt(Ng(e),t,i),t,i,r,n,s,2):2===a&&UEt(e,t,i,r,n,s):Ix(Ng(e),t,i,r,n,s,1);break}}function LEt(e){let t=e.prev,i=e,r=e.next;if(Un(t,i,r)>=0)return!1;let n=t.x,s=i.x,a=r.x,o=t.y,l=i.y,h=r.y,u=n<s?n<a?n:a:s<a?s:a,c=o<l?o<h?o:h:l<h?l:h,p=n>s?n>a?n:a:s>a?s:a,d=o>l?o>h?o:h:l>h?l:h,f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=c&&f.y<=d&&Fy(n,o,s,l,a,h,f.x,f.y)&&Un(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function FEt(e,t,i,r){let n=e.prev,s=e,a=e.next;if(Un(n,s,a)>=0)return!1;let o=n.x,l=s.x,h=a.x,u=n.y,c=s.y,p=a.y,d=o<l?o<h?o:h:l<h?l:h,f=u<c?u<p?u:p:c<p?c:p,m=o>l?o>h?o:h:l>h?l:h,g=u>c?u>p?u:p:c>p?c:p,y=yU(d,f,t,i,r),v=yU(m,g,t,i,r),T=e.prevZ,x=e.nextZ;for(;T&&T.z>=y&&x&&x.z<=v;){if(T.x>=d&&T.x<=m&&T.y>=f&&T.y<=g&&T!==n&&T!==a&&Fy(o,u,l,c,h,p,T.x,T.y)&&Un(T.prev,T,T.next)>=0||(T=T.prevZ,x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&Fy(o,u,l,c,h,p,x.x,x.y)&&Un(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;T&&T.z>=y;){if(T.x>=d&&T.x<=m&&T.y>=f&&T.y<=g&&T!==n&&T!==a&&Fy(o,u,l,c,h,p,T.x,T.y)&&Un(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;x&&x.z<=v;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&Fy(o,u,l,c,h,p,x.x,x.y)&&Un(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function HEt(e,t,i){let r=e;do{let n=r.prev,s=r.next.next;!wC(n,s)&&kpe(n,r,r.next,s)&&_x(n,s)&&_x(s,n)&&(t.push(n.i/i|0),t.push(r.i/i|0),t.push(s.i/i|0),Sx(r),Sx(r.next),r=e=s),r=r.next}while(r!==e);return Ng(r)}function UEt(e,t,i,r,n,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&YEt(a,e)){let o=Gpe(a,e);return a=Ng(a,a.next),o=Ng(o,o.next),Ix(a,t,i,r,n,s,0),void Ix(o,t,i,r,n,s,0)}e=e.next}a=a.next}while(a!==e)}function BEt(e,t,i,r){let n,s,a,o,l,h=[];for(n=0,s=t.length;n<s;n++)a=t[n]*r,o=n<s-1?t[n+1]*r:e.length,l=Bpe(e,a,o,r,!1),l===l.next&&(l.steiner=!0),h.push(qEt(l));for(h.sort(kEt),n=0;n<h.length;n++)i=GEt(h[n],i);return i}function kEt(e,t){return e.x-t.x}function GEt(e,t){let i=VEt(e,t);if(!i)return t;let r=Gpe(i,e);return Ng(r,r.next),Ng(i,i.next)}function VEt(e,t){let i,r=t,n=-1/0,s=e.x,a=e.y;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){let e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>n&&(n=e,i=r.x<r.next.x?r:r.next,e===s))return i}r=r.next}while(r!==t);if(!i)return null;let o,l=i,h=i.x,u=i.y,c=1/0;r=i;do{s>=r.x&&r.x>=h&&s!==r.x&&Fy(a<u?s:n,a,h,u,a<u?n:s,a,r.x,r.y)&&(o=Math.abs(a-r.y)/(s-r.x),_x(r,e)&&(o<c||o===c&&(r.x>i.x||r.x===i.x&&zEt(i,r)))&&(i=r,c=o)),r=r.next}while(r!==l);return i}function zEt(e,t){return Un(e.prev,e,t.prev)<0&&Un(t.next,e,e.next)<0}function jEt(e,t,i,r){let n=e;do{0===n.z&&(n.z=yU(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,WEt(n)}function WEt(e){let t,i,r,n,s,a,o,l,h=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,r=i,o=0,t=0;t<h&&(o++,r=r.nextZ,r);t++);for(l=h;o>0||l>0&&r;)0!==o&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,o--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,h*=2}while(a>1);return e}function yU(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function qEt(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function Fy(e,t,i,r,n,s,a,o){return(n-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(i-a)*(t-o)&&(i-a)*(s-o)>=(n-a)*(r-o)}function YEt(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!XEt(e,t)&&(_x(e,t)&&_x(t,e)&&$Et(e,t)&&(Un(e.prev,e,t.prev)||Un(e,t.prev,t))||wC(e,t)&&Un(e.prev,e,e.next)>0&&Un(t.prev,t,t.next)>0)}function Un(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function wC(e,t){return e.x===t.x&&e.y===t.y}function kpe(e,t,i,r){let n=CD(Un(e,t,i)),s=CD(Un(e,t,r)),a=CD(Un(i,r,e)),o=CD(Un(i,r,t));return!!(n!==s&&a!==o||0===n&&DD(e,i,t)||0===s&&DD(e,r,t)||0===a&&DD(i,e,r)||0===o&&DD(i,t,r))}function DD(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function CD(e){return e>0?1:e<0?-1:0}function XEt(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&kpe(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function _x(e,t){return Un(e.prev,e,e.next)<0?Un(e,t,e.next)>=0&&Un(e,e.prev,t)>=0:Un(e,t,e.prev)<0||Un(e,e.next,t)<0}function $Et(e,t){let i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}function Gpe(e,t){let i=new EU(e.i,e.x,e.y),r=new EU(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function ghe(e,t,i,r){let n=new EU(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Sx(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 EU(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ZEt(e,t,i,r){let n=0;for(let s=t,a=i-r;s<i;s+=r)n+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return n}var Ps=class{static area(e){let t=e.length,i=0;for(let r=t-1,n=0;n<t;r=n++)i+=e[r].x*e[n].y-e[n].x*e[r].y;return.5*i}static isClockWise(e){return Ps.area(e)<0}static triangulateShape(e,t){let i=[],r=[],n=[];vhe(e),yhe(i,e);let s=e.length;t.forEach(vhe);for(let o=0;o<t.length;o++)r.push(s),s+=t[o].length,yhe(i,t[o]);let a=NEt.triangulate(i,r);for(let o=0;o<a.length;o+=3)n.push(a.slice(o,o+3));return n}};function vhe(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function yhe(e,t){for(let i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}var Vp=class extends ot{constructor(e=new Fa([new ce(.5,.5),new ce(-.5,.5),new ce(-.5,-.5),new ce(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let i=this,r=[],n=[];for(let a=0,o=e.length;a<o;a++)s(e[a]);function s(e){let s,a,o,l,h,u=[],c=void 0!==t.curveSegments?t.curveSegments:12,p=void 0!==t.steps?t.steps:1,d=void 0!==t.depth?t.depth:1,f=void 0===t.bevelEnabled||t.bevelEnabled,m=void 0!==t.bevelThickness?t.bevelThickness:.2,g=void 0!==t.bevelSize?t.bevelSize:m-.1,y=void 0!==t.bevelOffset?t.bevelOffset:0,v=void 0!==t.bevelSegments?t.bevelSegments:3,T=t.extrudePath,x=void 0!==t.UVGenerator?t.UVGenerator:KEt,b=!1;T&&(s=T.getSpacedPoints(p),b=!0,f=!1,a=T.computeFrenetFrames(p,!1),o=new D,l=new D,h=new D),f||(v=0,m=0,g=0,y=0);let E=e.extractPoints(c),_=E.shape,w=E.holes;if(!Ps.isClockWise(_)){_=_.reverse();for(let e=0,t=w.length;e<t;e++){let t=w[e];Ps.isClockWise(t)&&(w[e]=t.reverse())}}let S=Ps.triangulateShape(_,w),M=_;for(let t=0,i=w.length;t<i;t++){let e=w[t];_=_.concat(e)}function I(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}let A=_.length,R=S.length;function C(e,t,i){let r,n,s,a=e.x-t.x,o=e.y-t.y,l=i.x-e.x,h=i.y-e.y,u=a*a+o*o,c=a*h-o*l;if(Math.abs(c)>Number.EPSILON){let c=Math.sqrt(u),p=Math.sqrt(l*l+h*h),d=t.x-o/c,f=t.y+a/c,m=((i.x-h/p-d)*h-(i.y+l/p-f)*l)/(a*h-o*l);r=d+a*m-e.x,n=f+o*m-e.y;let g=r*r+n*n;if(g<=2)return new ce(r,n);s=Math.sqrt(g/2)}else{let e=!1;a>Number.EPSILON?l>Number.EPSILON&&(e=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(h)&&(e=!0),e?(r=-o,n=a,s=Math.sqrt(u)):(r=a,n=o,s=Math.sqrt(u/2))}return new ce(r/s,n/s)}let O=[];for(let t=0,i=M.length,r=i-1,n=t+1;t<i;t++,r++,n++)r===i&&(r=0),n===i&&(n=0),O[t]=C(M[t],M[r],M[n]);let P,N=[],L=O.concat();for(let t=0,i=w.length;t<i;t++){let e=w[t];P=[];for(let t=0,i=e.length,r=i-1,n=t+1;t<i;t++,r++,n++)r===i&&(r=0),n===i&&(n=0),P[t]=C(e[t],e[r],e[n]);N.push(P),L=L.concat(P)}for(let t=0;t<v;t++){let e=t/v,i=m*Math.cos(e*Math.PI/2),r=g*Math.sin(e*Math.PI/2)+y;for(let t=0,n=M.length;t<n;t++){let e=I(M[t],O[t],r);k(e.x,e.y,-i)}for(let t=0,n=w.length;t<n;t++){let e=w[t];P=N[t];for(let t=0,n=e.length;t<n;t++){let n=I(e[t],P[t],r);k(n.x,n.y,-i)}}}let F=g+y;for(let t=0;t<A;t++){let e=f?I(_[t],L[t],F):_[t];b?(l.copy(a.normals[0]).multiplyScalar(e.x),o.copy(a.binormals[0]).multiplyScalar(e.y),h.copy(s[0]).add(l).add(o),k(h.x,h.y,h.z)):k(e.x,e.y,0)}for(let t=1;t<=p;t++)for(let e=0;e<A;e++){let i=f?I(_[e],L[e],F):_[e];b?(l.copy(a.normals[t]).multiplyScalar(i.x),o.copy(a.binormals[t]).multiplyScalar(i.y),h.copy(s[t]).add(l).add(o),k(h.x,h.y,h.z)):k(i.x,i.y,d/p*t)}for(let t=v-1;t>=0;t--){let e=t/v,i=m*Math.cos(e*Math.PI/2),r=g*Math.sin(e*Math.PI/2)+y;for(let t=0,n=M.length;t<n;t++){let e=I(M[t],O[t],r);k(e.x,e.y,d+i)}for(let t=0,n=w.length;t<n;t++){let e=w[t];P=N[t];for(let t=0,n=e.length;t<n;t++){let n=I(e[t],P[t],r);b?k(n.x,n.y+s[p-1].y,s[p-1].x+i):k(n.x,n.y,d+i)}}}function U(e,t){let i=e.length;for(;--i>=0;){let r=i,n=i-1;n<0&&(n=e.length-1);for(let e=0,i=p+2*v;e<i;e++){let i=A*e,s=A*(e+1);z(t+r+i,t+n+i,t+n+s,t+r+s)}}}function k(e,t,i){u.push(e),u.push(t),u.push(i)}function B(e,t,n){G(e),G(t),G(n);let s=r.length/3,a=x.generateTopUV(i,r,s-3,s-2,s-1);H(a[0]),H(a[1]),H(a[2])}function z(e,t,n,s){G(e),G(t),G(s),G(t),G(n),G(s);let a=r.length/3,o=x.generateSideWallUV(i,r,a-6,a-3,a-2,a-1);H(o[0]),H(o[1]),H(o[3]),H(o[1]),H(o[2]),H(o[3])}function G(e){r.push(u[3*e+0]),r.push(u[3*e+1]),r.push(u[3*e+2])}function H(e){n.push(e.x),n.push(e.y)}(function(){let e=r.length/3;if(f){let e=0,t=A*e;for(let i=0;i<R;i++){let e=S[i];B(e[2]+t,e[1]+t,e[0]+t)}e=p+2*v,t=A*e;for(let i=0;i<R;i++){let e=S[i];B(e[0]+t,e[1]+t,e[2]+t)}}else{for(let e=0;e<R;e++){let t=S[e];B(t[2],t[1],t[0])}for(let e=0;e<R;e++){let t=S[e];B(t[0]+A*p,t[1]+A*p,t[2]+A*p)}}i.addGroup(e,r.length/3-e,0)})(),function(){let e=r.length/3,t=0;U(M,t),t+=M.length;for(let i=0,r=w.length;i<r;i++){let e=w[i];U(e,t),t+=e.length}i.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new dt(r,3)),this.setAttribute("uv",new dt(n,2)),this.computeVertexNormals()}toJSON(){let e=super.toJSON();return JEt(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){let i=[];for(let n=0,s=e.shapes.length;n<s;n++){let r=t[e.shapes[n]];i.push(r)}let r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new _B[r.type]).fromJSON(r)),new Vp(i,e.options)}},KEt={generateTopUV:function(e,t,i,r,n){let s=t[3*i],a=t[3*i+1],o=t[3*r],l=t[3*r+1],h=t[3*n],u=t[3*n+1];return[new ce(s,a),new ce(o,l),new ce(h,u)]},generateSideWallUV:function(e,t,i,r,n,s){let a=t[3*i],o=t[3*i+1],l=t[3*i+2],h=t[3*r],u=t[3*r+1],c=t[3*r+2],p=t[3*n],d=t[3*n+1],f=t[3*n+2],m=t[3*s],g=t[3*s+1],y=t[3*s+2];return Math.abs(o-u)<Math.abs(a-h)?[new ce(a,1-l),new ce(h,1-c),new ce(p,1-f),new ce(m,1-y)]:[new ce(o,1-l),new ce(u,1-c),new ce(d,1-f),new ce(g,1-y)]}};function JEt(e,t,i){if(i.shapes=[],Array.isArray(e))for(let r=0,n=e.length;r<n;r++){let t=e[r];i.shapes.push(t.uuid)}else i.shapes.push(e.uuid);return i.options=Object.assign({},t),void 0!==t.extrudePath&&(i.options.extrudePath=t.extrudePath.toJSON()),i}var Lg=class extends Gc{constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,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],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Lg(e.radius,e.detail)}},yf=class extends Gc{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new yf(e.radius,e.detail)}},Fg=class extends ot{constructor(e=.5,t=1,i=32,r=1,n=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:n,thetaLength:s},i=Math.max(3,i);let a=[],o=[],l=[],h=[],u=e,c=(t-e)/(r=Math.max(1,r)),p=new D,d=new ce;for(let f=0;f<=r;f++){for(let e=0;e<=i;e++){let r=n+e/i*s;p.x=u*Math.cos(r),p.y=u*Math.sin(r),o.push(p.x,p.y,p.z),l.push(0,0,1),d.x=(p.x/t+1)/2,d.y=(p.y/t+1)/2,h.push(d.x,d.y)}u+=c}for(let f=0;f<r;f++){let e=f*(i+1);for(let t=0;t<i;t++){let r=t+e,n=r,s=r+i+1,o=r+i+2,l=r+1;a.push(n,s,l),a.push(s,o,l)}}this.setIndex(a),this.setAttribute("position",new dt(o,3)),this.setAttribute("normal",new dt(l,3)),this.setAttribute("uv",new dt(h,2))}static fromJSON(e){return new Fg(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}},Qu=class extends ot{constructor(e=new Fa([new ce(0,.5),new ce(-.5,-.5),new ce(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let i=[],r=[],n=[],s=[],a=0,o=0;if(!1===Array.isArray(e))l(e);else for(let h=0;h<e.length;h++)l(e[h]),this.addGroup(a,o,h),a+=o,o=0;function l(e){let a=r.length/3,l=e.extractPoints(t),h=l.shape,u=l.holes;!1===Ps.isClockWise(h)&&(h=h.reverse());for(let t=0,i=u.length;t<i;t++){let e=u[t];!0===Ps.isClockWise(e)&&(u[t]=e.reverse())}let c=Ps.triangulateShape(h,u);for(let t=0,i=u.length;t<i;t++){let e=u[t];h=h.concat(e)}for(let t=0,i=h.length;t<i;t++){let e=h[t];r.push(e.x,e.y,0),n.push(0,0,1),s.push(e.x,e.y)}for(let t=0,r=c.length;t<r;t++){let e=c[t],r=e[0]+a,n=e[1]+a,s=e[2]+a;i.push(r,n,s),o+=3}}this.setIndex(i),this.setAttribute("position",new dt(r,3)),this.setAttribute("normal",new dt(n,3)),this.setAttribute("uv",new dt(s,2))}toJSON(){let e=super.toJSON();return QEt(this.parameters.shapes,e)}static fromJSON(e,t){let i=[];for(let r=0,n=e.shapes.length;r<n;r++){let n=t[e.shapes[r]];i.push(n)}return new Qu(i,e.curveSegments)}};function QEt(e,t){if(t.shapes=[],Array.isArray(e))for(let i=0,r=e.length;i<r;i++){let r=e[i];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}var po=class extends ot{constructor(e=1,t=32,i=16,r=0,n=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:n,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));let o=Math.min(s+a,Math.PI),l=0,h=[],u=new D,c=new D,p=[],d=[],f=[],m=[];for(let g=0;g<=i;g++){let p=[],y=g/i,v=0;0==g&&0==s?v=.5/t:g==i&&o==Math.PI&&(v=-.5/t);for(let i=0;i<=t;i++){let o=i/t;u.x=-e*Math.cos(r+o*n)*Math.sin(s+y*a),u.y=e*Math.cos(s+y*a),u.z=e*Math.sin(r+o*n)*Math.sin(s+y*a),d.push(u.x,u.y,u.z),c.copy(u).normalize(),f.push(c.x,c.y,c.z),m.push(o+v,1-y),p.push(l++)}h.push(p)}for(let g=0;g<i;g++)for(let e=0;e<t;e++){let t=h[g][e+1],r=h[g][e],n=h[g+1][e],a=h[g+1][e+1];(0!==g||s>0)&&p.push(t,r,a),(g!==i-1||o<Math.PI)&&p.push(r,n,a)}this.setIndex(p),this.setAttribute("position",new dt(d,3)),this.setAttribute("normal",new dt(f,3)),this.setAttribute("uv",new dt(m,2))}static fromJSON(e){return new po(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}},Hg=class extends Gc{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Hg(e.radius,e.detail)}},zp=class extends ot{constructor(e=1,t=.4,i=12,r=48,n=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:n},i=Math.floor(i),r=Math.floor(r);let s=[],a=[],o=[],l=[],h=new D,u=new D,c=new D;for(let p=0;p<=i;p++)for(let s=0;s<=r;s++){let d=s/r*n,f=p/i*Math.PI*2;u.x=(e+t*Math.cos(f))*Math.cos(d),u.y=(e+t*Math.cos(f))*Math.sin(d),u.z=t*Math.sin(f),a.push(u.x,u.y,u.z),h.x=e*Math.cos(d),h.y=e*Math.sin(d),c.subVectors(u,h).normalize(),o.push(c.x,c.y,c.z),l.push(s/r),l.push(p/i)}for(let p=1;p<=i;p++)for(let e=1;e<=r;e++){let t=(r+1)*p+e-1,i=(r+1)*(p-1)+e-1,n=(r+1)*(p-1)+e,a=(r+1)*p+e;s.push(t,i,a),s.push(i,n,a)}this.setIndex(s),this.setAttribute("position",new dt(a,3)),this.setAttribute("normal",new dt(o,3)),this.setAttribute("uv",new dt(l,2))}static fromJSON(e){return new zp(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}},Ug=class extends ot{constructor(e=1,t=.4,i=64,r=8,n=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:n,q:s},i=Math.floor(i),r=Math.floor(r);let a=[],o=[],l=[],h=[],u=new D,c=new D,p=new D,d=new D,f=new D,m=new D,g=new D;for(let v=0;v<=i;++v){let a=v/i*n*Math.PI*2;y(a,n,s,e,p),y(a+.01,n,s,e,d),m.subVectors(d,p),g.addVectors(d,p),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=r;++e){let n=e/r*Math.PI*2,s=-t*Math.cos(n),a=t*Math.sin(n);u.x=p.x+(s*g.x+a*f.x),u.y=p.y+(s*g.y+a*f.y),u.z=p.z+(s*g.z+a*f.z),o.push(u.x,u.y,u.z),c.subVectors(u,p).normalize(),l.push(c.x,c.y,c.z),h.push(v/i),h.push(e/r)}}for(let v=1;v<=i;v++)for(let e=1;e<=r;e++){let t=(r+1)*(v-1)+(e-1),i=(r+1)*v+(e-1),n=(r+1)*v+e,s=(r+1)*(v-1)+e;a.push(t,i,s),a.push(i,n,s)}function y(e,t,i,r,n){let s=Math.cos(e),a=Math.sin(e),o=i/t*e,l=Math.cos(o);n.x=r*(2+l)*.5*s,n.y=r*(2+l)*a*.5,n.z=r*Math.sin(o)*.5}this.setIndex(a),this.setAttribute("position",new dt(o,3)),this.setAttribute("normal",new dt(l,3)),this.setAttribute("uv",new dt(h,2))}static fromJSON(e){return new Ug(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}},Bg=class extends ot{constructor(e=new xx(new D(-1,-1,0),new D(-1,1,0),new D(1,1,0)),t=64,i=1,r=8,n=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:n};let s=e.computeFrenetFrames(t,n);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;let a=new D,o=new D,l=new ce,h=new D,u=[],c=[],p=[],d=[];function f(n){h=e.getPointAt(n/t,h);let l=s.normals[n],p=s.binormals[n];for(let e=0;e<=r;e++){let t=e/r*Math.PI*2,n=Math.sin(t),s=-Math.cos(t);o.x=s*l.x+n*p.x,o.y=s*l.y+n*p.y,o.z=s*l.z+n*p.z,o.normalize(),c.push(o.x,o.y,o.z),a.x=h.x+i*o.x,a.y=h.y+i*o.y,a.z=h.z+i*o.z,u.push(a.x,a.y,a.z)}}(function(){for(let e=0;e<t;e++)f(e);f(!1===n?t:0),function(){for(let e=0;e<=t;e++)for(let i=0;i<=r;i++)l.x=e/t,l.y=i/r,p.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){let i=(r+1)*(e-1)+(t-1),n=(r+1)*e+(t-1),s=(r+1)*e+t,a=(r+1)*(e-1)+t;d.push(i,n,a),d.push(n,s,a)}}()})(),this.setIndex(d),this.setAttribute("position",new dt(u,3)),this.setAttribute("normal",new dt(c,3)),this.setAttribute("uv",new dt(p,2))}toJSON(){let e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Bg((new _B[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}},sC=class extends ot{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){let t=[],i=new Set,r=new D,n=new D;if(null!==e.index){let s=e.attributes.position,a=e.index,o=e.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){let l=o[e],h=l.start;for(let e=h,o=h+l.count;e<o;e+=3)for(let l=0;l<3;l++){let o=a.getX(e+l),h=a.getX(e+(l+1)%3);r.fromBufferAttribute(s,o),n.fromBufferAttribute(s,h),!0===Ehe(r,n,i)&&(t.push(r.x,r.y,r.z),t.push(n.x,n.y,n.z))}}}else{let s=e.attributes.position;for(let e=0,a=s.count/3;e<a;e++)for(let o=0;o<3;o++){let a=3*e+o,l=3*e+(o+1)%3;r.fromBufferAttribute(s,a),n.fromBufferAttribute(s,l),!0===Ehe(r,n,i)&&(t.push(r.x,r.y,r.z),t.push(n.x,n.y,n.z))}}this.setAttribute("position",new dt(t,3))}}};function Ehe(e,t,i){let r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,n=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==i.has(r)&&!0!==i.has(n)&&(i.add(r),i.add(n),!0)}var The=Object.freeze({__proto__:null,BoxGeometry:js,CapsuleGeometry:Cg,CircleGeometry:Ag,ConeGeometry:Og,CylinderGeometry:Hl,DodecahedronGeometry:Pg,EdgesGeometry:Jo,ExtrudeGeometry:Vp,IcosahedronGeometry:Lg,LatheGeometry:vf,OctahedronGeometry:yf,PlaneGeometry:En,PolyhedronGeometry:Gc,RingGeometry:Fg,ShapeGeometry:Qu,SphereGeometry:po,TetrahedronGeometry:Hg,TorusGeometry:zp,TorusKnotGeometry:Ug,TubeGeometry:Bg,WireframeGeometry:sC}),aC=class extends qr{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ve(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}},oC=class extends Zt{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}},Ef=class extends qr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ve(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_f,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=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.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}},Ul=class extends Ef{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ce(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return is(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ve(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ve(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ve(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},Ws=class extends qr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ve(16777215),this.specular=new Ve(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_f,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Bx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=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.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},lC=class extends qr{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ve(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_f,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=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}},Tf=class extends qr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_f,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}},Bl=class extends qr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ve(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_f,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Bx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=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.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},cC=class extends qr{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ve(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_f,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this.fog=e.fog,this}},kg=class extends br{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};function Ol(e,t,i){return SB(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)}function bg(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function SB(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Vpe(e){let t=e.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort((function(t,i){return e[t]-e[i]})),i}function TU(e,t,i){let r=e.length,n=new e.constructor(r);for(let s=0,a=0;a!==r;++s){let r=i[s]*t;for(let i=0;i!==t;++i)n[a++]=e[r+i]}return n}function wB(e,t,i,r){let n=1,s=e[0];for(;void 0!==s&&void 0===s[r];)s=e[n++];if(void 0===s)return;let a=s[r];if(void 0!==a)if(Array.isArray(a))do{a=s[r],void 0!==a&&(t.push(s.time),i.push.apply(i,a)),s=e[n++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[r],void 0!==a&&(t.push(s.time),a.toArray(i,i.length)),s=e[n++]}while(void 0!==s);else do{a=s[r],void 0!==a&&(t.push(s.time),i.push(a)),s=e[n++]}while(void 0!==s)}function eTt(e,t,i,r,n=30){let s=e.clone();s.name=t;let a=[];for(let l=0;l<s.tracks.length;++l){let e=s.tracks[l],t=e.getValueSize(),o=[],h=[];for(let s=0;s<e.times.length;++s){let a=e.times[s]*n;if(!(a<i||a>=r)){o.push(e.times[s]);for(let i=0;i<t;++i)h.push(e.values[s*t+i])}}0!==o.length&&(e.times=bg(o,e.times.constructor),e.values=bg(h,e.values.constructor),a.push(e))}s.tracks=a;let o=1/0;for(let l=0;l<s.tracks.length;++l)o>s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*o);return s.resetDuration(),s}function tTt(e,t=0,i=e,r=30){r<=0&&(r=30);let n=i.tracks.length,s=t/r;for(let a=0;a<n;++a){let t=i.tracks[a],r=t.ValueTypeName;if("bool"===r||"string"===r)continue;let n=e.tracks.find((function(e){return e.name===t.name&&e.ValueTypeName===r}));if(void 0===n)continue;let o=0,l=t.getValueSize();t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=l/3);let h=0,u=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=u/3);let c,p=t.times.length-1;if(s<=t.times[0]){let e=o,i=l-o;c=Ol(t.values,e,i)}else if(s>=t.times[p]){let e=p*l+o,i=e+l-o;c=Ol(t.values,e,i)}else{let e=t.createInterpolant(),i=o,r=l-o;e.evaluate(s),c=Ol(e.resultBuffer,i,r)}"quaternion"===r&&(new Br).fromArray(c).normalize().conjugate().toArray(c);let d=n.times.length;for(let e=0;e<d;++e){let t=e*u+h;if("quaternion"===r)Br.multiplyQuaternionsFlat(n.values,t,c,0,n.values,t);else{let e=u-2*h;for(let i=0;i<e;++i)n.values[t+i]-=c[i]}}}return e.blendMode=EB,e}var rTt=Object.freeze({__proto__:null,arraySlice:Ol,convertArray:bg,flattenJSON:wB,getKeyframeOrder:Vpe,isTypedArray:SB,makeClipAdditive:tTt,sortedArray:TU,subclip:eTt}),jp=class{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,r=t[i],n=t[i-1];e:{t:{let s;i:{r:if(!(e<r)){for(let s=i+2;;){if(void 0===r){if(e<n)break r;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===s)break;if(n=r,r=t[++i],e<r)break t}s=t.length;break i}if(e>=n)break e;{let a=t[1];e<a&&(i=2,n=a);for(let s=i-2;;){if(void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(i===s)break;if(r=n,n=t[--i-1],e>=n)break t}s=i,i=0}}for(;i<s;){let r=i+s>>>1;e<t[r]?s=r:i=r+1}if(r=t[i],n=t[i-1],void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r;for(let s=0;s!==r;++s)t[s]=i[n+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},uC=class extends jp{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Eg,endingEnd:Eg}}intervalChanged_(e,t,i){let r=this.parameterPositions,n=e-2,s=e+1,a=r[n],o=r[s];if(void 0===a)switch(this.getSettings_().endingStart){case Tg:n=e,a=2*t-i;break;case ux:n=r.length-2,a=t+r[n]-r[n+1];break;default:n=e,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case Tg:s=e,o=2*i-t;break;case ux:s=1,o=i+r[1]-r[0];break;default:s=e-1,o=t}let l=.5*(i-t),h=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(o-i),this._offsetPrev=n*h,this._offsetNext=s*h}interpolate_(e,t,i,r){let n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,h=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,p=this._weightNext,d=(i-t)/(r-t),f=d*d,m=f*d,g=-c*m+2*c*f-c*d,y=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*d+1,v=(-1-p)*m+(1.5+p)*f+.5*d,T=p*m-p*f;for(let x=0;x!==a;++x)n[x]=g*s[h+x]+y*s[l+x]+v*s[o+x]+T*s[u+x];return n}},wx=class extends jp{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,h=(i-t)/(r-t),u=1-h;for(let c=0;c!==a;++c)n[c]=s[l+c]*u+s[o+c]*h;return n}},hC=class extends jp{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}},Qo=class{constructor(e,t,i,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=bg(t,this.TimeBufferType),this.values=bg(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t,i=e.constructor;if(i.toJSON!==this.toJSON)t=i.toJSON(e);else{t={name:e.name,times:bg(e.times,Array),values:bg(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new hC(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new wx(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new uC(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Lp:t=this.InterpolantFactoryMethodDiscrete;break;case $u:t=this.InterpolantFactoryMethodLinear;break;case zD:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){let t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Lp;case this.InterpolantFactoryMethodLinear:return $u;case this.InterpolantFactoryMethodSmooth:return zD}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){let i=this.times,r=i.length,n=0,s=r-1;for(;n!==r&&i[n]<e;)++n;for(;-1!==s&&i[s]>t;)--s;if(++s,0!==n||s!==r){n>=s&&(s=Math.max(s,1),n=s-1);let e=this.getValueSize();this.times=Ol(i,n,s),this.values=Ol(this.values,n*e,s*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,r=this.values,n=i.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==n;a++){let t=i[a];if("number"==typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,t),e=!1;break}if(null!==s&&s>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,t,s),e=!1;break}s=t}if(void 0!==r&&SB(r))for(let a=0,o=r.length;a!==o;++a){let t=r[a];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,t),e=!1;break}}return e}optimize(){let e=Ol(this.times),t=Ol(this.values),i=this.getValueSize(),r=this.getInterpolation()===zD,n=e.length-1,s=1;for(let a=1;a<n;++a){let n=!1,o=e[a];if(o!==e[a+1]&&(1!==a||o!==e[0]))if(r)n=!0;else{let e=a*i,r=e-i,s=e+i;for(let a=0;a!==i;++a){let i=t[e+a];if(i!==t[r+a]||i!==t[s+a]){n=!0;break}}}if(n){if(a!==s){e[s]=e[a];let r=a*i,n=s*i;for(let e=0;e!==i;++e)t[n+e]=t[r+e]}++s}}if(n>0){e[s]=e[n];for(let e=n*i,r=s*i,a=0;a!==i;++a)t[r+a]=t[e+a];++s}return s!==e.length?(this.times=Ol(e,0,s),this.values=Ol(t,0,s*i)):(this.times=e,this.values=t),this}clone(){let e=Ol(this.times,0),t=Ol(this.values,0),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Qo.prototype.TimeBufferType=Float32Array,Qo.prototype.ValueBufferType=Float32Array,Qo.prototype.DefaultInterpolation=$u;var Wp=class extends Qo{};Wp.prototype.ValueTypeName="bool",Wp.prototype.ValueBufferType=Array,Wp.prototype.DefaultInterpolation=Lp,Wp.prototype.InterpolantFactoryMethodLinear=void 0,Wp.prototype.InterpolantFactoryMethodSmooth=void 0;var Rx=class extends Qo{};Rx.prototype.ValueTypeName="color";var Vc=class extends Qo{};Vc.prototype.ValueTypeName="number";var pC=class extends jp{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(i-t)/(r-t),l=e*a;for(let h=l+a;l!==h;l+=4)Br.slerpFlat(n,0,s,l-a,s,l,o);return n}},Ba=class extends Qo{InterpolantFactoryMethodLinear(e){return new pC(this.times,this.values,this.getValueSize(),e)}};Ba.prototype.ValueTypeName="quaternion",Ba.prototype.DefaultInterpolation=$u,Ba.prototype.InterpolantFactoryMethodSmooth=void 0;var qp=class extends Qo{};qp.prototype.ValueTypeName="string",qp.prototype.ValueBufferType=Array,qp.prototype.DefaultInterpolation=Lp,qp.prototype.InterpolantFactoryMethodLinear=void 0,qp.prototype.InterpolantFactoryMethodSmooth=void 0;var fo=class extends Qo{};fo.prototype.ValueTypeName="vector";var mo=class{constructor(e,t=-1,i,r=_C){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Xo(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,r=1/(e.fps||1);for(let s=0,a=i.length;s!==a;++s)t.push(nTt(i[s]).scale(r));let n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n}static toJSON(e){let t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let n=0,s=i.length;n!==s;++n)t.push(Qo.toJSON(i[n]));return r}static CreateFromMorphTargetSequence(e,t,i,r){let n=t.length,s=[];for(let a=0;a<n;a++){let e=[],o=[];e.push((a+n-1)%n,a,(a+1)%n),o.push(0,1,0);let l=Vpe(e);e=TU(e,1,l),o=TU(o,1,l),!r&&0===e[0]&&(e.push(n),o.push(o[0])),s.push(new Vc(".morphTargetInfluences["+t[a].name+"]",e,o).scale(1/i))}return new this(e,-1,s)}static findByName(e,t){let i=e;if(!Array.isArray(e)){let t=e;i=t.geometry&&t.geometry.animations||t.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let r={},n=/^([\w-]*?)([\d]+)$/;for(let a=0,o=e.length;a<o;a++){let t=e[a],i=t.name.match(n);if(i&&i.length>1){let e=i[1],n=r[e];n||(r[e]=n=[]),n.push(t)}}let s=[];for(let a in r)s.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(e,t,i,r,n){if(0!==i.length){let s=[],a=[];wB(i,s,a,r),0!==s.length&&n.push(new e(t,s,a))}},r=[],n=e.name||"default",s=e.fps||30,a=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let h=0;h<l.length;h++){let e=l[h].keys;if(e&&0!==e.length)if(e[0].morphTargets){let t,i={};for(t=0;t<e.length;t++)if(e[t].morphTargets)for(let r=0;r<e[t].morphTargets.length;r++)i[e[t].morphTargets[r]]=-1;for(let n in i){let i=[],s=[];for(let r=0;r!==e[t].morphTargets.length;++r){let r=e[t];i.push(r.time),s.push(r.morphTarget===n?1:0)}r.push(new Vc(".morphTargetInfluence["+n+"]",i,s))}o=i.length*s}else{let n=".bones["+t[h].name+"]";i(fo,n+".position",e,"pos",r),i(Ba,n+".quaternion",e,"rot",r),i(fo,n+".scale",e,"scl",r)}}return 0===r.length?null:new this(n,o,r,a)}resetDuration(){let e=0;for(let t=0,i=this.tracks.length;t!==i;++t){let i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}};function iTt(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Vc;case"vector":case"vector2":case"vector3":case"vector4":return fo;case"color":return Rx;case"quaternion":return Ba;case"bool":case"boolean":return Wp;case"string":return qp}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function nTt(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=iTt(e.type);if(void 0===e.times){let t=[],i=[];wB(e.keys,t,i,"value"),e.times=t,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}var AD,Gg={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},eh=class{constructor(e,t,i){let r,n=this,s=!1,a=0,o=0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++,!1===s&&void 0!==n.onStart&&n.onStart(e,a,o),s=!0},this.itemEnd=function(e){a++,void 0!==n.onProgress&&n.onProgress(e,a,o),a===o&&(s=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return r?r(e):e},this.setURLModifier=function(e){return r=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){let t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,i=l.length;t<i;t+=2){let i=l[t],r=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return r}return null}}},vo=new eh,pi=class{constructor(e){this.manager=void 0!==e?e:vo,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let i=this;return new Promise((function(r,n){i.load(e,r,t,n)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}},Rp={},bU=class extends Error{constructor(e,t){super(e),this.response=t}},di=class extends pi{constructor(e){super(e)}load(e,t,i,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let n=Gg.get(e);if(void 0!==n)return this.manager.itemStart(e),setTimeout((()=>{t&&t(n),this.manager.itemEnd(e)}),0),n;if(void 0!==Rp[e])return void Rp[e].push({onLoad:t,onProgress:i,onError:r});Rp[e]=[],Rp[e].push({onLoad:t,onProgress:i,onError:r});let s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;let i=Rp[e],r=t.body.getReader(),n=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),s=n?parseInt(n):0,a=0!==s,o=0,l=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:n})=>{if(r)e.close();else{o+=n.byteLength;let r=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let e=0,t=i.length;e<t;e++){let t=i[e];t.onProgress&&t.onProgress(r)}e.enqueue(n),t()}}))}()}});return new Response(l)}throw new bU(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,a)));case"json":return e.json();default:if(void 0===a)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(a),i=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(i);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{Gg.add(e,t);let i=Rp[e];delete Rp[e];for(let e=0,r=i.length;e<r;e++){let r=i[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{let i=Rp[e];if(void 0===i)throw this.manager.itemError(e),t;delete Rp[e];for(let e=0,r=i.length;e<r;e++){let r=i[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},xU=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=new di(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(i){try{t(n.parse(JSON.parse(i)))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}parse(e){let t=[];for(let i=0;i<e.length;i++){let r=mo.parse(e[i]);t.push(r)}return t}},IU=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=[],a=new Ex,o=new di(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(n.withCredentials);let l=0;function h(h){o.load(e[h],(function(e){let i=n.parse(e,!0);s[h]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(a.minFilter=hi),a.image=s,a.format=i.format,a.needsUpdate=!0,t&&t(a))}),i,r)}if(Array.isArray(e))for(let u=0,c=e.length;u<c;++u)h(u);else o.load(e,(function(e){let i=n.parse(e,!0);if(i.isCubemap){let e=i.mipmaps.length/i.mipmapCount;for(let t=0;t<e;t++){s[t]={mipmaps:[]};for(let e=0;e<i.mipmapCount;e++)s[t].mipmaps.push(i.mipmaps[t*i.mipmapCount+e]),s[t].format=i.format,s[t].width=i.width,s[t].height=i.height}a.image=s}else a.image.width=i.width,a.image.height=i.height,a.mipmaps=i.mipmaps;1===i.mipmapCount&&(a.minFilter=hi),a.format=i.format,a.needsUpdate=!0,t&&t(a)}),i,r);return a}},Vg=class extends pi{constructor(e){super(e)}load(e,t,i,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,s=Gg.get(e);if(void 0!==s)return n.manager.itemStart(e),setTimeout((function(){t&&t(s),n.manager.itemEnd(e)}),0),s;let a=dx("img");function o(){h(),Gg.add(e,this),t&&t(this),n.manager.itemEnd(e)}function l(t){h(),r&&r(t),n.manager.itemError(e),n.manager.itemEnd(e)}function h(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),n.manager.itemStart(e),a.src=e,a}},Mx=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=new Rg,s=new Vg(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function o(i){s.load(e[i],(function(e){n.images[i]=e,a++,6===a&&(n.needsUpdate=!0,t&&t(n))}),void 0,r)}for(let l=0;l<e.length;++l)o(l);return n}},zg=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=new Pl,a=new di(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(n.withCredentials),a.load(e,(function(e){let i=n.parse(e);i&&(void 0!==i.image?s.image=i.image:void 0!==i.data&&(s.image.width=i.width,s.image.height=i.height,s.image.data=i.data),s.wrapS=void 0!==i.wrapS?i.wrapS:vn,s.wrapT=void 0!==i.wrapT?i.wrapT:vn,s.magFilter=void 0!==i.magFilter?i.magFilter:hi,s.minFilter=void 0!==i.minFilter?i.minFilter:hi,s.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(s.encoding=i.encoding),void 0!==i.flipY&&(s.flipY=i.flipY),void 0!==i.format&&(s.format=i.format),void 0!==i.type&&(s.type=i.type),void 0!==i.mipmaps&&(s.mipmaps=i.mipmaps,s.minFilter=Ha),1===i.mipmapCount&&(s.minFilter=hi),void 0!==i.generateMipmaps&&(s.generateMipmaps=i.generateMipmaps),s.needsUpdate=!0,t&&t(s,i))}),i,r),s}},gs=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=new Pi,s=new Vg(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){n.image=e,n.needsUpdate=!0,void 0!==t&&t(n)}),i,r),n}},kl=class extends qt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ve(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}},bf=class extends kl{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(qt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ve(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}},g4=new Be,bhe=new D,xhe=new D,Dx=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ce(512,512),this.map=null,this.mapPass=null,this.matrix=new Be,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new na,this._frameExtents=new ce(1,1),this._viewportCount=1,this._viewports=[new jr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;bhe.setFromMatrixPosition(e.matrixWorld),t.position.copy(bhe),xhe.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(xhe),t.updateMatrixWorld(),g4.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(g4),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(g4)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){let e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},_U=class extends Dx{constructor(){super(new Vr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,i=2*px*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,n=e.distance||t.far;(i!==t.fov||r!==t.aspect||n!==t.far)&&(t.fov=i,t.aspect=r,t.far=n,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},th=class extends kl{constructor(e,t,i=0,r=Math.PI/3,n=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(qt.DEFAULT_UP),this.updateMatrix(),this.target=new qt,this.distance=i,this.angle=r,this.penumbra=n,this.decay=s,this.map=null,this.shadow=new _U}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},Ihe=new Be,ix=new D,v4=new D,SU=class extends Dx{constructor(){super(new Vr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new ce(4,2),this._viewportCount=6,this._viewports=[new jr(2,1,1,1),new jr(0,1,1,1),new jr(3,1,1,1),new jr(1,1,1,1),new jr(3,0,1,1),new jr(1,0,1,1)],this._cubeDirections=[new D(1,0,0),new D(-1,0,0),new D(0,0,1),new D(0,0,-1),new D(0,1,0),new D(0,-1,0)],this._cubeUps=[new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,0,1),new D(0,0,-1)]}updateMatrices(e,t=0){let i=this.camera,r=this.matrix,n=e.distance||i.far;n!==i.far&&(i.far=n,i.updateProjectionMatrix()),ix.setFromMatrixPosition(e.matrixWorld),i.position.copy(ix),v4.copy(i.position),v4.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(v4),i.updateMatrixWorld(),r.makeTranslation(-ix.x,-ix.y,-ix.z),Ihe.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ihe)}},zc=class extends kl{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new SU}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},wU=class extends Dx{constructor(){super(new Ni(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Ns=class extends kl{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(qt.DEFAULT_UP),this.updateMatrix(),this.target=new qt,this.shadow=new wU}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},Gl=class extends kl{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}},dC=class extends kl{constructor(e,t,i=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},fC=class{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new D)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let i=e.x,r=e.y,n=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*n),t.addScaledVector(s[3],.488603*i),t.addScaledVector(s[4],i*r*1.092548),t.addScaledVector(s[5],r*n*1.092548),t.addScaledVector(s[6],.315392*(3*n*n-1)),t.addScaledVector(s[7],i*n*1.092548),t.addScaledVector(s[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){let i=e.x,r=e.y,n=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*n),t.addScaledVector(s[3],1.023328*i),t.addScaledVector(s[4],.858086*i*r),t.addScaledVector(s[5],.858086*r*n),t.addScaledVector(s[6],.743125*n*n-.247708),t.addScaledVector(s[7],.858086*i*n),t.addScaledVector(s[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){let i=e.x,r=e.y,n=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*n,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*n,t[6]=.315392*(3*n*n-1),t[7]=1.092548*i*n,t[8]=.546274*(i*i-r*r)}},Wy=class extends kl{constructor(e=new fC,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}},qy=class extends pi{constructor(e){super(e),this.textures={}}load(e,t,i,r){let n=this,s=new di(n.manager);s.setPath(n.path),s.setRequestHeader(n.requestHeader),s.setWithCredentials(n.withCredentials),s.load(e,(function(i){try{t(n.parse(JSON.parse(i)))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}parse(e){let t=this.textures;function i(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}let r=qy.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new Ve).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(let n in e.uniforms){let t=e.uniforms[n];switch(r.uniforms[n]={},t.type){case"t":r.uniforms[n].value=i(t.value);break;case"c":r.uniforms[n].value=(new Ve).setHex(t.value);break;case"v2":r.uniforms[n].value=(new ce).fromArray(t.value);break;case"v3":r.uniforms[n].value=(new D).fromArray(t.value);break;case"v4":r.uniforms[n].value=(new jr).fromArray(t.value);break;case"m3":r.uniforms[n].value=(new Ui).fromArray(t.value);break;case"m4":r.uniforms[n].value=(new Be).fromArray(t.value);break;default:r.uniforms[n].value=t.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(let n in e.extensions)r.extensions[n]=e.extensions[n];if(void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=i(e.map)),void 0!==e.matcap&&(r.matcap=i(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=i(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=i(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=i(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new ce).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=i(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=i(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=i(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=i(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=i(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=i(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=i(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=i(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=i(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=i(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=i(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=i(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new ce).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=i(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=i(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=i(e.thicknessMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=i(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:aC,SpriteMaterial:yx,RawShaderMaterial:oC,ShaderMaterial:Zt,PointsMaterial:Rn,MeshPhysicalMaterial:Ul,MeshStandardMaterial:Ef,MeshPhongMaterial:Ws,MeshToonMaterial:lC,MeshNormalMaterial:Tf,MeshLambertMaterial:Bl,MeshDepthMaterial:Up,MeshDistanceMaterial:vx,MeshBasicMaterial:Xt,MeshMatcapMaterial:cC,LineDashedMaterial:kg,LineBasicMaterial:br,Material:qr}[e]}},qs=class{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},mC=class extends ot{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},gC=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=new di(n.manager);s.setPath(n.path),s.setRequestHeader(n.requestHeader),s.setWithCredentials(n.withCredentials),s.load(e,(function(i){try{t(n.parse(JSON.parse(i)))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}parse(e){let t={},i={};function r(e,r){if(void 0!==t[r])return t[r];let n=e.interleavedBuffers[r],s=function(e,t){if(void 0!==i[t])return i[t];let r=e.arrayBuffers[t],n=new Uint32Array(r).buffer;return i[t]=n,n}(e,n.buffer),a=Ny(n.type,s),o=new Bp(a,n.stride);return o.uuid=n.uuid,t[r]=o,o}let n=e.isInstancedBufferGeometry?new mC:new ot,s=e.data.index;if(void 0!==s){let e=Ny(s.type,s.array);n.setIndex(new Wt(e,1))}let a=e.data.attributes;for(let u in a){let t,i=a[u];if(i.isInterleavedBufferAttribute){let n=r(e.data,i.data);t=new ho(n,i.itemSize,i.offset,i.normalized)}else{let e=Ny(i.type,i.array);t=new(i.isInstancedBufferAttribute?kp:Wt)(e,i.itemSize,i.normalized)}void 0!==i.name&&(t.name=i.name),void 0!==i.usage&&t.setUsage(i.usage),void 0!==i.updateRange&&(t.updateRange.offset=i.updateRange.offset,t.updateRange.count=i.updateRange.count),n.setAttribute(u,t)}let o=e.data.morphAttributes;if(o)for(let u in o){let t=o[u],i=[];for(let n=0,s=t.length;n<s;n++){let s,a=t[n];if(a.isInterleavedBufferAttribute){let t=r(e.data,a.data);s=new ho(t,a.itemSize,a.offset,a.normalized)}else{let e=Ny(a.type,a.array);s=new Wt(e,a.itemSize,a.normalized)}void 0!==a.name&&(s.name=a.name),i.push(s)}n.morphAttributes[u]=i}e.data.morphTargetsRelative&&(n.morphTargetsRelative=!0);let l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let u=0,c=l.length;u!==c;++u){let e=l[u];n.addGroup(e.start,e.count,e.materialIndex)}let h=e.data.boundingSphere;if(void 0!==h){let e=new D;void 0!==h.center&&e.fromArray(h.center),n.boundingSphere=new $i(e,h.radius)}return e.name&&(n.name=e.name),e.userData&&(n.userData=e.userData),n}},RU=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=""===this.path?qs.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let a=new di(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(i){let s=null;try{s=JSON.parse(i)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}let a=s.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())return void 0!==r&&r(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);n.parse(s,t)}),i,r)}loadAsync(e,t){return ct(this,null,(function*(){let i=""===this.path?qs.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;let r=new di(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);let n=yield r.loadAsync(e,t),s=JSON.parse(n),a=s.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return yield this.parseAsync(s)}))}parse(e,t){let i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),n=this.parseGeometries(e.geometries,r),s=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),a=this.parseTextures(e.textures,s),o=this.parseMaterials(e.materials,a),l=this.parseObject(e.object,n,o,a,i),h=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,h),void 0!==t){let e=!1;for(let t in s)if(s[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}parseAsync(e){return ct(this,null,(function*(){let t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),n=yield this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,n),a=this.parseMaterials(e.materials,s),o=this.parseObject(e.object,r,a,s,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),o}))}parseShapes(e){let t={};if(void 0!==e)for(let i=0,r=e.length;i<r;i++){let r=(new Fa).fromJSON(e[i]);t[r.uuid]=r}return t}parseSkeletons(e,t){let i={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let n=0,s=e.length;n<s;n++){let t=(new Fl).fromJSON(e[n],r);i[t.uuid]=t}return i}parseGeometries(e,t){let i={};if(void 0!==e){let r=new gC;for(let n=0,s=e.length;n<s;n++){let s,a=e[n];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":s=r.parse(a);break;default:a.type in The?s=The[a.type].fromJSON(a,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${a.type}"`)}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),!0===s.isBufferGeometry&&void 0!==a.userData&&(s.userData=a.userData),i[a.uuid]=s}}return i}parseMaterials(e,t){let i={},r={};if(void 0!==e){let n=new qy;n.setTextures(t);for(let t=0,s=e.length;t<s;t++){let s=e[t];void 0===i[s.uuid]&&(i[s.uuid]=n.parse(s)),r[s.uuid]=i[s.uuid]}}return r}parseAnimations(e){let t={};if(void 0!==e)for(let i=0;i<e.length;i++){let r=e[i],n=mo.parse(r);t[n.uuid]=n}return t}parseImages(e,t){let i,r=this,n={};function s(e){if("string"==typeof e){let t=e;return function(e){return r.manager.itemStart(e),i.load(e,(function(){r.manager.itemEnd(e)}),void 0,(function(){r.manager.itemError(e),r.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t)}return e.data?{data:Ny(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){let r=new eh(t);i=new Vg(r),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){let i=e[t],r=i.url;if(Array.isArray(r)){let e=[];for(let t=0,i=r.length;t<i;t++){let i=s(r[t]);null!==i&&(i instanceof HTMLImageElement?e.push(i):e.push(new Pl(i.data,i.width,i.height)))}n[i.uuid]=new kc(e)}else{let e=s(i.url);n[i.uuid]=new kc(e)}}}return n}parseImagesAsync(e){return ct(this,null,(function*(){let t,i=this,r={};function n(e){return ct(this,null,(function*(){if("string"==typeof e){let r=e,n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r)?r:i.resourcePath+r;return yield t.loadAsync(n)}return e.data?{data:Ny(e.type,e.data),width:e.width,height:e.height}:null}))}if(void 0!==e&&e.length>0){t=new Vg(this.manager),t.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){let i=e[t],s=i.url;if(Array.isArray(s)){let e=[];for(let t=0,i=s.length;t<i;t++){let i=s[t],r=yield n(i);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new Pl(r.data,r.width,r.height)))}r[i.uuid]=new kc(e)}else{let e=yield n(i.url);r[i.uuid]=new kc(e)}}}return r}))}parseTextures(e,t){function i(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}let r={};if(void 0!==e)for(let n=0,s=e.length;n<s;n++){let s=e[n];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);let a,o=t[s.image],l=o.data;Array.isArray(l)?(a=new Rg,6===l.length&&(a.needsUpdate=!0)):(a=l&&l.data?new Pl:new Pi,l&&(a.needsUpdate=!0)),a.source=o,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=i(s.mapping,sTt)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=i(s.wrap[0],_he),a.wrapT=i(s.wrap[1],_he)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=i(s.minFilter,She)),void 0!==s.magFilter&&(a.magFilter=i(s.magFilter,She)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.generateMipmaps&&(a.generateMipmaps=s.generateMipmaps),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),void 0!==s.userData&&(a.userData=s.userData),r[s.uuid]=a}return r}parseObject(e,t,i,r,n){let s,a,o;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function h(e){if(void 0!==e){if(Array.isArray(e)){let t=[];for(let r=0,n=e.length;r<n;r++){let n=e[r];void 0===i[n]&&console.warn("THREE.ObjectLoader: Undefined material",n),t.push(i[n])}return t}return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),i[e]}}function u(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":s=new wn,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new Ve(e.background):s.background=u(e.background)),void 0!==e.environment&&(s.environment=u(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new Zu(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new Vy(e.fog.color,e.fog.density))),void 0!==e.backgroundBlurriness&&(s.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(s.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":s=new Vr(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new Ni(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new Gl(e.color,e.intensity);break;case"DirectionalLight":s=new Ns(e.color,e.intensity);break;case"PointLight":s=new zc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new dC(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new th(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new bf(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=(new Wy).fromJSON(e);break;case"SkinnedMesh":a=l(e.geometry),o=h(e.material),s=new Ku(a,o),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":a=l(e.geometry),o=h(e.material),s=new Je(a,o);break;case"InstancedMesh":a=l(e.geometry),o=h(e.material);let t=e.count,i=e.instanceMatrix,r=e.instanceColor;s=new sn(a,o,t),s.instanceMatrix=new kp(new Float32Array(i.array),16),void 0!==r&&(s.instanceColor=new kp(new Float32Array(r.array),r.itemSize));break;case"LOD":s=new eC;break;case"Line":s=new Sr(l(e.geometry),h(e.material));break;case"LineLoop":s=new zy(l(e.geometry),h(e.material));break;case"LineSegments":s=new Kr(l(e.geometry),h(e.material));break;case"PointCloud":case"Points":s=new Bi(l(e.geometry),h(e.material));break;case"Sprite":s=new QD(h(e.material));break;case"Group":s=new ar;break;case"Bone":s=new Ll;break;default:s=new qt}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){let a=e.children;for(let e=0;e<a.length;e++)s.add(this.parseObject(a[e],t,i,r,n))}if(void 0!==e.animations){let t=e.animations;for(let e=0;e<t.length;e++){let i=t[e];s.animations.push(n[i])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);let t=e.levels;for(let e=0;e<t.length;e++){let i=t[e],r=s.getObjectByProperty("uuid",i.object);void 0!==r&&s.addLevel(r,i.distance,i.hysteresis)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){let i=t[e.skeleton];void 0===i?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(i,e.bindMatrix)}}))}},sTt={UVMapping:bC,CubeReflectionMapping:df,CubeRefractionMapping:ff,EquirectangularReflectionMapping:Sg,EquirectangularRefractionMapping:cx,CubeUVReflectionMapping:Ky},_he={RepeatWrapping:yn,ClampToEdgeWrapping:vn,MirroredRepeatWrapping:Pp},She={NearestFilter:Oi,NearestMipmapNearestFilter:mf,NearestMipmapLinearFilter:Cp,LinearFilter:hi,LinearMipmapNearestFilter:jg,LinearMipmapLinearFilter:Ha},Cx=class extends pi{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,s=Gg.get(e);if(void 0!==s)return n.manager.itemStart(e),setTimeout((function(){t&&t(s),n.manager.itemEnd(e)}),0),s;let a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(n.options,{colorSpaceConversion:"none"}))})).then((function(i){Gg.add(e,i),t&&t(i),n.manager.itemEnd(e)})).catch((function(t){r&&r(t),n.manager.itemError(e),n.manager.itemEnd(e)})),n.manager.itemStart(e)}},Ax=class{static getContext(){return void 0===AD&&(AD=new(window.AudioContext||window.webkitAudioContext)),AD}static setContext(e){AD=e}},MU=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=new di(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(i){try{let e=i.slice(0);Ax.getContext().decodeAudioData(e,(function(e){t(e)}))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}},DU=class extends Wy{constructor(e,t,i=1){super(void 0,i),this.isHemisphereLightProbe=!0;let r=(new Ve).set(e),n=(new Ve).set(t),s=new D(r.r,r.g,r.b),a=new D(n.r,n.g,n.b),o=Math.sqrt(Math.PI),l=o*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(a).multiplyScalar(o),this.sh.coefficients[1].copy(s).sub(a).multiplyScalar(l)}},CU=class extends Wy{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;let i=(new Ve).set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}},whe=new Be,Rhe=new Be,pg=new Be,AU=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Vr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Vr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,pg.copy(e.projectionMatrix);let i,r,n=t.eyeSep/2,s=n*t.near/t.focus,a=t.near*Math.tan(Ig*t.fov*.5)/t.zoom;Rhe.elements[12]=-n,whe.elements[12]=n,i=-a*t.aspect+s,r=a*t.aspect+s,pg.elements[0]=2*t.near/(r-i),pg.elements[8]=(r+i)/(r-i),this.cameraL.projectionMatrix.copy(pg),i=-a*t.aspect-s,r=a*t.aspect-s,pg.elements[0]=2*t.near/(r-i),pg.elements[8]=(r+i)/(r-i),this.cameraR.projectionMatrix.copy(pg)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Rhe),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(whe)}},Vl=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Mhe(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=Mhe();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function Mhe(){return("undefined"==typeof performance?Date:performance).now()}var dg=new D,Dhe=new Br,aTt=new D,fg=new D,OU=class extends qt{constructor(){super(),this.type="AudioListener",this.context=Ax.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Vl}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(dg,Dhe,aTt),fg.set(0,0,-1).applyQuaternion(Dhe),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(dg.x,e),t.positionY.linearRampToValueAtTime(dg.y,e),t.positionZ.linearRampToValueAtTime(dg.z,e),t.forwardX.linearRampToValueAtTime(fg.x,e),t.forwardY.linearRampToValueAtTime(fg.y,e),t.forwardZ.linearRampToValueAtTime(fg.z,e),t.upX.linearRampToValueAtTime(i.x,e),t.upY.linearRampToValueAtTime(i.y,e),t.upZ.linearRampToValueAtTime(i.z,e)}else t.setPosition(dg.x,dg.y,dg.z),t.setOrientation(fg.x,fg.y,fg.z,i.x,i.y,i.z)}},vC=class extends qt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}},mg=new D,Che=new Br,oTt=new D,gg=new D,PU=class extends vC{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(mg,Che,oTt),gg.set(0,0,1).applyQuaternion(Che);let t=this.panner;if(t.positionX){let e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(mg.x,e),t.positionY.linearRampToValueAtTime(mg.y,e),t.positionZ.linearRampToValueAtTime(mg.z,e),t.orientationX.linearRampToValueAtTime(gg.x,e),t.orientationY.linearRampToValueAtTime(gg.y,e),t.orientationZ.linearRampToValueAtTime(gg.z,e)}else t.setPosition(mg.x,mg.y,mg.z),t.setOrientation(gg.x,gg.y,gg.z)}},NU=class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0,t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}},yC=class{constructor(e,t,i){let r,n,s;switch(this.binding=e,this.valueSize=i,t){case"quaternion":r=this._slerp,n=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":r=this._select,n=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:r=this._lerp,n=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=n,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let i=this.buffer,r=this.valueSize,n=e*r+r,s=this.cumulativeWeight;if(0===s){for(let e=0;e!==r;++e)i[n+e]=i[e];s=t}else{s+=t;let e=t/s;this._mixBufferRegion(i,n,0,e,r)}this.cumulativeWeight=s}accumulateAdditive(e){let t=this.buffer,i=this.valueSize,r=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,i=this.buffer,r=e*t+t,n=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,n<1){let e=t*this._origIndex;this._mixBufferRegion(i,r,e,1-n,t)}s>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let o=t,l=t+t;o!==l;++o)if(i[o]!==i[o+t]){a.setValue(i,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let n=i,s=r;n!==s;++n)t[n]=t[r+n%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,n){if(r>=.5)for(let s=0;s!==n;++s)e[t+s]=e[i+s]}_slerp(e,t,i,r){Br.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,n){let s=this._workIndex*n;Br.multiplyQuaternionsFlat(e,s,e,t,e,i),Br.slerpFlat(e,t,e,t,e,s,r)}_lerp(e,t,i,r,n){let s=1-r;for(let a=0;a!==n;++a){let n=t+a;e[n]=e[n]*s+e[i+a]*r}}_lerpAdditive(e,t,i,r,n){for(let s=0;s!==n;++s){let n=t+s;e[n]=e[n]+e[i+s]*r}}},RB="\\[\\]\\.:\\/",lTt=new RegExp("["+RB+"]","g"),MB="[^"+RB+"]",cTt="[^"+RB.replace("\\.","")+"]",uTt=/((?:WC+[\/:])*)/.source.replace("WC",MB),hTt=/(WCOD+)?/.source.replace("WCOD",cTt),pTt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",MB),dTt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",MB),fTt=new RegExp("^"+uTt+hTt+pTt+dTt+"$"),mTt=["material","materials","bones","map"],LU=class{constructor(e,t,i){let r=i||Cr.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},Cr=class{constructor(e,t,i){this.path=t,this.parsedPath=i||Cr.parseTrackName(t),this.node=Cr.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Cr.Composite(e,t,i):new Cr(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lTt,"")}static parseTrackName(e){let t=fTt.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){let e=i.nodeName.substring(r+1);-1!==mTt.indexOf(e)&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=e)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){let i=function(e){for(let r=0;r<e.length;r++){let n=e[r];if(n.name===t||n.uuid===t)return n;let s=i(n.children);if(s)return s}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,i=t.objectName,r=t.propertyName,n=t.propertyIndex;if(e||(e=Cr.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let r=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.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[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[i]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}let s=e[r];if(void 0===s){let i=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+r+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[n]&&(n=e.morphTargetDictionary[n])}o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n}else void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Cr.Composite=LU,Cr.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Cr.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Cr.prototype.GetterByBindingType=[Cr.prototype._getValue_direct,Cr.prototype._getValue_array,Cr.prototype._getValue_arrayElement,Cr.prototype._getValue_toArray],Cr.prototype.SetterByBindingTypeAndVersioning=[[Cr.prototype._setValue_direct,Cr.prototype._setValue_direct_setNeedsUpdate,Cr.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Cr.prototype._setValue_array,Cr.prototype._setValue_array_setNeedsUpdate,Cr.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Cr.prototype._setValue_arrayElement,Cr.prototype._setValue_arrayElement_setNeedsUpdate,Cr.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Cr.prototype._setValue_fromArray,Cr.prototype._setValue_fromArray_setNeedsUpdate,Cr.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var FU=class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Xo(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){let e,t=this._objects,i=this._indicesByUUID,r=this._paths,n=this._parsedPaths,s=this._bindings,a=s.length,o=t.length,l=this.nCachedObjects_;for(let h=0,u=arguments.length;h!==u;++h){let u=arguments[h],c=u.uuid,p=i[c];if(void 0===p){p=o++,i[c]=p,t.push(u);for(let e=0,t=a;e!==t;++e)s[e].push(new Cr(u,r[e],n[e]))}else if(p<l){e=t[p];let o=--l,h=t[o];i[h.uuid]=p,t[p]=h,i[c]=o,t[o]=u;for(let e=0,t=a;e!==t;++e){let t=s[e],i=t[o],a=t[p];t[p]=i,void 0===a&&(a=new Cr(u,r[e],n[e])),t[o]=a}}else t[p]!==e&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length,n=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){let a=arguments[s],o=a.uuid,l=t[o];if(void 0!==l&&l>=n){let s=n++,h=e[s];t[h.uuid]=l,e[l]=h,t[o]=s,e[s]=a;for(let e=0,t=r;e!==t;++e){let t=i[e],r=t[s],n=t[l];t[l]=r,t[s]=n}}}this.nCachedObjects_=n}uncache(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length,n=this.nCachedObjects_,s=e.length;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a].uuid,l=t[o];if(void 0!==l)if(delete t[o],l<n){let a=--n,o=e[a],h=--s,u=e[h];t[o.uuid]=l,e[l]=o,t[u.uuid]=a,e[a]=u,e.pop();for(let e=0,t=r;e!==t;++e){let t=i[e],r=t[a],n=t[h];t[l]=r,t[a]=n,t.pop()}}else{let n=--s,a=e[n];n>0&&(t[a.uuid]=l),e[l]=a,e.pop();for(let e=0,t=r;e!==t;++e){let t=i[e];t[l]=t[n],t.pop()}}}this.nCachedObjects_=n}subscribe_(e,t){let i=this._bindingsIndicesByPath,r=i[e],n=this._bindings;if(void 0!==r)return n[r];let s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,h=this.nCachedObjects_,u=new Array(l);r=n.length,i[e]=r,s.push(e),a.push(t),n.push(u);for(let c=h,p=o.length;c!==p;++c){let i=o[c];u[c]=new Cr(i,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){let r=this._paths,n=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];t[e[a]]=i,s[i]=o,s.pop(),n[i]=n[a],n.pop(),r[i]=r[a],r.pop()}}},HU=class{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;let n=t.tracks,s=n.length,a=new Array(s),o={endingStart:Eg,endingEnd:Eg};for(let l=0;l!==s;++l){let e=n[l].createInterpolant(null);a[l]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ipe,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){let i=this._clip.duration,r=e._clip.duration,n=r/i,s=i/r;e.warp(1,n,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){let r=this._mixer,n=r.time,s=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);let o=a.parameterPositions,l=a.sampleValues;return o[0]=n,o[1]=n+i,l[0]=e/s,l[1]=t/s,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled)return void this._updateWeight(e);let n=this._startTime;if(null!==n){let r=(e-n)*i;r<0||0===i?t=0:(this._startTime=null,t=i*r)}t*=this._updateTimeScale(e);let s=this._updateTime(t),a=this._updateWeight(e);if(a>0){let e=this._interpolants,t=this._propertyBindings;if(this.blendMode===EB)for(let i=0,r=e.length;i!==r;++i)e[i].evaluate(s),t[i].accumulateAdditive(a);else for(let i=0,n=e.length;i!==n;++i)e[i].evaluate(s),t[i].accumulate(r,a)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let i=this._weightInterpolant;if(null!==i){let r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let i=this._timeScaleInterpolant;null!==i&&(t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,i=this.loop,r=this.time+e,n=this._loopCount,s=i===_pe;if(0===e)return-1===n?r:s&&1==(1&n)?t-r:r;if(i===xpe){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===n&&(e>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),r>=t||r<0){let i=Math.floor(r/t);r-=t*i,n+=Math.abs(i);let a=this.repetitions-n;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){let t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=r;if(s&&1==(1&n))return t-r}return r}_setEndings(e,t,i){let r=this._interpolantSettings;i?(r.endingStart=Tg,r.endingEnd=Tg):(r.endingStart=e?this.zeroSlopeAtStart?Tg:Eg:ux,r.endingEnd=t?this.zeroSlopeAtEnd?Tg:Eg:ux)}_scheduleFading(e,t,i){let r=this._mixer,n=r.time,s=this._weightInterpolant;null===s&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);let a=s.parameterPositions,o=s.sampleValues;return a[0]=n,o[0]=t,a[1]=n+e,o[1]=i,this}},gTt=new Float32Array(1),UU=class extends Zo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let i=e._localRoot||this._root,r=e._clip.tracks,n=r.length,s=e._propertyBindings,a=e._interpolants,o=i.uuid,l=this._bindingsByRootAndName,h=l[o];void 0===h&&(h={},l[o]=h);for(let u=0;u!==n;++u){let e=r[u],n=e.name,l=h[n];if(void 0!==l)++l.referenceCount,s[u]=l;else{if(l=s[u],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,o,n));continue}let r=t&&t._propertyBindings[u].binding.parsedPath;l=new yC(Cr.create(i,n,r),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,o,n),s[u]=l}a[u].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,i=e._clip.uuid,r=this._actionsByClip[i];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,i,t)}let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let 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}}}}_isActiveAction(e){let t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,i){let r=this._actions,n=this._actionsByClip,s=n[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,n[t]=s;else{let t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),s.actionByRoot[i]=e}_removeInactiveAction(e){let t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;let n=e._clip.uuid,s=this._actionsByClip,a=s[n],o=a.knownActions,l=o[o.length-1],h=e._byClipCacheIndex;l._byClipCacheIndex=h,o[h]=l,o.pop(),e._byClipCacheIndex=null,delete a.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete s[n],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){let e=t[i];0==--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){let t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n}_takeBackAction(e){let t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n}_addInactiveBinding(e,t,i){let r=this._bindingsByRootAndName,n=this._bindings,s=r[t];void 0===s&&(s={},r[t]=s),s[i]=e,e._cacheIndex=n.length,n.push(e)}_removeInactiveBinding(e){let t=this._bindings,i=e.binding,r=i.rootNode.uuid,n=i.path,s=this._bindingsByRootAndName,a=s[r],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete a[n],0===Object.keys(a).length&&delete s[r]}_lendBinding(e){let t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n}_takeBackBinding(e){let t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&(i=new wx(new Float32Array(2),new Float32Array(2),1,gTt),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){let t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,n=t[r];e.__cacheIndex=r,t[r]=e,n.__cacheIndex=i,t[i]=n}clipAction(e,t,i){let r=t||this._root,n=r.uuid,s="string"==typeof e?mo.findByName(r,e):e,a=null!==s?s.uuid:e,o=this._actionsByClip[a],l=null;if(void 0===i&&(i=null!==s?s.blendMode:_C),void 0!==o){let e=o.actionByRoot[n];if(void 0!==e&&e.blendMode===i)return e;l=o.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;let h=new HU(this,s,t,i);return this._bindAction(h,l),this._addInactiveAction(h,a,n),h}existingAction(e,t){let i=t||this._root,r=i.uuid,n="string"==typeof e?mo.findByName(i,e):e,s=n?n.uuid:e,a=this._actionsByClip[s];return void 0!==a&&a.actionByRoot[r]||null}stopAllAction(){let e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;let t=this._actions,i=this._nActiveActions,r=this.time+=e,n=Math.sign(e),s=this._accuIndex^=1;for(let l=0;l!==i;++l)t[l]._update(r,e,n,s);let a=this._bindings,o=this._nActiveBindings;for(let l=0;l!==o;++l)a[l].apply(s);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,i=e.uuid,r=this._actionsByClip,n=r[i];if(void 0!==n){let e=n.knownActions;for(let i=0,r=e.length;i!==r;++i){let r=e[i];this._deactivateAction(r);let n=r._cacheIndex,s=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,s._cacheIndex=n,t[n]=s,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[i]}}uncacheRoot(e){let t=e.uuid,i=this._actionsByClip;for(let n in i){let e=i[n].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}let r=this._bindingsByRootAndName[t];if(void 0!==r)for(let n in r){let e=r[n];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){let i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}},Ox=class{constructor(e){this.value=e}clone(){return new Ox(void 0===this.value.clone?this.value:this.value.clone())}},vTt=0,BU=class extends Zo{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:vTt++}),this.name="",this.usage=hx,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){let t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;let t=e.uniforms;this.uniforms.length=0;for(let i=0,r=t.length;i<r;i++)this.uniforms.push(t[i].clone());return this}clone(){return(new this.constructor).copy(this)}},kU=class extends Bp{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}},GU=class{constructor(e,t,i,r,n){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=n,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}},ka=class{constructor(e,t,i=0,r=1/0){this.ray=new Ko(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new ky,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,i=[]){return VU(e,this,i,t),i.sort(Ahe),i}intersectObjects(e,t=!0,i=[]){for(let r=0,n=e.length;r<n;r++)VU(e[r],this,i,t);return i.sort(Ahe),i}};function Ahe(e,t){return e.distance-t.distance}function VU(e,t,i,r){if(e.layers.test(t.layers)&&e.raycast(t,i),!0===r){let r=e.children;for(let e=0,n=r.length;e<n;e++)VU(r[e],t,i,!0)}}var xf=class{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(is(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},zU=class{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return(new this.constructor).copy(this)}},Ohe=new ce,ns=class{constructor(e=new ce(1/0,1/0),t=new ce(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=Ohe.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Ohe.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},Phe=new D,OD=new D,Ga=class{constructor(e=new D,t=new D){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Phe.subVectors(e,this.start),OD.subVectors(this.end,this.start);let i=OD.dot(OD),r=OD.dot(Phe)/i;return t&&(r=is(r,0,1)),r}closestPointToPoint(e,t,i){let r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},Nhe=new D,jU=class extends qt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";let i=new ot,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,o=32;s<o;s++,a++){let e=s/o*Math.PI*2,t=a/o*Math.PI*2;r.push(Math.cos(e),Math.sin(e),1,Math.cos(t),Math.sin(t),1)}i.setAttribute("position",new dt(r,3));let n=new br({fog:!1,toneMapped:!1});this.cone=new Kr(i,n),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Nhe.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Nhe),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},uf=new D,PD=new Be,y4=new Be,WU=class extends Kr{constructor(e){let t=zpe(e),i=new ot,r=[],n=[],s=new Ve(0,0,1),a=new Ve(0,1,0);for(let o=0;o<t.length;o++){let e=t[o];e.parent&&e.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),n.push(s.r,s.g,s.b),n.push(a.r,a.g,a.b))}i.setAttribute("position",new dt(r,3)),i.setAttribute("color",new dt(n,3)),super(i,new br({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){let t=this.bones,i=this.geometry,r=i.getAttribute("position");y4.copy(this.root.matrixWorld).invert();for(let n=0,s=0;n<t.length;n++){let e=t[n];e.parent&&e.parent.isBone&&(PD.multiplyMatrices(y4,e.matrixWorld),uf.setFromMatrixPosition(PD),r.setXYZ(s,uf.x,uf.y,uf.z),PD.multiplyMatrices(y4,e.parent.matrixWorld),uf.setFromMatrixPosition(PD),r.setXYZ(s+1,uf.x,uf.y,uf.z),s+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}};function zpe(e){let t=[];!0===e.isBone&&t.push(e);for(let i=0;i<e.children.length;i++)t.push.apply(t,zpe(e.children[i]));return t}var qU=class extends Je{constructor(e,t,i){super(new po(t,4,2),new Xt({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},yTt=new D,Lhe=new Ve,Fhe=new Ve,YU=class extends qt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";let r=new yf(t);r.rotateY(.5*Math.PI),this.material=new Xt({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);let n=r.getAttribute("position"),s=new Float32Array(3*n.count);r.setAttribute("color",new Wt(s,3)),this.add(new Je(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{let t=e.geometry.getAttribute("color");Lhe.copy(this.light.color),Fhe.copy(this.light.groundColor);for(let e=0,i=t.count;e<i;e++){let r=e<i/2?Lhe:Fhe;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(yTt.setFromMatrixPosition(this.light.matrixWorld).negate())}},Px=class extends Kr{constructor(e=10,t=10,i=4473924,r=8947848){i=new Ve(i),r=new Ve(r);let n=t/2,s=e/t,a=e/2,o=[],l=[];for(let u=0,c=0,p=-a;u<=t;u++,p+=s){o.push(-a,0,p,a,0,p),o.push(p,0,-a,p,0,a);let e=u===n?i:r;e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3}let h=new ot;h.setAttribute("position",new dt(o,3)),h.setAttribute("color",new dt(l,3)),super(h,new br({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},XU=class extends Kr{constructor(e=10,t=16,i=8,r=64,n=4473924,s=8947848){n=new Ve(n),s=new Ve(s);let a=[],o=[];if(t>1)for(let h=0;h<t;h++){let i=h/t*(2*Math.PI),r=Math.sin(i)*e,l=Math.cos(i)*e;a.push(0,0,0),a.push(r,0,l);let u=1&h?n:s;o.push(u.r,u.g,u.b),o.push(u.r,u.g,u.b)}for(let h=0;h<i;h++){let t=1&h?n:s,l=e-e/i*h;for(let e=0;e<r;e++){let i=e/r*(2*Math.PI),n=Math.sin(i)*l,s=Math.cos(i)*l;a.push(n,0,s),o.push(t.r,t.g,t.b),i=(e+1)/r*(2*Math.PI),n=Math.sin(i)*l,s=Math.cos(i)*l,a.push(n,0,s),o.push(t.r,t.g,t.b)}}let l=new ot;l.setAttribute("position",new dt(a,3)),l.setAttribute("color",new dt(o,3)),super(l,new br({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},Hhe=new D,ND=new D,Uhe=new D,Nx=class extends qt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",void 0===t&&(t=1);let r=new ot;r.setAttribute("position",new dt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let n=new br({fog:!1,toneMapped:!1});this.lightPlane=new Sr(r,n),this.add(this.lightPlane),r=new ot,r.setAttribute("position",new dt([0,0,0,0,0,1],3)),this.targetLine=new Sr(r,n),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Hhe.setFromMatrixPosition(this.light.matrixWorld),ND.setFromMatrixPosition(this.light.target.matrixWorld),Uhe.subVectors(ND,Hhe),this.lightPlane.lookAt(ND),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(ND),this.targetLine.scale.z=Uhe.length()}},LD=new D,Xn=new Fp,Lx=class extends Kr{constructor(e){let t=new ot,i=new br({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],n=[],s={};function a(e,t){o(e),o(t)}function o(e){r.push(0,0,0),n.push(0,0,0),void 0===s[e]&&(s[e]=[]),s[e].push(r.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),t.setAttribute("position",new dt(r,3)),t.setAttribute("color",new dt(n,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();let l=new Ve(16755200),h=new Ve(16711680),u=new Ve(43775),c=new Ve(16777215),p=new Ve(3355443);this.setColors(l,h,u,c,p)}setColors(e,t,i,r,n){let s=this.geometry.getAttribute("color");s.setXYZ(0,e.r,e.g,e.b),s.setXYZ(1,e.r,e.g,e.b),s.setXYZ(2,e.r,e.g,e.b),s.setXYZ(3,e.r,e.g,e.b),s.setXYZ(4,e.r,e.g,e.b),s.setXYZ(5,e.r,e.g,e.b),s.setXYZ(6,e.r,e.g,e.b),s.setXYZ(7,e.r,e.g,e.b),s.setXYZ(8,e.r,e.g,e.b),s.setXYZ(9,e.r,e.g,e.b),s.setXYZ(10,e.r,e.g,e.b),s.setXYZ(11,e.r,e.g,e.b),s.setXYZ(12,e.r,e.g,e.b),s.setXYZ(13,e.r,e.g,e.b),s.setXYZ(14,e.r,e.g,e.b),s.setXYZ(15,e.r,e.g,e.b),s.setXYZ(16,e.r,e.g,e.b),s.setXYZ(17,e.r,e.g,e.b),s.setXYZ(18,e.r,e.g,e.b),s.setXYZ(19,e.r,e.g,e.b),s.setXYZ(20,e.r,e.g,e.b),s.setXYZ(21,e.r,e.g,e.b),s.setXYZ(22,e.r,e.g,e.b),s.setXYZ(23,e.r,e.g,e.b),s.setXYZ(24,t.r,t.g,t.b),s.setXYZ(25,t.r,t.g,t.b),s.setXYZ(26,t.r,t.g,t.b),s.setXYZ(27,t.r,t.g,t.b),s.setXYZ(28,t.r,t.g,t.b),s.setXYZ(29,t.r,t.g,t.b),s.setXYZ(30,t.r,t.g,t.b),s.setXYZ(31,t.r,t.g,t.b),s.setXYZ(32,i.r,i.g,i.b),s.setXYZ(33,i.r,i.g,i.b),s.setXYZ(34,i.r,i.g,i.b),s.setXYZ(35,i.r,i.g,i.b),s.setXYZ(36,i.r,i.g,i.b),s.setXYZ(37,i.r,i.g,i.b),s.setXYZ(38,r.r,r.g,r.b),s.setXYZ(39,r.r,r.g,r.b),s.setXYZ(40,n.r,n.g,n.b),s.setXYZ(41,n.r,n.g,n.b),s.setXYZ(42,n.r,n.g,n.b),s.setXYZ(43,n.r,n.g,n.b),s.setXYZ(44,n.r,n.g,n.b),s.setXYZ(45,n.r,n.g,n.b),s.setXYZ(46,n.r,n.g,n.b),s.setXYZ(47,n.r,n.g,n.b),s.setXYZ(48,n.r,n.g,n.b),s.setXYZ(49,n.r,n.g,n.b),s.needsUpdate=!0}update(){let e=this.geometry,t=this.pointMap;Xn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),rs("c",t,e,Xn,0,0,-1),rs("t",t,e,Xn,0,0,1),rs("n1",t,e,Xn,-1,-1,-1),rs("n2",t,e,Xn,1,-1,-1),rs("n3",t,e,Xn,-1,1,-1),rs("n4",t,e,Xn,1,1,-1),rs("f1",t,e,Xn,-1,-1,1),rs("f2",t,e,Xn,1,-1,1),rs("f3",t,e,Xn,-1,1,1),rs("f4",t,e,Xn,1,1,1),rs("u1",t,e,Xn,.7,1.1,-1),rs("u2",t,e,Xn,-.7,1.1,-1),rs("u3",t,e,Xn,0,2,-1),rs("cf1",t,e,Xn,-1,0,1),rs("cf2",t,e,Xn,1,0,1),rs("cf3",t,e,Xn,0,-1,1),rs("cf4",t,e,Xn,0,1,1),rs("cn1",t,e,Xn,-1,0,-1),rs("cn2",t,e,Xn,1,0,-1),rs("cn3",t,e,Xn,0,-1,-1),rs("cn4",t,e,Xn,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function rs(e,t,i,r,n,s,a){LD.set(n,s,a).unproject(r);let o=t[e];if(void 0!==o){let e=i.getAttribute("position");for(let t=0,i=o.length;t<i;t++)e.setXYZ(o[t],LD.x,LD.y,LD.z)}}var HD,E4,FD=new Rt,Fx=class extends Kr{constructor(e,t=16776960){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),n=new ot;n.setIndex(new Wt(i,1)),n.setAttribute("position",new Wt(r,3)),super(n,new br({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&FD.setFromObject(this.object),FD.isEmpty())return;let t=FD.min,i=FD.max,r=this.geometry.attributes.position,n=r.array;n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=t.x,n[4]=i.y,n[5]=i.z,n[6]=t.x,n[7]=t.y,n[8]=i.z,n[9]=i.x,n[10]=t.y,n[11]=i.z,n[12]=i.x,n[13]=i.y,n[14]=t.z,n[15]=t.x,n[16]=i.y,n[17]=t.z,n[18]=t.x,n[19]=t.y,n[20]=t.z,n[21]=i.x,n[22]=t.y,n[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},$U=class extends Kr{constructor(e,t=16776960){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new ot;r.setIndex(new Wt(i,1)),r.setAttribute("position",new dt([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)),super(r,new br({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}},ZU=class extends Sr{constructor(e,t=1,i=16776960){let r=i,n=new ot;n.setAttribute("position",new dt([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere(),super(n,new br({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;let s=new ot;s.setAttribute("position",new dt([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new Je(s,new Xt({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},Bhe=new D,jc=class extends qt{constructor(e=new D(0,0,1),t=new D(0,0,0),i=1,r=16776960,n=.2*i,s=.2*n){super(),this.type="ArrowHelper",void 0===HD&&((HD=new ot).setAttribute("position",new dt([0,0,0,0,1,0],3)),(E4=new Hl(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Sr(HD,new br({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Je(E4,new Xt({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,n,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Bhe.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Bhe,t)}}setLength(e,t=.2*e,i=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},KU=class extends Kr{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=new ot;i.setAttribute("position",new dt(t,3)),i.setAttribute("color",new dt([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(i,new br({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,i){let r=new Ve,n=this.geometry.attributes.color.array;return r.set(e),r.toArray(n,0),r.toArray(n,3),r.set(t),r.toArray(n,6),r.toArray(n,9),r.set(i),r.toArray(n,12),r.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Hx=class{constructor(){this.type="ShapePath",this.color=new Ve,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ju,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,n,s){return this.currentPath.bezierCurveTo(e,t,i,r,n,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){let i=t.length,r=!1;for(let n=i-1,s=0;s<i;n=s++){let i=t[n],a=t[s],o=a.x-i.x,l=a.y-i.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=t[s],o=-o,a=t[n],l=-l),e.y<i.y||e.y>a.y)continue;if(e.y===i.y){if(e.x===i.x)return!0}else{let t=l*(e.x-i.x)-o*(e.y-i.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==i.y)continue;if(a.x<=e.x&&e.x<=i.x||i.x<=e.x&&e.x<=a.x)return!0}}return r}let i=Ps.isClockWise,r=this.subPaths;if(0===r.length)return[];let n,s,a,o=[];if(1===r.length)return s=r[0],a=new Fa,a.curves=s.curves,o.push(a),o;let l=!i(r[0].getPoints());l=e?!l:l;let h,u,c=[],p=[],d=[],f=0;p[f]=void 0,d[f]=[];for(let m=0,g=r.length;m<g;m++)s=r[m],h=s.getPoints(),n=i(h),n=e?!n:n,n?(!l&&p[f]&&f++,p[f]={s:new Fa,p:h},p[f].s.curves=s.curves,l&&f++,d[f]=[]):d[f].push({h:s,p:h[0]});if(!p[0])return function(e){let t=[];for(let i=0,r=e.length;i<r;i++){let r=e[i],n=new Fa;n.curves=r.curves,t.push(n)}return t}(r);if(p.length>1){let e=!1,i=0;for(let t=0,r=p.length;t<r;t++)c[t]=[];for(let r=0,n=p.length;r<n;r++){let n=d[r];for(let s=0;s<n.length;s++){let a=n[s],o=!0;for(let n=0;n<p.length;n++)t(a.p,p[n].p)&&(r!==n&&i++,o?(o=!1,c[n].push(a)):e=!0);o&&c[r].push(a)}}i>0&&!1===e&&(d=c)}for(let m=0,g=p.length;m<g;m++){a=p[m].s,o.push(a),u=d[m];for(let e=0,t=u.length;e<t;e++)a.holes.push(u[e].h)}return o}},Mp=ETt();function ETt(){let e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),r=new Uint32Array(512),n=new Uint32Array(512);for(let l=0;l<256;++l){let e=l-127;e<-27?(r[l]=0,r[256|l]=32768,n[l]=24,n[256|l]=24):e<-14?(r[l]=1024>>-e-14,r[256|l]=1024>>-e-14|32768,n[l]=-e-1,n[256|l]=-e-1):e<=15?(r[l]=e+15<<10,r[256|l]=e+15<<10|32768,n[l]=13,n[256|l]=13):e<128?(r[l]=31744,r[256|l]=64512,n[l]=24,n[256|l]=24):(r[l]=31744,r[256|l]=64512,n[l]=13,n[256|l]=13)}let s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let e=l<<13,t=0;for(;!(8388608&e);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,s[l]=e|t}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)32!==l&&(o[l]=1024);return{floatView:t,uint32View:i,baseTable:r,shiftTable:n,mantissaTable:s,exponentTable:a,offsetTable:o}}function TTt(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=is(e,-65504,65504),Mp.floatView[0]=e;let t=Mp.uint32View[0],i=t>>23&511;return Mp.baseTable[i]+((8388607&t)>>Mp.shiftTable[i])}function bTt(e){let t=e>>10;return Mp.uint32View[0]=Mp.mantissaTable[Mp.offsetTable[t]+(1023&e)]+Mp.exponentTable[t],Mp.floatView[0]}var tE=Object.freeze({__proto__:null,fromHalfFloat:bTt,toHalfFloat:TTt}),JU=class extends js{constructor(e,t,i,r,n,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,i,r,n,s)}},QU=class extends Cg{constructor(e,t,i,r){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,i,r)}},eB=class extends Ag{constructor(e,t,i,r){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,i,r)}},tB=class extends Og{constructor(e,t,i,r,n,s,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,i,r,n,s,a)}},rB=class extends Hl{constructor(e,t,i,r,n,s,a,o){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,i,r,n,s,a,o)}},iB=class extends Pg{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}},nB=class extends Vp{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}},sB=class extends Lg{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}},aB=class extends vf{constructor(e,t,i,r){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,i,r)}},oB=class extends yf{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}},lB=class extends En{constructor(e,t,i,r){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,i,r)}},cB=class extends Gc{constructor(e,t,i,r){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,i,r)}},uB=class extends Fg{constructor(e,t,i,r,n,s){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,i,r,n,s)}},hB=class extends Qu{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}},pB=class extends po{constructor(e,t,i,r,n,s,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,i,r,n,s,a)}},dB=class extends Hg{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}},fB=class extends zp{constructor(e,t,i,r,n){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,i,r,n)}},mB=class extends Ug{constructor(e,t,i,r,n,s){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,i,r,n,s)}},gB=class extends Bg{constructor(e,t,i,r,n){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,i,r,n)}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:EC}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=EC);var rh=new $i,jpe=new D,Wpe=new D,qpe=new D,Ype=new D;function RC(e,t,i,r,n,s,a){if(jpe.fromBufferAttribute(t,r).applyMatrix4(e.matrixWorld),Wpe.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld),i.ray.distanceSqToSegment(jpe,Wpe,Ype,qpe)>s)return!1;let o=i.ray.origin.distanceTo(Ype);return!(o<i.near||o>i.far)&&(a.push({distance:o,point:qpe.clone(),index:r,object:e}),!0)}Sr.prototype.raycast=function(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Line.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),rh.copy(i.boundingSphere),rh.applyMatrix4(r),rh.radius+=n,!1===e.ray.intersectsSphere(rh))return;let a=n*n,o=this.isLineSegments?2:1,l=i.index,h=i.attributes.position,u=t.length;if(null!==l){let i=this.userData.batches;if(i&&i.length>0&&i[0].boundingSphere)for(let n=0;n<i.length;n++){let s=i[n];if(rh.copy(s.boundingSphere),rh.applyMatrix4(r),!1!==e.ray.intersectsSphere(rh))for(let i=s.indexStart,r=s.indexStart+s.indexCount;i<r;i+=o)if(RC(this,h,e,l.getX(i),l.getX(i+1),a,t)&&(t[t.length-1].index=i,t.length-u>=1))return}else for(let r=Math.max(0,s.start),n=Math.min(l.count,s.start+s.count)-1;r<n;r+=o)if(RC(this,h,e,l.getX(r),l.getX(r+1),a,t)&&(t[t.length-1].index=r,t.length-u>=1))return}else{let i=this.userData.batches;if(i&&i.length>0&&i[0].boundingSphere)for(let n=0;n<i.length;n++){let s=i[n];if(rh.copy(s.boundingSphere),rh.applyMatrix4(r),!1!==e.ray.intersectsSphere(rh))for(let i=s.positionStart,r=s.positionStart+s.positionCount;i<r;i+=o)if(RC(this,h,e,i,i+1,a,t)&&t.length-u>=1)return}else for(let r=Math.max(0,s.start),n=Math.min(h.count,s.start+s.count)-1;r<n;r+=o)if(RC(this,h,e,r,r+1,a,t)&&t.length-u>=1)return}};var Xpe=Math.pow(2,-24),Wg=class{constructor(){}};function jl(e,t,i){return i.min.x=t[e],i.min.y=t[e+1],i.min.z=t[e+2],i.max.x=t[e+3],i.max.y=t[e+4],i.max.z=t[e+5],i}function DB(e){let t=-1,i=-1/0;for(let r=0;r<3;r++){let n=e[r+3]-e[r];n>i&&(i=n,t=r)}return t}function CB(e,t){t.set(e)}function AB(e,t,i){let r,n;for(let s=0;s<3;s++){let a=s+3;r=e[s],n=t[s],i[s]=r<n?r:n,r=e[a],n=t[a],i[a]=r>n?r:n}}function Vx(e,t,i){for(let r=0;r<3;r++){let n=t[e+2*r],s=t[e+2*r+1],a=n-s,o=n+s;a<i[r]&&(i[r]=a),o>i[r+3]&&(i[r+3]=o)}}function rE(e){let t=e[3]-e[0],i=e[4]-e[1],r=e[5]-e[2];return 2*(t*i+i*r+r*t)}function _Tt(e,t){if(!e.index){let i,r=e.attributes.position.count,n=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;i=r>65535?new Uint32Array(new n(4*r)):new Uint16Array(new n(2*r)),e.setIndex(new Wt(i,1));for(let e=0;e<r;e++)i[e]=e}}function STt(e){if(!e.groups||!e.groups.length)return[{offset:0,count:e.index.count/3}];let t=[],i=new Set;for(let n of e.groups)i.add(n.start),i.add(n.start+n.count);let r=Array.from(i.values()).sort(((e,t)=>e-t));for(let n=0;n<r.length-1;n++){let e=r[n],i=r[n+1];t.push({offset:e/3,count:(i-e)/3})}return t}function PB(e,t,i,r,n=null){let s=1/0,a=1/0,o=1/0,l=-1/0,h=-1/0,u=-1/0,c=1/0,p=1/0,d=1/0,f=-1/0,m=-1/0,g=-1/0,y=null!==n;for(let v=6*t,T=6*(t+i);v<T;v+=6){let t=e[v+0],i=e[v+1],r=t-i,n=t+i;r<s&&(s=r),n>l&&(l=n),y&&t<c&&(c=t),y&&t>f&&(f=t);let T=e[v+2],x=e[v+3],b=T-x,E=T+x;b<a&&(a=b),E>h&&(h=E),y&&T<p&&(p=T),y&&T>m&&(m=T);let _=e[v+4],w=e[v+5],S=_-w,M=_+w;S<o&&(o=S),M>u&&(u=M),y&&_<d&&(d=_),y&&_>g&&(g=_)}r[0]=s,r[1]=a,r[2]=o,r[3]=l,r[4]=h,r[5]=u,y&&(n[0]=c,n[1]=p,n[2]=d,n[3]=f,n[4]=m,n[5]=g)}function wTt(e,t,i,r){let n=1/0,s=1/0,a=1/0,o=-1/0,l=-1/0,h=-1/0;for(let u=6*t,c=6*(t+i);u<c;u+=6){let t=e[u+0];t<n&&(n=t),t>o&&(o=t);let i=e[u+2];i<s&&(s=i),i>l&&(l=i);let r=e[u+4];r<a&&(a=r),r>h&&(h=r)}r[0]=n,r[1]=s,r[2]=a,r[3]=o,r[4]=l,r[5]=h}function RTt(e,t,i,r,n){let s=i,a=i+r-1,o=n.pos,l=2*n.axis;for(;;){for(;s<=a&&t[6*s+l]<o;)s++;for(;s<=a&&t[6*a+l]>=o;)a--;if(!(s<a))return s;for(let i=0;i<3;i++){let r=e[3*s+i];e[3*s+i]=e[3*a+i],e[3*a+i]=r;let n=t[6*s+2*i+0];t[6*s+2*i+0]=t[6*a+2*i+0],t[6*a+2*i+0]=n;let o=t[6*s+2*i+1];t[6*s+2*i+1]=t[6*a+2*i+1],t[6*a+2*i+1]=o}s++,a--}}var Xp=32,MTt=(e,t)=>e.candidate-t.candidate,Sf=new Array(Xp).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),MC=new Float32Array(6);function DTt(e,t,i,r,n,s){let a=-1,o=0;if(0===s)a=DB(t),-1!==a&&(o=(t[a]+t[a+3])/2);else if(1===s)a=DB(e),-1!==a&&(o=CTt(i,r,n,a));else if(2===s){let s=rE(e),l=1.25*n,h=6*r,u=6*(r+n);for(let e=0;e<3;e++){let r=t[e],c=(t[e+3]-r)/Xp;if(n<Xp/4){let t=[...Sf];t.length=n;let r=0;for(let n=h;n<u;n+=6,r++){let s=t[r];s.candidate=i[n+2*e],s.count=0;let{bounds:a,leftCacheBounds:o,rightCacheBounds:l}=s;for(let e=0;e<3;e++)l[e]=1/0,l[e+3]=-1/0,o[e]=1/0,o[e+3]=-1/0,a[e]=1/0,a[e+3]=-1/0;Vx(n,i,a)}t.sort(MTt);let c=n;for(let e=0;e<c;e++){let i=t[e];for(;e+1<c&&t[e+1].candidate===i.candidate;)t.splice(e+1,1),c--}for(let n=h;n<u;n+=6){let r=i[n+2*e];for(let e=0;e<c;e++){let s=t[e];r>=s.candidate?Vx(n,i,s.rightCacheBounds):(Vx(n,i,s.leftCacheBounds),s.count++)}}for(let i=0;i<c;i++){let r=t[i],h=r.count,u=n-r.count,c=r.leftCacheBounds,p=r.rightCacheBounds,d=0;0!==h&&(d=rE(c)/s);let f=0;0!==u&&(f=rE(p)/s);let m=1+1.25*(d*h+f*u);m<l&&(a=e,l=m,o=r.candidate)}}else{for(let e=0;e<Xp;e++){let t=Sf[e];t.count=0,t.candidate=r+c+e*c;let i=t.bounds;for(let e=0;e<3;e++)i[e]=1/0,i[e+3]=-1/0}for(let n=h;n<u;n+=6){let t=~~((i[n+2*e]-r)/c);t>=Xp&&(t=Xp-1);let s=Sf[t];s.count++,Vx(n,i,s.bounds)}let t=Sf[Xp-1];CB(t.bounds,t.rightCacheBounds);for(let e=Xp-2;e>=0;e--){let t=Sf[e],i=Sf[e+1];AB(t.bounds,i.rightCacheBounds,t.rightCacheBounds)}let p=0;for(let i=0;i<Xp-1;i++){let t=Sf[i],r=t.count,h=t.bounds,u=Sf[i+1].rightCacheBounds;0!==r&&(0===p?CB(h,MC):AB(h,MC,MC)),p+=r;let c=0,d=0;0!==p&&(c=rE(MC)/s);let f=n-p;0!==f&&(d=rE(u)/s);let m=1+1.25*(c*p+d*f);m<l&&(a=e,l=m,o=t.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:a,pos:o}}function CTt(e,t,i,r){let n=0;for(let s=t,a=t+i;s<a;s++)n+=e[6*s+2*r];return n/i}function ATt(e,t){let i=e.attributes.position,r=e.index.array,n=r.length/3,s=new Float32Array(6*n),a=i.normalized,o=i.array,l=i.offset||0,h=3;i.isInterleavedBufferAttribute&&(h=i.data.stride);let u=["getX","getY","getZ"];for(let c=0;c<n;c++){let e,n,p,d=3*c,f=6*c;a?(e=r[d+0],n=r[d+1],p=r[d+2]):(e=r[d+0]*h+l,n=r[d+1]*h+l,p=r[d+2]*h+l);for(let r=0;r<3;r++){let l,h,c;a?(l=i[u[r]](e),h=i[u[r]](n),c=i[u[r]](p)):(l=o[e+r],h=o[n+r],c=o[p+r]);let d=l;h<d&&(d=h),c<d&&(d=c);let m=l;h>m&&(m=h),c>m&&(m=c);let g=(m-d)/2,y=2*r;s[f+y+0]=d+g,s[f+y+1]=g+(Math.abs(d)+g)*Xpe,d<t[r]&&(t[r]=d),m>t[r+3]&&(t[r+3]=m)}}return s}function OTt(e,t){function i(e){p&&p(e/d)}function r(t,n,p,d=null,m=0){if(!f&&m>=l&&(f=!0,h&&(console.warn(`MeshBVH: Max depth of ${l} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),p<=u||m>=l)return i(n+p),t.offset=n,t.count=p,t;let g=DTt(t.boundingData,d,a,n,p,c);if(-1===g.axis)return i(n+p),t.offset=n,t.count=p,t;let y=RTt(o,a,n,p,g);if(y===n||y===n+p)i(n+p),t.offset=n,t.count=p;else{t.splitAxis=g.axis;let e=new Wg,i=n,o=y-n;t.left=e,e.boundingData=new Float32Array(6),PB(a,i,o,e.boundingData,s),r(e,i,o,s,m+1);let l=new Wg,h=y,u=p-o;t.right=l,l.boundingData=new Float32Array(6),PB(a,h,u,l.boundingData,s),r(l,h,u,s,m+1)}return t}_Tt(e,t);let n=new Float32Array(6),s=new Float32Array(6),a=ATt(e,n),o=e.index.array,l=t.maxDepth,h=t.verbose,u=t.maxLeafTris,c=t.strategy,p=t.onProgress,d=e.index.count/3,f=!1,m=[],g=STt(e);if(1===g.length){let e=g[0],t=new Wg;t.boundingData=n,wTt(a,e.offset,e.count,s),r(t,e.offset,e.count,s),m.push(t)}else for(let y of g){let e=new Wg;e.boundingData=new Float32Array(6),PB(a,y.offset,y.count,e.boundingData,s),r(e,y.offset,y.count,s),m.push(e)}return m}function Kpe(e,t){let i,r,n,s=OTt(e,t),a=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;u<s.length;u++){let e=s[u],t=new o(32*l(e));i=new Float32Array(t),r=new Uint32Array(t),n=new Uint16Array(t),h(0,e),a.push(t)}return a;function l(e){return e.count?1:1+l(e.left)+l(e.right)}function h(e,t){let s=e/4,a=e/2,o=!!t.count,l=t.boundingData;for(let r=0;r<6;r++)i[s+r]=l[r];if(o){let i=t.offset,o=t.count;return r[s+6]=i,n[a+14]=o,n[a+15]=65535,e+32}{let i,n=t.left,a=t.right,o=t.splitAxis;if(i=h(e+32,n),i/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return r[s+6]=i/4,i=h(i,a),r[s+7]=o,i}}}var yo=class{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let i=1/0,r=-1/0;for(let n=0,s=e.length;n<s;n++){let s=e[n][t];i=s<i?s:i,r=s>r?s:r}this.min=i,this.max=r}setFromPoints(e,t){let i=1/0,r=-1/0;for(let n=0,s=t.length;n<s;n++){let s=t[n],a=e.dot(s);i=a<i?a:i,r=a>r?a:r}this.min=i,this.max=r}isSeparated(e){return this.min>e.max||e.min>this.max}};yo.prototype.setFromBox=function(){let e=new D;return function(t,i){let r=i.min,n=i.max,s=1/0,a=-1/0;for(let o=0;o<=1;o++)for(let i=0;i<=1;i++)for(let l=0;l<=1;l++){e.x=r.x*o+n.x*(1-o),e.y=r.y*i+n.y*(1-i),e.z=r.z*l+n.z*(1-l);let h=t.dot(e);s=Math.min(h,s),a=Math.max(h,a)}this.min=s,this.max=a}}();var ZYt=function(){let e=new yo;return function(t,i){let r=t.points,n=t.satAxes,s=t.satBounds,a=i.points,o=i.satAxes,l=i.satBounds;for(let h=0;h<3;h++){let t=s[h],i=n[h];if(e.setFromPoints(i,a),t.isSeparated(e))return!1}for(let h=0;h<3;h++){let t=l[h],i=o[h];if(e.setFromPoints(i,r),t.isSeparated(e))return!1}}}(),PTt=function(){let e=new D,t=new D,i=new D;return function(r,n,s){let a=r.start,o=e,l=n.start,h=t;i.subVectors(a,l),e.subVectors(r.end,r.start),t.subVectors(n.end,n.start);let u,c,p=i.dot(h),d=h.dot(o),f=h.dot(h),m=i.dot(o),g=o.dot(o)*f-d*d;u=0!==g?(p*d-m*f)/g:0,c=(p+u*d)/f,s.x=u,s.y=c}}(),zx=function(){let e=new ce,t=new D,i=new D;return function(r,n,s,a){PTt(r,n,e);let o=e.x,l=e.y;if(o>=0&&o<=1&&l>=0&&l<=1)return r.at(o,s),void n.at(l,a);if(o>=0&&o<=1)return l<0?n.at(0,a):n.at(1,a),void r.closestPointToPoint(a,!0,s);if(l>=0&&l<=1)return o<0?r.at(0,s):r.at(1,s),void n.closestPointToPoint(s,!0,a);{let e,h;e=o<0?r.start:r.end,h=l<0?n.start:n.end;let u=t,c=i;return r.closestPointToPoint(h,!0,t),n.closestPointToPoint(e,!0,i),u.distanceToSquared(h)<=c.distanceToSquared(e)?(s.copy(u),void a.copy(h)):(s.copy(e),void a.copy(c))}}}(),Jpe=function(){let e=new D,t=new D,i=new Ri,r=new Ga;return function(n,s){let{radius:a,center:o}=n,{a:l,b:h,c:u}=s;if(r.start=l,r.end=h,r.closestPointToPoint(o,!0,e).distanceTo(o)<=a||(r.start=l,r.end=u,r.closestPointToPoint(o,!0,e).distanceTo(o)<=a)||(r.start=h,r.end=u,r.closestPointToPoint(o,!0,e).distanceTo(o)<=a))return!0;let c=s.getPlane(i);if(Math.abs(c.distanceToPoint(o))<=a){let e=c.projectPoint(o,t);if(s.containsPoint(e))return!0}return!1}}(),NTt=1e-15;function iE(e){return Math.abs(e)<NTt}var Eo=class extends pn{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map((()=>new D)),this.satBounds=new Array(4).fill().map((()=>new yo)),this.points=[this.a,this.b,this.c],this.sphere=new $i,this.plane=new Ri,this.needsUpdate=!0}intersectsSphere(e){return Jpe(e,this)}update(){let e=this.a,t=this.b,i=this.c,r=this.points,n=this.satAxes,s=this.satBounds,a=n[0],o=s[0];this.getNormal(a),o.setFromPoints(a,r);let l=n[1],h=s[1];l.subVectors(e,t),h.setFromPoints(l,r);let u=n[2],c=s[2];u.subVectors(t,i),c.setFromPoints(u,r);let p=n[3],d=s[3];p.subVectors(i,e),d.setFromPoints(p,r),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}};Eo.prototype.closestPointToSegment=function(){let e=new D,t=new D,i=new Ga;return function(r,n=null,s=null){let a,{start:o,end:l}=r,h=this.points,u=1/0;for(let c=0;c<3;c++){let o=(c+1)%3;i.start.copy(h[c]),i.end.copy(h[o]),zx(i,r,e,t),a=e.distanceToSquared(t),a<u&&(u=a,n&&n.copy(e),s&&s.copy(t))}return this.closestPointToPoint(o,e),a=o.distanceToSquared(e),a<u&&(u=a,n&&n.copy(e),s&&s.copy(o)),this.closestPointToPoint(l,e),a=l.distanceToSquared(e),a<u&&(u=a,n&&n.copy(e),s&&s.copy(l)),Math.sqrt(u)}}(),Eo.prototype.intersectsTriangle=function(){let e=new Eo,t=new Array(3),i=new Array(3),r=new yo,n=new yo,s=new D,a=new D,o=new D,l=new D,h=new Ga,u=new Ga,c=new Ga;return function(p,d=null,f=!1){this.needsUpdate&&this.update(),p.isExtendedTriangle?p.needsUpdate&&p.update():(e.copy(p),e.update(),p=e);let m=this.plane,g=p.plane;if(Math.abs(m.normal.dot(g.normal))>1-1e-10){let e=this.satBounds,a=this.satAxes;i[0]=p.a,i[1]=p.b,i[2]=p.c;for(let t=0;t<4;t++){let n=e[t],s=a[t];if(r.setFromPoints(s,i),n.isSeparated(r))return!1}let o=p.satBounds,l=p.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let i=0;i<4;i++){let e=o[i],n=l[i];if(r.setFromPoints(n,t),e.isSeparated(r))return!1}for(let h=0;h<4;h++){let e=a[h];for(let a=0;a<4;a++){let o=l[a];if(s.crossVectors(e,o),r.setFromPoints(s,t),n.setFromPoints(s,i),r.isSeparated(n))return!1}}return d&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),d.start.set(0,0,0),d.end.set(0,0,0)),!0}{let e=this.points,t=!1,i=0;for(let o=0;o<3;o++){let r=e[o],n=e[(o+1)%3];h.start.copy(r),h.end.copy(n),h.delta(a);let s=t?u.start:u.end,l=iE(g.distanceToPoint(r));if(iE(g.normal.dot(a))&&l){u.copy(h),i=2;break}if((g.intersectLine(h,s)||l)&&!iE(s.distanceTo(n))){if(i++,t)break;t=!0}}if(1===i&&p.containsPoint(u.end))return d&&(d.start.copy(u.end),d.end.copy(u.end)),!0;if(2!==i)return!1;let r=p.points,n=!1,s=0;for(let a=0;a<3;a++){let e=r[a],t=r[(a+1)%3];h.start.copy(e),h.end.copy(t),h.delta(o);let i=n?c.start:c.end,l=iE(m.distanceToPoint(e));if(iE(m.normal.dot(o))&&l){c.copy(h),s=2;break}if((m.intersectLine(h,i)||l)&&!iE(i.distanceTo(t))){if(s++,n)break;n=!0}}if(1===s&&this.containsPoint(c.end))return d&&(d.start.copy(c.end),d.end.copy(c.end)),!0;if(2!==s)return!1;if(u.delta(a),c.delta(o),a.dot(o)<0){let e=c.start;c.start=c.end,c.end=e}let f=u.start.dot(a),y=u.end.dot(a),v=c.start.dot(a),T=c.end.dot(a);return(f===T||v===y||y<v!==f<T)&&(d&&(l.subVectors(u.start,c.start),l.dot(a)>0?d.start.copy(u.start):d.start.copy(c.start),l.subVectors(u.end,c.end),l.dot(a)<0?d.end.copy(u.end):d.end.copy(c.end)),!0)}}}(),Eo.prototype.distanceToPoint=function(){let e=new D;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),Eo.prototype.distanceToTriangle=function(){let e=new D,t=new D,i=["a","b","c"],r=new Ga,n=new Ga;return function(s,a=null,o=null){let l=a||o?r:null;if(this.intersectsTriangle(s,l))return(a||o)&&(a&&l.getCenter(a),o&&l.getCenter(o)),0;let h=1/0;for(let t=0;t<3;t++){let r,n=i[t],l=s[n];this.closestPointToPoint(l,e),r=l.distanceToSquared(e),r<h&&(h=r,a&&a.copy(e),o&&o.copy(l));let u=this[n];s.closestPointToPoint(u,e),r=u.distanceToSquared(e),r<h&&(h=r,a&&a.copy(u),o&&o.copy(e))}for(let u=0;u<3;u++){let l=i[u],c=i[(u+1)%3];r.set(this[l],this[c]);for(let u=0;u<3;u++){let l=i[u],c=i[(u+1)%3];n.set(s[l],s[c]),zx(r,n,e,t);let p=e.distanceToSquared(t);p<h&&(h=p,a&&a.copy(e),o&&o.copy(t))}}return Math.sqrt(h)}}();var To=class{constructor(e,t,i){this.isOrientedBox=!0,this.min=new D,this.max=new D,this.matrix=new Be,this.invMatrix=new Be,this.points=new Array(8).fill().map((()=>new D)),this.satAxes=new Array(3).fill().map((()=>new D)),this.satBounds=new Array(3).fill().map((()=>new yo)),this.alignedSatBounds=new Array(3).fill().map((()=>new yo)),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),i&&this.matrix.copy(i)}set(e,t,i){this.min.copy(e),this.max.copy(t),this.matrix.copy(i),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}};To.prototype.update=function(){let e=this.matrix,t=this.min,i=this.max,r=this.points;for(let l=0;l<=1;l++)for(let n=0;n<=1;n++)for(let s=0;s<=1;s++){let a=r[1*l|2*n|4*s];a.x=l?i.x:t.x,a.y=n?i.y:t.y,a.z=s?i.z:t.z,a.applyMatrix4(e)}let n=this.satBounds,s=this.satAxes,a=r[0];for(let l=0;l<3;l++){let e=s[l],t=n[l],i=r[1<<l];e.subVectors(a,i),t.setFromPoints(e,r)}let o=this.alignedSatBounds;o[0].setFromPointsField(r,"x"),o[1].setFromPointsField(r,"y"),o[2].setFromPointsField(r,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1},To.prototype.intersectsBox=function(){let e=new yo;return function(t){this.needsUpdate&&this.update();let i=t.min,r=t.max,n=this.satBounds,s=this.satAxes,a=this.alignedSatBounds;if(e.min=i.x,e.max=r.x,a[0].isSeparated(e)||(e.min=i.y,e.max=r.y,a[1].isSeparated(e))||(e.min=i.z,e.max=r.z,a[2].isSeparated(e)))return!1;for(let o=0;o<3;o++){let i=s[o],r=n[o];if(e.setFromBox(i,t),r.isSeparated(e))return!1}return!0}}(),To.prototype.intersectsTriangle=function(){let e=new Eo,t=new Array(3),i=new yo,r=new yo,n=new D;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(e.copy(s),e.update(),s=e);let a=this.satBounds,o=this.satAxes;t[0]=s.a,t[1]=s.b,t[2]=s.c;for(let e=0;e<3;e++){let r=a[e],n=o[e];if(i.setFromPoints(n,t),r.isSeparated(i))return!1}let l=s.satBounds,h=s.satAxes,u=this.points;for(let e=0;e<3;e++){let t=l[e],r=h[e];if(i.setFromPoints(r,u),t.isSeparated(i))return!1}for(let e=0;e<3;e++){let s=o[e];for(let e=0;e<4;e++){let a=h[e];if(n.crossVectors(s,a),i.setFromPoints(n,t),r.setFromPoints(n,u),i.isSeparated(r))return!1}}return!0}}(),To.prototype.closestPointToPoint=function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t},To.prototype.distanceToPoint=function(){let e=new D;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),To.prototype.distanceToBox=function(){let e=["x","y","z"],t=new Array(12).fill().map((()=>new Ga)),i=new Array(12).fill().map((()=>new Ga)),r=new D,n=new D;return function(s,a=0,o=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(o||l)&&(s.getCenter(n),this.closestPointToPoint(n,r),s.closestPointToPoint(r,n),o&&o.copy(r),l&&l.copy(n)),0;let h=a*a,u=s.min,c=s.max,p=this.points,d=1/0;for(let e=0;e<8;e++){let t=p[e];n.copy(t).clamp(u,c);let i=t.distanceToSquared(n);if(i<d&&(d=i,o&&o.copy(t),l&&l.copy(n),i<h))return Math.sqrt(i)}let f=0;for(let r=0;r<3;r++)for(let n=0;n<=1;n++)for(let s=0;s<=1;s++){let a=(r+1)%3,o=(r+2)%3,l=1<<r|n<<a|s<<o,h=p[n<<a|s<<o],d=p[l];t[f].set(h,d);let m=e[r],g=e[a],y=e[o],v=i[f],T=v.start,x=v.end;T[m]=u[m],T[g]=n?u[g]:c[g],T[y]=s?u[y]:c[g],x[m]=c[m],x[g]=n?u[g]:c[g],x[y]=s?u[y]:c[g],f++}for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)for(let i=0;i<=1;i++){n.x=e?c.x:u.x,n.y=t?c.y:u.y,n.z=i?c.z:u.z,this.closestPointToPoint(n,r);let s=n.distanceToSquared(r);if(s<d&&(d=s,o&&o.copy(r),l&&l.copy(n),s<h))return Math.sqrt(s)}for(let e=0;e<12;e++){let s=t[e];for(let e=0;e<12;e++){let t=i[e];zx(s,t,r,n);let a=r.distanceToSquared(n);if(a<d&&(d=a,o&&o.copy(r),l&&l.copy(n),a<h))return Math.sqrt(a)}}return Math.sqrt(d)}}();var CC=new D,AC=new D,OC=new D,Qpe=new ce,ede=new ce,tde=new ce,rde=new D;function LTt(e,t,i,r,n,s){let a;return a=s===$n?e.intersectTriangle(r,i,t,!0,n):e.intersectTriangle(t,i,r,s!==bi,n),null===a?null:{distance:e.origin.distanceTo(n),point:n.clone()}}function FTt(e,t,i,r,n,s,a){CC.fromBufferAttribute(t,r),AC.fromBufferAttribute(t,n),OC.fromBufferAttribute(t,s);let o=LTt(e,CC,AC,OC,rde,a);if(o){i&&(Qpe.fromBufferAttribute(i,r),ede.fromBufferAttribute(i,n),tde.fromBufferAttribute(i,s),o.uv=pn.getUV(rde,CC,AC,OC,Qpe,ede,tde,new ce));let e={a:r,b:n,c:s,normal:new D,materialIndex:0};pn.getNormal(CC,AC,OC,e.normal),o.face=e,o.faceIndex=r}return o}function LB(e,t,i,r,n){let s=3*r,a=e.index.getX(s),o=e.index.getX(s+1),l=e.index.getX(s+2),h=FTt(i,e.attributes.position,e.attributes.uv,a,o,l,t);return h?(h.faceIndex=r,n&&n.push(h),h):null}function ide(e,t,i,r,n,s){for(let a=r,o=r+n;a<o;a++)LB(e,t,i,a,s)}function nde(e,t,i,r,n){let s=1/0,a=null;for(let o=r,l=r+n;o<l;o++){let r=LB(e,t,i,o);r&&r.distance<s&&(a=r,s=r.distance)}return a}function FB(e,t,i){return null===e||(e.point.applyMatrix4(t.matrixWorld),e.distance=e.point.distanceTo(i.ray.origin),e.object=t,e.distance<i.near||e.distance>i.far)?null:e}function Wl(e,t,i,r){let n=e.a,s=e.b,a=e.c,o=t,l=t+1,h=t+2;i&&(o=i.getX(t),l=i.getX(t+1),h=i.getX(t+2)),n.x=r.getX(o),n.y=r.getY(o),n.z=r.getZ(o),s.x=r.getX(l),s.y=r.getY(l),s.z=r.getZ(l),a.x=r.getX(h),a.y=r.getY(h),a.z=r.getZ(h)}function HB(e,t,i,r,n,s,a){let o=i.index,l=i.attributes.position;for(let h=e,u=t+e;h<u;h++)if(Wl(a,3*h,o,l),a.needsUpdate=!0,r(a,h,n,s))return!0;return!1}var nE=class{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){let e=this._primitives;return 0===e.length?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}};function $p(e,t){return 65535===t[e+15]}function qg(e,t){return t[e+6]}function sE(e,t){return t[e+14]}function aE(e){return e+8}function oE(e,t){return t[e+6]}function sde(e,t){return t[e+7]}var lE=new Rt,NC=new D,UTt=["x","y","z"];function LC(e,t,i,r,n){let s=2*e,a=cE,o=wf,l=Rf;if($p(s,o))ide(t,i,r,qg(e,l),sE(s,o),n);else{let s=aE(e);HC(s,a,r,NC)&&LC(s,t,i,r,n);let o=oE(e,l);HC(o,a,r,NC)&&LC(o,t,i,r,n)}}function FC(e,t,i,r){let n=2*e,s=cE,a=wf,o=Rf;if($p(n,a))return nde(t,i,r,qg(e,o),sE(n,a));{let n,a,l=sde(e,o),h=UTt[l],u=r.direction[h]>=0;u?(n=aE(e),a=oE(e,o)):(n=oE(e,o),a=aE(e));let c=HC(n,s,r,NC)?FC(n,t,i,r):null;if(c){let e=c.point[h];if(u?e<=s[a+l]:e>=s[a+l+3])return c}let p=HC(a,s,r,NC)?FC(a,t,i,r):null;return c&&p?c.distance<=p.distance?c:p:c||p||null}}var ade=function(){let e,t,i=[],r=new nE((()=>new Rt));return function(...s){e=r.getPrimitive(),t=r.getPrimitive(),i.push(e,t);let a=n(...s);r.releasePrimitive(e),r.releasePrimitive(t),i.pop(),i.pop();let o=i.length;return o>0&&(t=i[o-1],e=i[o-2]),a};function n(i,r,s,a,o=null,l=0,h=0){function u(e){let t=2*e,i=wf,r=Rf;for(;!$p(t,i);)t=2*(e=aE(e));return qg(e,r)}function c(e){let t=2*e,i=wf,r=Rf;for(;!$p(t,i);)t=2*(e=oE(e,r));return qg(e,r)+sE(t,i)}let p=2*i,d=cE,f=wf,m=Rf;if($p(p,f)){let t=qg(i,m),r=sE(p,f);return jl(i,d,e),a(t,r,!1,h,l+i,e)}{let p,g,y,v,T=aE(i),x=oE(i,m),b=T,E=x;if(o&&(y=e,v=t,jl(b,d,y),jl(E,d,v),p=o(y),g=o(v),g<p)){b=x,E=T;let e=p;p=g,g=e,y=v}y||(y=e,jl(b,d,y));let _,w=s(y,$p(2*b,f),p,h+1,l+b);if(2===w){let e=u(b);_=a(e,c(b)-e,!0,h+1,l+b,y)}else _=w&&n(b,r,s,a,o,l,h+1);if(_)return!0;v=t,jl(E,d,v);let S,M=s(v,$p(2*E,f),g,h+1,l+E);if(2===M){let e=u(E);S=a(e,c(E)-e,!0,h+1,l+E,v)}else S=M&&n(E,r,s,a,o,l,h+1);return!!S}}}(),ode=function(){let e=new Eo,t=new Eo,i=new Be,r=new To,n=new To;return function s(a,o,l,h,u=null){let c=2*a,p=cE,d=wf,f=Rf;if(null===u&&(l.boundingBox||l.computeBoundingBox(),r.set(l.boundingBox.min,l.boundingBox.max,h),u=r),!$p(c,d)){let e=a+8,t=f[a+6];return jl(e,p,lE),!!(u.intersectsBox(lE)&&s(e,o,l,h,u)||(jl(t,p,lE),u.intersectsBox(lE)&&s(t,o,l,h,u)))}{let r=o,s=r.index,u=r.attributes.position,m=l.index,g=l.attributes.position,y=qg(a,f),v=sE(c,d);if(i.copy(h).invert(),l.boundsTree)return jl(a,p,n),n.matrix.copy(i),n.needsUpdate=!0,l.boundsTree.shapecast({intersectsBounds:e=>n.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(h),e.b.applyMatrix4(h),e.c.applyMatrix4(h),e.needsUpdate=!0;for(let i=3*y,r=3*(v+y);i<r;i+=3)if(Wl(t,i,s,u),t.needsUpdate=!0,e.intersectsTriangle(t))return!0;return!1}});for(let n=3*y,a=v+3*y;n<a;n+=3){Wl(e,n,s,u),e.a.applyMatrix4(i),e.b.applyMatrix4(i),e.c.applyMatrix4(i),e.needsUpdate=!0;for(let i=0,r=m.count;i<r;i+=3)if(Wl(t,i,m,g),t.needsUpdate=!0,e.intersectsTriangle(t))return!0}}}}();function HC(e,t,i,r){return jl(e,t,lE),i.intersectBox(lE,r)}var PC,cE,wf,Rf,UB=[];function uE(e){PC&&UB.push(PC),PC=e,cE=new Float32Array(e),wf=new Uint16Array(e),Rf=new Uint32Array(e)}function jx(){PC=null,cE=null,wf=null,Rf=null,UB.length&&uE(UB.pop())}var BB=Symbol("skip tree generation"),kB=new Rt,GB=new Rt,hE=new Be,Yg=new To,Wx=new To,qx=new D,UC=new D,BTt=new D,kTt=new D,GTt=new D,lde=new Rt,ih=new nE((()=>new Eo)),Wc=class{static serialize(e,t={}){if(t.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),Wc.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t=Mr({cloneBuffers:!0},t);let i,r=e.geometry,n=e._roots,s=r.getIndex();return i=t.cloneBuffers?{roots:n.map((e=>e.slice())),index:s.array.slice()}:{roots:n,index:s.array},i}static deserialize(e,t,i={}){if("boolean"==typeof i)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),Wc.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});i=Mr({setIndex:!0},i);let{index:r,roots:n}=e,s=new Wc(t,Ln(Mr({},i),{[BB]:!0}));if(s._roots=n,i.setIndex){let i=t.getIndex();if(null===i){let i=new Wt(e.index,1,!1);t.setIndex(i)}else i.array!==r&&(i.array.set(r),i.needsUpdate=!0)}return s}constructor(e,t={}){if(!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if((t=Object.assign({strategy:0,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[BB]:!1},t)).useSharedArrayBuffer&&"undefined"==typeof SharedArrayBuffer)throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[BB]||(this._roots=Kpe(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Rt))),this.geometry=e}refit(e=null){e&&Array.isArray(e)&&(e=new Set(e));let t,i,r,n,s=this.geometry,a=s.index.array,o=s.attributes.position,l=0,h=this._roots;for(let c=0,p=h.length;c<p;c++)t=h[c],i=new Uint32Array(t),r=new Uint16Array(t),n=new Float32Array(t),u(0,l),l+=t.byteLength;function u(t,s,l=!1){let h=2*t;if(65535===r[h+15]){let e=i[t+6],s=1/0,l=1/0,u=1/0,c=-1/0,p=-1/0,d=-1/0;for(let t=3*e,i=3*(e+r[h+14]);t<i;t++){let e=a[t],i=o.getX(e),r=o.getY(e),n=o.getZ(e);i<s&&(s=i),i>c&&(c=i),r<l&&(l=r),r>p&&(p=r),n<u&&(u=n),n>d&&(d=n)}return(n[t+0]!==s||n[t+1]!==l||n[t+2]!==u||n[t+3]!==c||n[t+4]!==p||n[t+5]!==d)&&(n[t+0]=s,n[t+1]=l,n[t+2]=u,n[t+3]=c,n[t+4]=p,n[t+5]=d,!0)}{let r=t+8,a=i[t+6],o=r+s,h=a+s,c=l,p=!1,d=!1;e?c||(p=e.has(o),d=e.has(h),c=!p&&!d):(p=!0,d=!0);let f=c||d,m=!1;(c||p)&&(m=u(r,s,c));let g=!1;f&&(g=u(a,s,c));let y=m||g;if(y)for(let e=0;e<3;e++){let i=r+e,s=a+e,o=n[i],l=n[i+3],h=n[s],u=n[s+3];n[t+e]=o<h?o:h,n[t+e+3]=l>u?l:u}return y}}}traverse(e,t=0){let i=this._roots[t],r=new Uint32Array(i),n=new Uint16Array(i);!function t(s,a=0){let o=2*s,l=65535===n[o+15];if(l){let t=r[s+6],h=n[o+14];e(a,l,new Float32Array(i,4*s,6),t,h)}else{let n=s+8,o=r[s+6],h=r[s+7];e(a,l,new Float32Array(i,4*s,6),h)||(t(n,a+1),t(o,a+1))}}(0)}raycast(e,t=Xi){let i=this._roots,r=this.geometry,n=[],s=t.isMaterial,a=Array.isArray(t),o=r.groups,l=s?t.side:t;for(let h=0,u=i.length;h<u;h++){let s=a?t[o[h].materialIndex].side:l,u=n.length;if(uE(i[h]),LC(0,r,s,e,n),jx(),a){let e=o[h].materialIndex;for(let t=u,i=n.length;t<i;t++)n[t].face.materialIndex=e}}return n}raycastFirst(e,t=Xi){let i=this._roots,r=this.geometry,n=t.isMaterial,s=Array.isArray(t),a=null,o=r.groups,l=n?t.side:t;for(let h=0,u=i.length;h<u;h++){let n=s?t[o[h].materialIndex].side:l;uE(i[h]);let u=FC(0,r,n,e);jx(),null!=u&&(null==a||u.distance<a.distance)&&(a=u,s&&(u.face.materialIndex=o[h].materialIndex))}return a}intersectsGeometry(e,t){let i=this.geometry,r=!1;for(let n of this._roots)if(uE(n),r=ode(0,i,e,t),jx(),r)break;return r}shapecast(e,t,i){let r=this.geometry;if(e instanceof Function){if(t){let e=t;t=(t,i,r,n)=>{let s=3*i;return e(t,s,s+1,s+2,r,n)}}e={boundsTraverseOrder:i,intersectsBounds:e,intersectsTriangle:t,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}let n=ih.getPrimitive(),{boundsTraverseOrder:s,intersectsBounds:a,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){let e=o;o=(t,i,s,a,o)=>!!e(t,i,s,a,o)||HB(t,i,r,l,s,a,n)}else o||(o=l?(e,t,i,s)=>HB(e,t,r,l,i,s,n):(e,t,i)=>i);let h=!1,u=0;for(let c of this._roots){if(uE(c),h=ade(0,r,a,o,s,u),jx(),h)break;u+=c.byteLength}return ih.releasePrimitive(n),h}bvhcast(e,t,i){let{intersectsRanges:r,intersectsTriangles:n}=i,s=this.geometry.index,a=this.geometry.attributes.position,o=e.geometry.index,l=e.geometry.attributes.position;hE.copy(t).invert();let h=ih.getPrimitive(),u=ih.getPrimitive();if(n){let e=function(e,i,r,c,p,d,f,m){for(let g=r,y=r+c;g<y;g++){Wl(u,3*g,o,l),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let t=e,r=e+i;t<r;t++)if(Wl(h,3*t,s,a),h.needsUpdate=!0,n(h,u,t,g,p,d,f,m))return!0}return!1};if(r){let t=r;r=function(i,r,n,s,a,o,l,h){return!!t(i,r,n,s,a,o,l,h)||e(i,r,n,s,a,o,l,h)}}else r=e}e.getBoundingBox(GB),GB.applyMatrix4(t);let c=this.shapecast({intersectsBounds:e=>GB.intersectsBox(e),intersectsRange:(t,i,n,s,a,o)=>(kB.copy(o),kB.applyMatrix4(hE),e.shapecast({intersectsBounds:e=>kB.intersectsBox(e),intersectsRange:(e,n,o,l,h)=>r(t,i,e,n,s,a,l,h)}))});return ih.releasePrimitive(h),ih.releasePrimitive(u),c}intersectsBox(e,t){return Yg.set(e.min,e.max,t),Yg.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Yg.intersectsBox(e),intersectsTriangle:e=>Yg.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,i={},r={},n=0,s=1/0){e.boundingBox||e.computeBoundingBox(),Yg.set(e.boundingBox.min,e.boundingBox.max,t),Yg.needsUpdate=!0;let a=this.geometry,o=a.attributes.position,l=a.index,h=e.attributes.position,u=e.index,c=ih.getPrimitive(),p=ih.getPrimitive(),d=UC,f=BTt,m=null,g=null;r&&(m=kTt,g=GTt);let y=1/0,v=null,T=null;return hE.copy(t).invert(),Wx.matrix.copy(hE),this.shapecast({boundsTraverseOrder:e=>Yg.distanceToBox(e),intersectsBounds:(e,t,i)=>i<y&&i<s&&(t&&(Wx.min.copy(e.min),Wx.max.copy(e.max),Wx.needsUpdate=!0),!0),intersectsRange:(i,r)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>Wx.distanceToBox(e),intersectsBounds:(e,t,i)=>i<y&&i<s,intersectsRange:(e,s)=>{for(let a=3*e,x=3*(e+s);a<x;a+=3){Wl(p,a,u,h),p.a.applyMatrix4(t),p.b.applyMatrix4(t),p.c.applyMatrix4(t),p.needsUpdate=!0;for(let e=3*i,t=3*(i+r);e<t;e+=3){Wl(c,e,l,o),c.needsUpdate=!0;let t=c.distanceToTriangle(p,d,m);if(t<y&&(f.copy(d),g&&g.copy(m),y=t,v=e/3,T=a/3),t<n)return!0}}}});for(let e=0,s=u?u.count:h.count;e<s;e+=3){Wl(p,e,u,h),p.a.applyMatrix4(t),p.b.applyMatrix4(t),p.c.applyMatrix4(t),p.needsUpdate=!0;for(let t=3*i,s=3*(i+r);t<s;t+=3){Wl(c,t,l,o),c.needsUpdate=!0;let i=c.distanceToTriangle(p,d,m);if(i<y&&(f.copy(d),g&&g.copy(m),y=i,v=t/3,T=e/3),i<n)return!0}}}}),ih.releasePrimitive(c),ih.releasePrimitive(p),y===1/0?null:(i.point?i.point.copy(f):i.point=f.clone(),i.distance=y,i.faceIndex=v,r&&(r.point?r.point.copy(g):r.point=g.clone(),r.point.applyMatrix4(hE),f.applyMatrix4(hE),r.distance=f.sub(r.point).length(),r.faceIndex=T),i)}closestPointToPoint(e,t={},i=0,r=1/0){let n=i*i,s=r*r,a=1/0,o=null;if(this.shapecast({boundsTraverseOrder:t=>(qx.copy(e).clamp(t.min,t.max),qx.distanceToSquared(e)),intersectsBounds:(e,t,i)=>i<a&&i<s,intersectsTriangle:(t,i)=>{t.closestPointToPoint(e,qx);let r=e.distanceToSquared(qx);return r<a&&(UC.copy(qx),a=r,o=i),r<n}}),a===1/0)return null;let l=Math.sqrt(a);return t.point?t.point.copy(UC):t.point=UC.clone(),t.distance=l,t.faceIndex=o,t}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach((t=>{jl(0,new Float32Array(t),lde),e.union(lde)})),e}},VB=new Ko,cde=new Be,VTt=Je.prototype.raycast;function zB(e,t){if(this.geometry.boundsTree){if(void 0===this.material)return;cde.copy(this.matrixWorld).invert(),VB.copy(e.ray).applyMatrix4(cde);let i=this.geometry.boundsTree;if(!0===e.firstHitOnly){let r=FB(i.raycastFirst(VB,this.material),this,e);r&&t.push(r)}else{let r=i.raycast(VB,this.material);for(let i=0,n=r.length;i<n;i++){let n=FB(r[i],this,e);n&&t.push(n)}}}else VTt.call(this,e,t)}var ude=new Be,pE=new Ko,jB=new $i,Mf=new D,Df=new D,Cf=new D,WB=new D,qB=new D,YB=new D,BC=new D,kC=new D,GC=new D,VC=new ce,zC=new ce,jC=new ce,XB=new D,WC=new D;function zTt(e,t,i,r,n,s,a,o){let l;if(l=t.side===$n?r.intersectTriangle(a,s,n,!0,o):r.intersectTriangle(n,s,a,t.side!==bi,o),null===l)return null;WC.copy(o),WC.applyMatrix4(e.matrixWorld);let h=i.ray.origin.distanceTo(WC);return h<i.near||h>i.far?null:{distance:h,point:WC.clone(),object:e}}function qC(e,t,i,r,n,s,a,o,l,h,u,c){Mf.fromBufferAttribute(n,h),Df.fromBufferAttribute(n,u),Cf.fromBufferAttribute(n,c);let p=e.morphTargetInfluences;if(s&&p){BC.set(0,0,0),kC.set(0,0,0),GC.set(0,0,0);for(let e=0,t=s.length;e<t;e++){let t=p[e],i=s[e];0!==t&&(WB.fromBufferAttribute(i,h),qB.fromBufferAttribute(i,u),YB.fromBufferAttribute(i,c),a?(BC.addScaledVector(WB,t),kC.addScaledVector(qB,t),GC.addScaledVector(YB,t)):(BC.addScaledVector(WB.sub(Mf),t),kC.addScaledVector(qB.sub(Df),t),GC.addScaledVector(YB.sub(Cf),t)))}Mf.add(BC),Df.add(kC),Cf.add(GC)}e.isSkinnedMesh&&(e.boneTransform(h,Mf),e.boneTransform(u,Df),e.boneTransform(c,Cf));let d=zTt(e,t,i,r,Mf,Df,Cf,XB);if(d){o&&(VC.fromBufferAttribute(o,h),zC.fromBufferAttribute(o,u),jC.fromBufferAttribute(o,c),d.uv=pn.getUV(XB,Mf,Df,Cf,VC,zC,jC,new ce)),l&&(VC.fromBufferAttribute(l,h),zC.fromBufferAttribute(l,u),jC.fromBufferAttribute(l,c),d.uv2=pn.getUV(XB,Mf,Df,Cf,VC,zC,jC,new ce));let e={a:h,b:u,c:c,normal:new D,materialIndex:0};pn.getNormal(Mf,Df,Cf,e.normal),d.face=e}return d}Je.prototype.raycast=function(e,t){let i=this.geometry,r=this.material,n=this.matrixWorld;if(void 0===r||(null===i.boundingSphere&&i.computeBoundingSphere(),jB.copy(i.boundingSphere),jB.applyMatrix4(n),!1===e.ray.intersectsSphere(jB))||(ude.copy(n).invert(),pE.copy(e.ray).applyMatrix4(ude),null!==i.boundingBox&&!1===pE.intersectsBox(i.boundingBox)))return;let s,a=i.index,o=i.attributes.position,l=i.morphAttributes.position,h=i.morphTargetsRelative,u=i.attributes.uv,c=i.attributes.uv2,p=i.groups,d=i.drawRange,f=t.length;if(null!==a)if(Array.isArray(r))for(let m=0,g=p.length;m<g;m++){let i=p[m],n=r[i.materialIndex];for(let r=Math.max(i.start,d.start),p=Math.min(a.count,Math.min(i.start+i.count,d.start+d.count));r<p;r+=3){let p=a.getX(r),d=a.getX(r+1),m=a.getX(r+2);if(s=qC(this,n,e,pE,o,l,h,u,c,p,d,m),s&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=i.materialIndex,t.push(s)),t.length-f>=1)return}}else for(let m=Math.max(0,d.start),g=Math.min(a.count,d.start+d.count);m<g;m+=3){let i=a.getX(m),n=a.getX(m+1),p=a.getX(m+2);if(s=qC(this,r,e,pE,o,l,h,u,c,i,n,p),s&&(s.faceIndex=Math.floor(m/3),t.push(s)),t.length-f>=1)return}else if(void 0!==o)if(Array.isArray(r))for(let m=0,g=p.length;m<g;m++){let i=p[m],n=r[i.materialIndex];for(let r=Math.max(i.start,d.start),a=Math.min(o.count,Math.min(i.start+i.count,d.start+d.count));r<a;r+=3)if(s=qC(this,n,e,pE,o,l,h,u,c,r,r+1,r+2),s&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=i.materialIndex,t.push(s)),t.length-f>=1)return}else for(let m=Math.max(0,d.start),g=Math.min(o.count,d.start+d.count);m<g;m+=3)if(s=qC(this,r,e,pE,o,l,h,u,c,m,m+1,m+2),s&&(s.faceIndex=Math.floor(m/3),t.push(s)),t.length-f>=1)return},Je.prototype.raycast=zB;var YC=new $i,XC=new D;function hde(e,t,i,r,n,s){let a=r.ray.distanceSqToPoint(e);if(a<i){let i=new D;r.ray.closestPointToPoint(e,i);let o=r.ray.origin.distanceTo(i);if(o<r.near||o>r.far)return;n.push({distance:o,distanceToRay:Math.sqrt(a),point:i,index:t,face:null,object:s})}}Bi.prototype.raycast=function(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Points.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),YC.copy(i.boundingSphere),YC.applyMatrix4(r),YC.radius+=n,!1===e.ray.intersectsSphere(YC))return;let a=n*n,o=i.index,l=i.attributes.position,h=t.length;if(null!==o)for(let u=Math.max(0,s.start),c=Math.min(o.count,s.start+s.count);u<c;u++){let i=o.getX(u);if(XC.fromBufferAttribute(l,i).applyMatrix4(r),hde(XC,i,a,e,t,this),t.length-h>=1)return}else for(let u=Math.max(0,s.start),c=Math.min(l.count,s.start+s.count);u<c;u++)if(XC.fromBufferAttribute(l,u).applyMatrix4(r),hde(XC,u,a,e,t,this),t.length-h>=1)return};var $B=class{constructor(){this.id=0,this.object=null,this.z=0,this.renderOrder=0}},Yx=class{constructor(){this.id=0,this.v1=new Af,this.v2=new Af,this.v3=new Af,this.normalModel=new D,this.vertexNormalsModel=[new D,new D,new D],this.vertexNormalsLength=0,this.color=new Ve,this.material=null,this.uvs=[new ce,new ce,new ce],this.z=0,this.renderOrder=0}},Af=class{constructor(){this.position=new D,this.positionWorld=new D,this.positionScreen=new jr,this.visible=!0}copy(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)}},Xx=class{constructor(){this.id=0,this.v1=new Af,this.v2=new Af,this.vertexColors=[new Ve,new Ve],this.material=null,this.z=0,this.renderOrder=0}},$x=class{constructor(){this.id=0,this.object=null,this.x=0,this.y=0,this.z=0,this.rotation=0,this.scale=new ce,this.material=null,this.renderOrder=0}},$C=class{constructor(){let e,t,i,r,n,s,a,o,l,h,u,c=0,p=0,d=0,f=0,m=0,g={objects:[],lights:[],elements:[]},y=new D,v=new jr,T=new Rt(new D(-1,-1,-1),new D(1,1,1)),x=new Rt,b=new Array(3),E=new Be,_=new Be,w=new Be,S=new na,M=[],I=[],A=[],R=[],C=[],O=new function(){let e=[],t=[],l=[],h=null,c=new Ui;function m(e){let t=e.position,i=e.positionWorld,r=e.positionScreen;i.copy(t).applyMatrix4(u),r.copy(i).applyMatrix4(_);let n=1/r.w;r.x*=n,r.y*=n,r.z*=n,e.visible=r.x>=-1&&r.x<=1&&r.y>=-1&&r.y<=1&&r.z>=-1&&r.z<=1}function E(e,t,i){return!0===e.visible||!0===t.visible||!0===i.visible||(b[0]=e.positionScreen,b[1]=t.positionScreen,b[2]=i.positionScreen,T.intersectsBox(x.setFromPoints(b)))}function S(e,t,i){return(i.positionScreen.x-e.positionScreen.x)*(t.positionScreen.y-e.positionScreen.y)-(i.positionScreen.y-e.positionScreen.y)*(t.positionScreen.x-e.positionScreen.x)<0}return{setObject:function(i){h=i,c.getNormalMatrix(h.matrixWorld),e.length=0,t.length=0,l.length=0},projectVertex:m,checkTriangleVisibility:E,checkBackfaceCulling:S,pushVertex:function(e,t,n){i=function(){if(r===p){let e=new Af;return I.push(e),p++,r++,e}return I[r++]}(),i.position.set(e,t,n),m(i)},pushNormal:function(t,i,r){e.push(t,i,r)},pushColor:function(e,i,r){t.push(e,i,r)},pushUv:function(e,t){l.push(e,t)},pushLine:function(e,i){let r=I[e],n=I[i];r.positionScreen.copy(r.position).applyMatrix4(w),n.positionScreen.copy(n.position).applyMatrix4(w),!0===function(e,t){let i=0,r=1,n=e.z+e.w,s=t.z+t.w,a=-e.z+e.w,o=-t.z+t.w;return n>=0&&s>=0&&a>=0&&o>=0||!(n<0&&s<0||a<0&&o<0)&&(n<0?i=Math.max(i,n/(n-s)):s<0&&(r=Math.min(r,n/(n-s))),a<0?i=Math.max(i,a/(a-o)):o<0&&(r=Math.min(r,a/(a-o))),!(r<i)&&(e.lerp(t,i),t.lerp(e,1-r),!0))}(r.positionScreen,n.positionScreen)&&(r.positionScreen.multiplyScalar(1/r.positionScreen.w),n.positionScreen.multiplyScalar(1/n.positionScreen.w),a=function(){if(o===f){let e=new Xx;return R.push(e),f++,o++,e}return R[o++]}(),a.id=h.id,a.v1.copy(r),a.v2.copy(n),a.z=Math.max(r.positionScreen.z,n.positionScreen.z),a.renderOrder=h.renderOrder,a.material=h.material,h.material.vertexColors&&(a.vertexColors[0].fromArray(t,3*e),a.vertexColors[1].fromArray(t,3*i)),g.elements.push(a))},pushTriangle:function(i,r,a,o){let u=I[i],p=I[r],f=I[a];if(!1!==E(u,p,f)&&(o.side===bi||!0===S(u,p,f))){n=function(){if(s===d){let e=new Yx;return A.push(e),d++,s++,e}return A[s++]}(),n.id=h.id,n.v1.copy(u),n.v2.copy(p),n.v3.copy(f),n.z=(u.positionScreen.z+p.positionScreen.z+f.positionScreen.z)/3,n.renderOrder=h.renderOrder,y.subVectors(f.position,p.position),v.subVectors(u.position,p.position),y.cross(v),n.normalModel.copy(y),n.normalModel.applyMatrix3(c).normalize();for(let t=0;t<3;t++){let i=n.vertexNormalsModel[t];i.fromArray(e,3*arguments[t]),i.applyMatrix3(c).normalize(),n.uvs[t].fromArray(l,2*arguments[t])}n.vertexNormalsLength=3,n.material=o,o.vertexColors&&n.color.fromArray(t,3*i),g.elements.push(n)}}}};function P(e){if(!1===e.visible)return;if(e.isLight)g.lights.push(e);else if(e.isMesh||e.isLine||e.isPoints){if(!1===e.material.visible||!0===e.frustumCulled&&!1===S.intersectsObject(e))return;N(e)}else if(e.isSprite){if(!1===e.material.visible||!0===e.frustumCulled&&!1===S.intersectsSprite(e))return;N(e)}let t=e.children;for(let i=0,r=t.length;i<r;i++)P(t[i])}function N(i){e=function(){if(t===c){let e=new $B;return M.push(e),c++,t++,e}return M[t++]}(),e.id=i.id,e.object=i,y.setFromMatrixPosition(i.matrixWorld),y.applyMatrix4(_),e.z=y.z,e.renderOrder=i.renderOrder,g.objects.push(e)}function L(e,t,i){let r=1/e.w;e.z*=r,e.z>=-1&&e.z<=1&&(l=function(){if(h===m){let e=new $x;return C.push(e),m++,h++,e}return C[h++]}(),l.id=t.id,l.x=e.x*r,l.y=e.y*r,l.z=e.z,l.renderOrder=t.renderOrder,l.object=t,l.rotation=t.rotation,l.scale.x=t.scale.x*Math.abs(l.x-(e.x+i.projectionMatrix.elements[0])/(e.w+i.projectionMatrix.elements[12])),l.scale.y=t.scale.y*Math.abs(l.y-(e.y+i.projectionMatrix.elements[5])/(e.w+i.projectionMatrix.elements[13])),l.material=t.material,g.elements.push(l))}function F(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id!==t.id?e.id-t.id:0}this.projectScene=function(e,i,n,a){s=0,o=0,h=0,g.elements.length=0,!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===i.parent&&!0===i.matrixWorldAutoUpdate&&i.updateMatrixWorld(),E.copy(i.matrixWorldInverse),_.multiplyMatrices(i.projectionMatrix,E),S.setFromProjectionMatrix(_),t=0,g.objects.length=0,g.lights.length=0,P(e),!0===n&&g.objects.sort(F);let l=g.objects;for(let t=0,s=l.length;t<s;t++){let e=l[t].object,n=e.geometry;if(O.setObject(e),u=e.matrixWorld,r=0,e.isMesh){let t=e.material,i=Array.isArray(t),r=n.attributes,s=n.groups;if(void 0===r.position)continue;let a=r.position.array;for(let o=0,l=a.length;o<l;o+=3){let t=a[o],i=a[o+1],r=a[o+2],s=n.morphAttributes.position;if(void 0!==s){let l=n.morphTargetsRelative,h=e.morphTargetInfluences;for(let e=0,n=s.length;e<n;e++){let n=h[e];if(0===n)continue;let u=s[e];l?(t+=u.getX(o/3)*n,i+=u.getY(o/3)*n,r+=u.getZ(o/3)*n):(t+=(u.getX(o/3)-a[o])*n,i+=(u.getY(o/3)-a[o+1])*n,r+=(u.getZ(o/3)-a[o+2])*n)}}O.pushVertex(t,i,r)}if(void 0!==r.normal){let e=r.normal.array;for(let t=0,i=e.length;t<i;t+=3)O.pushNormal(e[t],e[t+1],e[t+2])}if(void 0!==r.color){let e=r.color.array;for(let t=0,i=e.length;t<i;t+=3)O.pushColor(e[t],e[t+1],e[t+2])}if(void 0!==r.uv){let e=r.uv.array;for(let t=0,i=e.length;t<i;t+=2)O.pushUv(e[t],e[t+1])}if(null!==n.index){let r=n.index.array;if(s.length>0)for(let n=0;n<s.length;n++){let a=s[n];if(t=!0===i?e.material[a.materialIndex]:e.material,void 0!==t)for(let e=a.start,i=a.start+a.count;e<i;e+=3)O.pushTriangle(r[e],r[e+1],r[e+2],t)}else for(let e=0,i=r.length;e<i;e+=3)O.pushTriangle(r[e],r[e+1],r[e+2],t)}else if(s.length>0)for(let n=0;n<s.length;n++){let r=s[n];if(t=!0===i?e.material[r.materialIndex]:e.material,void 0!==t)for(let e=r.start,i=r.start+r.count;e<i;e+=3)O.pushTriangle(e,e+1,e+2,t)}else for(let e=0,n=a.length/3;e<n;e+=3)O.pushTriangle(e,e+1,e+2,t)}else if(e.isLine){w.multiplyMatrices(_,u);let t=n.attributes;if(void 0!==t.position){let i=t.position.array;for(let e=0,t=i.length;e<t;e+=3)O.pushVertex(i[e],i[e+1],i[e+2]);if(void 0!==t.color){let e=t.color.array;for(let t=0,i=e.length;t<i;t+=3)O.pushColor(e[t],e[t+1],e[t+2])}if(null!==n.index){let e=n.index.array;for(let t=0,i=e.length;t<i;t+=2)O.pushLine(e[t],e[t+1])}else{let t=e.isLineSegments?2:1;for(let e=0,r=i.length/3-1;e<r;e+=t)O.pushLine(e,e+1)}}}else if(e.isPoints){w.multiplyMatrices(_,u);let t=n.attributes;if(void 0!==t.position){let r=t.position.array;for(let t=0,n=r.length;t<n;t+=3)v.set(r[t],r[t+1],r[t+2],1),v.applyMatrix4(w),L(v,e,i)}}else e.isSprite&&(e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),v.set(u.elements[12],u.elements[13],u.elements[14],1),v.applyMatrix4(_),L(v,e,i))}return!0===a&&g.elements.sort(F),g}}},pde=class extends qt{constructor(e){super(),this.isSVGObject=!0,this.node=e}},dde=class{constructor(){let e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m=0,g=null,y=1,v=this,T=new ns,x=new ns,b=new Ve,E=new Ve,_=new Ve,w=new Ve,S=new Ve,M=new D,I=new D,A=new D,R=new Ui,C=new Be,O=new Be,P=[],N=new $C,L=document.createElementNS("http://www.w3.org/2000/svg","svg");function F(){for(m=0;L.childNodes.length>0;)L.removeChild(L.childNodes[0])}function U(e){return null!==g?e.toFixed(g):e}function k(e,t,i){let r=t.scale.x*s,n=t.scale.y*a;i.isPointsMaterial&&(r*=i.size,n*=i.size);let o="M"+U(e.x-.5*r)+","+U(e.y-.5*n)+"h"+U(r)+"v"+U(n)+"h"+U(-r)+"z",l="";(i.isSpriteMaterial||i.isPointsMaterial)&&(l="fill:"+i.color.getStyle()+";fill-opacity:"+i.opacity),H(l,o)}function B(e,t,i){let r="M"+U(e.positionScreen.x)+","+U(e.positionScreen.y)+"L"+U(t.positionScreen.x)+","+U(t.positionScreen.y);if(i.isLineBasicMaterial){let e="fill:none;stroke:"+i.color.getStyle()+";stroke-opacity:"+i.opacity+";stroke-width:"+i.linewidth+";stroke-linecap:"+i.linecap;i.isLineDashedMaterial&&(e=e+";stroke-dasharray:"+i.dashSize+","+i.gapSize),H(e,r)}}function z(e,t,r,n,s){v.info.render.vertices+=3,v.info.render.faces++;let a="M"+U(e.positionScreen.x)+","+U(e.positionScreen.y)+"L"+U(t.positionScreen.x)+","+U(t.positionScreen.y)+"L"+U(r.positionScreen.x)+","+U(r.positionScreen.y)+"z",o="";s.isMeshBasicMaterial?(b.copy(s.color),s.vertexColors&&b.multiply(n.color)):s.isMeshLambertMaterial||s.isMeshPhongMaterial||s.isMeshStandardMaterial?(E.copy(s.color),s.vertexColors&&E.multiply(n.color),b.copy(_),I.copy(e.positionWorld).add(t.positionWorld).add(r.positionWorld).divideScalar(3),function(e,t,i,r){for(let n=0,s=e.length;n<s;n++){let s=e[n],a=s.color;if(s.isDirectionalLight){let e=M.setFromMatrixPosition(s.matrixWorld).normalize(),t=i.dot(e);if(t<=0)continue;t*=s.intensity,r.r+=a.r*t,r.g+=a.g*t,r.b+=a.b*t}else if(s.isPointLight){let e=M.setFromMatrixPosition(s.matrixWorld),n=i.dot(M.subVectors(e,t).normalize());if(n<=0||(n*=0==s.distance?1:1-Math.min(t.distanceTo(e)/s.distance,1),0==n))continue;n*=s.intensity,r.r+=a.r*n,r.g+=a.g*n,r.b+=a.b*n}}}(i,I,n.normalModel,b),b.multiply(E).add(s.emissive)):s.isMeshNormalMaterial&&(A.copy(n.normalModel).applyMatrix3(R).normalize(),b.setRGB(A.x,A.y,A.z).multiplyScalar(.5).addScalar(.5)),o=s.wireframe?"fill:none;stroke:"+b.getStyle()+";stroke-opacity:"+s.opacity+";stroke-width:"+s.wireframeLinewidth+";stroke-linecap:"+s.wireframeLinecap+";stroke-linejoin:"+s.wireframeLinejoin:"fill:"+b.getStyle()+";fill-opacity:"+s.opacity,H(o,a)}function G(e,t,i){let r=t.x-e.x,n=t.y-e.y,s=r*r+n*n;if(0===s)return;let a=i/Math.sqrt(s);r*=a,n*=a,t.x+=r,t.y+=n,e.x-=r,e.y-=n}function H(e,t){p===e?c+=t:(V(),p=e,c=t)}function V(){var e;c&&(e=m++,null==P[e]&&(P[e]=document.createElementNS("http://www.w3.org/2000/svg","path"),0==y&&P[e].setAttribute("shape-rendering","crispEdges")),u=P[e],u.setAttribute("d",c),u.setAttribute("style",p),L.appendChild(u)),c="",p=""}this.domElement=L,this.autoClear=!0,this.sortObjects=!0,this.sortElements=!0,this.overdraw=.5,this.info={render:{vertices:0,faces:0}},this.setQuality=function(e){switch(e){case"high":y=1;break;case"low":y=0}},this.setClearColor=function(e,t){d=e,f=t},this.setPixelRatio=function(){},this.setSize=function(e,t){r=e,n=t,s=r/2,a=n/2,L.setAttribute("viewBox",-s+" "+-a+" "+r+" "+n),L.setAttribute("width",r),L.setAttribute("height",n),T.min.set(-s,-a),T.max.set(s,a)},this.getSize=function(){return{width:r,height:n}},this.setPrecision=function(e){g=e},this.clear=function(){if(F(),"number"==typeof d){let e=jTt(d);L.style.backgroundColor=`rgba(${e.r}, ${e.g}, ${e.b}, ${f})`}else L.style.backgroundColor=d.getStyle()},this.render=function(r,n){if(!(n instanceof Fp))return void console.error("THREE.SVGRenderer.render: camera is not an instance of Camera.");let u=r.background;u&&u.isColor?(F(),L.style.backgroundColor=u.getStyle()):!0===this.autoClear&&this.clear(),v.info.render.vertices=0,v.info.render.faces=0,C.copy(n.matrixWorldInverse),O.multiplyMatrices(n.projectionMatrix,C),e=N.projectScene(r,n,this.sortObjects,this.sortElements),t=e.elements,i=e.lights,R.getNormalMatrix(n.matrixWorldInverse),function(e){_.setRGB(0,0,0),w.setRGB(0,0,0),S.setRGB(0,0,0);for(let t=0,i=e.length;t<i;t++){let i=e[t],r=i.color;i.isAmbientLight?(_.r+=r.r,_.g+=r.g,_.b+=r.b):i.isDirectionalLight?(w.r+=r.r,w.g+=r.g,w.b+=r.b):i.isPointLight&&(S.r+=r.r,S.g+=r.g,S.b+=r.b)}}(i),c="",p="";for(let e=0,i=t.length;e<i;e++){let i=t[e],r=i.material;if(void 0!==r&&0!==r.opacity)if(x.makeEmpty(),i instanceof $x)o=i,o.x*=s,o.y*=-a,k(o,i,r);else if(i instanceof Xx)o=i.v1,l=i.v2,o.positionScreen.x*=s,o.positionScreen.y*=-a,l.positionScreen.x*=s,l.positionScreen.y*=-a,x.setFromPoints([o.positionScreen,l.positionScreen]),!0===T.intersectsBox(x)&&B(o,l,r);else if(i instanceof Yx){if(o=i.v1,l=i.v2,h=i.v3,o.positionScreen.z<-1||o.positionScreen.z>1||l.positionScreen.z<-1||l.positionScreen.z>1||h.positionScreen.z<-1||h.positionScreen.z>1)continue;o.positionScreen.x*=s,o.positionScreen.y*=-a,l.positionScreen.x*=s,l.positionScreen.y*=-a,h.positionScreen.x*=s,h.positionScreen.y*=-a,this.overdraw>0&&(G(o.positionScreen,l.positionScreen,this.overdraw),G(l.positionScreen,h.positionScreen,this.overdraw),G(h.positionScreen,o.positionScreen,this.overdraw)),x.setFromPoints([o.positionScreen,l.positionScreen,h.positionScreen]),!0===T.intersectsBox(x)&&z(o,l,h,i,r)}}V(),r.traverseVisible((function(e){if(e.isSVGObject){if(M.setFromMatrixPosition(e.matrixWorld),M.applyMatrix4(O),M.z<-1||M.z>1)return;let t=M.x*s,i=-M.y*a,r=e.node;r.setAttribute("transform",`translate(${t}, ${i}) rotate(${e.rotation.z})`),L.appendChild(r)}}))}}};function jTt(e){let t={};return t.r=(e>>16&255)/255,t.g=(e>>8&255)/255,t.b=(255&e)/255,t}var fE=class extends qt{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}},dE=new D,fde=new Be,mde=new Be,gde=new D,vde=new D,nh=class{constructor(e={}){let t,i,r,n,s=this,a={objects:new WeakMap},o=void 0!==e.element?e.element:document.createElement("div");function l(e,t,i){if(e.isCSS2DObject){dE.setFromMatrixPosition(e.matrixWorld),dE.applyMatrix4(mde);let l=!0===e.visible&&dE.z>=-1&&dE.z<=1&&!0===e.layers.test(i.layers);if(e.element.style.display=!0===l?"":"none",!0===l){e.onBeforeRender(s,t,i);let a=e.element;a.style.transform="translate(-50%,-50%) translate("+(dE.x*r+r)+"px,"+(-dE.y*n+n)+"px)",a.parentNode!==o&&o.appendChild(a),e.onAfterRender(s,t,i)}let u={distanceToCameraSquared:h(i,e)};a.objects.set(e,u)}for(let r=0,n=e.children.length;r<n;r++)l(e.children[r],t,i)}function h(e,t){return gde.setFromMatrixPosition(e.matrixWorld),vde.setFromMatrixPosition(t.matrixWorld),gde.distanceToSquared(vde)}o.style.overflow="hidden",this.domElement=o,this.getSize=function(){return{width:t,height:i}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),fde.copy(t.matrixWorldInverse),mde.multiplyMatrices(t.projectionMatrix,fde),l(e,e,t),function(e){let t=function(e){let t=[];return e.traverse((function(e){e.isCSS2DObject&&t.push(e)})),t}(e).sort((function(e,t){return e.renderOrder!==t.renderOrder?t.renderOrder-e.renderOrder:a.objects.get(e).distanceToCameraSquared-a.objects.get(t).distanceToCameraSquared})),i=t.length;for(let r=0,n=t.length;r<n;r++)t[r].element.style.zIndex=i-r}(e)},this.setSize=function(e,s){t=e,i=s,r=t/2,n=i/2,o.style.width=e+"px",o.style.height=s+"px"}}},mE=class extends qt{constructor(e=!0,t=!1){super(),this.name="COORDINATE_AXES",this.AXIS_LENGTH=1,this.AXIS_COLOR_X=16711680,this.AXIS_COLOR_Y=65280,this.AXIS_COLOR_Z=255;let i=new D(0,0,0),r=new D(1,0,0),n=new D(0,1,0),s=new jc(r,i,this.AXIS_LENGTH,this.AXIS_COLOR_X,0,0),a=new jc(n,i,this.AXIS_LENGTH,this.AXIS_COLOR_Y,0,0);if(this.add(s,a),!t){let e=new D(0,0,1),t=new jc(e,i,this.AXIS_LENGTH,this.AXIS_COLOR_Z,0,0);this.add(t)}e&&this.addTexts(t)}addTexts(e=!1){let t=this.createText("X","#ff0000"),i=this.createText("Y","#00ff00");if(t.position.set(this.AXIS_LENGTH+.1,0,0),i.position.set(.1,this.AXIS_LENGTH,.1),this.add(t,i),!e){let e=this.createText("Z","#0000ff");e.position.set(0,0,this.AXIS_LENGTH+.1),this.add(e)}}createText(e,t,i=14){let r=document.createElement("div");r.innerHTML=e;let n=r.style;return n.color=t,n.width=`${i}px`,n.height=`${i}px`,n.textAlign="center",n.top="0px",n.left="0px",new fE(r)}},Of=class{constructor(e,t,i=!1){this.ignoreZAxis=!1,this.height=100,this.width=100,this.container=e,this.hostCamera=t,this.width=e.clientWidth||this.width,this.height=e.clientHeight||this.height,this.ignoreZAxis=i,this.init()}init(){this.initRenderer(),this.initScene(),this.animate()}initRenderer(){this.renderer=new go({antialias:!0,alpha:!0}),this.renderer.setSize(this.width,this.height),this.container.appendChild(this.renderer.domElement),this.css2dRenderer=new nh,this.css2dRenderer.setSize(this.width,this.height),this.css2dRenderer.domElement.style.height="0",this.css2dRenderer.domElement.style.width="0",this.container.appendChild(this.css2dRenderer.domElement)}initScene(){this.scene=new wn,this.camera=new Ni(-1,1,1,-1,.1,100),this.scene.add(this.camera),this.coordinateAxes=new mE(!0,this.ignoreZAxis),this.scene.add(this.coordinateAxes)}setHostCamera(e){this.hostCamera=e}render(){var e;!this.scene||!this.camera||(this.renderer&&(this.update(),this.renderer.render(this.scene,this.camera)),null==(e=this.css2dRenderer)||e.render(this.scene,this.camera))}animate(){requestAnimationFrame(this.animate.bind(this)),this.render()}update(){if(!this.hostCamera)return;let e=this.hostCamera;if(e){let t=new D;e.getWorldDirection(t);let i=e.up;this.updateCameraDirection(t,i)}}updateCameraDirection(e,t){if(!this.camera||!e)return;e.normalize();let i=.3;this.camera.position.set(2*-e.x+i,2*-e.y+i,2*-e.z+i),this.camera.lookAt(i,i,i),this.camera.up=t}dispose(){!this.scene||!this.camera||!this.coordinateAxes||(this.scene.clear(),this.scene=void 0,this.css2dRenderer&&(this.container.removeChild(this.css2dRenderer.domElement),this.css2dRenderer=void 0),this.renderer&&(this.container.removeChild(this.renderer.domElement),this.renderer.dispose(),this.renderer.forceContextLoss(),this.renderer=void 0),this.hostCamera=void 0,this.camera=void 0,this.coordinateAxes=void 0)}},ZC=class{constructor(e){this.isCanceled=!1;let t=new Promise(((e,t)=>{this.cancelReject=t}));this.promise=Promise.race([t,e])}cancel(){this.cancelReject&&this.cancelReject({type:"cancel"})}},WTt=ps(Ede(),1),re=WTt;re.setLevel("warn");var Tde=e=>{try{re.setLevel(e)}catch(e){re.setLevel("error"),re.error(e)}},ZB=class{static isTouchScreenDevice(){return"ontouchstart"in window}static printDeviceInfo(){let e=navigator.userAgent,t=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),r=/(?:Chrome|CriOS)/.test(e),n=/(?:iPad|PlayBook)/.test(e)||t&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!n,a=!s&&!t,o=ZB.isTouchScreenDevice();t&&re.debug("[DI] is android"),i&&re.debug("[DI] is fireFox"),r&&re.debug("[DI] is chrome"),n&&re.debug("[DI] is tablet"),s&&re.debug("[DI] is iPhone"),a&&re.debug("[DI] is PC"),o&&re.debug("[DI] is touch device")}static creatReactNativeCanvas(e){let t=e.drawingBufferWidth||e.width||0,i=e.drawingBufferHeight||e.height||0;return{style:{},width:t,height:i,clientWidth:Math.ceil(t/(window.devicePixelRatio||1)),clientHeight:Math.ceil(i/(window.devicePixelRatio||1)),addEventListener:()=>{},removeEventListener:()=>{}}}},xr=ZB;xr.isMobile=/mobile/i.test(navigator.userAgent),xr.isBrowser="undefined"!=typeof document,xr.isNode="undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process);var Tt=class{static isFullScreen(){return!(!document.fullscreenElement&&!document.mozFullScreenElement)}static fullScreen(e=document.documentElement){(e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen||e.msRequestFullscreen).call(e)}static exitFullscreen(){(document.exitFullscreen||document.mozCancelFullscreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)}static joinStrings(...e){return e.join("")}static numberToString(e){let t=2;return Math.abs(e)<1e-6?t=2:Math.abs(e)<1e-5?t=7:Math.abs(e)<1e-4?t=6:Math.abs(e)<.001?t=5:Math.abs(e)<.01?t=4:Math.abs(e)<.1&&(t=3),e.toFixed(t)}static hexToBase64(e){return btoa((e.match(/\w{2}/g)||[]).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))}static vectorToString(e){return e instanceof D?`(${this.numberToString(e.x)}, ${this.numberToString(e.y)}, ${this.numberToString(e.z)})`:`(${this.numberToString(e.x)}, ${this.numberToString(e.y)})`}static arrayToVector2(e){return e?e instanceof ce?e:Array.isArray(e)&&e.length>=2?new ce(e[0],e[1]):void 0:e}static arrayToVector3(e){return e?e instanceof D?e:Array.isArray(e)&&e.length>=2?new D(e[0],e[1],e.length>2?e[2]:0):void 0:e}static arrayToEuler(e){return e?e instanceof _r?e:Array.isArray(e)&&e.length>=3?new _r(e[0],e[1],e[2]):void 0:e}static arrayOrObjectToVector3(e){if(!e)return e;if(e instanceof D)return e;if(e instanceof ce)return new D(e.x,e.y,0);if(Array.isArray(e)&&e.length>=2)return new D(e[0],e[1],e[2]||0);let t=e;return null!=t.x&&null!=t.y?new D(t.x,t.y,t.z||0):void 0}static isVectorValid(e){let t=e&&!isNaN(e.x)&&!isNaN(e.y)&&isFinite(e.x)&&isFinite(e.y);return t&&e instanceof D&&(t=!isNaN(e.z)&&isFinite(e.z)),t}static isBoxValid(e){return e&&!e.isEmpty()&&this.isVectorValid(e.min)&&this.isVectorValid(e.max)}static isMatrixValid(e){let t=e&&e.elements;if(!t||t.length<16)return!1;for(let i=0;i<16;++i){let e=t[i];if(Number.isNaN(e))return!1}return!0}static guid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}static expandBoxByScale(e,t){let i=new D;e.getCenter(i);let r=(e.max.x-e.min.x)*t,n=(e.max.y-e.min.y)*t,s=(e.max.z-e.min.z)*t,a=new D(i.x-r/2,i.y-n/2,i.z-s/2),o=new D(i.x+r/2,i.y+n/2,i.z+s/2);e.set(a,o)}static expandBoxByMinSize(e,t){let i=new D;e.getCenter(i);let r=e.max.x-e.min.x,n=e.max.y-e.min.y,s=e.max.z-e.min.z;r<t&&(e.min.setX(i.x-t/2),e.max.setX(i.x+t/2)),n<t&&(e.min.setY(i.y-t/2),e.max.setY(i.y+t/2)),s<t&&(e.min.setZ(i.z-t/2),e.max.setZ(i.z+t/2))}static generateRandomInt(e,t){return Math.floor(Math.random()*(t-e+1))+e}static roundNumber(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}static convertDecimalToHex(e){return null==e?"#ffffff":`#${e.toString(16).padStart(6,"0")}`}static canvasToImage(e){let t=e.toDataURL(),i=new Image;return i.src=t,new Promise((e=>{i.onload=function(){e(i)}}))}static renderingContextToImage(e,t,i="image/png",r=.8){if(t){let n=Math.max(t.min.x,0),s=Math.max(t.min.y,0),a=Math.max(t.max.x-n,0),o=Math.max(t.max.y-s,0),l=e.getImageData(n,s,a,o),h=document.createElement("canvas");return h.width=a,h.height=o,h.getContext("2d").putImageData(l,0,0),h.toDataURL(i,r)}return e.canvas.toDataURL(i,r)}static printMemory(e){if(xr.isBrowser){let t=performance.memory;if(!t)return void re.warn("[CommonUtils] performance.memory is not available in this browser");let i=(t.jsHeapSizeLimit/1048576).toFixed(2),r=(t.totalJSHeapSize/1048576).toFixed(2),n=(t.usedJSHeapSize/1048576).toFixed(2);re.info(`[CommonUtils] ${e}. jsHeapSizeLimit: ${i}M , totalJSHeapSize: ${r}M , usedJSHeapSize: ${n}M `)}}static printGpuInfo(e){if(xr.isBrowser){let t=e.getExtension("webgl_debug_renderer_info"),i=e.getParameter(t.UNMASKED_RENDERER_WEBGL);re.info("[CommonUtils] gpu:",i)}}static sleep(e){return ct(this,null,(function*(){let t;return new Promise((i=>{t=setTimeout((()=>{i("")}),e)})).then((()=>{clearTimeout(t)}))}))}static twinkle(e,t=500){return ct(this,null,(function*(){let i=this.twinklingObjectIds;i[e.id]||(i[e.id]=!0,e.visible=!e.visible,yield this.sleep(t),e.visible=!e.visible,yield this.sleep(t),e.visible=!e.visible,yield this.sleep(t),e.visible=!e.visible,yield this.sleep(t),e.visible=!e.visible,yield this.sleep(t),e.visible=!e.visible,delete i[e.id])}))}};Tt.twinklingObjectIds={};var JC=(e,t,i)=>{let{default:r,active:n}=t;i?(e.remove(r),e.add(n||r)):(n&&e.remove(n),e.add(r))},xi=class{static getScreenPointByEvent(e,t){let i=new ce,{left:r,top:n}=t.getBoundingClientRect();return i.x=e.clientX-r,i.y=e.clientY-n,i}static getScreenPointByTouchEvent(e,t){let i=new ce,{left:r,top:n}=t.getBoundingClientRect();return i.x=e.touches[0].clientX-r,i.y=e.touches[0].clientY-n,i}static worldPosition2ScreenPoint(e,t,i){let{clientWidth:r,clientHeight:n}=i,s=e.clone(),a=new ce;return s.project(t),a.x=Math.round((.5+s.x/2)*r),a.y=Math.round((.5-s.y/2)*n),a}static screenPoint2worldPosition(e,t,i){let r=xi.screenPoint2NdcPoint(e,t,i);return new D(r.x,r.y,1).unproject(t)}static screenPoint2NdcPoint(e,t,i){let{clientWidth:r,clientHeight:n}=i,s=new ce;return s.x=e.x/r*2-1,s.y=-e.y/n*2+1,s}},sh=class{static createCSS2DObject(e){let t=new fE(e);return e.dataset.objectId=t.id.toString(),t}static createDefaultHotpoint(e=12){let t=document.createElement("div"),i=t.style;return i.width=`${e}px`,i.height=`${e}px`,i.opacity="0.8",i.cursor="pointer",i.top=-e/2+"px",i.left=-e/2+"px",i.backgroundColor="#ffffff",i.border="2px solid #00DAB7",i.borderRadius="50%",this.createCSS2DObject(t)}static createHotpoint(e){if(e){let t=document.createElement("div"),i=t.style;return i.top="0px",i.left="0px",t.innerHTML=e,this.createCSS2DObject(t)}return this.createDefaultHotpoint()}static createLabel(e,t=""){let i=document.createElement("div");if(i.innerHTML=e,t)i.classList.add(t);else{let e=i.style;e.padding="5px 9px",e.color="#ffffffdd",e.fontSize="12px",e.position="absolute",e.backgroundColor="rgba(0, 0, 0, 0.3)",e.borderRadius="12px",e.cursor="pointer",e.top="0px",e.left="0px"}return this.createCSS2DObject(i)}static tryFindObjectId(e){if(null!=e.dataset.objectId)return parseInt(e.dataset.objectId);let t=e.parentElement;return!t||t instanceof HTMLBodyElement?void 0:this.tryFindObjectId(t)}},gE={unit:"file",decimalPrecision:99,camera:{near:.1,far:3e4},mouse:{sensitivity:3},keyboard:{sensitivity:3}},bde={"Precision from file":99,"0(1)":0,"0.1(1/2)":1,"0.01(1/4)":2,"0.001(1/8)":3,"0.0001(1/16)":4,"0.00001(1/32)":5,"0.000001(1/64)":6},ah=(e,t)=>e.toFixed(t===bde["Precision from file"]?2:t),Ls=class{constructor(){this.map=new Map}addEventListener(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}dispatchEvent(e,t={}){let i=this.map.get(e);i&&[...i].forEach((e=>e(t)))}hasEventListener(e){return!!this.map.get(e)}removeEventListener(e,t){if(!e)return void this.map.clear();if(!t)return void this.map.delete(e);let i=this.map.get(e);i&&i.delete(t)}clearEventListeners(e){this.map.delete(e)}clearAllEventListener(){this.map.clear()}},sa=class{parse(e,t={}){if(t=Object.assign({decodeSpeed:5,encodeSpeed:5,encoderMethod:sa.MESH_EDGEBREAKER_ENCODING,quantization:[16,8,8,8,8],exportUvs:!0,exportNormals:!0,exportColor:!1},t),void 0===DracoEncoderModule)throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");let i,r,n=e.geometry,s=DracoEncoderModule(),a=new s.Encoder;if(!0===e.isMesh){i=new s.MeshBuilder,r=new s.Mesh;let e=n.getAttribute("position");i.AddFloatAttributeToMesh(r,s.POSITION,e.count,e.itemSize,e.array);let a=n.getIndex();if(null!==a)i.AddFacesToMesh(r,a.count/3,a.array);else{let t=new(e.count>65535?Uint32Array:Uint16Array)(e.count);for(let e=0;e<t.length;e++)t[e]=e;i.AddFacesToMesh(r,e.count,t)}if(!0===t.exportNormals){let e=n.getAttribute("normal");void 0!==e&&i.AddFloatAttributeToMesh(r,s.NORMAL,e.count,e.itemSize,e.array)}if(!0===t.exportUvs){let e=n.getAttribute("uv");void 0!==e&&i.AddFloatAttributeToMesh(r,s.TEX_COORD,e.count,e.itemSize,e.array)}if(!0===t.exportColor){let e=n.getAttribute("color");void 0!==e&&i.AddFloatAttributeToMesh(r,s.COLOR,e.count,e.itemSize,e.array)}}else{if(!0!==e.isPoints)throw new Error("DRACOExporter: Unsupported object type.");{i=new s.PointCloudBuilder,r=new s.PointCloud;let e=n.getAttribute("position");if(i.AddFloatAttribute(r,s.POSITION,e.count,e.itemSize,e.array),!0===t.exportColor){let e=n.getAttribute("color");void 0!==e&&i.AddFloatAttribute(r,s.COLOR,e.count,e.itemSize,e.array)}}}let o,l=new s.DracoInt8Array,h=void 0!==t.encodeSpeed?t.encodeSpeed:5,u=void 0!==t.decodeSpeed?t.decodeSpeed:5;if(a.SetSpeedOptions(h,u),void 0!==t.encoderMethod&&a.SetEncodingMethod(t.encoderMethod),void 0!==t.quantization)for(let p=0;p<5;p++)void 0!==t.quantization[p]&&a.SetAttributeQuantization(p,t.quantization[p]);if(o=!0===e.isMesh?a.EncodeMeshToDracoBuffer(r,l):a.EncodePointCloudToDracoBuffer(r,!0,l),s.destroy(r),0===o)throw new Error("THREE.DRACOExporter: Draco encoding failed.");let c=new Int8Array(new ArrayBuffer(o));for(let p=0;p<o;p++)c[p]=l.GetValue(p);return s.destroy(l),s.destroy(a),s.destroy(i),c}};sa.MESH_EDGEBREAKER_ENCODING=1,sa.MESH_SEQUENTIAL_ENCODING=0,sa.POINT_CLOUD=0,sa.TRIANGULAR_MESH=1,sa.INVALID=-1,sa.POSITION=0,sa.NORMAL=1,sa.COLOR=2,sa.TEX_COORD=3,sa.GENERIC=4;var vE=class{constructor(){this.pluginCallbacks=[],this.register((function(e){return new QB(e)})),this.register((function(e){return new ek(e)})),this.register((function(e){return new ik(e)})),this.register((function(e){return new nk(e)})),this.register((function(e){return new sk(e)})),this.register((function(e){return new ak(e)})),this.register((function(e){return new tk(e)})),this.register((function(e){return new rk(e)}))}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,r){let n=new JB,s=[];for(let a=0,o=this.pluginCallbacks.length;a<o;a++)s.push(this.pluginCallbacks[a](n));n.setPlugins(s),n.write(e,t,r).catch(i)}parseAsync(e,t){let i=this;return new Promise((function(r,n){i.parse(e,r,n,t)}))}},an={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},el={};el[Oi]=an.NEAREST,el[mf]=an.NEAREST_MIPMAP_NEAREST,el[Cp]=an.NEAREST_MIPMAP_LINEAR,el[hi]=an.LINEAR,el[jg]=an.LINEAR_MIPMAP_NEAREST,el[Ha]=an.LINEAR_MIPMAP_LINEAR,el[vn]=an.CLAMP_TO_EDGE,el[yn]=an.REPEAT,el[Pp]=an.MIRRORED_REPEAT;var xde={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},qTt=new Ve,Ide=12,YTt=1179937895,XTt=2,_de=8,$Tt=1313821514,ZTt=5130562;function Zx(e,t){return e.length===t.length&&e.every((function(e,i){return e===t[i]}))}function KTt(e){return(new TextEncoder).encode(e).buffer}function JTt(e){return Zx(e.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function QTt(e,t,i){let r={min:new Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=t;n<t+i;n++)for(let t=0;t<e.itemSize;t++){let i;e.itemSize>4?i=e.array[n*e.itemSize+t]:(0===t?i=e.getX(n):1===t?i=e.getY(n):2===t?i=e.getZ(n):3===t&&(i=e.getW(n)),!0===e.normalized&&(i=fr.normalize(i,e.array))),r.min[t]=Math.min(r.min[t],i),r.max[t]=Math.max(r.max[t],i)}return r}function Rde(e){return 4*Math.ceil(e/4)}function KB(e,t=0){let i=Rde(e.byteLength);if(i!==e.byteLength){let r=new Uint8Array(i);if(r.set(new Uint8Array(e)),0!==t)for(let n=e.byteLength;n<i;n++)r[n]=t;return r.buffer}return e}function Sde(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function wde(e,t){if(void 0!==e.toBlob)return new Promise((i=>e.toBlob(i,t)));let i;return"image/jpeg"===t?i=.92:"image/webp"===t&&(i=.8),e.convertToBlob({type:t,quality:i})}var JB=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}write(e,t){return ct(this,arguments,(function*(e,t,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),yield Promise.all(this.pending);let r=this,n=r.buffers,s=r.json;i=r.options;let a=r.extensionsUsed,o=new Blob(n,{type:"application/octet-stream"}),l=Object.keys(a);if(l.length>0&&(s.extensionsUsed=l),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=o.size),!0===i.binary){let e=new FileReader;e.readAsArrayBuffer(o),e.onloadend=function(){let i=KB(e.result),r=new DataView(new ArrayBuffer(_de));r.setUint32(0,i.byteLength,!0),r.setUint32(4,ZTt,!0);let n=KB(KTt(JSON.stringify(s)),32),a=new DataView(new ArrayBuffer(_de));a.setUint32(0,n.byteLength,!0),a.setUint32(4,$Tt,!0);let o=new ArrayBuffer(Ide),l=new DataView(o);l.setUint32(0,YTt,!0),l.setUint32(4,XTt,!0);let h=Ide+a.byteLength+n.byteLength+r.byteLength+i.byteLength;l.setUint32(8,h,!0);let u=new Blob([o,a,n,r,i],{type:"application/octet-stream"}),c=new FileReader;c.readAsArrayBuffer(u),c.onloadend=function(){t(c.result)}}}else if(s.buffers&&s.buffers.length>0){let e=new FileReader;e.readAsDataURL(o),e.onloadend=function(){let i=e.result;s.buffers[0].uri=i,t(s)}}else t(s)}))}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let i=this.options,r=this.extensionsUsed;try{let n=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&n.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(let e in n.gltfExtensions)t.extensions[e]=n.gltfExtensions[e],r[e]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new D;for(let i=0,r=e.count;i<r;i++)if(Math.abs(t.fromBufferAttribute(e,i).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let i=e.clone(),r=new D;for(let n=0,s=i.count;n<s;n++)r.fromBufferAttribute(i,n),0===r.x&&0===r.y&&0===r.z?r.setX(1):r.normalize(),i.setXYZ(n,r.x,r.y,r.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1,r={};(0!==t.offset.x||0!==t.offset.y)&&(r.offset=t.offset.toArray(),i=!0),0!==t.rotation&&(r.rotation=t.rotation,i=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(r.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=r,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function i(e){return e.encoding===yr?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.");let r=e?e.image:null,n=t?t.image:null,s=Math.max(r?r.width:0,n?n.width:0),a=Math.max(r?r.height:0,n?n.height:0),o=Sde();o.width=s,o.height=a;let l=o.getContext("2d");l.fillStyle="#00ffff",l.fillRect(0,0,s,a);let h=l.getImageData(0,0,s,a);if(r){l.drawImage(r,0,0,s,a);let t=i(e),n=l.getImageData(0,0,s,a).data;for(let e=2;e<n.length;e+=4)h.data[e]=256*t(n[e]/256)}if(n){l.drawImage(n,0,0,s,a);let e=i(t),r=l.getImageData(0,0,s,a).data;for(let t=1;t<r.length;t+=4)h.data[t]=256*e(r[t]/256)}l.putImageData(h,0,0);let u=(e||t).clone();return u.source=new kc(o),u.encoding=Nl,u}processBuffer(e){let t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,r,n){let s,a=this.json;a.bufferViews||(a.bufferViews=[]),s=t===an.UNSIGNED_BYTE?1:t===an.UNSIGNED_SHORT?2:4;let o=Rde(r*e.itemSize*s),l=new DataView(new ArrayBuffer(o)),h=0;for(let c=i;c<i+r;c++)for(let i=0;i<e.itemSize;i++){let r;e.itemSize>4?r=e.array[c*e.itemSize+i]:(0===i?r=e.getX(c):1===i?r=e.getY(c):2===i?r=e.getZ(c):3===i&&(r=e.getW(c)),!0===e.normalized&&(r=fr.normalize(r,e.array))),t===an.FLOAT?l.setFloat32(h,r,!0):t===an.UNSIGNED_INT?l.setUint32(h,r,!0):t===an.UNSIGNED_SHORT?l.setUint16(h,r,!0):t===an.UNSIGNED_BYTE&&l.setUint8(h,r),h+=s}let u={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:o};return void 0!==n&&(u.target=n),n===an.ARRAY_BUFFER&&(u.byteStride=e.itemSize*s),this.byteOffset+=o,a.bufferViews.push(u),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise((function(r){let n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){let e=KB(n.result),s={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,r(i.bufferViews.push(s)-1)}}))}processAccessor(e,t,i,r){let n,s=this.json;if(e.array.constructor===Float32Array)n=an.FLOAT;else if(e.array.constructor===Uint32Array)n=an.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)n=an.UNSIGNED_SHORT;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");n=an.UNSIGNED_BYTE}if(void 0===i&&(i=0),void 0===r&&(r=e.count),0===r)return null;let a,o=QTt(e,i,r);void 0!==t&&(a=e===t.index?an.ELEMENT_ARRAY_BUFFER:an.ARRAY_BUFFER);let l=this.processBufferView(e,n,i,r,a),h={bufferView:l.id,byteOffset:l.byteOffset,componentType:n,count:r,max:o.max,min:o.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(h.normalized=!0),s.accessors||(s.accessors=[]),s.accessors.push(h)-1}processImage(e,t,i,r="image/png"){if(null!==e){let n=this,s=n.cache,a=n.json,o=n.options,l=n.pending;s.images.has(e)||s.images.set(e,{});let h=s.images.get(e),u=r+":flipY/"+i.toString();if(void 0!==h[u])return h[u];a.images||(a.images=[]);let c={mimeType:r},p=Sde();p.width=Math.min(e.width,o.maxTextureSize),p.height=Math.min(e.height,o.maxTextureSize);let d=p.getContext("2d");if(!0===i&&(d.translate(0,p.height),d.scale(1,-1)),void 0!==e.data){t!==zs&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>o.maxTextureSize||e.height>o.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let i=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<i.length;t+=4)i[t+0]=e.data[t+0],i[t+1]=e.data[t+1],i[t+2]=e.data[t+2],i[t+3]=e.data[t+3];d.putImageData(new ImageData(i,e.width,e.height),0,0)}else d.drawImage(e,0,0,p.width,p.height);!0===o.binary?l.push(wde(p,r).then((e=>n.processBufferViewImage(e))).then((e=>{c.bufferView=e}))):void 0!==p.toDataURL?c.uri=p.toDataURL(r):l.push(wde(p,r).then((e=>(new FileReader).readAsDataURL(e))).then((e=>{c.uri=e})));let f=a.images.push(c)-1;return h[u]=f,f}throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let i={magFilter:el[e.magFilter],minFilter:el[e.minFilter],wrapS:el[e.wrapS],wrapT:el[e.wrapT]};return t.samplers.push(i)-1}processTexture(e){let t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]);let r=e.userData.mimeType;"image/webp"===r&&(r="image/png");let n={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(n.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,n)}));let s=i.textures.push(n)-1;return t.textures.set(e,s),s}processMaterial(e){let t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);let r={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let n=e.color.toArray().concat([e.opacity]);if(Zx(n,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),i={index:this.processTexture(t)};this.applyTextureTransform(i,t),r.pbrMetallicRoughness.metallicRoughnessTexture=i}if(e.map){let t={index:this.processTexture(e.map)};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive.clone().multiplyScalar(e.emissiveIntensity),i=Math.max(t.r,t.g,t.b);if(i>1&&(t.multiplyScalar(1/i),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),i>0&&(r.emissiveFactor=t.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap)};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:1};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode="BLEND":e.alphaTest>0&&(r.alphaMode="MASK",r.alphaCutoff=e.alphaTest),e.side===bi&&(r.doubleSided=!0),""!==e.name&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,r)}));let s=i.materials.push(r)-1;return t.materials.set(e,s),s}processMesh(e){let t=this.cache,i=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let v=0,T=e.material.length;v<T;v++)r.push(e.material[v].uuid);else r.push(e.material.uuid);let n=r.join(":");if(t.meshes.has(n))return t.meshes.get(n);let s,a=e.geometry;s=e.isLineSegments?an.LINES:e.isLineLoop?an.LINE_LOOP:e.isLine?an.LINE_STRIP:e.isPoints?an.POINTS:e.material.wireframe?an.LINES:an.TRIANGLES;let o={},l={},h=[],u=[],c={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},p=a.getAttribute("normal");void 0!==p&&!this.isNormalizedNormalAttribute(p)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(p)));let d=null;for(let v in a.attributes){if("morph"===v.slice(0,5))continue;let e=a.attributes[v];if(v=c[v]||v.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(v)||(v="_"+v),t.attributes.has(this.getUID(e))){l[v]=t.attributes.get(this.getUID(e));continue}d=null;let i=e.array;"JOINTS_0"===v&&!(i instanceof Uint16Array)&&!(i instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),d=new Wt(new Uint16Array(i),e.itemSize,e.normalized));let r=this.processAccessor(d||e,a);null!==r&&(l[v]=r,t.attributes.set(this.getUID(e),r))}if(void 0!==p&&a.setAttribute("normal",p),0===Object.keys(l).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let i=[],r=[],n={};if(void 0!==e.morphTargetDictionary)for(let t in e.morphTargetDictionary)n[e.morphTargetDictionary[t]]=t;for(let s=0;s<e.morphTargetInfluences.length;++s){let o={},l=!1;for(let e in a.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}let i=a.morphAttributes[e][s],r=e.toUpperCase(),n=a.attributes[e];if(t.attributes.has(this.getUID(i,!0))){o[r]=t.attributes.get(this.getUID(i,!0));continue}let h=i.clone();if(!a.morphTargetsRelative)for(let e=0,t=i.count;e<t;e++)for(let r=0;r<i.itemSize;r++)0===r&&h.setX(e,i.getX(e)-n.getX(e)),1===r&&h.setY(e,i.getY(e)-n.getY(e)),2===r&&h.setZ(e,i.getZ(e)-n.getZ(e)),3===r&&h.setW(e,i.getW(e)-n.getW(e));o[r]=this.processAccessor(h,a),t.attributes.set(this.getUID(n,!0),o[r])}u.push(o),i.push(e.morphTargetInfluences[s]),void 0!==e.morphTargetDictionary&&r.push(n[s])}o.weights=i,r.length>0&&(o.extras={},o.extras.targetNames=r)}let f=Array.isArray(e.material);if(f&&0===a.groups.length)return null;let m=f?e.material:[e.material],g=f?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let v=0,T=g.length;v<T;v++){let e={mode:s,attributes:l};if(this.serializeUserData(a,e),u.length>0&&(e.targets=u),null!==a.index){let i=this.getUID(a.index);(void 0!==g[v].start||void 0!==g[v].count)&&(i+=":"+g[v].start+":"+g[v].count),t.attributes.has(i)?e.indices=t.attributes.get(i):(e.indices=this.processAccessor(a.index,a,g[v].start,g[v].count),t.attributes.set(i,e.indices)),null===e.indices&&delete e.indices}let i=this.processMaterial(m[g[v].materialIndex]);null!==i&&(e.material=i),h.push(e)}o.primitives=h,i.meshes||(i.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,o)}));let y=i.meshes.push(o)-1;return t.meshes.set(n,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let i=e.isOrthographicCamera,r={type:i?"orthographic":"perspective"};return i?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:fr.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let i=this.json,r=this.nodeMap;i.animations||(i.animations=[]);let n=(e=vE.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,s=[],a=[];for(let o=0;o<n.length;++o){let e=n[o],i=Cr.parseTrackName(e.name),l=Cr.findNode(t,i.nodeName),h=xde[i.propertyName];if("bones"===i.objectName&&(l=!0===l.isSkinnedMesh?l.skeleton.getBoneByName(i.objectIndex):void 0),!l||!h)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',e.name),null;let u,c=1,p=e.values.length/e.times.length;h===xde.morphTargetInfluences&&(p/=l.morphTargetInfluences.length),!0===e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(u="CUBICSPLINE",p/=3):u=e.getInterpolation()===Lp?"STEP":"LINEAR",a.push({input:this.processAccessor(new Wt(e.times,c)),output:this.processAccessor(new Wt(e.values,p)),interpolation:u}),s.push({sampler:a.length-1,target:{node:r.get(l),path:h}})}return i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:a,channels:s}),i.animations.length-1}processSkin(e){let t=this.json,i=this.nodeMap,r=t.nodes[i.get(e)],n=e.skeleton;if(void 0===n)return null;let s=e.skeleton.bones[0];if(void 0===s)return null;let a=[],o=new Float32Array(16*n.bones.length),l=new Be;for(let h=0;h<n.bones.length;++h)a.push(i.get(n.bones[h])),l.copy(n.boneInverses[h]),l.multiply(e.bindMatrix).toArray(o,16*h);return void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new Wt(o,16)),joints:a,skeleton:i.get(s)}),r.skin=t.skins.length-1}processNode(e){let t=this.json,i=this.options,r=this.nodeMap;t.nodes||(t.nodes=[]);let n={};if(i.trs){let t=e.quaternion.toArray(),i=e.position.toArray(),r=e.scale.toArray();Zx(t,[0,0,0,1])||(n.rotation=t),Zx(i,[0,0,0])||(n.translation=i),Zx(r,[1,1,1])||(n.scale=r)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===JTt(e.matrix)&&(n.matrix=e.matrix.elements);if(""!==e.name&&(n.name=String(e.name)),this.serializeUserData(e,n),e.isMesh||e.isLine||e.isPoints){let t=this.processMesh(e);null!==t&&(n.mesh=t)}else e.isCamera&&(n.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let t=[];for(let r=0,n=e.children.length;r<n;r++){let n=e.children[r];if(n.visible||!1===i.onlyVisible){let e=this.processNode(n);null!==e&&t.push(e)}}t.length>0&&(n.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,n)}));let s=t.nodes.push(n)-1;return r.set(e,s),s}processScene(e){let t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);let r={};""!==e.name&&(r.name=e.name),t.scenes.push(r);let n=[];for(let s=0,a=e.children.length;s<a;s++){let t=e.children[s];if(t.visible||!1===i.onlyVisible){let e=this.processNode(t);null!==e&&n.push(e)}}n.length>0&&(r.nodes=n),this.serializeUserData(e,r)}processObjects(e){let t=new wn;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));let i=[];for(let r=0;r<e.length;r++)e[r]instanceof wn?this.processScene(e[r]):i.push(e[r]);i.length>0&&this.processObjects(i);for(let r=0;r<this.skins.length;++r)this.processSkin(this.skins[r]);for(let r=0;r<t.animations.length;++r)this.processAnimation(t.animations[r],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,i=this.plugins.length;t<i;t++)e(this.plugins[t])}},QB=class{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);let i=this.writer,r=i.json,n=i.extensionsUsed,s={};e.name&&(s.name=e.name),s.color=e.color.toArray(),s.intensity=e.intensity,e.isDirectionalLight?s.type="directional":e.isPointLight?(s.type="point",e.distance>0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||0!==e.target.position.x||0!==e.target.position.y||-1!==e.target.position.z)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),n[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},n[this.name]=!0);let a=r.extensions[this.name].lights;a.push(s),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},ek=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},tk=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;let i=this.writer,r=i.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:i.processTexture(e.clearcoatMap)};i.applyTextureTransform(t,e.clearcoatMap),n.clearcoatTexture=t}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:i.processTexture(e.clearcoatRoughnessMap)};i.applyTextureTransform(t,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:i.processTexture(e.clearcoatNormalMap)};i.applyTextureTransform(t,e.clearcoatNormalMap),n.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}},rk=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;let i=this.writer,r=i.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:i.processTexture(e.iridescenceMap)};i.applyTextureTransform(t,e.iridescenceMap),n.iridescenceTexture=t}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:i.processTexture(e.iridescenceThicknessMap)};i.applyTextureTransform(t,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}},ik=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,r=i.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){let t={index:i.processTexture(e.transmissionMap)};i.applyTextureTransform(t,e.transmissionMap),n.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}},nk=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,r=i.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){let t={index:i.processTexture(e.thicknessMap)};i.applyTextureTransform(t,e.thicknessMap),n.thicknessTexture=t}n.attenuationDistance=e.attenuationDistance,n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}},sk=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;let i=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,i[this.name]=!0}},ak=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(qTt)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let i=this.writer,r=i.extensionsUsed,n={};if(e.specularIntensityMap){let t={index:i.processTexture(e.specularIntensityMap)};i.applyTextureTransform(t,e.specularIntensityMap),n.specularTexture=t}if(e.specularColorMap){let t={index:i.processTexture(e.specularColorMap)};i.applyTextureTransform(t,e.specularColorMap),n.specularColorTexture=t}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};vE.Utils={insertKeyframe:function(e,t){let i,r=e.getValueSize(),n=new e.TimeBufferType(e.times.length+1),s=new e.ValueBufferType(e.values.length+r),a=e.createInterpolant(new e.ValueBufferType(r));if(0===e.times.length){n[0]=t;for(let e=0;e<r;e++)s[e]=0;i=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<.001)return 0;n[0]=t,n.set(e.times,1),s.set(a.evaluate(t),0),s.set(e.values,r),i=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<.001)return e.times.length-1;n[n.length-1]=t,n.set(e.times,0),s.set(e.values,0),s.set(a.evaluate(t),e.values.length),i=n.length-1}else for(let o=0;o<e.times.length;o++){if(Math.abs(e.times[o]-t)<.001)return o;if(e.times[o]<t&&e.times[o+1]>t){n.set(e.times.slice(0,o+1),0),n[o+1]=t,n.set(e.times.slice(o+1),o+2),s.set(e.values.slice(0,(o+1)*r),0),s.set(a.evaluate(t),(o+1)*r),s.set(e.values.slice((o+1)*r),(o+2)*r),i=o+1;break}}return e.times=n,e.values=s,i},mergeMorphTargetTracks:function(e,t){let i=[],r={},n=e.tracks;for(let s=0;s<n.length;++s){let e=n[s],a=Cr.parseTrackName(e.name),o=Cr.findNode(t,a.nodeName);if("morphTargetInfluences"!==a.propertyName||void 0===a.propertyIndex){i.push(e);continue}if(e.createInterpolant!==e.InterpolantFactoryMethodDiscrete&&e.createInterpolant!==e.InterpolantFactoryMethodLinear){if(e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),e=e.clone(),e.setInterpolation($u)}let l,h=o.morphTargetInfluences.length,u=o.morphTargetDictionary[a.propertyIndex];if(void 0===u)throw new Error("THREE.GLTFExporter: Morph target name not found: "+a.propertyIndex);if(void 0===r[o.uuid]){l=e.clone();let t=new l.ValueBufferType(h*l.times.length);for(let e=0;e<l.times.length;e++)t[e*h+u]=l.values[e];l.name=(a.nodeName||"")+".morphTargetInfluences",l.values=t,r[o.uuid]=l,i.push(l);continue}let c=e.createInterpolant(new e.ValueBufferType(1));l=r[o.uuid];for(let t=0;t<l.times.length;t++)l.values[t*h+u]=c.evaluate(l.times[t]);for(let t=0;t<e.times.length;t++){let i=this.insertKeyframe(l,e.times[t]);l.values[i*h+u]=e.values[t]}}return e.tracks=i,e}};var QC=class{parse(e){let t="",i=0,r=0,n=0,s=new D,a=new Ve,o=new D,l=new ce,h=[];return e.traverse((function(e){!0===e.isMesh&&function(e){let a=0,u=0,c=0,p=e.geometry,d=new Ui,f=p.getAttribute("position"),m=p.getAttribute("normal"),g=p.getAttribute("uv"),y=p.getIndex();if(t+="o "+e.name+"\n",e.material&&e.material.name&&(t+="usemtl "+e.material.name+"\n"),void 0!==f)for(let i=0,r=f.count;i<r;i++,a++)s.fromBufferAttribute(f,i),s.applyMatrix4(e.matrixWorld),t+="v "+s.x+" "+s.y+" "+s.z+"\n";if(void 0!==g)for(let i=0,r=g.count;i<r;i++,c++)l.fromBufferAttribute(g,i),t+="vt "+l.x+" "+l.y+"\n";if(void 0!==m){d.getNormalMatrix(e.matrixWorld);for(let e=0,i=m.count;e<i;e++,u++)o.fromBufferAttribute(m,e),o.applyMatrix3(d).normalize(),t+="vn "+o.x+" "+o.y+" "+o.z+"\n"}if(null!==y)for(let s=0,o=y.count;s<o;s+=3){for(let e=0;e<3;e++){let t=y.getX(s+e)+1;h[e]=i+t+(m||g?"/"+(g?r+t:"")+(m?"/"+(n+t):""):"")}t+="f "+h.join(" ")+"\n"}else for(let s=0,o=f.count;s<o;s+=3){for(let e=0;e<3;e++){let t=s+e+1;h[e]=i+t+(m||g?"/"+(g?r+t:"")+(m?"/"+(n+t):""):"")}t+="f "+h.join(" ")+"\n"}i+=a,r+=c,n+=u}(e),!0===e.isLine&&function(e){let r=0,n=e.geometry,a=e.type,o=n.getAttribute("position");if(t+="o "+e.name+"\n",void 0!==o)for(let i=0,l=o.count;i<l;i++,r++)s.fromBufferAttribute(o,i),s.applyMatrix4(e.matrixWorld),t+="v "+s.x+" "+s.y+" "+s.z+"\n";if("Line"===a){t+="l ";for(let e=1,r=o.count;e<=r;e++)t+=i+e+" ";t+="\n"}if("LineSegments"===a)for(let s=1,l=s+1,h=o.count;s<h;s+=2,l=s+1)t+="l "+(i+s)+" "+(i+l)+"\n";i+=r}(e),!0===e.isPoints&&function(e){let r=0,n=e.geometry,o=n.getAttribute("position"),l=n.getAttribute("color");if(t+="o "+e.name+"\n",void 0!==o){for(let i=0,n=o.count;i<n;i++,r++)s.fromBufferAttribute(o,i),s.applyMatrix4(e.matrixWorld),t+="v "+s.x+" "+s.y+" "+s.z,void 0!==l&&(a.fromBufferAttribute(l,i).convertLinearToSRGB(),t+=" "+a.r+" "+a.g+" "+a.b),t+="\n";t+="p ";for(let e=1,r=o.count;e<=r;e++)t+=i+e+" ";t+="\n"}i+=r}(e)})),t}},Mn=class{static exportToGltf(e,t){Mn.exportToGltfOrGlb(e,t,{binary:!1})}static exportToGlb(e,t){Mn.exportToGltfOrGlb(e,t,{binary:!0})}static exportToGltfOrGlb(e,t,i={}){if(!e||!t)throw new Error("Invalid input or filename!");let r=new vE;i=Object.assign({},{binary:!0,onlyVisible:!1,includeCustomExtensions:!1},i),r.parse(e,(e=>{if(i.binary){t=Mn.addExtention(t,Mn.EXTENSION_GLB);let i=e;Mn.saveArrayBuffer(i,t)}else t=Mn.addExtention(t,Mn.EXTENSION_GLTF),Mn.saveJson(e,t)}),(e=>console.log(e)),i)}static exportToObj(e,t){if(!e||!t)throw new Error("Invalid input or filename!");t=Mn.addExtention(t,Mn.EXTENSION_OBJ);let i=(new QC).parse(e);Mn.saveString(i,t)}static exportToDraco(e,t,i={}){if(!e||!t)throw new Error("Invalid input or filename!");t=Mn.addExtention(t,Mn.EXTENSION_DRACO);let r=new sa;i=Object.assign({},{encodeSpeed:5},i);let n=r.parse(e,i);Mn.saveArrayBuffer(n,t)}static exportToThreeJsJson(e,t){let i=e.toJSON();t.toLowerCase().endsWith(Mn.EXTENSION_JSON)||(t+=Mn.EXTENSION_JSON),Mn.saveJson(i,t)}static save(e,t){let i=Mn.downloadLink;i||(i=document.createElement("a"),i.style.display="none",document.body.appendChild(i),Mn.downloadLink=i),i.href=URL.createObjectURL(e),i.download=t,i.click()}static saveArrayBuffer(e,t){Mn.save(new Blob([e],{type:"application/octet-stream"}),t)}static saveJson(e,t){Mn.saveJsonString(JSON.stringify(e),t)}static saveJsonString(e,t){Mn.save(new Blob([e],{type:"application/json"}),t)}static saveString(e,t){Mn.save(new Blob([e],{type:"text/csv"}),t)}static addExtention(e,t){return e.toLowerCase().endsWith(t.toLowerCase())||(e+=t),e}},Xg=Mn;Xg.EXTENSION_GLTF=".gltf",Xg.EXTENSION_GLB=".glb",Xg.EXTENSION_OBJ=".obj",Xg.EXTENSION_DRACO=".drc",Xg.EXTENSION_JSON=".json";var eA=class{constructor(){this.prevTime=(performance||Date).now(),this.beginTime=(performance||Date).now(),this.frames=0,this.fps=Number.NaN}begin(){this.beginTime=(performance||Date).now()}end(){this.frames++;let e=(performance||Date).now();return e>=this.prevTime+1e3&&(this.fps=Math.round(1e3*this.frames/(e-this.prevTime)),this.frames=0,this.prevTime=e),e}update(){this.beginTime=this.end()}},pk={exports:{}};function iA(e,t,i){i=i||2;var r,n,s,a,o,l,h,u=t&&t.length,c=u?t[0]*i:e.length,p=Pde(e,0,c,i,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=n1t(e,t,p,i)),e.length>80*i){r=s=e[0],n=a=e[1];for(var f=i;f<c;f+=i)(o=e[f])<r&&(r=o),(l=e[f+1])<n&&(n=l),o>s&&(s=o),l>a&&(a=l);h=0!==(h=Math.max(s-r,a-n))?32767/h:0}return Kx(p,d,i,r,n,h,0),d}function Pde(e,t,i,r,n){var s,a;if(n===hk(e,t,i,r)>0)for(s=t;s<i;s+=r)a=Mde(s,e[s],e[s+1],a);else for(s=i-r;s>=t;s-=r)a=Mde(s,e[s],e[s+1],a);return a&&nA(a,a.next)&&(Qx(a),a=a.next),a}function $g(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!nA(r,r.next)&&0!==Bn(r.prev,r,r.next))r=r.next;else{if(Qx(r),(r=t=r.prev)===r.next)break;i=!0}}while(i||r!==t);return t}function Kx(e,t,i,r,n,s,a){if(e){!a&&s&&c1t(e,r,n,s);for(var o,l,h=e;e.prev!==e.next;)if(o=e.prev,l=e.next,s?t1t(e,r,n,s):e1t(e))t.push(o.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),Qx(e),e=l.next,h=l.next;else if((e=l)===h){a?1===a?Kx(e=r1t($g(e),t,i),t,i,r,n,s,2):2===a&&i1t(e,t,i,r,n,s):Kx($g(e),t,i,r,n,s,1);break}}}function e1t(e){var t=e.prev,i=e,r=e.next;if(Bn(t,i,r)>=0)return!1;for(var n=t.x,s=i.x,a=r.x,o=t.y,l=i.y,h=r.y,u=n<s?n<a?n:a:s<a?s:a,c=o<l?o<h?o:h:l<h?l:h,p=n>s?n>a?n:a:s>a?s:a,d=o>l?o>h?o:h:l>h?l:h,f=r.next;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=c&&f.y<=d&&yE(n,o,s,l,a,h,f.x,f.y)&&Bn(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function t1t(e,t,i,r){var n=e.prev,s=e,a=e.next;if(Bn(n,s,a)>=0)return!1;for(var o=n.x,l=s.x,h=a.x,u=n.y,c=s.y,p=a.y,d=o<l?o<h?o:h:l<h?l:h,f=u<c?u<p?u:p:c<p?c:p,m=o>l?o>h?o:h:l>h?l:h,g=u>c?u>p?u:p:c>p?c:p,y=ck(d,f,t,i,r),v=ck(m,g,t,i,r),T=e.prevZ,x=e.nextZ;T&&T.z>=y&&x&&x.z<=v;){if(T.x>=d&&T.x<=m&&T.y>=f&&T.y<=g&&T!==n&&T!==a&&yE(o,u,l,c,h,p,T.x,T.y)&&Bn(T.prev,T,T.next)>=0||(T=T.prevZ,x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&yE(o,u,l,c,h,p,x.x,x.y)&&Bn(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;T&&T.z>=y;){if(T.x>=d&&T.x<=m&&T.y>=f&&T.y<=g&&T!==n&&T!==a&&yE(o,u,l,c,h,p,T.x,T.y)&&Bn(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;x&&x.z<=v;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&yE(o,u,l,c,h,p,x.x,x.y)&&Bn(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function r1t(e,t,i){var r=e;do{var n=r.prev,s=r.next.next;!nA(n,s)&&Nde(n,r,r.next,s)&&Jx(n,s)&&Jx(s,n)&&(t.push(n.i/i|0),t.push(r.i/i|0),t.push(s.i/i|0),Qx(r),Qx(r.next),r=e=s),r=r.next}while(r!==e);return $g(r)}function i1t(e,t,i,r,n,s){var a=e;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&p1t(a,o)){var l=Lde(a,o);return a=$g(a,a.next),l=$g(l,l.next),Kx(a,t,i,r,n,s,0),void Kx(l,t,i,r,n,s,0)}o=o.next}a=a.next}while(a!==e)}function n1t(e,t,i,r){var n,s,a,o=[];for(n=0,s=t.length;n<s;n++)(a=Pde(e,t[n]*r,n<s-1?t[n+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),o.push(h1t(a));for(o.sort(s1t),n=0;n<o.length;n++)i=a1t(o[n],i);return i}function s1t(e,t){return e.x-t.x}function a1t(e,t){var i=o1t(e,t);if(!i)return t;var r=Lde(i,e);return $g(r,r.next),$g(i,i.next)}function o1t(e,t){var i,r=t,n=e.x,s=e.y,a=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var o=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=n&&o>a&&(a=o,i=r.x<r.next.x?r:r.next,o===n))return i}r=r.next}while(r!==t);if(!i)return null;var l,h=i,u=i.x,c=i.y,p=1/0;r=i;do{n>=r.x&&r.x>=u&&n!==r.x&&yE(s<c?n:a,s,u,c,s<c?a:n,s,r.x,r.y)&&(l=Math.abs(s-r.y)/(n-r.x),Jx(r,e)&&(l<p||l===p&&(r.x>i.x||r.x===i.x&&l1t(i,r)))&&(i=r,p=l)),r=r.next}while(r!==h);return i}function l1t(e,t){return Bn(e.prev,e,t.prev)<0&&Bn(t.next,e,e.next)<0}function c1t(e,t,i,r){var n=e;do{0===n.z&&(n.z=ck(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,u1t(n)}function u1t(e){var t,i,r,n,s,a,o,l,h=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,r=i,o=0,t=0;t<h&&(o++,r=r.nextZ);t++);for(l=h;o>0||l>0&&r;)0!==o&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,o--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,h*=2}while(a>1);return e}function ck(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function h1t(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function yE(e,t,i,r,n,s,a,o){return(n-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(i-a)*(t-o)&&(i-a)*(s-o)>=(n-a)*(r-o)}function p1t(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!d1t(e,t)&&(Jx(e,t)&&Jx(t,e)&&f1t(e,t)&&(Bn(e.prev,e,t.prev)||Bn(e,t.prev,t))||nA(e,t)&&Bn(e.prev,e,e.next)>0&&Bn(t.prev,t,t.next)>0)}function Bn(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function nA(e,t){return e.x===t.x&&e.y===t.y}function Nde(e,t,i,r){var n=rA(Bn(e,t,i)),s=rA(Bn(e,t,r)),a=rA(Bn(i,r,e)),o=rA(Bn(i,r,t));return!!(n!==s&&a!==o||0===n&&tA(e,i,t)||0===s&&tA(e,r,t)||0===a&&tA(i,e,r)||0===o&&tA(i,t,r))}function tA(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function rA(e){return e>0?1:e<0?-1:0}function d1t(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&Nde(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function Jx(e,t){return Bn(e.prev,e,e.next)<0?Bn(e,t,e.next)>=0&&Bn(e,e.prev,t)>=0:Bn(e,t,e.prev)<0||Bn(e,e.next,t)<0}function f1t(e,t){var i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}function Lde(e,t){var i=new uk(e.i,e.x,e.y),r=new uk(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function Mde(e,t,i,r){var n=new uk(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Qx(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 uk(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function hk(e,t,i,r){for(var n=0,s=t,a=i-r;s<i;s+=r)n+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return n}pk.exports=iA,pk.exports.default=iA,iA.deviation=function(e,t,i,r){var n=t&&t.length,s=n?t[0]*i:e.length,a=Math.abs(hk(e,0,s,i));if(n)for(var o=0,l=t.length;o<l;o++){var h=t[o]*i,u=o<l-1?t[o+1]*i:e.length;a-=Math.abs(hk(e,h,u,i))}var c=0;for(o=0;o<r.length;o+=3){var p=r[o]*i,d=r[o+1]*i,f=r[o+2]*i;c+=Math.abs((e[p]-e[f])*(e[d+1]-e[p+1])-(e[p]-e[d])*(e[f+1]-e[p+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},iA.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var s=0;s<e[n].length;s++)for(var a=0;a<t;a++)i.vertices.push(e[n][s][a]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i};var K$t=pk.exports;function Dde(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function m1t(e,t){var i=t[0],r=t[1],n=t[2],s=Math.sqrt(i*i+r*r+n*n)||1;return e[0]=i/s,e[1]=r/s,e[2]=n/s,e}function g1t(e,t,i){var r=t[0],n=t[1],s=t[2],a=i[0],o=i[1],l=i[2];return e[0]=n*l-s*o,e[1]=s*a-r*l,e[2]=r*o-n*a,e}function v1t(e,t){function i(e,t,i,r){e[0]=t,e[1]=i,e[2]=r}for(var r=[],n=[],s=[],a=[],o=[],l=[],h=e.length,u=new Float32Array(t.length),c=0;c<h;){var p=3*e[c],d=3*e[c+1],f=3*e[c+2];i(r,t[p],t[p+1],t[p+2]),i(n,t[d],t[d+1],t[d+2]),i(s,t[f],t[f+1],t[f+2]),Dde(o,s,n),Dde(a,r,n),g1t(l,o,a);for(var m=0;m<3;m++)u[p+m]+=l[m],u[d+m]+=l[m],u[f+m]+=l[m];c+=3}for(var g=0,y=u.length;g<y;)i(l,u[g],u[g+1],u[g+2]),m1t(l,l),u[g]=l[0]||0,u[g+1]=l[1]||0,u[g+2]=l[2]||0,g+=3;return u}function y1t(e){if(1===e.length)return{position:e[0].position,normal:e[0].normal,uv:e[0].uv,indices:e[0].indices,results:e};for(var t=0,i=0,r=0,n=e.length;r<n;r++){var s=e[r],a=s.position,o=s.indices;t+=a.length,i+=o.length}for(var l={position:new Float32Array(t),normal:new Float32Array(t),uv:new Float32Array(t/3*2),indices:new Uint32Array(i),results:e},h=0,u=0,c=0,p=0,d=0,f=e.length;d<f;d++){var m=e[d],g=m.position,y=m.indices,v=m.normal,T=m.uv;l.position.set(g,h),l.normal.set(v,h),l.uv.set(T,p);for(var x=0,b=y.length;x<b;){var E=y[x]+u;l.indices[c]=E,c++,x++}p+=T.length,h+=g.length,u+=g.length/3}return l}function E1t(e){return 180*e/Math.PI}function Cde(e){return e/180*Math.PI}function T1t(e,t,i,r,n,s){var a=3*i,o=3*r,l=3*n,h=3*s,u=t[a],c=t[a+1],p=t[a+2],d=t[o],f=t[o+1],m=t[o+2],g=t[l],y=t[l+1],v=t[l+2],T=t[h],x=t[h+1],b=t[h+2];Math.abs(c-f)<Math.abs(u-d)?(e.push(u,1-p),e.push(d,1-m),e.push(g,1-v),e.push(T,1-b)):(e.push(c,1-p),e.push(f,1-m),e.push(y,1-v),e.push(x,1-b))}function Fde(e,t){t=Object.assign({},{depth:2,lineWidth:1},t);var i=y1t(e.map((function(e){var i=I1t(e,t);return i.line=e,b1t(i,t),x1t(i,t),i.position=new Float32Array(i.points),i.indices=new Uint32Array(i.index),i.uv=new Float32Array(i.uvs),i.normal=v1t(i.indices,i.position),i})));return i.lines=e,i}function b1t(e,t){for(var i=t.depth,r=[],n=[],s=[],a=e.leftPoints,o=e.rightPoints,l=0,h=a.length;l<h;){var u=3*l,c=a[l],p=c[0],d=c[1],f=c[2];r[u]=p,r[u+1]=d,r[u+2]=i+f;var m=o[l],g=m[0],y=m[1],v=m[2],T=3*h+u;r[T]=g,r[T+1]=y,r[T+2]=i+v;var x=2*h*3+u;r[x]=p,r[x+1]=d,r[x+2]=f;var b=2*h*3+3*h+u;r[b]=g,r[b+1]=y,r[b+2]=v,l++}for(l=0,h=r.length;l<h;){var E=r[l],_=r[l+1];s.push(E,_),l+=3}for(l=0,h=a.length;l<h-1;){var w=l,S=l+1,M=w+h,I=S+h;n.push(w,M,S),n.push(M,I,S);var D=l+2*h,A=D+1,R=D+h,C=A+h;n.push(D,R,A),n.push(R,C,A),l++}e.index=n,e.points=r,e.uvs=s}function x1t(e,t){var i=e.points,r=e.index,n=e.leftPoints,s=e.rightPoints,a=e.uvs,o=t.depth,l=[n,s];function h(e,t){var n=i.length/3;i.push(e[0],e[1],o+e[2],t[0],t[1],o+t[2],e[0],e[1],e[2],t[0],t[1],t[2]);var s=n+2,l=n+3,h=n,u=n+1;r.push(s,h,l,h,u,l),T1t(a,i,s,l,h,u)}for(var u=0,c=l.length;u<c;u++){var p=l[u];u>0&&(p=(p=p.map((function(e){return e}))).reverse());for(var d=0,f=p.length-1;d<f;)h(p[d],p[d+1]),d++}for(var m=n.length,g=[s[0],n[0],n[m-1],s[m-1]],y=0;y<g.length;y+=2)h(g[y],g[y+1])}var ok={x:0,y:0},lk={x:0,y:0};function I1t(e,t){for(var i=0,r=t.lineWidth/2,n=[],s=[],a=[],o=e.length,l=0;l<o-1;){var h=e[l],u=e[l+1],c=u[1]-h[1],p=u[0]-h[0],d=0,f=E1t(Math.atan(c/p));if(i=f,0===l)d=f,d-=90;else{var m=e[l-1];ok.x=m[0]-h[0],ok.y=m[1]-h[1],lk.x=u[0]-h[0],lk.y=u[1]-h[1],d=f-_1t(ok,lk)/2}var g=Ade(Cde(d),r,h),y=g[0],v=g[1];n.push(y,v),Ode(y,h,u)?(s.push(y),a.push(v)):(s.push(v),a.push(y)),l++}var T=i,x=Cde(T-=90),b=e[o-2],E=e[o-1],_=Ade(x,r,E),w=_[0],S=_[1];return n.push(w,S),Ode(w,b,E)?(s.push(w),a.push(S)):(s.push(S),a.push(w)),{offsetPoints:n,leftPoints:s,rightPoints:a}}function Ade(e,t,i){var r=i[0],n=i[1],s=i[2]||0,a=[r+Math.cos(e)*t,n+Math.sin(e)*t,s],o=e+=Math.PI;return[a,[r+Math.cos(o)*t,n+Math.sin(o)*t,s]]}var _1t=function(e,t){var i=e.x,r=e.y,n=t.x,s=t.y,a=i*n+r*s,o=i*s-r*n;return(Math.atan2(o,a)/Math.PI*180+360)%360};function Ode(e,t,i){var r=t[0],n=t[1],s=i[0],a=i[1];return(n-a)*e[0]+(s-r)*e[1]+r*a-s*n>0}var dk=1e-15,$t=class{static roundNumber(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}static floorNumber(e,t){return Math.floor(e*Math.pow(10,t))/Math.pow(10,t)}static areNumbersEqual(e,t,i=1e-7){return Math.abs(e-t)<i*Math.max(1,Math.abs(e),Math.abs(t))}static areVector2sEqual(e,t,i=1e-7){return $t.areNumbersEqual(e.x,t.x,i)&&$t.areNumbersEqual(e.y,t.y,i)}static areVector3sEqual(e,t,i=1e-7){return $t.areNumbersEqual(e.x,t.x,i)&&$t.areNumbersEqual(e.y,t.y,i)&&$t.areNumbersEqual(e.z,t.z,i)}static areNumbersClose(e,t,i=1e-9,r=1e-12){return Math.abs(e-t)<=Math.max(i*Math.max(Math.abs(e),Math.abs(t)),r)}static areVector2sClose(e,t,i=1e-9,r=1e-12){return this.areNumbersClose(e.x,t.x,i,r)&&this.areNumbersClose(e.y,t.y,i,r)}static areVectorsClose(e,t,i=1e-9,r=1e-12){return this.areNumbersClose(e.x,t.x,i,r)&&this.areNumbersClose(e.y,t.y,i,r)&&this.areNumbersClose(e.z,t.z,i,r)}static getArcAngleSpanInRadian(e,t){let i=2*Math.PI;return $t.areNumbersClose(e,t,dk)?0:(e%=i,$t.areNumbersClose(e,t%i,dk)?i:($t.areNumbersClose(t,i,dk)&&(t%=i),t<e&&(t+=i),t-e))}static getIntegerPartLength(e){return(e=Math.abs(e))<1?0:Math.ceil(Math.log10(Math.abs(e)+1))}static getRelativeEps(e,t=1e-7){let i=$t.getIntegerPartLength(e);return Math.max(Math.pow(10,i)*t,t)}static getVector2RelativeEps(e,t=1e-7){return Math.min($t.getRelativeEps(e.x,t),$t.getRelativeEps(e.y,t))}static getControlPointByTwoPoints(e,t){let i=(new ce).subVectors(t,e),r=i.angle(),n=i.length(),s=fr.degToRad(45),a=n/2/Math.cos(s);return new ce(e.x+a*Math.cos(s-r),e.y-a*Math.sin(s-r))}},fk=1e7,Hde=new ns,Ude=new ns,Bde=new D,kde=new D,Gde=new D,Pf=new pn,kt=class{static geometryEquals(e,t){return e===t||e.type===t.type&&e.name===t.name&&e.morphTargetsRelative===t.morphTargetsRelative&&this.equals(e.boundingBox,t.boundingBox)&&this.equals(e.boundingSphere,t.boundingSphere)&&this.attributesEqual(e.attributes,t.attributes)&&this.bufferAttributeEqual(e.index,t.index)}static equals(e,t){return e===t||!e&&!t||!(!e||!t)&&e.equals(t)}static attributesEqual(e,t){if(e===t)return!0;let i=Object.keys(e).sort(),r=Object.keys(t).sort();if(i.length!==r.length)return!1;for(let n=0;n<i.length;++n){if(i[n]!==r[n])return!1;let s=e[i[n]],a=t[r[n]];if(!this.bufferAttributeEqual(s,a))return!1}return!0}static bufferAttributeEqual(e,t){if(e===t)return!0;if(!e||!t||e.name!==t.name||e.itemSize!==t.itemSize||e.count!==t.count||e.normalized!==t.normalized)return!1;if(e.array&&t.array){if(e.array.length!==t.array.length)return!1;for(let i=0;i<e.array.length;++i)if(e.array[i]!==t.array[i])return!1}else if(e.array||t.array)return!1;let i=e.data,r=t.data;if(i&&r){if(i.length!==r.length)return!1;for(let e=0;e<i.length;++e)if(i[e]!==r[e])return!1}else if(i||r)return!1;return!0}static tryConvertInterleavedBufferAttributes(e){!e||!e.attributes||Object.keys(e.attributes).forEach((t=>{let i=e.attributes[t];if(i instanceof ho){let r=i.clone();e.attributes[t]=r}}))}static isPointInPolygon(e,t,i=!1){let r=e.x,n=e.y,s=!1,a=t.length;for(let o=0,l=a-1;o<a;l=o++){let e=t[o].x,a=t[o].y,h=t[l].x,u=t[l].y,c=a>n!=u>n;i&&(c=a>=n!=u>=n),c&&r<(h-e)*(n-a)/(u-a)+e&&(s=!s)}return s}static caculateGeometryCenter(e){if(!e.hasAttribute("position"))return null;let t=e.getAttribute("position");if(0===t.count)return null;let i=new D,r=t.itemSize,n=t.array,s=[0,0,0];for(let a=0;a<t.count;a++)for(let e=0;e<r;e++)s[e]+=n[a*r+e];for(let a=0;a<r;a++)i.setComponent(a,s[a]/t.count);return i}static isConvex(e){let t=e.length,i=0,r=0,n=new ce,s=new ce;for(let a=0;a<t;++a){let o=e[a],l=e[(a+1)%t],h=e[(a+2)%t];if(n.subVectors(l,o),s.subVectors(h,l),r=n.cross(s),0!=r){if(r>0&&i<0||r<0&&i>0)return!1;i=r}}return!0}static areLineSegmentsIntersecting(e,t){let{start:i,end:r}=e,{start:n,end:s}=t,a=n.clone().sub(i),o=r.clone().sub(i),l=s.clone().sub(i),h=a.cross(o).dot(l.cross(o)),u=i.clone().sub(n),c=s.clone().sub(n),p=r.clone().sub(n),d=u.cross(c).dot(p.cross(c));return h<0&&d<0}static getLineSegmentsIntersectingPoint(e,t){let{start:i,end:r}=e,{start:n,end:s}=t,a=Bde.subVectors(r,i).normalize(),o=kde.subVectors(s,n).normalize();if(1===a.dot(o))return null;let l=Gde.subVectors(n,i),h=a.clone().cross(o),u=l.clone().cross(o),c=l.clone().dot(h);if(c>=1e-5||c<=-1e-5)return null;let p=h.lengthSq();if($t.areNumbersEqual(0,p))return;let d=u.clone().dot(h)/p,f=i.clone().add(a.multiplyScalar(d));return f.equals(i)||f.equals(r)?null:f}static isPointOnLineSegment(e,t,i=.001){let{start:r,end:n}=t,s=Bde.subVectors(r,n).length(),a=kde.subVectors(e,r).length(),o=Gde.subVectors(e,n).length();return Math.abs(s-(a+o))<=i}static isPointOnLineSegments(e,t,i=.001){let r=!1;for(let n=0;n<t.length-1;n+=2){let s=t[n],a=t[n+1];if(r=this.isPointOnLineSegment(e,{start:s,end:a},i),r)break}return r}static checkAndRebasePositionsOnRTC(e,t){if(0===e.length)return!1;let i=e[0]instanceof D;e.forEach((e=>{i?t.add(e):(t.x+=e.x,t.y+=e.y)})),t.divideScalar(e.length);let r=!1;if(kt.shouldRebasePositionOnRTC(t)){r=!0;for(let r=0;r<e.length;r++){let n=e[r].x-t.x,s=e[r].y-t.y;e[r]=i?new D(n,s,e[r].z-t.z):new ce(n,s)}}else t.setScalar(0);return r}static shouldRebasePositionOnRTC(e){return Math.abs(e.x)>fk||Math.abs(e.y)>fk||e instanceof D&&Math.abs(e.z)>fk}static calculateSurfaceArea(e){let t=0,i=e.getAttribute("position"),r=e.index;if(r)for(let n=0;n<r.count;n+=3)Pf.a.fromBufferAttribute(i,r.getX(n)),Pf.b.fromBufferAttribute(i,r.getX(n+1)),Pf.c.fromBufferAttribute(i,r.getX(n+2)),t+=Pf.getArea();else for(let n=0;n<i.count;n+=3)Pf.a.fromBufferAttribute(i,n),Pf.b.fromBufferAttribute(i,n+1),Pf.c.fromBufferAttribute(i,n+2),t+=Pf.getArea();return t}static convertLineStripToLine(e,t=!1){let i=e.getIndex();if(!i)return;let r=i.array.constructor,n=i.count,s=n;n>2&&(s=t?2*n:2*n-2);let a=new r(s),o=0;for(let l=0;l<n;l++){let e=i.getX(l);a[o++]=e,l>0&&l<n-1&&(a[o++]=e)}t&&(a[o++]=i.getX(n-1),a[o++]=i.getX(0)),e.setIndex(a)}static convertGeometryWithIndexedToNonIndexed(e){if(!e.index)return e;let t=new ot,i=e.index;for(let r in e.attributes)t.setAttribute(r,kt.createGeometryAttributeByIndex(e.attributes[r],i));return t}static createGeometryAttributeByIndex(e,t){let i=t.count,r=e.itemSize,n=new(0,e.array.constructor)(i*r);for(let s=0;s<i;s++){let i=t.getX(s)*r;for(let t=0;t<r;t++)n[s*r+t]=e.array[i+t]}return new Wt(n,r,e.normalized)}static getLineEndPointsByIndex(e,t){var i,r,n;let s=t=>{let i=e.geometry.attributes.position.array;return e.localToWorld(new D(i[3*t],i[3*t+1],i[3*t+2]))};e.updateWorldMatrix(!0,!1);let a=(null==(i=e.geometry.getIndex())?void 0:i.array)||[],o=null!=(r=a[t])?r:t,l=null!=(n=a[t+1])?n:t+1;return[s(o),s(l)]}static arePolygonsIntersect(e,t){if(0===e.length||0===t.length||(Hde.setFromPoints(e),Ude.setFromPoints(t),!Hde.intersectsBox(Ude)))return!1;for(let i=0;i<e.length;){if(this.isPointInPolygon(e[i],t,!0))return!0;i<e.length-1&&$t.areVector2sEqual(e[i+1],e[i])&&++i,++i}return!1}static getLineLineIntersectionPoint(e,t,i,r,n=.001){let s=t.clone().sub(e).normalize(),a=r.clone().sub(i).normalize();if(Math.abs(s.dot(a))>1-n)return;let o=t.y-e.y,l=e.x-t.x,h=o*e.x+l*e.y,u=r.y-i.y,c=i.x-r.x,p=u*i.x+c*i.y,d=o*c-u*l;return Math.abs(d)<n?void 0:new ce((c*h-l*p)/d,(o*p-u*h)/d)}static getOffsetPoint(e,t,i){let r=t.x-e.x,n=t.y-e.y,s=i/Math.sqrt(r*r+n*n);return new ce(-s*n,s*r)}static convertSimpleWidthLineToMeshGeometry(e,t){let i,r,n,s=!1,a=!1,o=[],l=[],h=new ce,u=new ce,c=new ce,p=new ce,d=[],f=t/2;for(let v=0,T=e.length-1;v<T;v++)s=!v,a=v===e.length-2,i=this.getOffsetPoint(e[v],e[v+1],f),h=new ce(e[v].x+i.x,e[v].y+i.y),u=new ce(e[v+1].x+i.x,e[v+1].y+i.y),c=new ce(e[v].x-i.x,e[v].y-i.y),p=new ce(e[v+1].x-i.x,e[v+1].y-i.y),s||(r=this.getLineLineIntersectionPoint(o[0],o[1],h,u),void 0!==r?d.unshift(r):d.unshift(h),n=this.getLineLineIntersectionPoint(l[0],l[1],c,p),void 0!==n?d.push(n):d.push(c)),s&&(d.unshift(h),d.push(c)),a&&(d.unshift(u),d.push(p)),a||(o=[h,u],l=[c,p]);if(d.length<3)return;let m=Ps.triangulateShape(d,[]),g=[];for(let v=0;v<m.length;v++)g.push(...m[v]);let y=(new ot).setFromPoints(d);return y.setIndex(g),y}static convertWidthLineToMeshGeometry(e,t){if(e.length<2)return;let i=[];e.forEach((e=>{i.push([e.x,e.y])}));try{let{indices:e,position:r}=Fde([i],{lineWidth:t,depth:1}),n=new ot;return n.setAttribute("position",new dt(r,3)),n.setIndex(Array.from(e)),n}catch(e){return}}static releaseGeometryManually(e){e.index=null,e.attributes={}}static getAdjacentNonRepeatPoints(e,t=1e-7){let i=[],r=e.length;for(let n=0;n<r-1;n++)$t.areVector3sEqual(e[n],e[n+1],t)||i.push(e[n]);return i.push(e[r-1]),i}static mergeBBoxes(e){let t=[...e];if(t.length<2)return t;let i=[],r=[];for(let n=0;n<t.length;n++){let e=t[n];if(!r.includes(n)){for(let i=0;i<t.length;i++){let n=t[i];e.equals(n)||e.intersectsBox(n)&&(e.union(n),r.push(i))}i.push(e)}}return i}},on=!1,iZt=!1,oh=10,ql=11,On=12,EE="gemini-viewer-iconfont",nZt="keydown",sZt="keyup",Nf="mousemove",mk="mouseup",gk="mousedown",aZt="Escape",oZt="Enter",lZt="axis-section-plane",cZt="axis-section-plane-control",uZt="section-plane",hZt="section-plane-control",pZt="section-box",vk="plane-section-boxface",Vde=-1e3,TE=(e=>(e.ObjectsBoxSection="ObjectsBoxSection",e.PickPlaneSection="PickPlaneSection",e.AxisPlaneSection="AxisPlaneSection",e))(TE||{}),aa=class{static createGroundGrid(e,t,i){e=e||this.DEFAULT_WIDTH,t=t||this.DEFAULT_WIDTH_SEGS;let r=new Px(e,t);i?r.position.set(i.x,i.y,i.z):r.position.y=0;let n=r.material;return Array.isArray(n)||(n.opacity=this.DEFAULT_MAT_PARAMS.opacity,n.transparent=this.DEFAULT_MAT_PARAMS.transparent),r.name=this.GROUND_GRID_NAME,r.layers.enableAll(),r.layers.disable(12),r.matrixAutoUpdate=!1,r.updateMatrix(),r}static createGrassGround(e,t,i,r,n){return ct(this,null,(function*(){return t=t||this.DEFAULT_WIDTH,i=i||this.DEFAULT_HEIGHT,new Promise((s=>{(new gs).load(e||"images/terrain/grass.jpg",(e=>{e.wrapS=e.wrapT=yn,e.repeat.set(r||this.DEFAULT_WIDTH_SEGS/5,n||this.DEFAULT_HEIGHT_SETS/5),e.anisotropy=16,e.encoding=yr;let a=new Bl({map:e});a.side=Xi;let o=new Je(new En(t,i),a);return o.rotation.x=-Math.PI/2,o.position.y=0,o.receiveShadow=!0,o.name=this.GRASS_GROUND_NAME,o.layers.enableAll(),o.layers.disable(12),o.matrixAutoUpdate=!1,o.updateMatrix(),s(o)}))}))}))}};aa.GROUND_GRID_NAME="GROUND_GRID",aa.GRASS_GROUND_NAME="GRASS_GROUND",aa.DEFAULT_WIDTH=1e3,aa.DEFAULT_HEIGHT=1e3,aa.DEFAULT_WIDTH_SEGS=100,aa.DEFAULT_HEIGHT_SETS=100,aa.DEFAULT_MAT_PARAMS={color:12829635,transparent:!0,opacity:.5,wireframeLinewidth:.5};var zde={NavCube:{front:"Front",back:"Back",top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ContextMenu:{viewFitAll:"View Fit All",hideAll:"Hide All",showAll:"Show All",xRayAll:"X-Ray",xRayNone:"X-Ray None",selectNone:"Select None",resetView:"Reset View",viewFitEntity:"View Fit",hideEntity:"Hide",hideOthers:"Hide Others",xRayEntity:"X-Ray",xRayOthers:"X-Ray Others",select:"Select",deselect:"Undo Select",showSectionPlane:"Show Section Plane",showSectionBox:"Show Section Box",showAxisSection:"Show Axis Section",hideSectionPlane:"Hide Section Plane",hideSectionBox:"Hide Section Box",hideAxisSection:"Hide Axis Section",undoSection:"Undo Section"},ProgressBar:{Loading:"Loading",Comparing:"Comparing"},Toolbar:{homeView:"Home",orthoView:"Ortho View",measurement:"Measure",distanceMeasurement:"Distance",areaMeasurement:"Area",angleMeasurement:"Angle",coordinateMeasurement:"Coordinate",clearMeasurement:"Clear",markupVisibility:"Markup Visibility",markup:"Markup",markupArrow:"Arrow",markupRect:"Rect",markupCloudRect:"CloudRect",markupPolyLine:"PolyLine",markupCloudLine:"CloudLine",markupEllipse:"Ellipse",markupCircle:"Circle",markupDot:"Dot",markupText:"Text",markupX:"X",markupStroke:"Stroke Style",markupLineWidth:"Line Width",markupLineWidth2:"Line Width 2",markupLineWidth5:"Line Width 5",markupLineWidth10:"Line Width 10",markupFontSize:"Font Size",markupFontSize14:"14",markupFontSize18:"18",markupFontSize24:"24",clearMarkup:"Clear Markup",quitMarkup:"Quit markup",section:"Section",axisSection:"Axis Section",pickSectionPlane:"Pick Section Plane",sectionBox:"Section Box",bimTree:"BIM Tree",viewpoint:"Viewpoint",annotation:"Annotation",property:"Property",settings:"Settings",compared:"Compared",quitCompare:"Quit compare",fullscreen:"Full Screen",layers:"Layers",zoomToRectangle:"Zoom",screenshot:"Screenshot"},Tooltip:{measure:"Pick a point to continue, pressing ESC to exit",areaMeasurement:"Pick a point to continue, pressing ESC to exit, right click to finish",section:"Click to pick a section plane",boxSelect:"Box select an area"},PopPanel:{reset:"Reset"}},jde={NavCube:{front:"\u524d",back:"\u540e",top:"\u4e0a",bottom:"\u4e0b",left:"\u5de6",right:"\u53f3"},ContextMenu:{viewFitAll:"\u7f29\u653e\u89c6\u53e3\u5230\u6240\u6709\u6a21\u578b",hideAll:"\u5168\u90e8\u9690\u85cf",showAll:"\u5168\u90e8\u663e\u793a",xRayAll:"\u5168\u90e8\u5e94\u7528 X \u5149\u6a21\u5f0f",xRayNone:"\u6e05\u9664 X \u5149\u6a21\u5f0f",selectNone:"\u6e05\u7a7a\u9009\u62e9",resetView:"\u91cd\u7f6e\u89c6\u56fe",viewFitEntity:"\u7f29\u653e\u89c6\u53e3\u5230\u5b9e\u4f53",hideEntity:"\u9690\u85cf",hideOthers:"\u9690\u85cf\u5176\u4ed6 (\u9694\u79bb)",xRayEntity:"\u5e94\u7528 X \u5149\u6a21\u5f0f",xRayOthers:"\u5bf9\u5176\u4ed6\u5b9e\u4f53\u5e94\u7528 X \u5149\u6a21\u5f0f",select:"\u9009\u62e9",deselect:"\u53d6\u6d88\u9009\u62e9",showSectionPlane:"\u663e\u793a\u5256\u5207\u9762",showSectionBox:"\u663e\u793a\u5256\u5207\u76d2",showAxisSection:"\u663e\u793a\u8f74\u5411\u5256\u5207",hideSectionPlane:"\u9690\u85cf\u5256\u5207\u9762",hideSectionBox:"\u9690\u85cf\u5256\u5207\u76d2",hideAxisSection:"\u9690\u85cf\u8f74\u5411\u5256\u5207",undoSection:"\u53d6\u6d88\u5256\u5207"},ProgressBar:{Loading:"\u6b63\u5728\u52a0\u8f7d",Comparing:"\u6b63\u5728\u5bf9\u6bd4"},Toolbar:{homeView:"\u4e3b\u89c6\u56fe",orthoView:"\u6b63\u4ea4\u89c6\u56fe",measurement:"\u6d4b\u91cf",distanceMeasurement:"\u8ddd\u79bb\u6d4b\u91cf",areaMeasurement:"\u9762\u79ef\u6d4b\u91cf",angleMeasurement:"\u89d2\u5ea6\u6d4b\u91cf",coordinateMeasurement:"\u5750\u6807\u6d4b\u91cf",clearMeasurement:"\u6e05\u9664\u6d4b\u91cf",markupVisibility:"\u6279\u6ce8\u663e\u9690",markup:"\u6279\u6ce8",markupArrow:"\u7bad\u5934",markupRect:"\u77e9\u5f62\u6846",markupCloudRect:"\u4e91\u7ebf\u6846",markupPolyLine:"\u591a\u6bb5\u7ebf",markupCloudLine:"\u4e91\u7ebf",markupEllipse:"\u692d\u5706",markupCircle:"\u5706",markupDot:"\u70b9",markupText:"\u6587\u5b57",markupX:"\u53c9\u53f7",markupStroke:"\u753b\u7b14\u989c\u8272",markupLineWidth:"\u7ebf\u5bbd",markupLineWidth2:"\u7ebf\u5bbd 2",markupLineWidth5:"\u7ebf\u5bbd 5",markupLineWidth10:"\u7ebf\u5bbd 10",markupFontSize:"\u5b57\u53f7",markupFontSize14:"14",markupFontSize18:"18",markupFontSize24:"24",clearMarkup:"\u6e05\u9664\u6279\u6ce8",quitMarkup:"\u9000\u51fa\u6279\u6ce8",section:"\u5256\u5207",axisSection:"\u8f74\u5411\u5256\u5207",pickSectionPlane:"\u9762\u5256\u5207",sectionBox:"\u5256\u5207\u76d2",bimTree:"BIM\u6811",viewpoint:"\u89c6\u70b9",annotation:"\u6279\u6ce8",property:"\u5c5e\u6027",settings:"\u8bbe\u7f6e",compared:"\u56fe\u7eb8\u5bf9\u6bd4",quitCompare:"\u9000\u51fa\u56fe\u7eb8\u5bf9\u6bd4",fullscreen:"\u5168\u5c4f",layers:"\u56fe\u5c42",zoomToRectangle:"\u6846\u9009\u653e\u5927",screenshot:"\u622a\u5c4f"},Tooltip:{measure:"\u70b9\u51fb\u7ee7\u7eed\u6d4b\u91cf, ESC \u53d6\u6d88\u6d4b\u91cf",areaMeasurement:"\u70b9\u51fb\u7ee7\u7eed\u6d4b\u91cf, ESC \u53d6\u6d88\u6d4b\u91cf\uff0c\u53f3\u952e\u5b8c\u6210\u6d4b\u91cf",section:"\u70b9\u51fb\u786e\u5b9a\u5256\u5207\u9762",boxSelect:"\u6846\u9009\u4e00\u4e2a\u533a\u57df"},PopPanel:{reset:"\u91cd\u7f6e"}},ss=class{static materialEquals(e,t){if(e===t)return!0;if(e.type!==t.type)return!1;if(e instanceof qr&&t instanceof qr){let i=e,r=t;return e.alphaTest===t.alphaTest&&e.opacity===t.opacity&&e.side===t.side&&e.visible===t.visible&&e.name===t.name&&e.transparent===t.transparent&&this.colorEquals(i.color,r.color)&&this.colorEquals(i.emissive,r.emissive)&&i.roughness===r.roughness&&i.metalness===r.metalness&&i.alphaMap===r.alphaMap&&i.uniforms===r.uniforms&&i.defines===r.defines&&i.vertexShader===r.vertexShader&&i.fragmentShader===r.fragmentShader&&i.clippingPlanes===r.clippingPlanes&&i.map===r.map&&i.clipIntersection===r.clipIntersection}return!1}static materialsEquals(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)&&e.length===t.length){for(let i=0;i<e.length;++i)if(!this.materialEquals(e[i],t[i]))return!1;return!0}return e instanceof qr&&t instanceof qr&&this.materialEquals(e,t)}static colorEquals(e,t){return e===t||e instanceof Ve&&t instanceof Ve&&e.equals(t)}static clonedHighlightMaterials(e,t={}){if(!e||!e.material)return;let i=e.material;if(Array.isArray(i)&&i.length>0){let e=[];return i.forEach((i=>{e.push(this.clonedHighlightMaterial(i,t))})),e}if(i instanceof qr)return this.clonedHighlightMaterial(i,t);console.warn(`[MaterialUtils] Invalid material: ${i}`)}static clonedHighlightMaterial(e,t={}){let{depthTest:i,highlightColor:r=new Ve(583902),opacity:n=.7}=t,s=e.clone();return this.setMaterialColor(s,r),s.opacity=n,s.transparent=!0,void 0!==i&&(s.depthTest=!1,s.side=bi),s}static cloneMaterial(e){if(!e)return e;if(Array.isArray(e)){let t=[];return e.forEach((e=>{t.push(e.clone())})),t}return e.clone()}static getMaterialColor(e){let t=new Ve(16777215);return e instanceof Rn||e instanceof br||e instanceof Xt?t=e.color:e instanceof Zt&&e.uniforms.u_color&&(t=e.uniforms.u_color.value),t}static setMaterialColor(e,t){var i,r,n;let s=e;null==(i=s.color)||i.set(t),null==(r=s.emissive)||r.set(t),null!=(n=s.uniforms)&&n.u_color&&s.uniforms.u_color.value.set(t)}static cloneMaterials(e){let t=new Map;e.traverse((e=>{e.material&&(e.material=(e=>{let i;return Array.isArray(e)?(i=[],e.forEach((e=>{if(t.has(e))i.push(t.get(e));else{let r=e.clone();t.set(e,r),i.push(r)}}))):e&&(t.has(e)?i=t.get(e):(i=e.clone(),t.set(e,i))),i})(e.material))}))}};function bo(e,t=!1){let i=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),n=new Set(Object.keys(e[0].morphAttributes)),s={},a={},o=e[0].morphTargetsRelative,l=new ot,h=0;for(let u=0;u<e.length;++u){let c=e[u],p=0;if(i!==(null!==c.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let e in c.attributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===s[e]&&(s[e]=[]),s[e].push(c.attributes[e]),p++}if(p!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". Make sure all geometries have the same number of attributes."),null;if(o!==c.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let e in c.morphAttributes){if(!n.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[e]&&(a[e]=[]),a[e].push(c.morphAttributes[e])}if(t){let e;if(i)e=c.index.count;else{if(void 0===c.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". The geometry must have either an index or a position attribute"),null;e=c.attributes.position.count}l.addGroup(h,e,u),h+=e}}if(i){let t=0,i=[];for(let r=0;r<e.length;++r){let n=e[r].index;for(let e=0;e<n.count;++e)i.push(n.getX(e)+t);t+=e[r].attributes.position.count}l.setIndex(i)}for(let u in s){let e=Wde(s[u]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" attribute."),null;l.setAttribute(u,e)}for(let u in a){let e=a[u][0].length;if(0===e)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[u]=[];for(let t=0;t<e;++t){let e=[];for(let r=0;r<a[u].length;++r)e.push(a[u][r][t]);let i=Wde(e);if(!i)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" morphAttribute."),null;l.morphAttributes[u].push(i)}}return l}function Wde(e){let t,i,r,n=0;for(let o=0;o<e.length;++o){let s=e[o];if(s.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===i&&(i=s.itemSize),i!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=s.normalized),r!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;n+=s.array.length}let s=new t(n),a=0;for(let o=0;o<e.length;++o)s.set(e[o].array,a),a+=e[o].array.length;return new Wt(s,i,r)}function qde(e,t=1e-4){t=Math.max(t,Number.EPSILON);let i={},r=e.getIndex(),n=e.getAttribute("position"),s=r?r.count:n.count,a=0,o=Object.keys(e.attributes),l={},h={},u=[],c=["getX","getY","getZ","getW"],p=["setX","setY","setZ","setW"];for(let g=0,y=o.length;g<y;g++){let t=o[g],i=e.attributes[t];l[t]=new Wt(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized);let r=e.morphAttributes[t];r&&(h[t]=new Wt(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized))}let d=Math.log10(1/t),f=Math.pow(10,d);for(let g=0;g<s;g++){let t=r?r.getX(g):g,n="";for(let i=0,r=o.length;i<r;i++){let r=o[i],s=e.getAttribute(r),a=s.itemSize;for(let e=0;e<a;e++)n+=~~(s[c[e]](t)*f)+","}if(n in i)u.push(i[n]);else{for(let i=0,r=o.length;i<r;i++){let r=o[i],n=e.getAttribute(r),s=e.morphAttributes[r],u=n.itemSize,d=l[r],f=h[r];for(let e=0;e<u;e++){let i=c[e],r=p[e];if(d[r](a,n[i](t)),s)for(let e=0,n=s.length;e<n;e++)f[e][r](a,s[e][i](t))}}i[n]=a,u.push(a),a++}}let m=e.clone();for(let g in e.attributes){let e=l[g];if(m.setAttribute(g,new Wt(e.array.slice(0,a*e.itemSize),e.itemSize,e.normalized)),g in h)for(let t=0;t<h[g].length;t++){let e=h[g][t];m.morphAttributes[g][t]=new Wt(e.array.slice(0,a*e.itemSize),e.itemSize,e.normalized)}}return m.setIndex(u),m}function yk(e,t){if(t===TB)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===Jy||t===Gx){let i=e.getIndex();if(null===i){let t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),i=e.getIndex()}let r=i.count-2,n=[];if(t===Jy)for(let e=1;e<=r;e++)n.push(i.getX(0)),n.push(i.getX(e)),n.push(i.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(n.push(i.getX(e)),n.push(i.getX(e+1)),n.push(i.getX(e+2))):(n.push(i.getX(e+2)),n.push(i.getX(e+1)),n.push(i.getX(e)));n.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let s=e.clone();return s.setIndex(n),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}function eI(e){let t=new Blob([e],{type:"text/javascript"}),i=URL.createObjectURL(t),r=new Worker(i);return URL.revokeObjectURL(i),r}function Ek(){return eI('var Sc=Object.defineProperty,Tc=Object.defineProperties;var Ac=Object.getOwnPropertyDescriptors;var Ao=Object.getOwnPropertySymbols;var Ec=Object.prototype.hasOwnProperty,Cc=Object.prototype.propertyIsEnumerable;var Eo=(r,t,e)=>t in r?Sc(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Zi=(r,t)=>{for(var e in t||(t={}))Ec.call(t,e)&&Eo(r,e,t[e]);if(Ao)for(var e of Ao(t))Cc.call(t,e)&&Eo(r,e,t[e]);return r},Co=(r,t)=>Tc(r,Ac(t));var ro="149";var Pc=0,Po=1,Rc=2;var Wa=1,Lc=2,Ni=3,Ue=0,he=1,We=2;var pn=0,ri=1,Ro=2,Lo=3,Io=4,Ic=5,ni=100,Dc=101,Nc=102,Do=103,No=104,Fc=200,zc=201,Oc=202,Bc=203,qa=204,Xa=205,Uc=206,kc=207,Vc=208,Gc=209,Hc=210,Wc=0,qc=1,Xc=2,Er=3,Yc=4,Zc=5,Jc=6,$c=7,Ya=0,Kc=1,jc=2,nn=0,Qc=1,tl=2,el=3,nl=4,il=5,Za=300,ci=301,li=302,Cr=303,Pr=304,Ls=306,Rr=1e3,Oe=1001,Lr=1002,ce=1003,Fo=1004;var Zs=1005;var Re=1006,sl=1007;var Oi=1008;var Dn=1009,rl=1010,ol=1011,Ja=1012,al=1013,Pn=1014,Rn=1015,Bi=1016,cl=1017,ll=1018,oi=1020,hl=1021,Be=1023,ul=1024,fl=1025,Ln=1026,hi=1027,dl=1028,pl=1029,ml=1030,gl=1031,xl=1033,Js=33776,$s=33777,Ks=33778,js=33779,zo=35840,Oo=35841,Bo=35842,Uo=35843,_l=36196,ko=37492,Vo=37496,Go=37808,Ho=37809,Wo=37810,qo=37811,Xo=37812,Yo=37813,Zo=37814,Jo=37815,$o=37816,Ko=37817,jo=37818,Qo=37819,ta=37820,ea=37821,Qs=36492,yl=36283,na=36284,ia=36285,sa=36286;var xs=2300,_s=2301,tr=2302,ra=2400,oa=2401,aa=2402;var Nn=3e3,Ot=3001,vl=3200,Ml=3201,bl=0,wl=1;var Ge="srgb",Ui="srgb-linear";var er=7680;var Sl=519,ca=35044;var la="300 es",Ir=1035,mn=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,t);t.target=null}}},ne=["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"];var nr=Math.PI/180,ha=180/Math.PI;function Gi(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ne[r&255]+ne[r>>8&255]+ne[r>>16&255]+ne[r>>24&255]+"-"+ne[t&255]+ne[t>>8&255]+"-"+ne[t>>16&15|64]+ne[t>>24&255]+"-"+ne[e&63|128]+ne[e>>8&255]+"-"+ne[e>>16&255]+ne[e>>24&255]+ne[n&255]+ne[n>>8&255]+ne[n>>16&255]+ne[n>>24&255]).toLowerCase()}function de(r,t,e){return Math.max(t,Math.min(e,r))}function Tl(r,t){return(r%t+t)%t}function ir(r,t,e){return(1-e)*r+e*t}function ua(r){return(r&r-1)===0&&r!==0}function Dr(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function Ji(r,t){switch(t.constructor){case Float32Array:return r;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Me(r,t){switch(t.constructor){case Float32Array:return r;case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var At=class{constructor(t=0,e=0){At.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*n-a*i+t.x,this.y=s*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},le=class{constructor(){le.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,n,i,s,a,o,c,l){let h=this.elements;return h[0]=t,h[1]=i,h[2]=o,h[3]=e,h[4]=s,h[5]=c,h[6]=n,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],o=n[3],c=n[6],l=n[1],h=n[4],f=n[7],u=n[2],m=n[5],x=n[8],p=i[0],d=i[3],g=i[6],M=i[1],_=i[4],v=i[7],b=i[2],A=i[5],C=i[8];return s[0]=a*p+o*M+c*b,s[3]=a*d+o*_+c*A,s[6]=a*g+o*v+c*C,s[1]=l*p+h*M+f*b,s[4]=l*d+h*_+f*A,s[7]=l*g+h*v+f*C,s[2]=u*p+m*M+x*b,s[5]=u*d+m*_+x*A,s[8]=u*g+m*v+x*C,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8];return e*a*h-e*o*l-n*s*h+n*o*c+i*s*l-i*a*c}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],f=h*a-o*l,u=o*c-h*s,m=l*s-a*c,x=e*f+n*u+i*m;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/x;return t[0]=f*p,t[1]=(i*l-h*n)*p,t[2]=(o*n-i*a)*p,t[3]=u*p,t[4]=(h*e-i*c)*p,t[5]=(i*s-o*e)*p,t[6]=m*p,t[7]=(n*c-l*e)*p,t[8]=(a*e-n*s)*p,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,a,o){let c=Math.cos(s),l=Math.sin(s);return this.set(n*c,n*l,-n*(c*a+l*o)+a+t,-i*l,i*c,-i*(-l*a+c*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(sr.makeScale(t,e)),this}rotate(t){return this.premultiply(sr.makeRotation(-t)),this}translate(t,e){return this.premultiply(sr.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},sr=new le;function $a(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function ys(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function In(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function gs(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var rr={[Ge]:{[Ui]:In},[Ui]:{[Ge]:gs}},oe={legacyMode:!0,get workingColorSpace(){return Ui},set workingColorSpace(r){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(r,t,e){if(this.legacyMode||t===e||!t||!e)return r;if(rr[t]&&rr[t][e]!==void 0){let n=rr[t][e];return r.r=n(r.r),r.g=n(r.g),r.b=n(r.b),r}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(r,t){return this.convert(r,this.workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this.workingColorSpace)}},Ka={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},qt={r:0,g:0,b:0},Ne={h:0,s:0,l:0},$i={h:0,s:0,l:0};function or(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}function Ki(r,t){return t.r=r.r,t.g=r.g,t.b=r.b,t}var Bt=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,e===void 0&&n===void 0?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ge){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,oe.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=oe.workingColorSpace){return this.r=t,this.g=e,this.b=n,oe.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=oe.workingColorSpace){if(t=Tl(t,1),e=de(e,0,1),n=de(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,a=2*n-s;this.r=or(a,s,t+1/3),this.g=or(a,s,t),this.b=or(a,s,t-1/3)}return oe.toWorkingColorSpace(this,i),this}setStyle(t,e=Ge){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(t)){let s,a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(s[1],10))/255,this.g=Math.min(255,parseInt(s[2],10))/255,this.b=Math.min(255,parseInt(s[3],10))/255,oe.toWorkingColorSpace(this,e),n(s[4]),this;if(s=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(s[1],10))/100,this.g=Math.min(100,parseInt(s[2],10))/100,this.b=Math.min(100,parseInt(s[3],10))/100,oe.toWorkingColorSpace(this,e),n(s[4]),this;break;case"hsl":case"hsla":if(s=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o)){let c=parseFloat(s[1])/360,l=parseFloat(s[2])/100,h=parseFloat(s[3])/100;return n(s[4]),this.setHSL(c,l,h,e)}break}}else if(i=/^\\#([A-Fa-f\\d]+)$/.exec(t)){let s=i[1],a=s.length;if(a===3)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,oe.toWorkingColorSpace(this,e),this;if(a===6)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,oe.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=Ge){let n=Ka[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=In(t.r),this.g=In(t.g),this.b=In(t.b),this}copyLinearToSRGB(t){return this.r=gs(t.r),this.g=gs(t.g),this.b=gs(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ge){return oe.fromWorkingColorSpace(Ki(this,qt),t),de(qt.r*255,0,255)<<16^de(qt.g*255,0,255)<<8^de(qt.b*255,0,255)<<0}getHexString(t=Ge){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=oe.workingColorSpace){oe.fromWorkingColorSpace(Ki(this,qt),e);let n=qt.r,i=qt.g,s=qt.b,a=Math.max(n,i,s),o=Math.min(n,i,s),c,l,h=(o+a)/2;if(o===a)c=0,l=0;else{let f=a-o;switch(l=h<=.5?f/(a+o):f/(2-a-o),a){case n:c=(i-s)/f+(i<s?6:0);break;case i:c=(s-n)/f+2;break;case s:c=(n-i)/f+4;break}c/=6}return t.h=c,t.s=l,t.l=h,t}getRGB(t,e=oe.workingColorSpace){return oe.fromWorkingColorSpace(Ki(this,qt),e),t.r=qt.r,t.g=qt.g,t.b=qt.b,t}getStyle(t=Ge){return oe.fromWorkingColorSpace(Ki(this,qt),t),t!==Ge?`color(${t} ${qt.r} ${qt.g} ${qt.b})`:`rgb(${qt.r*255|0},${qt.g*255|0},${qt.b*255|0})`}offsetHSL(t,e,n){return this.getHSL(Ne),Ne.h+=t,Ne.s+=e,Ne.l+=n,this.setHSL(Ne.h,Ne.s,Ne.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Ne),t.getHSL($i);let n=ir(Ne.h,$i.h,e),i=ir(Ne.s,$i.s,e),s=ir(Ne.l,$i.l,e);return this.setHSL(n,i,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};Bt.NAMES=Ka;var Gn,vs=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Gn===void 0&&(Gn=ys("canvas")),Gn.width=t.width,Gn.height=t.height;let n=Gn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Gn}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap){let e=ys("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=In(s[a]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(In(e[n]/255)*255):e[n]=In(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},Ms=class{constructor(t=null){this.isSource=!0,this.uuid=Gi(),this.data=t,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(ar(i[a].image)):s.push(ar(i[a]))}else s=ar(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function ar(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?vs.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Al=0,ue=class extends mn{constructor(t=ue.DEFAULT_IMAGE,e=ue.DEFAULT_MAPPING,n=Oe,i=Oe,s=Re,a=Oi,o=Be,c=Dn,l=ue.DEFAULT_ANISOTROPY,h=Nn){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Al++}),this.uuid=Gi(),this.name="",this.source=new Ms(t),this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=c,this.offset=new At(0,0),this.repeat=new At(1,1),this.center=new At(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new le,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,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,type:this.type,encoding:this.encoding,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),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Za)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Rr:t.x=t.x-Math.floor(t.x);break;case Oe:t.x=t.x<0?0:1;break;case Lr:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Rr:t.y=t.y-Math.floor(t.y);break;case Oe:t.y=t.y<0?0:1;break;case Lr:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}};ue.DEFAULT_IMAGE=null;ue.DEFAULT_MAPPING=Za;ue.DEFAULT_ANISOTROPY=1;var Xt=class{constructor(t=0,e=0,n=0,i=1){Xt.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s,c=t.elements,l=c[0],h=c[4],f=c[8],u=c[1],m=c[5],x=c[9],p=c[2],d=c[6],g=c[10];if(Math.abs(h-u)<.01&&Math.abs(f-p)<.01&&Math.abs(x-d)<.01){if(Math.abs(h+u)<.1&&Math.abs(f+p)<.1&&Math.abs(x+d)<.1&&Math.abs(l+m+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let _=(l+1)/2,v=(m+1)/2,b=(g+1)/2,A=(h+u)/4,C=(f+p)/4,y=(x+d)/4;return _>v&&_>b?_<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(_),i=A/n,s=C/n):v>b?v<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(v),n=A/i,s=y/i):b<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(b),n=C/s,i=y/s),this.set(n,i,s,e),this}let M=Math.sqrt((d-x)*(d-x)+(f-p)*(f-p)+(u-h)*(u-h));return Math.abs(M)<.001&&(M=1),this.x=(d-x)/M,this.y=(f-p)/M,this.z=(u-h)/M,this.w=Math.acos((l+m+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},rn=class extends mn{constructor(t=1,e=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Xt(0,0,t,e),this.scissorTest=!1,this.viewport=new Xt(0,0,t,e);let i={width:t,height:e,depth:1};this.texture=new ue(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.internalFormat=n.internalFormat!==void 0?n.internalFormat:null,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Re,this.depthBuffer=n.depthBuffer!==void 0?n.depthBuffer:!0,this.stencilBuffer=n.stencilBuffer!==void 0?n.stencilBuffer:!1,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null,this.samples=n.samples!==void 0?n.samples:0}setSize(t,e,n=1){(this.width!==t||this.height!==e||this.depth!==n)&&(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new Ms(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},bs=class extends ue{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ce,this.minFilter=ce,this.wrapR=Oe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Nr=class extends ue{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ce,this.minFilter=ce,this.wrapR=Oe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var gn=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,a,o){let c=n[i+0],l=n[i+1],h=n[i+2],f=n[i+3],u=s[a+0],m=s[a+1],x=s[a+2],p=s[a+3];if(o===0){t[e+0]=c,t[e+1]=l,t[e+2]=h,t[e+3]=f;return}if(o===1){t[e+0]=u,t[e+1]=m,t[e+2]=x,t[e+3]=p;return}if(f!==p||c!==u||l!==m||h!==x){let d=1-o,g=c*u+l*m+h*x+f*p,M=g>=0?1:-1,_=1-g*g;if(_>Number.EPSILON){let b=Math.sqrt(_),A=Math.atan2(b,g*M);d=Math.sin(d*A)/b,o=Math.sin(o*A)/b}let v=o*M;if(c=c*d+u*v,l=l*d+m*v,h=h*d+x*v,f=f*d+p*v,d===1-o){let b=1/Math.sqrt(c*c+l*l+h*h+f*f);c*=b,l*=b,h*=b,f*=b}}t[e]=c,t[e+1]=l,t[e+2]=h,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,a){let o=n[i],c=n[i+1],l=n[i+2],h=n[i+3],f=s[a],u=s[a+1],m=s[a+2],x=s[a+3];return t[e]=o*x+h*f+c*m-l*u,t[e+1]=c*x+h*u+l*f-o*m,t[e+2]=l*x+h*m+o*u-c*f,t[e+3]=h*x-o*f-c*u-l*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){let n=t._x,i=t._y,s=t._z,a=t._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(i/2),f=o(s/2),u=c(n/2),m=c(i/2),x=c(s/2);switch(a){case"XYZ":this._x=u*h*f+l*m*x,this._y=l*m*f-u*h*x,this._z=l*h*x+u*m*f,this._w=l*h*f-u*m*x;break;case"YXZ":this._x=u*h*f+l*m*x,this._y=l*m*f-u*h*x,this._z=l*h*x-u*m*f,this._w=l*h*f+u*m*x;break;case"ZXY":this._x=u*h*f-l*m*x,this._y=l*m*f+u*h*x,this._z=l*h*x+u*m*f,this._w=l*h*f-u*m*x;break;case"ZYX":this._x=u*h*f-l*m*x,this._y=l*m*f+u*h*x,this._z=l*h*x-u*m*f,this._w=l*h*f+u*m*x;break;case"YZX":this._x=u*h*f+l*m*x,this._y=l*m*f+u*h*x,this._z=l*h*x-u*m*f,this._w=l*h*f-u*m*x;break;case"XZY":this._x=u*h*f-l*m*x,this._y=l*m*f-u*h*x,this._z=l*h*x+u*m*f,this._w=l*h*f+u*m*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],a=e[1],o=e[5],c=e[9],l=e[2],h=e[6],f=e[10],u=n+o+f;if(u>0){let m=.5/Math.sqrt(u+1);this._w=.25/m,this._x=(h-c)*m,this._y=(s-l)*m,this._z=(a-i)*m}else if(n>o&&n>f){let m=2*Math.sqrt(1+n-o-f);this._w=(h-c)/m,this._x=.25*m,this._y=(i+a)/m,this._z=(s+l)/m}else if(o>f){let m=2*Math.sqrt(1+o-n-f);this._w=(s-l)/m,this._x=(i+a)/m,this._y=.25*m,this._z=(c+h)/m}else{let m=2*Math.sqrt(1+f-n-o);this._w=(a-i)/m,this._x=(s+l)/m,this._y=(c+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(de(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,a=t._w,o=e._x,c=e._y,l=e._z,h=e._w;return this._x=n*h+a*o+i*l-s*c,this._y=i*h+a*c+s*o-n*l,this._z=s*h+a*l+n*c-i*o,this._w=a*h-n*o-i*c-s*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,a=this._w,o=a*t._w+n*t._x+i*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;let c=1-o*o;if(c<=Number.EPSILON){let m=1-e;return this._w=m*a+e*this._w,this._x=m*n+e*this._x,this._y=m*i+e*this._y,this._z=m*s+e*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(c),h=Math.atan2(l,o),f=Math.sin((1-e)*h)/l,u=Math.sin(e*h)/l;return this._w=a*f+this._w*u,this._x=n*f+this._x*u,this._y=i*f+this._y*u,this._z=s*f+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(s),n*Math.cos(s),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},R=class{constructor(t=0,e=0,n=0){R.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(fa.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(fa.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,a=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,a=t.y,o=t.z,c=t.w,l=c*e+a*i-o*n,h=c*n+o*e-s*i,f=c*i+s*n-a*e,u=-s*e-a*n-o*i;return this.x=l*c+u*-s+h*-o-f*-a,this.y=h*c+u*-a+f*-s-l*-o,this.z=f*c+u*-o+l*-a-h*-s,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,a=e.x,o=e.y,c=e.z;return this.x=i*c-s*o,this.y=s*a-n*c,this.z=n*o-i*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return cr.copy(this).projectOnVector(t),this.sub(cr)}reflect(t){return this.sub(cr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(de(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},cr=new R,fa=new gn,fe=class{constructor(t=new R(1/0,1/0,1/0),e=new R(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,i=1/0,s=-1/0,a=-1/0,o=-1/0;for(let c=0,l=t.length;c<l;c+=3){let h=t[c],f=t[c+1],u=t[c+2];h<e&&(e=h),f<n&&(n=f),u<i&&(i=u),h>s&&(s=h),f>a&&(a=f),u>o&&(o=u)}return this.min.set(e,n,i),this.max.set(s,a,o),this}setFromBufferAttribute(t){let e=1/0,n=1/0,i=1/0,s=-1/0,a=-1/0,o=-1/0;for(let c=0,l=t.count;c<l;c++){let h=t.getX(c),f=t.getY(c),u=t.getZ(c);h<e&&(e=h),f<n&&(n=f),u<i&&(i=u),h>s&&(s=h),f>a&&(a=f),u>o&&(o=u)}return this.min.set(e,n,i),this.max.set(s,a,o),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=Sn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0)if(e&&n.attributes!=null&&n.attributes.position!==void 0){let s=n.attributes.position;for(let a=0,o=s.count;a<o;a++)Sn.fromBufferAttribute(s,a).applyMatrix4(t.matrixWorld),this.expandByPoint(Sn)}else n.boundingBox===null&&n.computeBoundingBox(),lr.copy(n.boundingBox),lr.applyMatrix4(t.matrixWorld),this.union(lr);let i=t.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Sn),Sn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Ei),ji.subVectors(this.max,Ei),Hn.subVectors(t.a,Ei),Wn.subVectors(t.b,Ei),qn.subVectors(t.c,Ei),ln.subVectors(Wn,Hn),hn.subVectors(qn,Wn),Tn.subVectors(Hn,qn);let e=[0,-ln.z,ln.y,0,-hn.z,hn.y,0,-Tn.z,Tn.y,ln.z,0,-ln.x,hn.z,0,-hn.x,Tn.z,0,-Tn.x,-ln.y,ln.x,0,-hn.y,hn.x,0,-Tn.y,Tn.x,0];return!hr(e,Hn,Wn,qn,ji)||(e=[1,0,0,0,1,0,0,0,1],!hr(e,Hn,Wn,qn,ji))?!1:(Qi.crossVectors(ln,hn),e=[Qi.x,Qi.y,Qi.z],hr(e,Hn,Wn,qn,ji))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Sn.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=this.getSize(Sn).length()*.5,t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Ke[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ke[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ke[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ke[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ke[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ke[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ke[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ke[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ke),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Ke=[new R,new R,new R,new R,new R,new R,new R,new R],Sn=new R,lr=new fe,Hn=new R,Wn=new R,qn=new R,ln=new R,hn=new R,Tn=new R,Ei=new R,ji=new R,Qi=new R,An=new R;function hr(r,t,e,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){An.fromArray(r,s);let o=i.x*Math.abs(An.x)+i.y*Math.abs(An.y)+i.z*Math.abs(An.z),c=t.dot(An),l=e.dot(An),h=n.dot(An);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}var El=new fe,Ci=new R,ur=new R,Fn=class{constructor(t=new R,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):El.setFromPoints(t).getCenter(n);let i=0;for(let s=0,a=t.length;s<a;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Ci.subVectors(t,this.center);let e=Ci.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Ci,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ur.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Ci.copy(t.center).add(ur)),this.expandByPoint(Ci.copy(t.center).sub(ur))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},je=new R,fr=new R,ts=new R,un=new R,dr=new R,es=new R,pr=new R,Fr=class{constructor(t=new R,e=new R(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,je)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=je.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(je.copy(this.direction).multiplyScalar(e).add(this.origin),je.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){fr.copy(t).add(e).multiplyScalar(.5),ts.copy(e).sub(t).normalize(),un.copy(this.origin).sub(fr);let s=t.distanceTo(e)*.5,a=-this.direction.dot(ts),o=un.dot(this.direction),c=-un.dot(ts),l=un.lengthSq(),h=Math.abs(1-a*a),f,u,m,x;if(h>0)if(f=a*c-o,u=a*o-c,x=s*h,f>=0)if(u>=-x)if(u<=x){let p=1/h;f*=p,u*=p,m=f*(f+a*u+2*o)+u*(a*f+u+2*c)+l}else u=s,f=Math.max(0,-(a*u+o)),m=-f*f+u*(u+2*c)+l;else u=-s,f=Math.max(0,-(a*u+o)),m=-f*f+u*(u+2*c)+l;else u<=-x?(f=Math.max(0,-(-a*s+o)),u=f>0?-s:Math.min(Math.max(-s,-c),s),m=-f*f+u*(u+2*c)+l):u<=x?(f=0,u=Math.min(Math.max(-s,-c),s),m=u*(u+2*c)+l):(f=Math.max(0,-(a*s+o)),u=f>0?s:Math.min(Math.max(-s,-c),s),m=-f*f+u*(u+2*c)+l);else u=a>0?-s:s,f=Math.max(0,-(a*u+o)),m=-f*f+u*(u+2*c)+l;return n&&n.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(ts).multiplyScalar(u).add(fr),m}intersectSphere(t,e){je.subVectors(t.center,this.origin);let n=je.dot(this.direction),i=je.dot(je)-n*n,s=t.radius*t.radius;if(i>s)return null;let a=Math.sqrt(s-i),o=n-a,c=n+a;return o<0&&c<0?null:o<0?this.at(c,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,a,o,c,l=1/this.direction.x,h=1/this.direction.y,f=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),h>=0?(s=(t.min.y-u.y)*h,a=(t.max.y-u.y)*h):(s=(t.max.y-u.y)*h,a=(t.min.y-u.y)*h),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),f>=0?(o=(t.min.z-u.z)*f,c=(t.max.z-u.z)*f):(o=(t.max.z-u.z)*f,c=(t.min.z-u.z)*f),n>c||o>i)||((o>n||n!==n)&&(n=o),(c<i||i!==i)&&(i=c),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,je)!==null}intersectTriangle(t,e,n,i,s){dr.subVectors(e,t),es.subVectors(n,t),pr.crossVectors(dr,es);let a=this.direction.dot(pr),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;un.subVectors(this.origin,t);let c=o*this.direction.dot(es.crossVectors(un,es));if(c<0)return null;let l=o*this.direction.dot(dr.cross(un));if(l<0||c+l>a)return null;let h=-o*un.dot(pr);return h<0?null:this.at(h/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},zt=class{constructor(){zt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,n,i,s,a,o,c,l,h,f,u,m,x,p,d){let g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=s,g[5]=a,g[9]=o,g[13]=c,g[2]=l,g[6]=h,g[10]=f,g[14]=u,g[3]=m,g[7]=x,g[11]=p,g[15]=d,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new zt().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/Xn.setFromMatrixColumn(t,0).length(),s=1/Xn.setFromMatrixColumn(t,1).length(),a=1/Xn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,a=Math.cos(n),o=Math.sin(n),c=Math.cos(i),l=Math.sin(i),h=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let u=a*h,m=a*f,x=o*h,p=o*f;e[0]=c*h,e[4]=-c*f,e[8]=l,e[1]=m+x*l,e[5]=u-p*l,e[9]=-o*c,e[2]=p-u*l,e[6]=x+m*l,e[10]=a*c}else if(t.order==="YXZ"){let u=c*h,m=c*f,x=l*h,p=l*f;e[0]=u+p*o,e[4]=x*o-m,e[8]=a*l,e[1]=a*f,e[5]=a*h,e[9]=-o,e[2]=m*o-x,e[6]=p+u*o,e[10]=a*c}else if(t.order==="ZXY"){let u=c*h,m=c*f,x=l*h,p=l*f;e[0]=u-p*o,e[4]=-a*f,e[8]=x+m*o,e[1]=m+x*o,e[5]=a*h,e[9]=p-u*o,e[2]=-a*l,e[6]=o,e[10]=a*c}else if(t.order==="ZYX"){let u=a*h,m=a*f,x=o*h,p=o*f;e[0]=c*h,e[4]=x*l-m,e[8]=u*l+p,e[1]=c*f,e[5]=p*l+u,e[9]=m*l-x,e[2]=-l,e[6]=o*c,e[10]=a*c}else if(t.order==="YZX"){let u=a*c,m=a*l,x=o*c,p=o*l;e[0]=c*h,e[4]=p-u*f,e[8]=x*f+m,e[1]=f,e[5]=a*h,e[9]=-o*h,e[2]=-l*h,e[6]=m*f+x,e[10]=u-p*f}else if(t.order==="XZY"){let u=a*c,m=a*l,x=o*c,p=o*l;e[0]=c*h,e[4]=-f,e[8]=l*h,e[1]=u*f+p,e[5]=a*h,e[9]=m*f-x,e[2]=x*f-m,e[6]=o*h,e[10]=p*f+u}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Cl,t,Pl)}lookAt(t,e,n){let i=this.elements;return be.subVectors(t,e),be.lengthSq()===0&&(be.z=1),be.normalize(),fn.crossVectors(n,be),fn.lengthSq()===0&&(Math.abs(n.z)===1?be.x+=1e-4:be.z+=1e-4,be.normalize(),fn.crossVectors(n,be)),fn.normalize(),ns.crossVectors(be,fn),i[0]=fn.x,i[4]=ns.x,i[8]=be.x,i[1]=fn.y,i[5]=ns.y,i[9]=be.y,i[2]=fn.z,i[6]=ns.z,i[10]=be.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],o=n[4],c=n[8],l=n[12],h=n[1],f=n[5],u=n[9],m=n[13],x=n[2],p=n[6],d=n[10],g=n[14],M=n[3],_=n[7],v=n[11],b=n[15],A=i[0],C=i[4],y=i[8],S=i[12],P=i[1],O=i[5],B=i[9],D=i[13],I=i[2],k=i[6],Y=i[10],Z=i[14],H=i[3],$=i[7],J=i[11],dt=i[15];return s[0]=a*A+o*P+c*I+l*H,s[4]=a*C+o*O+c*k+l*$,s[8]=a*y+o*B+c*Y+l*J,s[12]=a*S+o*D+c*Z+l*dt,s[1]=h*A+f*P+u*I+m*H,s[5]=h*C+f*O+u*k+m*$,s[9]=h*y+f*B+u*Y+m*J,s[13]=h*S+f*D+u*Z+m*dt,s[2]=x*A+p*P+d*I+g*H,s[6]=x*C+p*O+d*k+g*$,s[10]=x*y+p*B+d*Y+g*J,s[14]=x*S+p*D+d*Z+g*dt,s[3]=M*A+_*P+v*I+b*H,s[7]=M*C+_*O+v*k+b*$,s[11]=M*y+_*B+v*Y+b*J,s[15]=M*S+_*D+v*Z+b*dt,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],a=t[1],o=t[5],c=t[9],l=t[13],h=t[2],f=t[6],u=t[10],m=t[14],x=t[3],p=t[7],d=t[11],g=t[15];return x*(+s*c*f-i*l*f-s*o*u+n*l*u+i*o*m-n*c*m)+p*(+e*c*m-e*l*u+s*a*u-i*a*m+i*l*h-s*c*h)+d*(+e*l*f-e*o*m-s*a*f+n*a*m+s*o*h-n*l*h)+g*(-i*o*h-e*c*f+e*o*u+i*a*f-n*a*u+n*c*h)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],f=t[9],u=t[10],m=t[11],x=t[12],p=t[13],d=t[14],g=t[15],M=f*d*l-p*u*l+p*c*m-o*d*m-f*c*g+o*u*g,_=x*u*l-h*d*l-x*c*m+a*d*m+h*c*g-a*u*g,v=h*p*l-x*f*l+x*o*m-a*p*m-h*o*g+a*f*g,b=x*f*c-h*p*c-x*o*u+a*p*u+h*o*d-a*f*d,A=e*M+n*_+i*v+s*b;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let C=1/A;return t[0]=M*C,t[1]=(p*u*s-f*d*s-p*i*m+n*d*m+f*i*g-n*u*g)*C,t[2]=(o*d*s-p*c*s+p*i*l-n*d*l-o*i*g+n*c*g)*C,t[3]=(f*c*s-o*u*s-f*i*l+n*u*l+o*i*m-n*c*m)*C,t[4]=_*C,t[5]=(h*d*s-x*u*s+x*i*m-e*d*m-h*i*g+e*u*g)*C,t[6]=(x*c*s-a*d*s-x*i*l+e*d*l+a*i*g-e*c*g)*C,t[7]=(a*u*s-h*c*s+h*i*l-e*u*l-a*i*m+e*c*m)*C,t[8]=v*C,t[9]=(x*f*s-h*p*s-x*n*m+e*p*m+h*n*g-e*f*g)*C,t[10]=(a*p*s-x*o*s+x*n*l-e*p*l-a*n*g+e*o*g)*C,t[11]=(h*o*s-a*f*s-h*n*l+e*f*l+a*n*m-e*o*m)*C,t[12]=b*C,t[13]=(h*p*i-x*f*i+x*n*u-e*p*u-h*n*d+e*f*d)*C,t[14]=(x*o*i-a*p*i-x*n*c+e*p*c+a*n*d-e*o*d)*C,t[15]=(a*f*i-h*o*i+h*n*c-e*f*c-a*n*u+e*o*u)*C,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,a=t.x,o=t.y,c=t.z,l=s*a,h=s*o;return this.set(l*a+n,l*o-i*c,l*c+i*o,0,l*o+i*c,h*o+n,h*c-i*a,0,l*c-i*o,h*c+i*a,s*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,a){return this.set(1,n,s,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,a=e._y,o=e._z,c=e._w,l=s+s,h=a+a,f=o+o,u=s*l,m=s*h,x=s*f,p=a*h,d=a*f,g=o*f,M=c*l,_=c*h,v=c*f,b=n.x,A=n.y,C=n.z;return i[0]=(1-(p+g))*b,i[1]=(m+v)*b,i[2]=(x-_)*b,i[3]=0,i[4]=(m-v)*A,i[5]=(1-(u+g))*A,i[6]=(d+M)*A,i[7]=0,i[8]=(x+_)*C,i[9]=(d-M)*C,i[10]=(1-(u+p))*C,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=Xn.set(i[0],i[1],i[2]).length(),a=Xn.set(i[4],i[5],i[6]).length(),o=Xn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],Fe.copy(this);let l=1/s,h=1/a,f=1/o;return Fe.elements[0]*=l,Fe.elements[1]*=l,Fe.elements[2]*=l,Fe.elements[4]*=h,Fe.elements[5]*=h,Fe.elements[6]*=h,Fe.elements[8]*=f,Fe.elements[9]*=f,Fe.elements[10]*=f,e.setFromRotationMatrix(Fe),n.x=s,n.y=a,n.z=o,this}makePerspective(t,e,n,i,s,a){let o=this.elements,c=2*s/(e-t),l=2*s/(n-i),h=(e+t)/(e-t),f=(n+i)/(n-i),u=-(a+s)/(a-s),m=-2*a*s/(a-s);return o[0]=c,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=l,o[9]=f,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=m,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,s,a){let o=this.elements,c=1/(e-t),l=1/(n-i),h=1/(a-s),f=(e+t)*c,u=(n+i)*l,m=(a+s)*h;return o[0]=2*c,o[4]=0,o[8]=0,o[12]=-f,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-m,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Xn=new R,Fe=new zt,Cl=new R(0,0,0),Pl=new R(1,1,1),fn=new R,ns=new R,be=new R,da=new zt,pa=new gn,ui=class{constructor(t=0,e=0,n=0,i=ui.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],a=i[4],o=i[8],c=i[1],l=i[5],h=i[9],f=i[2],u=i[6],m=i[10];switch(e){case"XYZ":this._y=Math.asin(de(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-de(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(de(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-de(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(u,m),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(de(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-de(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return da.makeRotationFromQuaternion(t),this.setFromRotationMatrix(da,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return pa.setFromEuler(this),this.setFromQuaternion(pa,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};ui.DEFAULT_ORDER="XYZ";var ws=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},Rl=0,ma=new R,Yn=new gn,Qe=new zt,is=new R,Pi=new R,Ll=new R,Il=new gn,ga=new R(1,0,0),xa=new R(0,1,0),_a=new R(0,0,1),Dl={type:"added"},ya={type:"removed"},pe=class extends mn{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Rl++}),this.uuid=Gi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=pe.DEFAULT_UP.clone();let t=new R,e=new ui,n=new gn,i=new R(1,1,1);function s(){n.setFromEuler(e,!1)}function a(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new zt},normalMatrix:{value:new le}}),this.matrix=new zt,this.matrixWorld=new zt,this.matrixAutoUpdate=pe.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=pe.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new ws,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Yn.setFromAxisAngle(t,e),this.quaternion.multiply(Yn),this}rotateOnWorldAxis(t,e){return Yn.setFromAxisAngle(t,e),this.quaternion.premultiply(Yn),this}rotateX(t){return this.rotateOnAxis(ga,t)}rotateY(t){return this.rotateOnAxis(xa,t)}rotateZ(t){return this.rotateOnAxis(_a,t)}translateOnAxis(t,e){return ma.copy(t).applyQuaternion(this.quaternion),this.position.add(ma.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(ga,t)}translateY(t){return this.translateOnAxis(xa,t)}translateZ(t){return this.translateOnAxis(_a,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Qe.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?is.copy(t):is.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Pi.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Qe.lookAt(Pi,is,this.up):Qe.lookAt(is,Pi,this.up),this.quaternion.setFromRotationMatrix(Qe),i&&(Qe.extractRotation(i.matrixWorld),Yn.setFromRotationMatrix(Qe),this.quaternion.premultiply(Yn.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can\'t be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(Dl)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ya)),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){let e=this.children[t];e.parent=null,e.dispatchEvent(ya)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Qe.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Qe.multiply(t.parent.matrixWorld)),t.applyMatrix4(Qe),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let a=this.children[n].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e){let n=[];this[t]===e&&n.push(this);for(let i=0,s=this.children.length;i<s;i++){let a=this.children[i].getObjectsByProperty(t,e);a.length>0&&(n=n.concat(a))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pi,t,Ll),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pi,Il,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,a=i.length;s<a;s++){let o=i[s];o.matrixWorldAutoUpdate===!0&&o.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON()));function s(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(t)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){let c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l<h;l++){let f=c[l];s(t.shapes,f)}else s(t.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let o=[];for(let c=0,l=this.material.length;c<l;c++)o.push(s(t.materials,this.material[c]));i.material=o}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){let c=this.animations[o];i.animations.push(s(t.animations,c))}}if(e){let o=a(t.geometries),c=a(t.materials),l=a(t.textures),h=a(t.images),f=a(t.shapes),u=a(t.skeletons),m=a(t.animations),x=a(t.nodes);o.length>0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),u.length>0&&(n.skeletons=u),m.length>0&&(n.animations=m),x.length>0&&(n.nodes=x)}return n.object=i,n;function a(o){let c=[];for(let l in o){let h=o[l];delete h.metadata,c.push(h)}return c}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};pe.DEFAULT_UP=new R(0,1,0);pe.DEFAULT_MATRIX_AUTO_UPDATE=!0;pe.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var ze=new R,tn=new R,mr=new R,en=new R,Zn=new R,Jn=new R,va=new R,gr=new R,xr=new R,_r=new R,ie=class{constructor(t=new R,e=new R,n=new R){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),ze.subVectors(t,e),i.cross(ze);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){ze.subVectors(i,e),tn.subVectors(n,e),mr.subVectors(t,e);let a=ze.dot(ze),o=ze.dot(tn),c=ze.dot(mr),l=tn.dot(tn),h=tn.dot(mr),f=a*l-o*o;if(f===0)return s.set(-2,-1,-1);let u=1/f,m=(l*c-o*h)*u,x=(a*h-o*c)*u;return s.set(1-m-x,x,m)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,en),en.x>=0&&en.y>=0&&en.x+en.y<=1}static getUV(t,e,n,i,s,a,o,c){return this.getBarycoord(t,e,n,i,en),c.set(0,0),c.addScaledVector(s,en.x),c.addScaledVector(a,en.y),c.addScaledVector(o,en.z),c}static isFrontFacing(t,e,n,i){return ze.subVectors(n,e),tn.subVectors(t,e),ze.cross(tn).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ze.subVectors(this.c,this.b),tn.subVectors(this.a,this.b),ze.cross(tn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ie.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ie.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,s){return ie.getUV(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return ie.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ie.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,a,o;Zn.subVectors(i,n),Jn.subVectors(s,n),gr.subVectors(t,n);let c=Zn.dot(gr),l=Jn.dot(gr);if(c<=0&&l<=0)return e.copy(n);xr.subVectors(t,i);let h=Zn.dot(xr),f=Jn.dot(xr);if(h>=0&&f<=h)return e.copy(i);let u=c*f-h*l;if(u<=0&&c>=0&&h<=0)return a=c/(c-h),e.copy(n).addScaledVector(Zn,a);_r.subVectors(t,s);let m=Zn.dot(_r),x=Jn.dot(_r);if(x>=0&&m<=x)return e.copy(s);let p=m*l-c*x;if(p<=0&&l>=0&&x<=0)return o=l/(l-x),e.copy(n).addScaledVector(Jn,o);let d=h*x-m*f;if(d<=0&&f-h>=0&&m-x>=0)return va.subVectors(s,i),o=(f-h)/(f-h+(m-x)),e.copy(i).addScaledVector(va,o);let g=1/(d+p+u);return a=p*g,o=u*g,e.copy(n).addScaledVector(Zn,a).addScaledVector(Jn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},Nl=0,fi=class extends mn{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Nl++}),this.uuid=Gi(),this.name="",this.type="Material",this.blending=ri,this.side=Ue,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=qa,this.blendDst=Xa,this.blendEquation=ni,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Er,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Sl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=er,this.stencilZFail=er,this.stencilZPass=er,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn("THREE.Material: \'"+e+"\' parameter is undefined.");continue}let i=this[e];if(i===void 0){console.warn("THREE."+this.type+": \'"+e+"\' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ri&&(n.blending=this.blending),this.side!==Ue&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(n.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){let a=[];for(let o in s){let c=s[o];delete c.metadata,a.push(c)}return a}if(e){let s=i(t.textures),a=i(t.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},Ss=class extends fi{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Bt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ya,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}},Ht=new R,ss=new At,Yt=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=ca,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)ss.fromBufferAttribute(this,e),ss.applyMatrix3(t),this.setXY(e,ss.x,ss.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Ht.fromBufferAttribute(this,e),Ht.applyMatrix3(t),this.setXYZ(e,Ht.x,Ht.y,Ht.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Ht.fromBufferAttribute(this,e),Ht.applyMatrix4(t),this.setXYZ(e,Ht.x,Ht.y,Ht.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ht.fromBufferAttribute(this,e),Ht.applyNormalMatrix(t),this.setXYZ(e,Ht.x,Ht.y,Ht.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ht.fromBufferAttribute(this,e),Ht.transformDirection(t),this.setXYZ(e,Ht.x,Ht.y,Ht.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ji(e,this.array)),e}setX(t,e){return this.normalized&&(e=Me(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ji(e,this.array)),e}setY(t,e){return this.normalized&&(e=Me(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ji(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Me(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ji(e,this.array)),e}setW(t,e){return this.normalized&&(e=Me(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Me(e,this.array),n=Me(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Me(e,this.array),n=Me(n,this.array),i=Me(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=Me(e,this.array),n=Me(n,this.array),i=Me(i,this.array),s=Me(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==ca&&(t.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}};var Ts=class extends Yt{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var As=class extends Yt{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var sn=class extends Yt{constructor(t,e,n){super(new Float32Array(t),e,n)}};var Fl=0,Pe=new zt,yr=new pe,$n=new R,we=new fe,Ri=new fe,Qt=new R,ke=class extends mn{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Fl++}),this.uuid=Gi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new($a(t)?As:Ts)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new le().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Pe.makeRotationFromQuaternion(t),this.applyMatrix4(Pe),this}rotateX(t){return Pe.makeRotationX(t),this.applyMatrix4(Pe),this}rotateY(t){return Pe.makeRotationY(t),this.applyMatrix4(Pe),this}rotateZ(t){return Pe.makeRotationZ(t),this.applyMatrix4(Pe),this}translate(t,e,n){return Pe.makeTranslation(t,e,n),this.applyMatrix4(Pe),this}scale(t,e,n){return Pe.makeScale(t,e,n),this.applyMatrix4(Pe),this}lookAt(t){return yr.lookAt(t),yr.updateMatrix(),this.applyMatrix4(yr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter($n).negate(),this.translate($n.x,$n.y,$n.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new sn(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new fe);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error(\'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".\',this),this.boundingBox.set(new R(-1/0,-1/0,-1/0),new R(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];we.setFromBufferAttribute(s),this.morphTargetsRelative?(Qt.addVectors(this.boundingBox.min,we.min),this.boundingBox.expandByPoint(Qt),Qt.addVectors(this.boundingBox.max,we.max),this.boundingBox.expandByPoint(Qt)):(this.boundingBox.expandByPoint(we.min),this.boundingBox.expandByPoint(we.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error(\'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.\',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Fn);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error(\'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".\',this),this.boundingSphere.set(new R,1/0);return}if(t){let n=this.boundingSphere.center;if(we.setFromBufferAttribute(t),e)for(let s=0,a=e.length;s<a;s++){let o=e[s];Ri.setFromBufferAttribute(o),this.morphTargetsRelative?(Qt.addVectors(we.min,Ri.min),we.expandByPoint(Qt),Qt.addVectors(we.max,Ri.max),we.expandByPoint(Qt)):(we.expandByPoint(Ri.min),we.expandByPoint(Ri.max))}we.getCenter(n);let i=0;for(let s=0,a=t.count;s<a;s++)Qt.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(Qt));if(e)for(let s=0,a=e.length;s<a;s++){let o=e[s],c=this.morphTargetsRelative;for(let l=0,h=o.count;l<h;l++)Qt.fromBufferAttribute(o,l),c&&($n.fromBufferAttribute(t,l),Qt.add($n)),i=Math.max(i,n.distanceToSquared(Qt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error(\'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.\',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=t.array,i=e.position.array,s=e.normal.array,a=e.uv.array,o=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Yt(new Float32Array(4*o),4));let c=this.getAttribute("tangent").array,l=[],h=[];for(let P=0;P<o;P++)l[P]=new R,h[P]=new R;let f=new R,u=new R,m=new R,x=new At,p=new At,d=new At,g=new R,M=new R;function _(P,O,B){f.fromArray(i,P*3),u.fromArray(i,O*3),m.fromArray(i,B*3),x.fromArray(a,P*2),p.fromArray(a,O*2),d.fromArray(a,B*2),u.sub(f),m.sub(f),p.sub(x),d.sub(x);let D=1/(p.x*d.y-d.x*p.y);isFinite(D)&&(g.copy(u).multiplyScalar(d.y).addScaledVector(m,-p.y).multiplyScalar(D),M.copy(m).multiplyScalar(p.x).addScaledVector(u,-d.x).multiplyScalar(D),l[P].add(g),l[O].add(g),l[B].add(g),h[P].add(M),h[O].add(M),h[B].add(M))}let v=this.groups;v.length===0&&(v=[{start:0,count:n.length}]);for(let P=0,O=v.length;P<O;++P){let B=v[P],D=B.start,I=B.count;for(let k=D,Y=D+I;k<Y;k+=3)_(n[k+0],n[k+1],n[k+2])}let b=new R,A=new R,C=new R,y=new R;function S(P){C.fromArray(s,P*3),y.copy(C);let O=l[P];b.copy(O),b.sub(C.multiplyScalar(C.dot(O))).normalize(),A.crossVectors(y,O);let D=A.dot(h[P])<0?-1:1;c[P*4]=b.x,c[P*4+1]=b.y,c[P*4+2]=b.z,c[P*4+3]=D}for(let P=0,O=v.length;P<O;++P){let B=v[P],D=B.start,I=B.count;for(let k=D,Y=D+I;k<Y;k+=3)S(n[k+0]),S(n[k+1]),S(n[k+2])}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Yt(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let u=0,m=n.count;u<m;u++)n.setXYZ(u,0,0,0);let i=new R,s=new R,a=new R,o=new R,c=new R,l=new R,h=new R,f=new R;if(t)for(let u=0,m=t.count;u<m;u+=3){let x=t.getX(u+0),p=t.getX(u+1),d=t.getX(u+2);i.fromBufferAttribute(e,x),s.fromBufferAttribute(e,p),a.fromBufferAttribute(e,d),h.subVectors(a,s),f.subVectors(i,s),h.cross(f),o.fromBufferAttribute(n,x),c.fromBufferAttribute(n,p),l.fromBufferAttribute(n,d),o.add(h),c.add(h),l.add(h),n.setXYZ(x,o.x,o.y,o.z),n.setXYZ(p,c.x,c.y,c.z),n.setXYZ(d,l.x,l.y,l.z)}else for(let u=0,m=e.count;u<m;u+=3)i.fromBufferAttribute(e,u+0),s.fromBufferAttribute(e,u+1),a.fromBufferAttribute(e,u+2),h.subVectors(a,s),f.subVectors(i,s),h.cross(f),n.setXYZ(u+0,h.x,h.y,h.z),n.setXYZ(u+1,h.x,h.y,h.z),n.setXYZ(u+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Qt.fromBufferAttribute(t,e),Qt.normalize(),t.setXYZ(e,Qt.x,Qt.y,Qt.z)}toNonIndexed(){function t(o,c){let l=o.array,h=o.itemSize,f=o.normalized,u=new l.constructor(c.length*h),m=0,x=0;for(let p=0,d=c.length;p<d;p++){o.isInterleavedBufferAttribute?m=c[p]*o.data.stride+o.offset:m=c[p]*h;for(let g=0;g<h;g++)u[x++]=l[m++]}return new Yt(u,h,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new ke,n=this.index.array,i=this.attributes;for(let o in i){let c=i[o],l=t(c,n);e.setAttribute(o,l)}let s=this.morphAttributes;for(let o in s){let c=[],l=s[o];for(let h=0,f=l.length;h<f;h++){let u=l[h],m=t(u,n);c.push(m)}e.morphAttributes[o]=c}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let o=0,c=a.length;o<c;o++){let l=a[o];e.addGroup(l.start,l.count,l.materialIndex)}return e}toJSON(){let t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(t[l]=c[l]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let c in n){let l=n[c];t.data.attributes[c]=l.toJSON(t.data)}let i={},s=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let f=0,u=l.length;f<u;f++){let m=l[f];h.push(m.toJSON(t.data))}h.length>0&&(i[c]=h,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let l in i){let h=i[l];this.setAttribute(l,h.clone(e))}let s=t.morphAttributes;for(let l in s){let h=[],f=s[l];for(let u=0,m=f.length;u<m;u++)h.push(f[u].clone(e));this.morphAttributes[l]=h}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let l=0,h=a.length;l<h;l++){let f=a[l];this.addGroup(f.start,f.count,f.materialIndex)}let o=t.boundingBox;o!==null&&(this.boundingBox=o.clone());let c=t.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,t.parameters!==void 0&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}},Ma=new zt,Kn=new Fr,vr=new Fn,Li=new R,Ii=new R,Di=new R,Mr=new R,rs=new R,os=new At,as=new At,cs=new At,br=new R,ls=new R,qe=class extends pe{constructor(t=new ke,e=new Ss){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){let o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let o=this.morphTargetInfluences;if(s&&o){rs.set(0,0,0);for(let c=0,l=s.length;c<l;c++){let h=o[c],f=s[c];h!==0&&(Mr.fromBufferAttribute(f,t),a?rs.addScaledVector(Mr,h):rs.addScaledVector(Mr.sub(e),h))}e.add(rs)}return this.isSkinnedMesh&&this.boneTransform(t,e),e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),vr.copy(n.boundingSphere),vr.applyMatrix4(s),t.ray.intersectsSphere(vr)===!1)||(Ma.copy(s).invert(),Kn.copy(t.ray).applyMatrix4(Ma),n.boundingBox!==null&&Kn.intersectsBox(n.boundingBox)===!1))return;let a,o=n.index,c=n.attributes.position,l=n.attributes.uv,h=n.attributes.uv2,f=n.groups,u=n.drawRange;if(o!==null)if(Array.isArray(i))for(let m=0,x=f.length;m<x;m++){let p=f[m],d=i[p.materialIndex],g=Math.max(p.start,u.start),M=Math.min(o.count,Math.min(p.start+p.count,u.start+u.count));for(let _=g,v=M;_<v;_+=3){let b=o.getX(_),A=o.getX(_+1),C=o.getX(_+2);a=hs(this,d,t,Kn,l,h,b,A,C),a&&(a.faceIndex=Math.floor(_/3),a.face.materialIndex=p.materialIndex,e.push(a))}}else{let m=Math.max(0,u.start),x=Math.min(o.count,u.start+u.count);for(let p=m,d=x;p<d;p+=3){let g=o.getX(p),M=o.getX(p+1),_=o.getX(p+2);a=hs(this,i,t,Kn,l,h,g,M,_),a&&(a.faceIndex=Math.floor(p/3),e.push(a))}}else if(c!==void 0)if(Array.isArray(i))for(let m=0,x=f.length;m<x;m++){let p=f[m],d=i[p.materialIndex],g=Math.max(p.start,u.start),M=Math.min(c.count,Math.min(p.start+p.count,u.start+u.count));for(let _=g,v=M;_<v;_+=3){let b=_,A=_+1,C=_+2;a=hs(this,d,t,Kn,l,h,b,A,C),a&&(a.faceIndex=Math.floor(_/3),a.face.materialIndex=p.materialIndex,e.push(a))}}else{let m=Math.max(0,u.start),x=Math.min(c.count,u.start+u.count);for(let p=m,d=x;p<d;p+=3){let g=p,M=p+1,_=p+2;a=hs(this,i,t,Kn,l,h,g,M,_),a&&(a.faceIndex=Math.floor(p/3),e.push(a))}}}};function zl(r,t,e,n,i,s,a,o){let c;if(t.side===he?c=n.intersectTriangle(a,s,i,!0,o):c=n.intersectTriangle(i,s,a,t.side===Ue,o),c===null)return null;ls.copy(o),ls.applyMatrix4(r.matrixWorld);let l=e.ray.origin.distanceTo(ls);return l<e.near||l>e.far?null:{distance:l,point:ls.clone(),object:r}}function hs(r,t,e,n,i,s,a,o,c){r.getVertexPosition(a,Li),r.getVertexPosition(o,Ii),r.getVertexPosition(c,Di);let l=zl(r,t,e,n,Li,Ii,Di,br);if(l){i&&(os.fromBufferAttribute(i,a),as.fromBufferAttribute(i,o),cs.fromBufferAttribute(i,c),l.uv=ie.getUV(br,Li,Ii,Di,os,as,cs,new At)),s&&(os.fromBufferAttribute(s,a),as.fromBufferAttribute(s,o),cs.fromBufferAttribute(s,c),l.uv2=ie.getUV(br,Li,Ii,Di,os,as,cs,new At));let h={a,b:o,c,normal:new R,materialIndex:0};ie.getNormal(Li,Ii,Di,h.normal),l.face=h}return l}var zn=class extends ke{constructor(t=1,e=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};let o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);let c=[],l=[],h=[],f=[],u=0,m=0;x("z","y","x",-1,-1,n,e,t,a,s,0),x("z","y","x",1,-1,n,e,-t,a,s,1),x("x","z","y",1,1,t,n,e,i,a,2),x("x","z","y",1,-1,t,n,-e,i,a,3),x("x","y","z",1,-1,t,e,n,i,s,4),x("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(c),this.setAttribute("position",new sn(l,3)),this.setAttribute("normal",new sn(h,3)),this.setAttribute("uv",new sn(f,2));function x(p,d,g,M,_,v,b,A,C,y,S){let P=v/C,O=b/y,B=v/2,D=b/2,I=A/2,k=C+1,Y=y+1,Z=0,H=0,$=new R;for(let J=0;J<Y;J++){let dt=J*O-D;for(let z=0;z<k;z++){let K=z*P-B;$[p]=K*M,$[d]=dt*_,$[g]=I,l.push($.x,$.y,$.z),$[p]=0,$[d]=0,$[g]=A>0?1:-1,h.push($.x,$.y,$.z),f.push(z/C),f.push(1-J/y),Z+=1}}for(let J=0;J<y;J++)for(let dt=0;dt<C;dt++){let z=u+dt+k*J,K=u+dt+k*(J+1),nt=u+(dt+1)+k*(J+1),it=u+(dt+1)+k*J;c.push(z,K,it),c.push(K,nt,it),H+=6}o.addGroup(m,H,S),m+=H,u+=Z}}static fromJSON(t){return new zn(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function di(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function ae(r){let t={};for(let e=0;e<r.length;e++){let n=di(r[e]);for(let i in n)t[i]=n[i]}return t}function Ol(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function ja(r){return r.getRenderTarget()===null&&r.outputEncoding===Ot?Ge:Ui}var Bl={clone:di,merge:ae},Ul=`void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`,kl=`void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}`,on=class extends fi{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Ul,this.fragmentShader=kl,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=di(t.uniforms),this.uniformsGroups=Ol(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let a=this.uniforms[i].value;a&&a.isTexture?e.uniforms[i]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[i]={type:"m4",value:a.toArray()}:e.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},Es=class extends pe{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new zt,this.projectionMatrix=new zt,this.projectionMatrixInverse=new zt}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Se=class extends Es{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=ha*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(nr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return ha*2*Math.atan(Math.tan(nr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,s,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(nr*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,a=this.view;if(this.view!==null&&this.view.enabled){let c=a.fullWidth,l=a.fullHeight;s+=a.offsetX*i/c,e-=a.offsetY*n/l,i*=a.width/c,n*=a.height/l}let o=this.filmOffset;o!==0&&(s+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},jn=-90,Qn=1,zr=class extends pe{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n;let i=new Se(jn,Qn,t,e);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(1,0,0),this.add(i);let s=new Se(jn,Qn,t,e);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(-1,0,0),this.add(s);let a=new Se(jn,Qn,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(0,1,0),this.add(a);let o=new Se(jn,Qn,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(0,-1,0),this.add(o);let c=new Se(jn,Qn,t,e);c.layers=this.layers,c.up.set(0,1,0),c.lookAt(0,0,1),this.add(c);let l=new Se(jn,Qn,t,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(t,e){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,a,o,c,l]=this.children,h=t.getRenderTarget(),f=t.toneMapping,u=t.xr.enabled;t.toneMapping=nn,t.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,s),t.setRenderTarget(n,2),t.render(e,a),t.setRenderTarget(n,3),t.render(e,o),t.setRenderTarget(n,4),t.render(e,c),n.texture.generateMipmaps=m,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(h),t.toneMapping=f,t.xr.enabled=u,n.texture.needsPMREMUpdate=!0}},Cs=class extends ue{constructor(t,e,n,i,s,a,o,c,l,h){t=t!==void 0?t:[],e=e!==void 0?e:ci,super(t,e,n,i,s,a,o,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},Or=class extends rn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Cs(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:Re}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,fragmentShader:`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`},i=new zn(5,5,5),s=new on({name:"CubemapFromEquirect",uniforms:di(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:he,blending:pn});s.uniforms.tEquirect.value=e;let a=new qe(i,s),o=e.minFilter;return e.minFilter===Oi&&(e.minFilter=Re),new zr(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(s)}},wr=new R,Vl=new R,Gl=new le,Te=class{constructor(t=new R(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=wr.subVectors(n,e).cross(Vl.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){let n=t.delta(wr),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(n).multiplyScalar(s).add(t.start)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||Gl.getNormalMatrix(t),i=this.coplanarPoint(wr).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},ti=new Fn,us=new R,Ps=class{constructor(t=new Te,e=new Te,n=new Te,i=new Te,s=new Te,a=new Te){this.planes=[t,e,n,i,s,a]}set(t,e,n,i,s,a){let o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){let e=this.planes,n=t.elements,i=n[0],s=n[1],a=n[2],o=n[3],c=n[4],l=n[5],h=n[6],f=n[7],u=n[8],m=n[9],x=n[10],p=n[11],d=n[12],g=n[13],M=n[14],_=n[15];return e[0].setComponents(o-i,f-c,p-u,_-d).normalize(),e[1].setComponents(o+i,f+c,p+u,_+d).normalize(),e[2].setComponents(o+s,f+l,p+m,_+g).normalize(),e[3].setComponents(o-s,f-l,p-m,_-g).normalize(),e[4].setComponents(o-a,f-h,p-x,_-M).normalize(),e[5].setComponents(o+a,f+h,p+x,_+M).normalize(),this}intersectsObject(t){let e=t.geometry;return e.boundingSphere===null&&e.computeBoundingSphere(),ti.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ti)}intersectsSprite(t){return ti.center.set(0,0,0),ti.radius=.7071067811865476,ti.applyMatrix4(t.matrixWorld),this.intersectsSphere(ti)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let n=0;n<6;n++){let i=e[n];if(us.x=i.normal.x>0?t.max.x:t.min.x,us.y=i.normal.y>0?t.max.y:t.min.y,us.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(us)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function Qa(){let r=null,t=!1,e=null,n=null;function i(s,a){e(s,a),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function Hl(r,t){let e=t.isWebGL2,n=new WeakMap;function i(l,h){let f=l.array,u=l.usage,m=r.createBuffer();r.bindBuffer(h,m),r.bufferData(h,f,u),l.onUploadCallback();let x;if(f instanceof Float32Array)x=5126;else if(f instanceof Uint16Array)if(l.isFloat16BufferAttribute)if(e)x=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else x=5123;else if(f instanceof Int16Array)x=5122;else if(f instanceof Uint32Array)x=5125;else if(f instanceof Int32Array)x=5124;else if(f instanceof Int8Array)x=5120;else if(f instanceof Uint8Array)x=5121;else if(f instanceof Uint8ClampedArray)x=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:m,type:x,bytesPerElement:f.BYTES_PER_ELEMENT,version:l.version}}function s(l,h,f){let u=h.array,m=h.updateRange;r.bindBuffer(f,l),m.count===-1?r.bufferSubData(f,0,u):(e?r.bufferSubData(f,m.offset*u.BYTES_PER_ELEMENT,u,m.offset,m.count):r.bufferSubData(f,m.offset*u.BYTES_PER_ELEMENT,u.subarray(m.offset,m.offset+m.count)),m.count=-1),h.onUploadCallback()}function a(l){return l.isInterleavedBufferAttribute&&(l=l.data),n.get(l)}function o(l){l.isInterleavedBufferAttribute&&(l=l.data);let h=n.get(l);h&&(r.deleteBuffer(h.buffer),n.delete(l))}function c(l,h){if(l.isGLBufferAttribute){let u=n.get(l);(!u||u.version<l.version)&&n.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}l.isInterleavedBufferAttribute&&(l=l.data);let f=n.get(l);f===void 0?n.set(l,i(l,h)):f.version<l.version&&(s(f.buffer,l,h),f.version=l.version)}return{get:a,remove:o,update:c}}var ki=class extends ke{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};let s=t/2,a=e/2,o=Math.floor(n),c=Math.floor(i),l=o+1,h=c+1,f=t/o,u=e/c,m=[],x=[],p=[],d=[];for(let g=0;g<h;g++){let M=g*u-a;for(let _=0;_<l;_++){let v=_*f-s;x.push(v,-M,0),p.push(0,0,1),d.push(_/o),d.push(1-g/c)}}for(let g=0;g<c;g++)for(let M=0;M<o;M++){let _=M+l*g,v=M+l*(g+1),b=M+1+l*(g+1),A=M+1+l*g;m.push(_,v,A),m.push(v,b,A)}this.setIndex(m),this.setAttribute("position",new sn(x,3)),this.setAttribute("normal",new sn(p,3)),this.setAttribute("uv",new sn(d,2))}static fromJSON(t){return new ki(t.width,t.height,t.widthSegments,t.heightSegments)}},Wl=`#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif`,ql=`#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`,Xl=`#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif`,Yl=`#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif`,Zl=`#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif`,Jl=`#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif`,$l="vec3 transformed = vec3( position );",Kl=`vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif`,jl=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif`,Ql=`#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif`,th=`#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif`,eh=`#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif`,nh=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`,ih=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif`,sh=`#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif`,rh=`#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif`,oh=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif`,ah=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif`,ch=`#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif`,lh=`#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}`,hh=`#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif`,uh=`vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif`,fh=`#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif`,dh=`#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif`,ph=`#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif`,mh=`#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif`,gh="gl_FragColor = linearToOutputTexel( gl_FragColor );",xh=`vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}`,_h=`#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif`,yh=`#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif`,vh=`#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif`,Mh=`#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif`,bh=`#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif`,wh=`#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif`,Sh=`#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif`,Th=`#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif`,Ah=`#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif`,Eh=`#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}`,Ch=`#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif`,Ph=`#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif`,Rh=`LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;`,Lh=`varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert`,Ih=`uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif`,Dh=`#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif`,Nh=`ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;`,Fh=`varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon`,zh=`BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,Oh=`varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong`,Bh=`PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif`,Uh=`struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}`,kh=`\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif`,Vh=`#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif`,Gh=`#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif`,Hh=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`,Wh=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`,qh=`#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif`,Xh=`#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif`,Yh=`#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif`,Zh=`#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif`,Jh=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif`,$h=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`,Kh=`float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif`,jh=`#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif`,Qh=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif`,tu=`#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif`,eu=`#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif`,nu=`#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif`,iu=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;`,su=`#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif`,ru=`#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`,ou=`#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`,au=`#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif`,cu=`#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif`,lu=`#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif`,hu=`#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif`,uu=`#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif`,fu=`#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif`,du=`#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );`,pu=`vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}`,mu=`#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif`,gu=`vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`,xu=`#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`,_u=`#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif`,yu=`float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif`,vu=`#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif`,Mu=`#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif`,bu=`#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif`,wu=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif`,Su=`float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}`,Tu=`#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif`,Au=`#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif`,Eu=`#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif`,Cu=`#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif`,Pu=`float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif`,Ru=`#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif`,Lu=`#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`,Iu=`#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }`,Du=`#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif`,Nu=`#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif`,Fu=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif`,zu=`#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif`,Ou=`#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif`,Bu=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif`,Uu=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif`,ku=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif`,Vu=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif`,Gu=`varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}`,Hu=`uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,Wu=`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}`,qu=`#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,Xu=`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}`,Yu=`uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,Zu=`#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}`,Ju=`#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}`,$u=`#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}`,Ku=`#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}`,ju=`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}`,Qu=`uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,tf=`uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}`,ef=`uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}`,nf=`#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}`,sf=`uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,rf=`#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,of=`#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,af=`#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}`,cf=`#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,lf=`#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}`,hf=`#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}`,uf=`#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,ff=`#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,df=`#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}`,pf=`#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,mf=`#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,gf=`#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,xf=`uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}`,_f=`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}`,yf=`#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,vf=`uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}`,Mf=`uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}`,bf=`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}`,wt={alphamap_fragment:Wl,alphamap_pars_fragment:ql,alphatest_fragment:Xl,alphatest_pars_fragment:Yl,aomap_fragment:Zl,aomap_pars_fragment:Jl,begin_vertex:$l,beginnormal_vertex:Kl,bsdfs:jl,iridescence_fragment:Ql,bumpmap_pars_fragment:th,clipping_planes_fragment:eh,clipping_planes_pars_fragment:nh,clipping_planes_pars_vertex:ih,clipping_planes_vertex:sh,color_fragment:rh,color_pars_fragment:oh,color_pars_vertex:ah,color_vertex:ch,common:lh,cube_uv_reflection_fragment:hh,defaultnormal_vertex:uh,displacementmap_pars_vertex:fh,displacementmap_vertex:dh,emissivemap_fragment:ph,emissivemap_pars_fragment:mh,encodings_fragment:gh,encodings_pars_fragment:xh,envmap_fragment:_h,envmap_common_pars_fragment:yh,envmap_pars_fragment:vh,envmap_pars_vertex:Mh,envmap_physical_pars_fragment:Dh,envmap_vertex:bh,fog_vertex:wh,fog_pars_vertex:Sh,fog_fragment:Th,fog_pars_fragment:Ah,gradientmap_pars_fragment:Eh,lightmap_fragment:Ch,lightmap_pars_fragment:Ph,lights_lambert_fragment:Rh,lights_lambert_pars_fragment:Lh,lights_pars_begin:Ih,lights_toon_fragment:Nh,lights_toon_pars_fragment:Fh,lights_phong_fragment:zh,lights_phong_pars_fragment:Oh,lights_physical_fragment:Bh,lights_physical_pars_fragment:Uh,lights_fragment_begin:kh,lights_fragment_maps:Vh,lights_fragment_end:Gh,logdepthbuf_fragment:Hh,logdepthbuf_pars_fragment:Wh,logdepthbuf_pars_vertex:qh,logdepthbuf_vertex:Xh,map_fragment:Yh,map_pars_fragment:Zh,map_particle_fragment:Jh,map_particle_pars_fragment:$h,metalnessmap_fragment:Kh,metalnessmap_pars_fragment:jh,morphcolor_vertex:Qh,morphnormal_vertex:tu,morphtarget_pars_vertex:eu,morphtarget_vertex:nu,normal_fragment_begin:iu,normal_fragment_maps:su,normal_pars_fragment:ru,normal_pars_vertex:ou,normal_vertex:au,normalmap_pars_fragment:cu,clearcoat_normal_fragment_begin:lu,clearcoat_normal_fragment_maps:hu,clearcoat_pars_fragment:uu,iridescence_pars_fragment:fu,output_fragment:du,packing:pu,premultiplied_alpha_fragment:mu,project_vertex:gu,dithering_fragment:xu,dithering_pars_fragment:_u,roughnessmap_fragment:yu,roughnessmap_pars_fragment:vu,shadowmap_pars_fragment:Mu,shadowmap_pars_vertex:bu,shadowmap_vertex:wu,shadowmask_pars_fragment:Su,skinbase_vertex:Tu,skinning_pars_vertex:Au,skinning_vertex:Eu,skinnormal_vertex:Cu,specularmap_fragment:Pu,specularmap_pars_fragment:Ru,tonemapping_fragment:Lu,tonemapping_pars_fragment:Iu,transmission_fragment:Du,transmission_pars_fragment:Nu,uv_pars_fragment:Fu,uv_pars_vertex:zu,uv_vertex:Ou,uv2_pars_fragment:Bu,uv2_pars_vertex:Uu,uv2_vertex:ku,worldpos_vertex:Vu,background_vert:Gu,background_frag:Hu,backgroundCube_vert:Wu,backgroundCube_frag:qu,cube_vert:Xu,cube_frag:Yu,depth_vert:Zu,depth_frag:Ju,distanceRGBA_vert:$u,distanceRGBA_frag:Ku,equirect_vert:ju,equirect_frag:Qu,linedashed_vert:tf,linedashed_frag:ef,meshbasic_vert:nf,meshbasic_frag:sf,meshlambert_vert:rf,meshlambert_frag:of,meshmatcap_vert:af,meshmatcap_frag:cf,meshnormal_vert:lf,meshnormal_frag:hf,meshphong_vert:uf,meshphong_frag:ff,meshphysical_vert:df,meshphysical_frag:pf,meshtoon_vert:mf,meshtoon_frag:gf,points_vert:xf,points_frag:_f,shadow_vert:yf,shadow_frag:vf,sprite_vert:Mf,sprite_frag:bf},et={common:{diffuse:{value:new Bt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new le},uv2Transform:{value:new le},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new At(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Bt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Bt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new le}},sprite:{diffuse:{value:new Bt(16777215)},opacity:{value:1},center:{value:new At(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new le}}},He={basic:{uniforms:ae([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.fog]),vertexShader:wt.meshbasic_vert,fragmentShader:wt.meshbasic_frag},lambert:{uniforms:ae([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.fog,et.lights,{emissive:{value:new Bt(0)}}]),vertexShader:wt.meshlambert_vert,fragmentShader:wt.meshlambert_frag},phong:{uniforms:ae([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.fog,et.lights,{emissive:{value:new Bt(0)},specular:{value:new Bt(1118481)},shininess:{value:30}}]),vertexShader:wt.meshphong_vert,fragmentShader:wt.meshphong_frag},standard:{uniforms:ae([et.common,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.roughnessmap,et.metalnessmap,et.fog,et.lights,{emissive:{value:new Bt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag},toon:{uniforms:ae([et.common,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.gradientmap,et.fog,et.lights,{emissive:{value:new Bt(0)}}]),vertexShader:wt.meshtoon_vert,fragmentShader:wt.meshtoon_frag},matcap:{uniforms:ae([et.common,et.bumpmap,et.normalmap,et.displacementmap,et.fog,{matcap:{value:null}}]),vertexShader:wt.meshmatcap_vert,fragmentShader:wt.meshmatcap_frag},points:{uniforms:ae([et.points,et.fog]),vertexShader:wt.points_vert,fragmentShader:wt.points_frag},dashed:{uniforms:ae([et.common,et.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wt.linedashed_vert,fragmentShader:wt.linedashed_frag},depth:{uniforms:ae([et.common,et.displacementmap]),vertexShader:wt.depth_vert,fragmentShader:wt.depth_frag},normal:{uniforms:ae([et.common,et.bumpmap,et.normalmap,et.displacementmap,{opacity:{value:1}}]),vertexShader:wt.meshnormal_vert,fragmentShader:wt.meshnormal_frag},sprite:{uniforms:ae([et.sprite,et.fog]),vertexShader:wt.sprite_vert,fragmentShader:wt.sprite_frag},background:{uniforms:{uvTransform:{value:new le},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:wt.background_vert,fragmentShader:wt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:wt.backgroundCube_vert,fragmentShader:wt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:wt.cube_vert,fragmentShader:wt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wt.equirect_vert,fragmentShader:wt.equirect_frag},distanceRGBA:{uniforms:ae([et.common,et.displacementmap,{referencePosition:{value:new R},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wt.distanceRGBA_vert,fragmentShader:wt.distanceRGBA_frag},shadow:{uniforms:ae([et.lights,et.fog,{color:{value:new Bt(0)},opacity:{value:1}}]),vertexShader:wt.shadow_vert,fragmentShader:wt.shadow_frag}};He.physical={uniforms:ae([He.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new At(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Bt(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new At},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Bt(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Bt(1,1,1)},specularColorMap:{value:null}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag};var fs={r:0,b:0,g:0};function wf(r,t,e,n,i,s,a){let o=new Bt(0),c=s===!0?0:1,l,h,f=null,u=0,m=null;function x(d,g){let M=!1,_=g.isScene===!0?g.background:null;_&&_.isTexture&&(_=(g.backgroundBlurriness>0?e:t).get(_));let v=r.xr,b=v.getSession&&v.getSession();b&&b.environmentBlendMode==="additive"&&(_=null),_===null?p(o,c):_&&_.isColor&&(p(_,1),M=!0),(r.autoClear||M)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Ls)?(h===void 0&&(h=new qe(new zn(1,1,1),new on({name:"BackgroundCubeMaterial",uniforms:di(He.backgroundCube.uniforms),vertexShader:He.backgroundCube.vertexShader,fragmentShader:He.backgroundCube.fragmentShader,side:he,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(A,C,y){this.matrixWorld.copyPosition(y.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),h.material.uniforms.envMap.value=_,h.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.toneMapped=_.encoding!==Ot,(f!==_||u!==_.version||m!==r.toneMapping)&&(h.material.needsUpdate=!0,f=_,u=_.version,m=r.toneMapping),h.layers.enableAll(),d.unshift(h,h.geometry,h.material,0,0,null)):_&&_.isTexture&&(l===void 0&&(l=new qe(new ki(2,2),new on({name:"BackgroundMaterial",uniforms:di(He.background.uniforms),vertexShader:He.background.vertexShader,fragmentShader:He.background.fragmentShader,side:Ue,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=_,l.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,l.material.toneMapped=_.encoding!==Ot,_.matrixAutoUpdate===!0&&_.updateMatrix(),l.material.uniforms.uvTransform.value.copy(_.matrix),(f!==_||u!==_.version||m!==r.toneMapping)&&(l.material.needsUpdate=!0,f=_,u=_.version,m=r.toneMapping),l.layers.enableAll(),d.unshift(l,l.geometry,l.material,0,0,null))}function p(d,g){d.getRGB(fs,ja(r)),n.buffers.color.setClear(fs.r,fs.g,fs.b,g,a)}return{getClearColor:function(){return o},setClearColor:function(d,g=1){o.set(d),c=g,p(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(d){c=d,p(o,c)},render:x}}function Sf(r,t,e,n){let i=r.getParameter(34921),s=n.isWebGL2?null:t.get("OES_vertex_array_object"),a=n.isWebGL2||s!==null,o={},c=d(null),l=c,h=!1;function f(I,k,Y,Z,H){let $=!1;if(a){let J=p(Z,Y,k);l!==J&&(l=J,m(l.object)),$=g(I,Z,Y,H),$&&M(I,Z,Y,H)}else{let J=k.wireframe===!0;(l.geometry!==Z.id||l.program!==Y.id||l.wireframe!==J)&&(l.geometry=Z.id,l.program=Y.id,l.wireframe=J,$=!0)}H!==null&&e.update(H,34963),($||h)&&(h=!1,y(I,k,Y,Z),H!==null&&r.bindBuffer(34963,e.get(H).buffer))}function u(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function m(I){return n.isWebGL2?r.bindVertexArray(I):s.bindVertexArrayOES(I)}function x(I){return n.isWebGL2?r.deleteVertexArray(I):s.deleteVertexArrayOES(I)}function p(I,k,Y){let Z=Y.wireframe===!0,H=o[I.id];H===void 0&&(H={},o[I.id]=H);let $=H[k.id];$===void 0&&($={},H[k.id]=$);let J=$[Z];return J===void 0&&(J=d(u()),$[Z]=J),J}function d(I){let k=[],Y=[],Z=[];for(let H=0;H<i;H++)k[H]=0,Y[H]=0,Z[H]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:Y,attributeDivisors:Z,object:I,attributes:{},index:null}}function g(I,k,Y,Z){let H=l.attributes,$=k.attributes,J=0,dt=Y.getAttributes();for(let z in dt)if(dt[z].location>=0){let nt=H[z],it=$[z];if(it===void 0&&(z==="instanceMatrix"&&I.instanceMatrix&&(it=I.instanceMatrix),z==="instanceColor"&&I.instanceColor&&(it=I.instanceColor)),nt===void 0||nt.attribute!==it||it&&nt.data!==it.data)return!0;J++}return l.attributesNum!==J||l.index!==Z}function M(I,k,Y,Z){let H={},$=k.attributes,J=0,dt=Y.getAttributes();for(let z in dt)if(dt[z].location>=0){let nt=$[z];nt===void 0&&(z==="instanceMatrix"&&I.instanceMatrix&&(nt=I.instanceMatrix),z==="instanceColor"&&I.instanceColor&&(nt=I.instanceColor));let it={};it.attribute=nt,nt&&nt.data&&(it.data=nt.data),H[z]=it,J++}l.attributes=H,l.attributesNum=J,l.index=Z}function _(){let I=l.newAttributes;for(let k=0,Y=I.length;k<Y;k++)I[k]=0}function v(I){b(I,0)}function b(I,k){let Y=l.newAttributes,Z=l.enabledAttributes,H=l.attributeDivisors;Y[I]=1,Z[I]===0&&(r.enableVertexAttribArray(I),Z[I]=1),H[I]!==k&&((n.isWebGL2?r:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](I,k),H[I]=k)}function A(){let I=l.newAttributes,k=l.enabledAttributes;for(let Y=0,Z=k.length;Y<Z;Y++)k[Y]!==I[Y]&&(r.disableVertexAttribArray(Y),k[Y]=0)}function C(I,k,Y,Z,H,$){n.isWebGL2===!0&&(Y===5124||Y===5125)?r.vertexAttribIPointer(I,k,Y,H,$):r.vertexAttribPointer(I,k,Y,Z,H,$)}function y(I,k,Y,Z){if(n.isWebGL2===!1&&(I.isInstancedMesh||Z.isInstancedBufferGeometry)&&t.get("ANGLE_instanced_arrays")===null)return;_();let H=Z.attributes,$=Y.getAttributes(),J=k.defaultAttributeValues;for(let dt in $){let z=$[dt];if(z.location>=0){let K=H[dt];if(K===void 0&&(dt==="instanceMatrix"&&I.instanceMatrix&&(K=I.instanceMatrix),dt==="instanceColor"&&I.instanceColor&&(K=I.instanceColor)),K!==void 0){let nt=K.normalized,it=K.itemSize,U=e.get(K);if(U===void 0)continue;let Mt=U.buffer,ht=U.type,ut=U.bytesPerElement;if(K.isInterleavedBufferAttribute){let at=K.data,Ft=at.stride,bt=K.offset;if(at.isInstancedInterleavedBuffer){for(let _t=0;_t<z.locationSize;_t++)b(z.location+_t,at.meshPerAttribute);I.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=at.meshPerAttribute*at.count)}else for(let _t=0;_t<z.locationSize;_t++)v(z.location+_t);r.bindBuffer(34962,Mt);for(let _t=0;_t<z.locationSize;_t++)C(z.location+_t,it/z.locationSize,ht,nt,Ft*ut,(bt+it/z.locationSize*_t)*ut)}else{if(K.isInstancedBufferAttribute){for(let at=0;at<z.locationSize;at++)b(z.location+at,K.meshPerAttribute);I.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=K.meshPerAttribute*K.count)}else for(let at=0;at<z.locationSize;at++)v(z.location+at);r.bindBuffer(34962,Mt);for(let at=0;at<z.locationSize;at++)C(z.location+at,it/z.locationSize,ht,nt,it*ut,it/z.locationSize*at*ut)}}else if(J!==void 0){let nt=J[dt];if(nt!==void 0)switch(nt.length){case 2:r.vertexAttrib2fv(z.location,nt);break;case 3:r.vertexAttrib3fv(z.location,nt);break;case 4:r.vertexAttrib4fv(z.location,nt);break;default:r.vertexAttrib1fv(z.location,nt)}}}}A()}function S(){B();for(let I in o){let k=o[I];for(let Y in k){let Z=k[Y];for(let H in Z)x(Z[H].object),delete Z[H];delete k[Y]}delete o[I]}}function P(I){if(o[I.id]===void 0)return;let k=o[I.id];for(let Y in k){let Z=k[Y];for(let H in Z)x(Z[H].object),delete Z[H];delete k[Y]}delete o[I.id]}function O(I){for(let k in o){let Y=o[k];if(Y[I.id]===void 0)continue;let Z=Y[I.id];for(let H in Z)x(Z[H].object),delete Z[H];delete Y[I.id]}}function B(){D(),h=!0,l!==c&&(l=c,m(l.object))}function D(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:f,reset:B,resetDefaultState:D,dispose:S,releaseStatesOfGeometry:P,releaseStatesOfProgram:O,initAttributes:_,enableAttribute:v,disableUnusedAttributes:A}}function Tf(r,t,e,n){let i=n.isWebGL2,s;function a(l){s=l}function o(l,h){r.drawArrays(s,l,h),e.update(h,s,1)}function c(l,h,f){if(f===0)return;let u,m;if(i)u=r,m="drawArraysInstanced";else if(u=t.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",u===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}u[m](s,l,h,f),e.update(h,s,f)}this.setMode=a,this.render=o,this.renderInstances=c}function Af(r,t,e){let n;function i(){if(n!==void 0)return n;if(t.has("EXT_texture_filter_anisotropic")===!0){let C=t.get("EXT_texture_filter_anisotropic");n=r.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(C){if(C==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";C="mediump"}return C==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let a=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext,o=e.precision!==void 0?e.precision:"highp",c=s(o);c!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",c,"instead."),o=c);let l=a||t.has("WEBGL_draw_buffers"),h=e.logarithmicDepthBuffer===!0,f=r.getParameter(34930),u=r.getParameter(35660),m=r.getParameter(3379),x=r.getParameter(34076),p=r.getParameter(34921),d=r.getParameter(36347),g=r.getParameter(36348),M=r.getParameter(36349),_=u>0,v=a||t.has("OES_texture_float"),b=_&&v,A=a?r.getParameter(36183):0;return{isWebGL2:a,drawBuffers:l,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:f,maxVertexTextures:u,maxTextureSize:m,maxCubemapSize:x,maxAttributes:p,maxVertexUniforms:d,maxVaryings:g,maxFragmentUniforms:M,vertexTextures:_,floatFragmentTextures:v,floatVertexTextures:b,maxSamples:A}}function Ef(r){let t=this,e=null,n=0,i=!1,s=!1,a=new Te,o=new le,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(f,u){let m=f.length!==0||u||n!==0||i;return i=u,n=f.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,u){e=h(f,u,0)},this.setState=function(f,u,m){let x=f.clippingPlanes,p=f.clipIntersection,d=f.clipShadows,g=r.get(f);if(!i||x===null||x.length===0||s&&!d)s?h(null):l();else{let M=s?0:n,_=M*4,v=g.clippingState||null;c.value=v,v=h(x,u,_,m);for(let b=0;b!==_;++b)v[b]=e[b];g.clippingState=v,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=M}};function l(){c.value!==e&&(c.value=e,c.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(f,u,m,x){let p=f!==null?f.length:0,d=null;if(p!==0){if(d=c.value,x!==!0||d===null){let g=m+p*4,M=u.matrixWorldInverse;o.getNormalMatrix(M),(d===null||d.length<g)&&(d=new Float32Array(g));for(let _=0,v=m;_!==p;++_,v+=4)a.copy(f[_]).applyMatrix4(M,o),a.normal.toArray(d,v),d[v+3]=a.constant}c.value=d,c.needsUpdate=!0}return t.numPlanes=p,t.numIntersection=0,d}}function Cf(r){let t=new WeakMap;function e(a,o){return o===Cr?a.mapping=ci:o===Pr&&(a.mapping=li),a}function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let o=a.mapping;if(o===Cr||o===Pr)if(t.has(a)){let c=t.get(a).texture;return e(c,a.mapping)}else{let c=a.image;if(c&&c.height>0){let l=new Or(c.height/2);return l.fromEquirectangularTexture(r,a),t.set(a,l),a.addEventListener("dispose",i),e(l.texture,a.mapping)}else return null}}return a}function i(a){let o=a.target;o.removeEventListener("dispose",i);let c=t.get(o);c!==void 0&&(t.delete(o),c.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var Br=class extends Es{constructor(t=-1,e=1,n=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,a=n+t,o=i+e,c=i-e;if(this.view!==null&&this.view.enabled){let l=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=l*this.view.offsetX,a=s+l*this.view.width,o-=h*this.view.offsetY,c=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,c,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},ii=4,ba=[.125,.215,.35,.446,.526,.582],Cn=20,Sr=new Br,wa=new Bt,Tr=null,En=(1+Math.sqrt(5))/2,ei=1/En,Sa=[new R(1,1,1),new R(-1,1,1),new R(1,1,-1),new R(-1,1,-1),new R(0,En,ei),new R(0,En,-ei),new R(ei,0,En),new R(-ei,0,En),new R(En,ei,0),new R(-En,ei,0)],Rs=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Tr=this._renderer.getRenderTarget(),this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Ea(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Aa(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Tr),t.scissorTest=!1,ds(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===ci||t.mapping===li?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Tr=this._renderer.getRenderTarget();let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:Re,minFilter:Re,generateMipmaps:!1,type:Bi,format:Be,encoding:Nn,depthBuffer:!1},i=Ta(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Ta(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Pf(s)),this._blurMaterial=Rf(s,t,e)}return i}_compileMaterial(t){let e=new qe(this._lodPlanes[0],t);this._renderer.compile(e,Sr)}_sceneToCubeUV(t,e,n,i){let o=new Se(90,1,e,n),c=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,u=h.toneMapping;h.getClearColor(wa),h.toneMapping=nn,h.autoClear=!1;let m=new Ss({name:"PMREM.Background",side:he,depthWrite:!1,depthTest:!1}),x=new qe(new zn,m),p=!1,d=t.background;d?d.isColor&&(m.color.copy(d),t.background=null,p=!0):(m.color.copy(wa),p=!0);for(let g=0;g<6;g++){let M=g%3;M===0?(o.up.set(0,c[g],0),o.lookAt(l[g],0,0)):M===1?(o.up.set(0,0,c[g]),o.lookAt(0,l[g],0)):(o.up.set(0,c[g],0),o.lookAt(0,0,l[g]));let _=this._cubeSize;ds(i,M*_,g>2?_:0,_,_),h.setRenderTarget(i),p&&h.render(x,o),h.render(t,o)}x.geometry.dispose(),x.material.dispose(),h.toneMapping=u,h.autoClear=f,t.background=d}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===ci||t.mapping===li;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Ea()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Aa());let s=i?this._cubemapMaterial:this._equirectMaterial,a=new qe(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;let c=this._cubeSize;ds(e,0,0,3*c,2*c),n.setRenderTarget(e),n.render(a,Sr)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){let s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),a=Sa[(i-1)%Sa.length];this._blur(t,i-1,i,s,a)}e.autoClear=n}_blur(t,e,n,i,s){let a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,i,"latitudinal",s),this._halfBlur(a,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,a,o){let c=this._renderer,l=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let h=3,f=new qe(this._lodPlanes[i],l),u=l.uniforms,m=this._sizeLods[n]-1,x=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*Cn-1),p=s/x,d=isFinite(s)?1+Math.floor(h*p):Cn;d>Cn&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${d} samples when the maximum is set to ${Cn}`);let g=[],M=0;for(let C=0;C<Cn;++C){let y=C/p,S=Math.exp(-y*y/2);g.push(S),C===0?M+=S:C<d&&(M+=2*S)}for(let C=0;C<g.length;C++)g[C]=g[C]/M;u.envMap.value=t.texture,u.samples.value=d,u.weights.value=g,u.latitudinal.value=a==="latitudinal",o&&(u.poleAxis.value=o);let{_lodMax:_}=this;u.dTheta.value=x,u.mipInt.value=_-n;let v=this._sizeLods[i],b=3*v*(i>_-ii?i-_+ii:0),A=4*(this._cubeSize-v);ds(e,b,A,3*v,2*v),c.setRenderTarget(e),c.render(f,Sr)}};function Pf(r){let t=[],e=[],n=[],i=r,s=r-ii+1+ba.length;for(let a=0;a<s;a++){let o=Math.pow(2,i);e.push(o);let c=1/o;a>r-ii?c=ba[a-r+ii-1]:a===0&&(c=0),n.push(c);let l=1/(o-2),h=-l,f=1+l,u=[h,h,f,h,f,f,h,h,f,f,h,f],m=6,x=6,p=3,d=2,g=1,M=new Float32Array(p*x*m),_=new Float32Array(d*x*m),v=new Float32Array(g*x*m);for(let A=0;A<m;A++){let C=A%3*2/3-1,y=A>2?0:-1,S=[C,y,0,C+2/3,y,0,C+2/3,y+1,0,C,y,0,C+2/3,y+1,0,C,y+1,0];M.set(S,p*x*A),_.set(u,d*x*A);let P=[A,A,A,A,A,A];v.set(P,g*x*A)}let b=new ke;b.setAttribute("position",new Yt(M,p)),b.setAttribute("uv",new Yt(_,d)),b.setAttribute("faceIndex",new Yt(v,g)),t.push(b),i>ii&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Ta(r,t,e){let n=new rn(r,t,e);return n.texture.mapping=Ls,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function ds(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function Rf(r,t,e){let n=new Float32Array(Cn),i=new R(0,1,0);return new on({name:"SphericalGaussianBlur",defines:{n:Cn,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:oo(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues\' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,blending:pn,depthTest:!1,depthWrite:!1})}function Aa(){return new on({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:oo(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,blending:pn,depthTest:!1,depthWrite:!1})}function Ea(){return new on({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:oo(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,blending:pn,depthTest:!1,depthWrite:!1})}function oo(){return`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`}function Lf(r){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){let c=o.mapping,l=c===Cr||c===Pr,h=c===ci||c===li;if(l||h)if(o.isRenderTargetTexture&&o.needsPMREMUpdate===!0){o.needsPMREMUpdate=!1;let f=t.get(o);return e===null&&(e=new Rs(r)),f=l?e.fromEquirectangular(o,f):e.fromCubemap(o,f),t.set(o,f),f.texture}else{if(t.has(o))return t.get(o).texture;{let f=o.image;if(l&&f&&f.height>0||h&&f&&i(f)){e===null&&(e=new Rs(r));let u=l?e.fromEquirectangular(o):e.fromCubemap(o);return t.set(o,u),o.addEventListener("dispose",s),u.texture}else return null}}}return o}function i(o){let c=0,l=6;for(let h=0;h<l;h++)o[h]!==void 0&&c++;return c===l}function s(o){let c=o.target;c.removeEventListener("dispose",s);let l=t.get(c);l!==void 0&&(t.delete(c),l.dispose())}function a(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:a}}function If(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(n){n.isWebGL2?e("EXT_color_buffer_float"):(e("WEBGL_depth_texture"),e("OES_texture_float"),e("OES_texture_half_float"),e("OES_texture_half_float_linear"),e("OES_standard_derivatives"),e("OES_element_index_uint"),e("OES_vertex_array_object"),e("ANGLE_instanced_arrays")),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function Df(r,t,e,n){let i={},s=new WeakMap;function a(f){let u=f.target;u.index!==null&&t.remove(u.index);for(let x in u.attributes)t.remove(u.attributes[x]);u.removeEventListener("dispose",a),delete i[u.id];let m=s.get(u);m&&(t.remove(m),s.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,e.memory.geometries--}function o(f,u){return i[u.id]===!0||(u.addEventListener("dispose",a),i[u.id]=!0,e.memory.geometries++),u}function c(f){let u=f.attributes;for(let x in u)t.update(u[x],34962);let m=f.morphAttributes;for(let x in m){let p=m[x];for(let d=0,g=p.length;d<g;d++)t.update(p[d],34962)}}function l(f){let u=[],m=f.index,x=f.attributes.position,p=0;if(m!==null){let M=m.array;p=m.version;for(let _=0,v=M.length;_<v;_+=3){let b=M[_+0],A=M[_+1],C=M[_+2];u.push(b,A,A,C,C,b)}}else{let M=x.array;p=x.version;for(let _=0,v=M.length/3-1;_<v;_+=3){let b=_+0,A=_+1,C=_+2;u.push(b,A,A,C,C,b)}}let d=new($a(u)?As:Ts)(u,1);d.version=p;let g=s.get(f);g&&t.remove(g),s.set(f,d)}function h(f){let u=s.get(f);if(u){let m=f.index;m!==null&&u.version<m.version&&l(f)}else l(f);return s.get(f)}return{get:o,update:c,getWireframeAttribute:h}}function Nf(r,t,e,n){let i=n.isWebGL2,s;function a(u){s=u}let o,c;function l(u){o=u.type,c=u.bytesPerElement}function h(u,m){r.drawElements(s,m,o,u*c),e.update(m,s,1)}function f(u,m,x){if(x===0)return;let p,d;if(i)p=r,d="drawElementsInstanced";else if(p=t.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",p===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[d](s,m,o,u*c,x),e.update(m,s,x)}this.setMode=a,this.setIndex=l,this.render=h,this.renderInstances=f}function Ff(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(e.calls++,a){case 4:e.triangles+=o*(s/3);break;case 1:e.lines+=o*(s/2);break;case 3:e.lines+=o*(s-1);break;case 2:e.lines+=o*s;break;case 0:e.points+=o*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function zf(r,t){return r[0]-t[0]}function Of(r,t){return Math.abs(t[1])-Math.abs(r[1])}function Bf(r,t,e){let n={},i=new Float32Array(8),s=new WeakMap,a=new Xt,o=[];for(let l=0;l<8;l++)o[l]=[l,0];function c(l,h,f,u){let m=l.morphTargetInfluences;if(t.isWebGL2===!0){let x=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,p=x!==void 0?x.length:0,d=s.get(h);if(d===void 0||d.count!==p){let k=function(){D.dispose(),s.delete(h),h.removeEventListener("dispose",k)};d!==void 0&&d.texture.dispose();let _=h.morphAttributes.position!==void 0,v=h.morphAttributes.normal!==void 0,b=h.morphAttributes.color!==void 0,A=h.morphAttributes.position||[],C=h.morphAttributes.normal||[],y=h.morphAttributes.color||[],S=0;_===!0&&(S=1),v===!0&&(S=2),b===!0&&(S=3);let P=h.attributes.position.count*S,O=1;P>t.maxTextureSize&&(O=Math.ceil(P/t.maxTextureSize),P=t.maxTextureSize);let B=new Float32Array(P*O*4*p),D=new bs(B,P,O,p);D.type=Rn,D.needsUpdate=!0;let I=S*4;for(let Y=0;Y<p;Y++){let Z=A[Y],H=C[Y],$=y[Y],J=P*O*4*Y;for(let dt=0;dt<Z.count;dt++){let z=dt*I;_===!0&&(a.fromBufferAttribute(Z,dt),B[J+z+0]=a.x,B[J+z+1]=a.y,B[J+z+2]=a.z,B[J+z+3]=0),v===!0&&(a.fromBufferAttribute(H,dt),B[J+z+4]=a.x,B[J+z+5]=a.y,B[J+z+6]=a.z,B[J+z+7]=0),b===!0&&(a.fromBufferAttribute($,dt),B[J+z+8]=a.x,B[J+z+9]=a.y,B[J+z+10]=a.z,B[J+z+11]=$.itemSize===4?a.w:1)}}d={count:p,texture:D,size:new At(P,O)},s.set(h,d),h.addEventListener("dispose",k)}let g=0;for(let _=0;_<m.length;_++)g+=m[_];let M=h.morphTargetsRelative?1:1-g;u.getUniforms().setValue(r,"morphTargetBaseInfluence",M),u.getUniforms().setValue(r,"morphTargetInfluences",m),u.getUniforms().setValue(r,"morphTargetsTexture",d.texture,e),u.getUniforms().setValue(r,"morphTargetsTextureSize",d.size)}else{let x=m===void 0?0:m.length,p=n[h.id];if(p===void 0||p.length!==x){p=[];for(let v=0;v<x;v++)p[v]=[v,0];n[h.id]=p}for(let v=0;v<x;v++){let b=p[v];b[0]=v,b[1]=m[v]}p.sort(Of);for(let v=0;v<8;v++)v<x&&p[v][1]?(o[v][0]=p[v][0],o[v][1]=p[v][1]):(o[v][0]=Number.MAX_SAFE_INTEGER,o[v][1]=0);o.sort(zf);let d=h.morphAttributes.position,g=h.morphAttributes.normal,M=0;for(let v=0;v<8;v++){let b=o[v],A=b[0],C=b[1];A!==Number.MAX_SAFE_INTEGER&&C?(d&&h.getAttribute("morphTarget"+v)!==d[A]&&h.setAttribute("morphTarget"+v,d[A]),g&&h.getAttribute("morphNormal"+v)!==g[A]&&h.setAttribute("morphNormal"+v,g[A]),i[v]=C,M+=C):(d&&h.hasAttribute("morphTarget"+v)===!0&&h.deleteAttribute("morphTarget"+v),g&&h.hasAttribute("morphNormal"+v)===!0&&h.deleteAttribute("morphNormal"+v),i[v]=0)}let _=h.morphTargetsRelative?1:1-M;u.getUniforms().setValue(r,"morphTargetBaseInfluence",_),u.getUniforms().setValue(r,"morphTargetInfluences",i)}}return{update:c}}function Uf(r,t,e,n){let i=new WeakMap;function s(c){let l=n.render.frame,h=c.geometry,f=t.get(c,h);return i.get(f)!==l&&(t.update(f),i.set(f,l)),c.isInstancedMesh&&(c.hasEventListener("dispose",o)===!1&&c.addEventListener("dispose",o),e.update(c.instanceMatrix,34962),c.instanceColor!==null&&e.update(c.instanceColor,34962)),f}function a(){i=new WeakMap}function o(c){let l=c.target;l.removeEventListener("dispose",o),e.remove(l.instanceMatrix),l.instanceColor!==null&&e.remove(l.instanceColor)}return{update:s,dispose:a}}var tc=new ue,ec=new bs,nc=new Nr,ic=new Cs,Ca=[],Pa=[],Ra=new Float32Array(16),La=new Float32Array(9),Ia=new Float32Array(4);function mi(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=Ca[i];if(s===void 0&&(s=new Float32Array(i),Ca[i]=s),t!==0){n.toArray(s,0);for(let a=1,o=0;a!==t;++a)o+=e,r[a].toArray(s,o)}return s}function Zt(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function Jt(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function Is(r,t){let e=Pa[t];e===void 0&&(e=new Int32Array(t),Pa[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function kf(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function Vf(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Zt(e,t))return;r.uniform2fv(this.addr,t),Jt(e,t)}}function Gf(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Zt(e,t))return;r.uniform3fv(this.addr,t),Jt(e,t)}}function Hf(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Zt(e,t))return;r.uniform4fv(this.addr,t),Jt(e,t)}}function Wf(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Zt(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Jt(e,t)}else{if(Zt(e,n))return;Ia.set(n),r.uniformMatrix2fv(this.addr,!1,Ia),Jt(e,n)}}function qf(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Zt(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Jt(e,t)}else{if(Zt(e,n))return;La.set(n),r.uniformMatrix3fv(this.addr,!1,La),Jt(e,n)}}function Xf(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Zt(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Jt(e,t)}else{if(Zt(e,n))return;Ra.set(n),r.uniformMatrix4fv(this.addr,!1,Ra),Jt(e,n)}}function Yf(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function Zf(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Zt(e,t))return;r.uniform2iv(this.addr,t),Jt(e,t)}}function Jf(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Zt(e,t))return;r.uniform3iv(this.addr,t),Jt(e,t)}}function $f(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Zt(e,t))return;r.uniform4iv(this.addr,t),Jt(e,t)}}function Kf(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function jf(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Zt(e,t))return;r.uniform2uiv(this.addr,t),Jt(e,t)}}function Qf(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Zt(e,t))return;r.uniform3uiv(this.addr,t),Jt(e,t)}}function td(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Zt(e,t))return;r.uniform4uiv(this.addr,t),Jt(e,t)}}function ed(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2D(t||tc,i)}function nd(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||nc,i)}function id(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||ic,i)}function sd(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||ec,i)}function rd(r){switch(r){case 5126:return kf;case 35664:return Vf;case 35665:return Gf;case 35666:return Hf;case 35674:return Wf;case 35675:return qf;case 35676:return Xf;case 5124:case 35670:return Yf;case 35667:case 35671:return Zf;case 35668:case 35672:return Jf;case 35669:case 35673:return $f;case 5125:return Kf;case 36294:return jf;case 36295:return Qf;case 36296:return td;case 35678:case 36198:case 36298:case 36306:case 35682:return ed;case 35679:case 36299:case 36307:return nd;case 35680:case 36300:case 36308:case 36293:return id;case 36289:case 36303:case 36311:case 36292:return sd}}function od(r,t){r.uniform1fv(this.addr,t)}function ad(r,t){let e=mi(t,this.size,2);r.uniform2fv(this.addr,e)}function cd(r,t){let e=mi(t,this.size,3);r.uniform3fv(this.addr,e)}function ld(r,t){let e=mi(t,this.size,4);r.uniform4fv(this.addr,e)}function hd(r,t){let e=mi(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function ud(r,t){let e=mi(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function fd(r,t){let e=mi(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function dd(r,t){r.uniform1iv(this.addr,t)}function pd(r,t){r.uniform2iv(this.addr,t)}function md(r,t){r.uniform3iv(this.addr,t)}function gd(r,t){r.uniform4iv(this.addr,t)}function xd(r,t){r.uniform1uiv(this.addr,t)}function _d(r,t){r.uniform2uiv(this.addr,t)}function yd(r,t){r.uniform3uiv(this.addr,t)}function vd(r,t){r.uniform4uiv(this.addr,t)}function Md(r,t,e){let n=this.cache,i=t.length,s=Is(e,i);Zt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)e.setTexture2D(t[a]||tc,s[a])}function bd(r,t,e){let n=this.cache,i=t.length,s=Is(e,i);Zt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)e.setTexture3D(t[a]||nc,s[a])}function wd(r,t,e){let n=this.cache,i=t.length,s=Is(e,i);Zt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)e.setTextureCube(t[a]||ic,s[a])}function Sd(r,t,e){let n=this.cache,i=t.length,s=Is(e,i);Zt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)e.setTexture2DArray(t[a]||ec,s[a])}function Td(r){switch(r){case 5126:return od;case 35664:return ad;case 35665:return cd;case 35666:return ld;case 35674:return hd;case 35675:return ud;case 35676:return fd;case 5124:case 35670:return dd;case 35667:case 35671:return pd;case 35668:case 35672:return md;case 35669:case 35673:return gd;case 5125:return xd;case 36294:return _d;case 36295:return yd;case 36296:return vd;case 35678:case 36198:case 36298:case 36306:case 35682:return Md;case 35679:case 36299:case 36307:return bd;case 35680:case 36300:case 36308:case 36293:return wd;case 36289:case 36303:case 36311:case 36292:return Sd}}var Ur=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=rd(e.type)}},kr=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=Td(e.type)}},Vr=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,a=i.length;s!==a;++s){let o=i[s];o.setValue(t,e[o.id],n)}}},Ar=/(\\w+)(\\])?(\\[|\\.)?/g;function Da(r,t){r.seq.push(t),r.map[t.id]=t}function Ad(r,t,e){let n=r.name,i=n.length;for(Ar.lastIndex=0;;){let s=Ar.exec(n),a=Ar.lastIndex,o=s[1],c=s[2]==="]",l=s[3];if(c&&(o=o|0),l===void 0||l==="["&&a+2===i){Da(e,l===void 0?new Ur(o,r,t):new kr(o,r,t));break}else{let f=e.map[o];f===void 0&&(f=new Vr(o),Da(e,f)),e=f}}}var ai=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,35718);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),a=t.getUniformLocation(e,s.name);Ad(s,a,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,a=e.length;s!==a;++s){let o=e[s],c=n[o.id];c.needsUpdate!==!1&&o.setValue(t,c.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let a=t[i];a.id in e&&n.push(a)}return n}};function Na(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var Ed=0;function Cd(r,t){let e=r.split(`\n`),n=[],i=Math.max(t-6,0),s=Math.min(t+6,e.length);for(let a=i;a<s;a++){let o=a+1;n.push(`${o===t?">":" "} ${o}: ${e[a]}`)}return n.join(`\n`)}function Pd(r){switch(r){case Nn:return["Linear","( value )"];case Ot:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",r),["Linear","( value )"]}}function Fa(r,t,e){let n=r.getShaderParameter(t,35713),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\\d+)/.exec(i);if(s){let a=parseInt(s[1]);return e.toUpperCase()+`\n\n`+i+`\n\n`+Cd(r.getShaderSource(t),a)}else return i}function Rd(r,t){let e=Pd(t);return"vec4 "+r+"( vec4 value ) { return LinearTo"+e[0]+e[1]+"; }"}function Ld(r,t){let e;switch(t){case Qc:e="Linear";break;case tl:e="Reinhard";break;case el:e="OptimizedCineon";break;case nl:e="ACESFilmic";break;case il:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function Id(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.tangentSpaceNormalMap||r.clearcoatNormalMap||r.flatShading||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Fi).join(`\n`)}function Dd(r){let t=[];for(let e in r){let n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`\n`)}function Nd(r,t){let e={},n=r.getProgramParameter(t,35721);for(let i=0;i<n;i++){let s=r.getActiveAttrib(t,i),a=s.name,o=1;s.type===35674&&(o=2),s.type===35675&&(o=3),s.type===35676&&(o=4),e[a]={type:s.type,location:r.getAttribLocation(t,a),locationSize:o}}return e}function Fi(r){return r!==""}function za(r,t){let e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,e).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Oa(r,t){return r.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Fd=/^[ \\t]*#include +<([\\w\\d./]+)>/gm;function Gr(r){return r.replace(Fd,zd)}function zd(r,t){let e=wt[t];if(e===void 0)throw new Error("Can not resolve #include <"+t+">");return Gr(e)}var Od=/#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;function Ba(r){return r.replace(Od,Bd)}function Bd(r,t,e,n){let i="";for(let s=parseInt(t);s<parseInt(e);s++)i+=n.replace(/\\[\\s*i\\s*\\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Ua(r){let t="precision "+r.precision+` float;\nprecision `+r.precision+" int;";return r.precision==="highp"?t+=`\n#define HIGH_PRECISION`:r.precision==="mediump"?t+=`\n#define MEDIUM_PRECISION`:r.precision==="lowp"&&(t+=`\n#define LOW_PRECISION`),t}function Ud(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Wa?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===Lc?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Ni&&(t="SHADOWMAP_TYPE_VSM"),t}function kd(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case ci:case li:t="ENVMAP_TYPE_CUBE";break;case Ls:t="ENVMAP_TYPE_CUBE_UV";break}return t}function Vd(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case li:t="ENVMAP_MODE_REFRACTION";break}return t}function Gd(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case Ya:t="ENVMAP_BLENDING_MULTIPLY";break;case Kc:t="ENVMAP_BLENDING_MIX";break;case jc:t="ENVMAP_BLENDING_ADD";break}return t}function Hd(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function Wd(r,t,e,n){let i=r.getContext(),s=e.defines,a=e.vertexShader,o=e.fragmentShader,c=Ud(e),l=kd(e),h=Vd(e),f=Gd(e),u=Hd(e),m=e.isWebGL2?"":Id(e),x=Dd(s),p=i.createProgram(),d,g,M=e.glslVersion?"#version "+e.glslVersion+`\n`:"";e.isRawShaderMaterial?(d=[x].filter(Fi).join(`\n`),d.length>0&&(d+=`\n`),g=[m,x].filter(Fi).join(`\n`),g.length>0&&(g+=`\n`)):(d=[Ua(e),"#define SHADER_NAME "+e.shaderName,x,e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.displacementMap&&e.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",e.specularColorMap?"#define USE_SPECULARCOLORMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEENCOLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors&&e.isWebGL2?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",`\n`].filter(Fi).join(`\n`),g=[m,Ua(e),"#define SHADER_NAME "+e.shaderName,x,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.envMap?"#define "+h:"",e.envMap?"#define "+f:"",u?"#define CUBEUV_TEXEL_WIDTH "+u.texelWidth:"",u?"#define CUBEUV_TEXEL_HEIGHT "+u.texelHeight:"",u?"#define CUBEUV_MAX_MIP "+u.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",e.specularColorMap?"#define USE_SPECULARCOLORMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEENCOLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==nn?"#define TONE_MAPPING":"",e.toneMapping!==nn?wt.tonemapping_pars_fragment:"",e.toneMapping!==nn?Ld("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",wt.encodings_pars_fragment,Rd("linearToOutputTexel",e.outputEncoding),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`\n`].filter(Fi).join(`\n`)),a=Gr(a),a=za(a,e),a=Oa(a,e),o=Gr(o),o=za(o,e),o=Oa(o,e),a=Ba(a),o=Ba(o),e.isWebGL2&&e.isRawShaderMaterial!==!0&&(M=`#version 300 es\n`,d=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`\n`)+`\n`+d,g=["#define varying in",e.glslVersion===la?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===la?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`\n`)+`\n`+g);let _=M+d+a,v=M+g+o,b=Na(i,35633,_),A=Na(i,35632,v);if(i.attachShader(p,b),i.attachShader(p,A),e.index0AttributeName!==void 0?i.bindAttribLocation(p,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(p,0,"position"),i.linkProgram(p),r.debug.checkShaderErrors){let S=i.getProgramInfoLog(p).trim(),P=i.getShaderInfoLog(b).trim(),O=i.getShaderInfoLog(A).trim(),B=!0,D=!0;if(i.getProgramParameter(p,35714)===!1){B=!1;let I=Fa(i,b,"vertex"),k=Fa(i,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(p,35715)+`\n\nProgram Info Log: `+S+`\n`+I+`\n`+k)}else S!==""?console.warn("THREE.WebGLProgram: Program Info Log:",S):(P===""||O==="")&&(D=!1);D&&(this.diagnostics={runnable:B,programLog:S,vertexShader:{log:P,prefix:d},fragmentShader:{log:O,prefix:g}})}i.deleteShader(b),i.deleteShader(A);let C;this.getUniforms=function(){return C===void 0&&(C=new ai(i,p)),C};let y;return this.getAttributes=function(){return y===void 0&&(y=Nd(i,p)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(p),this.program=void 0},this.name=e.shaderName,this.id=Ed++,this.cacheKey=t,this.usedTimes=1,this.program=p,this.vertexShader=b,this.fragmentShader=A,this}var qd=0,Hr=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Wr(t),e.set(t,n)),n}},Wr=class{constructor(t){this.id=qd++,this.code=t,this.usedTimes=0}};function Xd(r,t,e,n,i,s,a){let o=new ws,c=new Hr,l=[],h=i.isWebGL2,f=i.logarithmicDepthBuffer,u=i.vertexTextures,m=i.precision,x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function p(y,S,P,O,B){let D=O.fog,I=B.geometry,k=y.isMeshStandardMaterial?O.environment:null,Y=(y.isMeshStandardMaterial?e:t).get(y.envMap||k),Z=Y&&Y.mapping===Ls?Y.image.height:null,H=x[y.type];y.precision!==null&&(m=i.getMaxPrecision(y.precision),m!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",m,"instead."));let $=I.morphAttributes.position||I.morphAttributes.normal||I.morphAttributes.color,J=$!==void 0?$.length:0,dt=0;I.morphAttributes.position!==void 0&&(dt=1),I.morphAttributes.normal!==void 0&&(dt=2),I.morphAttributes.color!==void 0&&(dt=3);let z,K,nt,it;if(H){let Ft=He[H];z=Ft.vertexShader,K=Ft.fragmentShader}else z=y.vertexShader,K=y.fragmentShader,c.update(y),nt=c.getVertexShaderID(y),it=c.getFragmentShaderID(y);let U=r.getRenderTarget(),Mt=y.alphaTest>0,ht=y.clearcoat>0,ut=y.iridescence>0;return{isWebGL2:h,shaderID:H,shaderName:y.type,vertexShader:z,fragmentShader:K,defines:y.defines,customVertexShaderID:nt,customFragmentShaderID:it,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:m,instancing:B.isInstancedMesh===!0,instancingColor:B.isInstancedMesh===!0&&B.instanceColor!==null,supportsVertexTextures:u,outputEncoding:U===null?r.outputEncoding:U.isXRRenderTarget===!0?U.texture.encoding:Nn,map:!!y.map,matcap:!!y.matcap,envMap:!!Y,envMapMode:Y&&Y.mapping,envMapCubeUVHeight:Z,lightMap:!!y.lightMap,aoMap:!!y.aoMap,emissiveMap:!!y.emissiveMap,bumpMap:!!y.bumpMap,normalMap:!!y.normalMap,objectSpaceNormalMap:y.normalMapType===wl,tangentSpaceNormalMap:y.normalMapType===bl,decodeVideoTexture:!!y.map&&y.map.isVideoTexture===!0&&y.map.encoding===Ot,clearcoat:ht,clearcoatMap:ht&&!!y.clearcoatMap,clearcoatRoughnessMap:ht&&!!y.clearcoatRoughnessMap,clearcoatNormalMap:ht&&!!y.clearcoatNormalMap,iridescence:ut,iridescenceMap:ut&&!!y.iridescenceMap,iridescenceThicknessMap:ut&&!!y.iridescenceThicknessMap,displacementMap:!!y.displacementMap,roughnessMap:!!y.roughnessMap,metalnessMap:!!y.metalnessMap,specularMap:!!y.specularMap,specularIntensityMap:!!y.specularIntensityMap,specularColorMap:!!y.specularColorMap,opaque:y.transparent===!1&&y.blending===ri,alphaMap:!!y.alphaMap,alphaTest:Mt,gradientMap:!!y.gradientMap,sheen:y.sheen>0,sheenColorMap:!!y.sheenColorMap,sheenRoughnessMap:!!y.sheenRoughnessMap,transmission:y.transmission>0,transmissionMap:!!y.transmissionMap,thicknessMap:!!y.thicknessMap,combine:y.combine,vertexTangents:!!y.normalMap&&!!I.attributes.tangent,vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&!!I.attributes.color&&I.attributes.color.itemSize===4,vertexUvs:!!y.map||!!y.bumpMap||!!y.normalMap||!!y.specularMap||!!y.alphaMap||!!y.emissiveMap||!!y.roughnessMap||!!y.metalnessMap||!!y.clearcoatMap||!!y.clearcoatRoughnessMap||!!y.clearcoatNormalMap||!!y.iridescenceMap||!!y.iridescenceThicknessMap||!!y.displacementMap||!!y.transmissionMap||!!y.thicknessMap||!!y.specularIntensityMap||!!y.specularColorMap||!!y.sheenColorMap||!!y.sheenRoughnessMap,uvsVertexOnly:!(y.map||y.bumpMap||y.normalMap||y.specularMap||y.alphaMap||y.emissiveMap||y.roughnessMap||y.metalnessMap||y.clearcoatNormalMap||y.iridescenceMap||y.iridescenceThicknessMap||y.transmission>0||y.transmissionMap||y.thicknessMap||y.specularIntensityMap||y.specularColorMap||y.sheen>0||y.sheenColorMap||y.sheenRoughnessMap)&&!!y.displacementMap,fog:!!D,useFog:y.fog===!0,fogExp2:D&&D.isFogExp2,flatShading:!!y.flatShading,sizeAttenuation:y.sizeAttenuation,logarithmicDepthBuffer:f,skinning:B.isSkinnedMesh===!0,morphTargets:I.morphAttributes.position!==void 0,morphNormals:I.morphAttributes.normal!==void 0,morphColors:I.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:dt,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:y.dithering,shadowMapEnabled:r.shadowMap.enabled&&P.length>0,shadowMapType:r.shadowMap.type,toneMapping:y.toneMapped?r.toneMapping:nn,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:y.premultipliedAlpha,doubleSided:y.side===We,flipSided:y.side===he,useDepthPacking:!!y.depthPacking,depthPacking:y.depthPacking||0,index0AttributeName:y.index0AttributeName,extensionDerivatives:y.extensions&&y.extensions.derivatives,extensionFragDepth:y.extensions&&y.extensions.fragDepth,extensionDrawBuffers:y.extensions&&y.extensions.drawBuffers,extensionShaderTextureLOD:y.extensions&&y.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||n.has("EXT_shader_texture_lod"),customProgramCacheKey:y.customProgramCacheKey()}}function d(y){let S=[];if(y.shaderID?S.push(y.shaderID):(S.push(y.customVertexShaderID),S.push(y.customFragmentShaderID)),y.defines!==void 0)for(let P in y.defines)S.push(P),S.push(y.defines[P]);return y.isRawShaderMaterial===!1&&(g(S,y),M(S,y),S.push(r.outputEncoding)),S.push(y.customProgramCacheKey),S.join()}function g(y,S){y.push(S.precision),y.push(S.outputEncoding),y.push(S.envMapMode),y.push(S.envMapCubeUVHeight),y.push(S.combine),y.push(S.vertexUvs),y.push(S.fogExp2),y.push(S.sizeAttenuation),y.push(S.morphTargetsCount),y.push(S.morphAttributeCount),y.push(S.numDirLights),y.push(S.numPointLights),y.push(S.numSpotLights),y.push(S.numSpotLightMaps),y.push(S.numHemiLights),y.push(S.numRectAreaLights),y.push(S.numDirLightShadows),y.push(S.numPointLightShadows),y.push(S.numSpotLightShadows),y.push(S.numSpotLightShadowsWithMaps),y.push(S.shadowMapType),y.push(S.toneMapping),y.push(S.numClippingPlanes),y.push(S.numClipIntersection),y.push(S.depthPacking)}function M(y,S){o.disableAll(),S.isWebGL2&&o.enable(0),S.supportsVertexTextures&&o.enable(1),S.instancing&&o.enable(2),S.instancingColor&&o.enable(3),S.map&&o.enable(4),S.matcap&&o.enable(5),S.envMap&&o.enable(6),S.lightMap&&o.enable(7),S.aoMap&&o.enable(8),S.emissiveMap&&o.enable(9),S.bumpMap&&o.enable(10),S.normalMap&&o.enable(11),S.objectSpaceNormalMap&&o.enable(12),S.tangentSpaceNormalMap&&o.enable(13),S.clearcoat&&o.enable(14),S.clearcoatMap&&o.enable(15),S.clearcoatRoughnessMap&&o.enable(16),S.clearcoatNormalMap&&o.enable(17),S.iridescence&&o.enable(18),S.iridescenceMap&&o.enable(19),S.iridescenceThicknessMap&&o.enable(20),S.displacementMap&&o.enable(21),S.specularMap&&o.enable(22),S.roughnessMap&&o.enable(23),S.metalnessMap&&o.enable(24),S.gradientMap&&o.enable(25),S.alphaMap&&o.enable(26),S.alphaTest&&o.enable(27),S.vertexColors&&o.enable(28),S.vertexAlphas&&o.enable(29),S.vertexUvs&&o.enable(30),S.vertexTangents&&o.enable(31),S.uvsVertexOnly&&o.enable(32),y.push(o.mask),o.disableAll(),S.fog&&o.enable(0),S.useFog&&o.enable(1),S.flatShading&&o.enable(2),S.logarithmicDepthBuffer&&o.enable(3),S.skinning&&o.enable(4),S.morphTargets&&o.enable(5),S.morphNormals&&o.enable(6),S.morphColors&&o.enable(7),S.premultipliedAlpha&&o.enable(8),S.shadowMapEnabled&&o.enable(9),S.physicallyCorrectLights&&o.enable(10),S.doubleSided&&o.enable(11),S.flipSided&&o.enable(12),S.useDepthPacking&&o.enable(13),S.dithering&&o.enable(14),S.specularIntensityMap&&o.enable(15),S.specularColorMap&&o.enable(16),S.transmission&&o.enable(17),S.transmissionMap&&o.enable(18),S.thicknessMap&&o.enable(19),S.sheen&&o.enable(20),S.sheenColorMap&&o.enable(21),S.sheenRoughnessMap&&o.enable(22),S.decodeVideoTexture&&o.enable(23),S.opaque&&o.enable(24),y.push(o.mask)}function _(y){let S=x[y.type],P;if(S){let O=He[S];P=Bl.clone(O.uniforms)}else P=y.uniforms;return P}function v(y,S){let P;for(let O=0,B=l.length;O<B;O++){let D=l[O];if(D.cacheKey===S){P=D,++P.usedTimes;break}}return P===void 0&&(P=new Wd(r,S,y,s),l.push(P)),P}function b(y){if(--y.usedTimes===0){let S=l.indexOf(y);l[S]=l[l.length-1],l.pop(),y.destroy()}}function A(y){c.remove(y)}function C(){c.dispose()}return{getParameters:p,getProgramCacheKey:d,getUniforms:_,acquireProgram:v,releaseProgram:b,releaseShaderCache:A,programs:l,dispose:C}}function Yd(){let r=new WeakMap;function t(s){let a=r.get(s);return a===void 0&&(a={},r.set(s,a)),a}function e(s){r.delete(s)}function n(s,a,o){r.get(s)[a]=o}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function Zd(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function ka(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function Va(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function a(f,u,m,x,p,d){let g=r[t];return g===void 0?(g={id:f.id,object:f,geometry:u,material:m,groupOrder:x,renderOrder:f.renderOrder,z:p,group:d},r[t]=g):(g.id=f.id,g.object=f,g.geometry=u,g.material=m,g.groupOrder=x,g.renderOrder=f.renderOrder,g.z=p,g.group=d),t++,g}function o(f,u,m,x,p,d){let g=a(f,u,m,x,p,d);m.transmission>0?n.push(g):m.transparent===!0?i.push(g):e.push(g)}function c(f,u,m,x,p,d){let g=a(f,u,m,x,p,d);m.transmission>0?n.unshift(g):m.transparent===!0?i.unshift(g):e.unshift(g)}function l(f,u){e.length>1&&e.sort(f||Zd),n.length>1&&n.sort(u||ka),i.length>1&&i.sort(u||ka)}function h(){for(let f=t,u=r.length;f<u;f++){let m=r[f];if(m.id===null)break;m.id=null,m.object=null,m.geometry=null,m.material=null,m.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:o,unshift:c,finish:h,sort:l}}function Jd(){let r=new WeakMap;function t(n,i){let s=r.get(n),a;return s===void 0?(a=new Va,r.set(n,[a])):i>=s.length?(a=new Va,s.push(a)):a=s[i],a}function e(){r=new WeakMap}return{get:t,dispose:e}}function $d(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new R,color:new Bt};break;case"SpotLight":e={position:new R,direction:new R,color:new Bt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new R,color:new Bt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new R,skyColor:new Bt,groundColor:new Bt};break;case"RectAreaLight":e={color:new Bt,position:new R,halfWidth:new R,halfHeight:new R};break}return r[t.id]=e,e}}}function Kd(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var jd=0;function Qd(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function tp(r,t){let e=new $d,n=Kd(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let h=0;h<9;h++)i.probe.push(new R);let s=new R,a=new zt,o=new zt;function c(h,f){let u=0,m=0,x=0;for(let O=0;O<9;O++)i.probe[O].set(0,0,0);let p=0,d=0,g=0,M=0,_=0,v=0,b=0,A=0,C=0,y=0;h.sort(Qd);let S=f!==!0?Math.PI:1;for(let O=0,B=h.length;O<B;O++){let D=h[O],I=D.color,k=D.intensity,Y=D.distance,Z=D.shadow&&D.shadow.map?D.shadow.map.texture:null;if(D.isAmbientLight)u+=I.r*k*S,m+=I.g*k*S,x+=I.b*k*S;else if(D.isLightProbe)for(let H=0;H<9;H++)i.probe[H].addScaledVector(D.sh.coefficients[H],k);else if(D.isDirectionalLight){let H=e.get(D);if(H.color.copy(D.color).multiplyScalar(D.intensity*S),D.castShadow){let $=D.shadow,J=n.get(D);J.shadowBias=$.bias,J.shadowNormalBias=$.normalBias,J.shadowRadius=$.radius,J.shadowMapSize=$.mapSize,i.directionalShadow[p]=J,i.directionalShadowMap[p]=Z,i.directionalShadowMatrix[p]=D.shadow.matrix,v++}i.directional[p]=H,p++}else if(D.isSpotLight){let H=e.get(D);H.position.setFromMatrixPosition(D.matrixWorld),H.color.copy(I).multiplyScalar(k*S),H.distance=Y,H.coneCos=Math.cos(D.angle),H.penumbraCos=Math.cos(D.angle*(1-D.penumbra)),H.decay=D.decay,i.spot[g]=H;let $=D.shadow;if(D.map&&(i.spotLightMap[C]=D.map,C++,$.updateMatrices(D),D.castShadow&&y++),i.spotLightMatrix[g]=$.matrix,D.castShadow){let J=n.get(D);J.shadowBias=$.bias,J.shadowNormalBias=$.normalBias,J.shadowRadius=$.radius,J.shadowMapSize=$.mapSize,i.spotShadow[g]=J,i.spotShadowMap[g]=Z,A++}g++}else if(D.isRectAreaLight){let H=e.get(D);H.color.copy(I).multiplyScalar(k),H.halfWidth.set(D.width*.5,0,0),H.halfHeight.set(0,D.height*.5,0),i.rectArea[M]=H,M++}else if(D.isPointLight){let H=e.get(D);if(H.color.copy(D.color).multiplyScalar(D.intensity*S),H.distance=D.distance,H.decay=D.decay,D.castShadow){let $=D.shadow,J=n.get(D);J.shadowBias=$.bias,J.shadowNormalBias=$.normalBias,J.shadowRadius=$.radius,J.shadowMapSize=$.mapSize,J.shadowCameraNear=$.camera.near,J.shadowCameraFar=$.camera.far,i.pointShadow[d]=J,i.pointShadowMap[d]=Z,i.pointShadowMatrix[d]=D.shadow.matrix,b++}i.point[d]=H,d++}else if(D.isHemisphereLight){let H=e.get(D);H.skyColor.copy(D.color).multiplyScalar(k*S),H.groundColor.copy(D.groundColor).multiplyScalar(k*S),i.hemi[_]=H,_++}}M>0&&(t.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=et.LTC_FLOAT_1,i.rectAreaLTC2=et.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=et.LTC_HALF_1,i.rectAreaLTC2=et.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=u,i.ambient[1]=m,i.ambient[2]=x;let P=i.hash;(P.directionalLength!==p||P.pointLength!==d||P.spotLength!==g||P.rectAreaLength!==M||P.hemiLength!==_||P.numDirectionalShadows!==v||P.numPointShadows!==b||P.numSpotShadows!==A||P.numSpotMaps!==C)&&(i.directional.length=p,i.spot.length=g,i.rectArea.length=M,i.point.length=d,i.hemi.length=_,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=A,i.spotShadowMap.length=A,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=A+C-y,i.spotLightMap.length=C,i.numSpotLightShadowsWithMaps=y,P.directionalLength=p,P.pointLength=d,P.spotLength=g,P.rectAreaLength=M,P.hemiLength=_,P.numDirectionalShadows=v,P.numPointShadows=b,P.numSpotShadows=A,P.numSpotMaps=C,i.version=jd++)}function l(h,f){let u=0,m=0,x=0,p=0,d=0,g=f.matrixWorldInverse;for(let M=0,_=h.length;M<_;M++){let v=h[M];if(v.isDirectionalLight){let b=i.directional[u];b.direction.setFromMatrixPosition(v.matrixWorld),s.setFromMatrixPosition(v.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(g),u++}else if(v.isSpotLight){let b=i.spot[x];b.position.setFromMatrixPosition(v.matrixWorld),b.position.applyMatrix4(g),b.direction.setFromMatrixPosition(v.matrixWorld),s.setFromMatrixPosition(v.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(g),x++}else if(v.isRectAreaLight){let b=i.rectArea[p];b.position.setFromMatrixPosition(v.matrixWorld),b.position.applyMatrix4(g),o.identity(),a.copy(v.matrixWorld),a.premultiply(g),o.extractRotation(a),b.halfWidth.set(v.width*.5,0,0),b.halfHeight.set(0,v.height*.5,0),b.halfWidth.applyMatrix4(o),b.halfHeight.applyMatrix4(o),p++}else if(v.isPointLight){let b=i.point[m];b.position.setFromMatrixPosition(v.matrixWorld),b.position.applyMatrix4(g),m++}else if(v.isHemisphereLight){let b=i.hemi[d];b.direction.setFromMatrixPosition(v.matrixWorld),b.direction.transformDirection(g),d++}}}return{setup:c,setupView:l,state:i}}function Ga(r,t){let e=new tp(r,t),n=[],i=[];function s(){n.length=0,i.length=0}function a(f){n.push(f)}function o(f){i.push(f)}function c(f){e.setup(n,f)}function l(f){e.setupView(n,f)}return{init:s,state:{lightsArray:n,shadowsArray:i,lights:e},setupLights:c,setupLightsView:l,pushLight:a,pushShadow:o}}function ep(r,t){let e=new WeakMap;function n(s,a=0){let o=e.get(s),c;return o===void 0?(c=new Ga(r,t),e.set(s,[c])):a>=o.length?(c=new Ga(r,t),o.push(c)):c=o[a],c}function i(){e=new WeakMap}return{get:n,dispose:i}}var qr=class extends fi{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=vl,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},Xr=class extends fi{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new R,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},np=`void main() {\n\tgl_Position = vec4( position, 1.0 );\n}`,ip=`uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}`;function sp(r,t,e){let n=new Ps,i=new At,s=new At,a=new Xt,o=new qr({depthPacking:Ml}),c=new Xr,l={},h=e.maxTextureSize,f={[Ue]:he,[he]:Ue,[We]:We},u=new on({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new At},radius:{value:4}},vertexShader:np,fragmentShader:ip}),m=u.clone();m.defines.HORIZONTAL_PASS=1;let x=new ke;x.setAttribute("position",new Yt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new qe(x,u),d=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Wa,this.render=function(v,b,A){if(d.enabled===!1||d.autoUpdate===!1&&d.needsUpdate===!1||v.length===0)return;let C=r.getRenderTarget(),y=r.getActiveCubeFace(),S=r.getActiveMipmapLevel(),P=r.state;P.setBlending(pn),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);for(let O=0,B=v.length;O<B;O++){let D=v[O],I=D.shadow;if(I===void 0){console.warn("THREE.WebGLShadowMap:",D,"has no shadow.");continue}if(I.autoUpdate===!1&&I.needsUpdate===!1)continue;i.copy(I.mapSize);let k=I.getFrameExtents();if(i.multiply(k),s.copy(I.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/k.x),i.x=s.x*k.x,I.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/k.y),i.y=s.y*k.y,I.mapSize.y=s.y)),I.map===null){let Z=this.type!==Ni?{minFilter:ce,magFilter:ce}:{};I.map=new rn(i.x,i.y,Z),I.map.texture.name=D.name+".shadowMap",I.camera.updateProjectionMatrix()}r.setRenderTarget(I.map),r.clear();let Y=I.getViewportCount();for(let Z=0;Z<Y;Z++){let H=I.getViewport(Z);a.set(s.x*H.x,s.y*H.y,s.x*H.z,s.y*H.w),P.viewport(a),I.updateMatrices(D,Z),n=I.getFrustum(),_(b,A,I.camera,D,this.type)}I.isPointLightShadow!==!0&&this.type===Ni&&g(I,A),I.needsUpdate=!1}d.needsUpdate=!1,r.setRenderTarget(C,y,S)};function g(v,b){let A=t.update(p);u.defines.VSM_SAMPLES!==v.blurSamples&&(u.defines.VSM_SAMPLES=v.blurSamples,m.defines.VSM_SAMPLES=v.blurSamples,u.needsUpdate=!0,m.needsUpdate=!0),v.mapPass===null&&(v.mapPass=new rn(i.x,i.y)),u.uniforms.shadow_pass.value=v.map.texture,u.uniforms.resolution.value=v.mapSize,u.uniforms.radius.value=v.radius,r.setRenderTarget(v.mapPass),r.clear(),r.renderBufferDirect(b,null,A,u,p,null),m.uniforms.shadow_pass.value=v.mapPass.texture,m.uniforms.resolution.value=v.mapSize,m.uniforms.radius.value=v.radius,r.setRenderTarget(v.map),r.clear(),r.renderBufferDirect(b,null,A,m,p,null)}function M(v,b,A,C,y,S){let P=null,O=A.isPointLight===!0?v.customDistanceMaterial:v.customDepthMaterial;if(O!==void 0)P=O;else if(P=A.isPointLight===!0?c:o,r.localClippingEnabled&&b.clipShadows===!0&&Array.isArray(b.clippingPlanes)&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0||b.map&&b.alphaTest>0){let B=P.uuid,D=b.uuid,I=l[B];I===void 0&&(I={},l[B]=I);let k=I[D];k===void 0&&(k=P.clone(),I[D]=k),P=k}return P.visible=b.visible,P.wireframe=b.wireframe,S===Ni?P.side=b.shadowSide!==null?b.shadowSide:b.side:P.side=b.shadowSide!==null?b.shadowSide:f[b.side],P.alphaMap=b.alphaMap,P.alphaTest=b.alphaTest,P.map=b.map,P.clipShadows=b.clipShadows,P.clippingPlanes=b.clippingPlanes,P.clipIntersection=b.clipIntersection,P.displacementMap=b.displacementMap,P.displacementScale=b.displacementScale,P.displacementBias=b.displacementBias,P.wireframeLinewidth=b.wireframeLinewidth,P.linewidth=b.linewidth,A.isPointLight===!0&&P.isMeshDistanceMaterial===!0&&(P.referencePosition.setFromMatrixPosition(A.matrixWorld),P.nearDistance=C,P.farDistance=y),P}function _(v,b,A,C,y){if(v.visible===!1)return;if(v.layers.test(b.layers)&&(v.isMesh||v.isLine||v.isPoints)&&(v.castShadow||v.receiveShadow&&y===Ni)&&(!v.frustumCulled||n.intersectsObject(v))){v.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,v.matrixWorld);let O=t.update(v),B=v.material;if(Array.isArray(B)){let D=O.groups;for(let I=0,k=D.length;I<k;I++){let Y=D[I],Z=B[Y.materialIndex];if(Z&&Z.visible){let H=M(v,Z,C,A.near,A.far,y);r.renderBufferDirect(A,null,O,H,v,Y)}}}else if(B.visible){let D=M(v,B,C,A.near,A.far,y);r.renderBufferDirect(A,null,O,D,v,null)}}let P=v.children;for(let O=0,B=P.length;O<B;O++)_(P[O],b,A,C,y)}}function rp(r,t,e){let n=e.isWebGL2;function i(){let L=!1,V=new Xt,j=null,ot=new Xt(0,0,0,0);return{setMask:function(lt){j!==lt&&!L&&(r.colorMask(lt,lt,lt,lt),j=lt)},setLocked:function(lt){L=lt},setClear:function(lt,It,Kt,ee,vn){vn===!0&&(lt*=ee,It*=ee,Kt*=ee),V.set(lt,It,Kt,ee),ot.equals(V)===!1&&(r.clearColor(lt,It,Kt,ee),ot.copy(V))},reset:function(){L=!1,j=null,ot.set(-1,0,0,0)}}}function s(){let L=!1,V=null,j=null,ot=null;return{setTest:function(lt){lt?Mt(2929):ht(2929)},setMask:function(lt){V!==lt&&!L&&(r.depthMask(lt),V=lt)},setFunc:function(lt){if(j!==lt){switch(lt){case Wc:r.depthFunc(512);break;case qc:r.depthFunc(519);break;case Xc:r.depthFunc(513);break;case Er:r.depthFunc(515);break;case Yc:r.depthFunc(514);break;case Zc:r.depthFunc(518);break;case Jc:r.depthFunc(516);break;case $c:r.depthFunc(517);break;default:r.depthFunc(515)}j=lt}},setLocked:function(lt){L=lt},setClear:function(lt){ot!==lt&&(r.clearDepth(lt),ot=lt)},reset:function(){L=!1,V=null,j=null,ot=null}}}function a(){let L=!1,V=null,j=null,ot=null,lt=null,It=null,Kt=null,ee=null,vn=null;return{setTest:function(kt){L||(kt?Mt(2960):ht(2960))},setMask:function(kt){V!==kt&&!L&&(r.stencilMask(kt),V=kt)},setFunc:function(kt,Je,Ce){(j!==kt||ot!==Je||lt!==Ce)&&(r.stencilFunc(kt,Je,Ce),j=kt,ot=Je,lt=Ce)},setOp:function(kt,Je,Ce){(It!==kt||Kt!==Je||ee!==Ce)&&(r.stencilOp(kt,Je,Ce),It=kt,Kt=Je,ee=Ce)},setLocked:function(kt){L=kt},setClear:function(kt){vn!==kt&&(r.clearStencil(kt),vn=kt)},reset:function(){L=!1,V=null,j=null,ot=null,lt=null,It=null,Kt=null,ee=null,vn=null}}}let o=new i,c=new s,l=new a,h=new WeakMap,f=new WeakMap,u={},m={},x=new WeakMap,p=[],d=null,g=!1,M=null,_=null,v=null,b=null,A=null,C=null,y=null,S=!1,P=null,O=null,B=null,D=null,I=null,k=r.getParameter(35661),Y=!1,Z=0,H=r.getParameter(7938);H.indexOf("WebGL")!==-1?(Z=parseFloat(/^WebGL (\\d)/.exec(H)[1]),Y=Z>=1):H.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\\d)/.exec(H)[1]),Y=Z>=2);let $=null,J={},dt=r.getParameter(3088),z=r.getParameter(2978),K=new Xt().fromArray(dt),nt=new Xt().fromArray(z);function it(L,V,j){let ot=new Uint8Array(4),lt=r.createTexture();r.bindTexture(L,lt),r.texParameteri(L,10241,9728),r.texParameteri(L,10240,9728);for(let It=0;It<j;It++)r.texImage2D(V+It,0,6408,1,1,0,6408,5121,ot);return lt}let U={};U[3553]=it(3553,3553,1),U[34067]=it(34067,34069,6),o.setClear(0,0,0,1),c.setClear(1),l.setClear(0),Mt(2929),c.setFunc(Er),te(!1),Ee(Po),Mt(2884),se(pn);function Mt(L){u[L]!==!0&&(r.enable(L),u[L]=!0)}function ht(L){u[L]!==!1&&(r.disable(L),u[L]=!1)}function ut(L,V){return m[L]!==V?(r.bindFramebuffer(L,V),m[L]=V,n&&(L===36009&&(m[36160]=V),L===36160&&(m[36009]=V)),!0):!1}function at(L,V){let j=p,ot=!1;if(L)if(j=x.get(V),j===void 0&&(j=[],x.set(V,j)),L.isWebGLMultipleRenderTargets){let lt=L.texture;if(j.length!==lt.length||j[0]!==36064){for(let It=0,Kt=lt.length;It<Kt;It++)j[It]=36064+It;j.length=lt.length,ot=!0}}else j[0]!==36064&&(j[0]=36064,ot=!0);else j[0]!==1029&&(j[0]=1029,ot=!0);ot&&(e.isWebGL2?r.drawBuffers(j):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(j))}function Ft(L){return d!==L?(r.useProgram(L),d=L,!0):!1}let bt={[ni]:32774,[Dc]:32778,[Nc]:32779};if(n)bt[Do]=32775,bt[No]=32776;else{let L=t.get("EXT_blend_minmax");L!==null&&(bt[Do]=L.MIN_EXT,bt[No]=L.MAX_EXT)}let _t={[Fc]:0,[zc]:1,[Oc]:768,[qa]:770,[Hc]:776,[Vc]:774,[Uc]:772,[Bc]:769,[Xa]:771,[Gc]:775,[kc]:773};function se(L,V,j,ot,lt,It,Kt,ee){if(L===pn){g===!0&&(ht(3042),g=!1);return}if(g===!1&&(Mt(3042),g=!0),L!==Ic){if(L!==M||ee!==S){if((_!==ni||A!==ni)&&(r.blendEquation(32774),_=ni,A=ni),ee)switch(L){case ri:r.blendFuncSeparate(1,771,1,771);break;case Ro:r.blendFunc(1,1);break;case Lo:r.blendFuncSeparate(0,769,0,1);break;case Io:r.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}else switch(L){case ri:r.blendFuncSeparate(770,771,1,771);break;case Ro:r.blendFunc(770,1);break;case Lo:r.blendFuncSeparate(0,769,0,1);break;case Io:r.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}v=null,b=null,C=null,y=null,M=L,S=ee}return}lt=lt||V,It=It||j,Kt=Kt||ot,(V!==_||lt!==A)&&(r.blendEquationSeparate(bt[V],bt[lt]),_=V,A=lt),(j!==v||ot!==b||It!==C||Kt!==y)&&(r.blendFuncSeparate(_t[j],_t[ot],_t[It],_t[Kt]),v=j,b=ot,C=It,y=Kt),M=L,S=!1}function Ae(L,V){L.side===We?ht(2884):Mt(2884);let j=L.side===he;V&&(j=!j),te(j),L.blending===ri&&L.transparent===!1?se(pn):se(L.blending,L.blendEquation,L.blendSrc,L.blendDst,L.blendEquationAlpha,L.blendSrcAlpha,L.blendDstAlpha,L.premultipliedAlpha),c.setFunc(L.depthFunc),c.setTest(L.depthTest),c.setMask(L.depthWrite),o.setMask(L.colorWrite);let ot=L.stencilWrite;l.setTest(ot),ot&&(l.setMask(L.stencilWriteMask),l.setFunc(L.stencilFunc,L.stencilRef,L.stencilFuncMask),l.setOp(L.stencilFail,L.stencilZFail,L.stencilZPass)),Nt(L.polygonOffset,L.polygonOffsetFactor,L.polygonOffsetUnits),L.alphaToCoverage===!0?Mt(32926):ht(32926)}function te(L){P!==L&&(L?r.frontFace(2304):r.frontFace(2305),P=L)}function Ee(L){L!==Pc?(Mt(2884),L!==O&&(L===Po?r.cullFace(1029):L===Rc?r.cullFace(1028):r.cullFace(1032))):ht(2884),O=L}function Wt(L){L!==B&&(Y&&r.lineWidth(L),B=L)}function Nt(L,V,j){L?(Mt(32823),(D!==V||I!==j)&&(r.polygonOffset(V,j),D=V,I=j)):ht(32823)}function Ze(L){L?Mt(3089):ht(3089)}function De(L){L===void 0&&(L=33984+k-1),$!==L&&(r.activeTexture(L),$=L)}function E(L,V,j){j===void 0&&($===null?j=33984+k-1:j=$);let ot=J[j];ot===void 0&&(ot={type:void 0,texture:void 0},J[j]=ot),(ot.type!==L||ot.texture!==V)&&($!==j&&(r.activeTexture(j),$=j),r.bindTexture(L,V||U[L]),ot.type=L,ot.texture=V)}function w(){let L=J[$];L!==void 0&&L.type!==void 0&&(r.bindTexture(L.type,null),L.type=void 0,L.texture=void 0)}function W(){try{r.compressedTexImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Q(){try{r.compressedTexImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function tt(){try{r.texSubImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function st(){try{r.texSubImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function yt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function rt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function X(){try{r.texStorage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function mt(){try{r.texStorage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function xt(){try{r.texImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function ct(){try{r.texImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function gt(L){K.equals(L)===!1&&(r.scissor(L.x,L.y,L.z,L.w),K.copy(L))}function ft(L){nt.equals(L)===!1&&(r.viewport(L.x,L.y,L.z,L.w),nt.copy(L))}function Rt(L,V){let j=f.get(V);j===void 0&&(j=new WeakMap,f.set(V,j));let ot=j.get(L);ot===void 0&&(ot=r.getUniformBlockIndex(V,L.name),j.set(L,ot))}function Ut(L,V){let ot=f.get(V).get(L);h.get(V)!==ot&&(r.uniformBlockBinding(V,ot,L.__bindingPointIndex),h.set(V,ot))}function $t(){r.disable(3042),r.disable(2884),r.disable(2929),r.disable(32823),r.disable(3089),r.disable(2960),r.disable(32926),r.blendEquation(32774),r.blendFunc(1,0),r.blendFuncSeparate(1,0,1,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(513),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(519,0,4294967295),r.stencilOp(7680,7680,7680),r.clearStencil(0),r.cullFace(1029),r.frontFace(2305),r.polygonOffset(0,0),r.activeTexture(33984),r.bindFramebuffer(36160,null),n===!0&&(r.bindFramebuffer(36009,null),r.bindFramebuffer(36008,null)),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},$=null,J={},m={},x=new WeakMap,p=[],d=null,g=!1,M=null,_=null,v=null,b=null,A=null,C=null,y=null,S=!1,P=null,O=null,B=null,D=null,I=null,K.set(0,0,r.canvas.width,r.canvas.height),nt.set(0,0,r.canvas.width,r.canvas.height),o.reset(),c.reset(),l.reset()}return{buffers:{color:o,depth:c,stencil:l},enable:Mt,disable:ht,bindFramebuffer:ut,drawBuffers:at,useProgram:Ft,setBlending:se,setMaterial:Ae,setFlipSided:te,setCullFace:Ee,setLineWidth:Wt,setPolygonOffset:Nt,setScissorTest:Ze,activeTexture:De,bindTexture:E,unbindTexture:w,compressedTexImage2D:W,compressedTexImage3D:Q,texImage2D:xt,texImage3D:ct,updateUBOMapping:Rt,uniformBlockBinding:Ut,texStorage2D:X,texStorage3D:mt,texSubImage2D:tt,texSubImage3D:st,compressedTexSubImage2D:yt,compressedTexSubImage3D:rt,scissor:gt,viewport:ft,reset:$t}}function op(r,t,e,n,i,s,a){let o=i.isWebGL2,c=i.maxTextures,l=i.maxCubemapSize,h=i.maxTextureSize,f=i.maxSamples,u=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator=="undefined"?!1:/OculusBrowser/g.test(navigator.userAgent),x=new WeakMap,p,d=new WeakMap,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(E){}function M(E,w){return g?new OffscreenCanvas(E,w):ys("canvas")}function _(E,w,W,Q){let tt=1;if((E.width>Q||E.height>Q)&&(tt=Q/Math.max(E.width,E.height)),tt<1||w===!0)if(typeof HTMLImageElement!="undefined"&&E instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&E instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&E instanceof ImageBitmap){let st=w?Dr:Math.floor,yt=st(tt*E.width),rt=st(tt*E.height);p===void 0&&(p=M(yt,rt));let X=W?M(yt,rt):p;return X.width=yt,X.height=rt,X.getContext("2d").drawImage(E,0,0,yt,rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+E.width+"x"+E.height+") to ("+yt+"x"+rt+")."),X}else return"data"in E&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+E.width+"x"+E.height+")."),E;return E}function v(E){return ua(E.width)&&ua(E.height)}function b(E){return o?!1:E.wrapS!==Oe||E.wrapT!==Oe||E.minFilter!==ce&&E.minFilter!==Re}function A(E,w){return E.generateMipmaps&&w&&E.minFilter!==ce&&E.minFilter!==Re}function C(E){r.generateMipmap(E)}function y(E,w,W,Q,tt=!1){if(o===!1)return w;if(E!==null){if(r[E]!==void 0)return r[E];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \'"+E+"\'")}let st=w;return w===6403&&(W===5126&&(st=33326),W===5131&&(st=33325),W===5121&&(st=33321)),w===33319&&(W===5126&&(st=33328),W===5131&&(st=33327),W===5121&&(st=33323)),w===6408&&(W===5126&&(st=34836),W===5131&&(st=34842),W===5121&&(st=Q===Ot&&tt===!1?35907:32856),W===32819&&(st=32854),W===32820&&(st=32855)),(st===33325||st===33326||st===33327||st===33328||st===34842||st===34836)&&t.get("EXT_color_buffer_float"),st}function S(E,w,W){return A(E,W)===!0||E.isFramebufferTexture&&E.minFilter!==ce&&E.minFilter!==Re?Math.log2(Math.max(w.width,w.height))+1:E.mipmaps!==void 0&&E.mipmaps.length>0?E.mipmaps.length:E.isCompressedTexture&&Array.isArray(E.image)?w.mipmaps.length:1}function P(E){return E===ce||E===Fo||E===Zs?9728:9729}function O(E){let w=E.target;w.removeEventListener("dispose",O),D(w),w.isVideoTexture&&x.delete(w)}function B(E){let w=E.target;w.removeEventListener("dispose",B),k(w)}function D(E){let w=n.get(E);if(w.__webglInit===void 0)return;let W=E.source,Q=d.get(W);if(Q){let tt=Q[w.__cacheKey];tt.usedTimes--,tt.usedTimes===0&&I(E),Object.keys(Q).length===0&&d.delete(W)}n.remove(E)}function I(E){let w=n.get(E);r.deleteTexture(w.__webglTexture);let W=E.source,Q=d.get(W);delete Q[w.__cacheKey],a.memory.textures--}function k(E){let w=E.texture,W=n.get(E),Q=n.get(w);if(Q.__webglTexture!==void 0&&(r.deleteTexture(Q.__webglTexture),a.memory.textures--),E.depthTexture&&E.depthTexture.dispose(),E.isWebGLCubeRenderTarget)for(let tt=0;tt<6;tt++)r.deleteFramebuffer(W.__webglFramebuffer[tt]),W.__webglDepthbuffer&&r.deleteRenderbuffer(W.__webglDepthbuffer[tt]);else{if(r.deleteFramebuffer(W.__webglFramebuffer),W.__webglDepthbuffer&&r.deleteRenderbuffer(W.__webglDepthbuffer),W.__webglMultisampledFramebuffer&&r.deleteFramebuffer(W.__webglMultisampledFramebuffer),W.__webglColorRenderbuffer)for(let tt=0;tt<W.__webglColorRenderbuffer.length;tt++)W.__webglColorRenderbuffer[tt]&&r.deleteRenderbuffer(W.__webglColorRenderbuffer[tt]);W.__webglDepthRenderbuffer&&r.deleteRenderbuffer(W.__webglDepthRenderbuffer)}if(E.isWebGLMultipleRenderTargets)for(let tt=0,st=w.length;tt<st;tt++){let yt=n.get(w[tt]);yt.__webglTexture&&(r.deleteTexture(yt.__webglTexture),a.memory.textures--),n.remove(w[tt])}n.remove(w),n.remove(E)}let Y=0;function Z(){Y=0}function H(){let E=Y;return E>=c&&console.warn("THREE.WebGLTextures: Trying to use "+E+" texture units while this GPU supports only "+c),Y+=1,E}function $(E){let w=[];return w.push(E.wrapS),w.push(E.wrapT),w.push(E.wrapR||0),w.push(E.magFilter),w.push(E.minFilter),w.push(E.anisotropy),w.push(E.internalFormat),w.push(E.format),w.push(E.type),w.push(E.generateMipmaps),w.push(E.premultiplyAlpha),w.push(E.flipY),w.push(E.unpackAlignment),w.push(E.encoding),w.join()}function J(E,w){let W=n.get(E);if(E.isVideoTexture&&Ze(E),E.isRenderTargetTexture===!1&&E.version>0&&W.__version!==E.version){let Q=E.image;if(Q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ht(W,E,w);return}}e.bindTexture(3553,W.__webglTexture,33984+w)}function dt(E,w){let W=n.get(E);if(E.version>0&&W.__version!==E.version){ht(W,E,w);return}e.bindTexture(35866,W.__webglTexture,33984+w)}function z(E,w){let W=n.get(E);if(E.version>0&&W.__version!==E.version){ht(W,E,w);return}e.bindTexture(32879,W.__webglTexture,33984+w)}function K(E,w){let W=n.get(E);if(E.version>0&&W.__version!==E.version){ut(W,E,w);return}e.bindTexture(34067,W.__webglTexture,33984+w)}let nt={[Rr]:10497,[Oe]:33071,[Lr]:33648},it={[ce]:9728,[Fo]:9984,[Zs]:9986,[Re]:9729,[sl]:9985,[Oi]:9987};function U(E,w,W){if(W?(r.texParameteri(E,10242,nt[w.wrapS]),r.texParameteri(E,10243,nt[w.wrapT]),(E===32879||E===35866)&&r.texParameteri(E,32882,nt[w.wrapR]),r.texParameteri(E,10240,it[w.magFilter]),r.texParameteri(E,10241,it[w.minFilter])):(r.texParameteri(E,10242,33071),r.texParameteri(E,10243,33071),(E===32879||E===35866)&&r.texParameteri(E,32882,33071),(w.wrapS!==Oe||w.wrapT!==Oe)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(E,10240,P(w.magFilter)),r.texParameteri(E,10241,P(w.minFilter)),w.minFilter!==ce&&w.minFilter!==Re&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){let Q=t.get("EXT_texture_filter_anisotropic");if(w.magFilter===ce||w.minFilter!==Zs&&w.minFilter!==Oi||w.type===Rn&&t.has("OES_texture_float_linear")===!1||o===!1&&w.type===Bi&&t.has("OES_texture_half_float_linear")===!1)return;(w.anisotropy>1||n.get(w).__currentAnisotropy)&&(r.texParameterf(E,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy)}}function Mt(E,w){let W=!1;E.__webglInit===void 0&&(E.__webglInit=!0,w.addEventListener("dispose",O));let Q=w.source,tt=d.get(Q);tt===void 0&&(tt={},d.set(Q,tt));let st=$(w);if(st!==E.__cacheKey){tt[st]===void 0&&(tt[st]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,W=!0),tt[st].usedTimes++;let yt=tt[E.__cacheKey];yt!==void 0&&(tt[E.__cacheKey].usedTimes--,yt.usedTimes===0&&I(w)),E.__cacheKey=st,E.__webglTexture=tt[st].texture}return W}function ht(E,w,W){let Q=3553;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(Q=35866),w.isData3DTexture&&(Q=32879);let tt=Mt(E,w),st=w.source;e.bindTexture(Q,E.__webglTexture,33984+W);let yt=n.get(st);if(st.version!==yt.__version||tt===!0){e.activeTexture(33984+W),r.pixelStorei(37440,w.flipY),r.pixelStorei(37441,w.premultiplyAlpha),r.pixelStorei(3317,w.unpackAlignment),r.pixelStorei(37443,0);let rt=b(w)&&v(w.image)===!1,X=_(w.image,rt,!1,h);X=De(w,X);let mt=v(X)||o,xt=s.convert(w.format,w.encoding),ct=s.convert(w.type),gt=y(w.internalFormat,xt,ct,w.encoding,w.isVideoTexture);U(Q,w,mt);let ft,Rt=w.mipmaps,Ut=o&&w.isVideoTexture!==!0,$t=yt.__version===void 0||tt===!0,L=S(w,X,mt);if(w.isDepthTexture)gt=6402,o?w.type===Rn?gt=36012:w.type===Pn?gt=33190:w.type===oi?gt=35056:gt=33189:w.type===Rn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),w.format===Ln&>===6402&&w.type!==Ja&&w.type!==Pn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),w.type=Pn,ct=s.convert(w.type)),w.format===hi&>===6402&&(gt=34041,w.type!==oi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),w.type=oi,ct=s.convert(w.type))),$t&&(Ut?e.texStorage2D(3553,1,gt,X.width,X.height):e.texImage2D(3553,0,gt,X.width,X.height,0,xt,ct,null));else if(w.isDataTexture)if(Rt.length>0&&mt){Ut&&$t&&e.texStorage2D(3553,L,gt,Rt[0].width,Rt[0].height);for(let V=0,j=Rt.length;V<j;V++)ft=Rt[V],Ut?e.texSubImage2D(3553,V,0,0,ft.width,ft.height,xt,ct,ft.data):e.texImage2D(3553,V,gt,ft.width,ft.height,0,xt,ct,ft.data);w.generateMipmaps=!1}else Ut?($t&&e.texStorage2D(3553,L,gt,X.width,X.height),e.texSubImage2D(3553,0,0,0,X.width,X.height,xt,ct,X.data)):e.texImage2D(3553,0,gt,X.width,X.height,0,xt,ct,X.data);else if(w.isCompressedTexture)if(w.isCompressedArrayTexture){Ut&&$t&&e.texStorage3D(35866,L,gt,Rt[0].width,Rt[0].height,X.depth);for(let V=0,j=Rt.length;V<j;V++)ft=Rt[V],w.format!==Be?xt!==null?Ut?e.compressedTexSubImage3D(35866,V,0,0,0,ft.width,ft.height,X.depth,xt,ft.data,0,0):e.compressedTexImage3D(35866,V,gt,ft.width,ft.height,X.depth,0,ft.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ut?e.texSubImage3D(35866,V,0,0,0,ft.width,ft.height,X.depth,xt,ct,ft.data):e.texImage3D(35866,V,gt,ft.width,ft.height,X.depth,0,xt,ct,ft.data)}else{Ut&&$t&&e.texStorage2D(3553,L,gt,Rt[0].width,Rt[0].height);for(let V=0,j=Rt.length;V<j;V++)ft=Rt[V],w.format!==Be?xt!==null?Ut?e.compressedTexSubImage2D(3553,V,0,0,ft.width,ft.height,xt,ft.data):e.compressedTexImage2D(3553,V,gt,ft.width,ft.height,0,ft.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ut?e.texSubImage2D(3553,V,0,0,ft.width,ft.height,xt,ct,ft.data):e.texImage2D(3553,V,gt,ft.width,ft.height,0,xt,ct,ft.data)}else if(w.isDataArrayTexture)Ut?($t&&e.texStorage3D(35866,L,gt,X.width,X.height,X.depth),e.texSubImage3D(35866,0,0,0,0,X.width,X.height,X.depth,xt,ct,X.data)):e.texImage3D(35866,0,gt,X.width,X.height,X.depth,0,xt,ct,X.data);else if(w.isData3DTexture)Ut?($t&&e.texStorage3D(32879,L,gt,X.width,X.height,X.depth),e.texSubImage3D(32879,0,0,0,0,X.width,X.height,X.depth,xt,ct,X.data)):e.texImage3D(32879,0,gt,X.width,X.height,X.depth,0,xt,ct,X.data);else if(w.isFramebufferTexture){if($t)if(Ut)e.texStorage2D(3553,L,gt,X.width,X.height);else{let V=X.width,j=X.height;for(let ot=0;ot<L;ot++)e.texImage2D(3553,ot,gt,V,j,0,xt,ct,null),V>>=1,j>>=1}}else if(Rt.length>0&&mt){Ut&&$t&&e.texStorage2D(3553,L,gt,Rt[0].width,Rt[0].height);for(let V=0,j=Rt.length;V<j;V++)ft=Rt[V],Ut?e.texSubImage2D(3553,V,0,0,xt,ct,ft):e.texImage2D(3553,V,gt,xt,ct,ft);w.generateMipmaps=!1}else Ut?($t&&e.texStorage2D(3553,L,gt,X.width,X.height),e.texSubImage2D(3553,0,0,0,xt,ct,X)):e.texImage2D(3553,0,gt,xt,ct,X);A(w,mt)&&C(Q),yt.__version=st.version,w.onUpdate&&w.onUpdate(w)}E.__version=w.version}function ut(E,w,W){if(w.image.length!==6)return;let Q=Mt(E,w),tt=w.source;e.bindTexture(34067,E.__webglTexture,33984+W);let st=n.get(tt);if(tt.version!==st.__version||Q===!0){e.activeTexture(33984+W),r.pixelStorei(37440,w.flipY),r.pixelStorei(37441,w.premultiplyAlpha),r.pixelStorei(3317,w.unpackAlignment),r.pixelStorei(37443,0);let yt=w.isCompressedTexture||w.image[0].isCompressedTexture,rt=w.image[0]&&w.image[0].isDataTexture,X=[];for(let V=0;V<6;V++)!yt&&!rt?X[V]=_(w.image[V],!1,!0,l):X[V]=rt?w.image[V].image:w.image[V],X[V]=De(w,X[V]);let mt=X[0],xt=v(mt)||o,ct=s.convert(w.format,w.encoding),gt=s.convert(w.type),ft=y(w.internalFormat,ct,gt,w.encoding),Rt=o&&w.isVideoTexture!==!0,Ut=st.__version===void 0||Q===!0,$t=S(w,mt,xt);U(34067,w,xt);let L;if(yt){Rt&&Ut&&e.texStorage2D(34067,$t,ft,mt.width,mt.height);for(let V=0;V<6;V++){L=X[V].mipmaps;for(let j=0;j<L.length;j++){let ot=L[j];w.format!==Be?ct!==null?Rt?e.compressedTexSubImage2D(34069+V,j,0,0,ot.width,ot.height,ct,ot.data):e.compressedTexImage2D(34069+V,j,ft,ot.width,ot.height,0,ot.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Rt?e.texSubImage2D(34069+V,j,0,0,ot.width,ot.height,ct,gt,ot.data):e.texImage2D(34069+V,j,ft,ot.width,ot.height,0,ct,gt,ot.data)}}}else{L=w.mipmaps,Rt&&Ut&&(L.length>0&&$t++,e.texStorage2D(34067,$t,ft,X[0].width,X[0].height));for(let V=0;V<6;V++)if(rt){Rt?e.texSubImage2D(34069+V,0,0,0,X[V].width,X[V].height,ct,gt,X[V].data):e.texImage2D(34069+V,0,ft,X[V].width,X[V].height,0,ct,gt,X[V].data);for(let j=0;j<L.length;j++){let lt=L[j].image[V].image;Rt?e.texSubImage2D(34069+V,j+1,0,0,lt.width,lt.height,ct,gt,lt.data):e.texImage2D(34069+V,j+1,ft,lt.width,lt.height,0,ct,gt,lt.data)}}else{Rt?e.texSubImage2D(34069+V,0,0,0,ct,gt,X[V]):e.texImage2D(34069+V,0,ft,ct,gt,X[V]);for(let j=0;j<L.length;j++){let ot=L[j];Rt?e.texSubImage2D(34069+V,j+1,0,0,ct,gt,ot.image[V]):e.texImage2D(34069+V,j+1,ft,ct,gt,ot.image[V])}}}A(w,xt)&&C(34067),st.__version=tt.version,w.onUpdate&&w.onUpdate(w)}E.__version=w.version}function at(E,w,W,Q,tt){let st=s.convert(W.format,W.encoding),yt=s.convert(W.type),rt=y(W.internalFormat,st,yt,W.encoding);n.get(w).__hasExternalTextures||(tt===32879||tt===35866?e.texImage3D(tt,0,rt,w.width,w.height,w.depth,0,st,yt,null):e.texImage2D(tt,0,rt,w.width,w.height,0,st,yt,null)),e.bindFramebuffer(36160,E),Nt(w)?u.framebufferTexture2DMultisampleEXT(36160,Q,tt,n.get(W).__webglTexture,0,Wt(w)):(tt===3553||tt>=34069&&tt<=34074)&&r.framebufferTexture2D(36160,Q,tt,n.get(W).__webglTexture,0),e.bindFramebuffer(36160,null)}function Ft(E,w,W){if(r.bindRenderbuffer(36161,E),w.depthBuffer&&!w.stencilBuffer){let Q=33189;if(W||Nt(w)){let tt=w.depthTexture;tt&&tt.isDepthTexture&&(tt.type===Rn?Q=36012:tt.type===Pn&&(Q=33190));let st=Wt(w);Nt(w)?u.renderbufferStorageMultisampleEXT(36161,st,Q,w.width,w.height):r.renderbufferStorageMultisample(36161,st,Q,w.width,w.height)}else r.renderbufferStorage(36161,Q,w.width,w.height);r.framebufferRenderbuffer(36160,36096,36161,E)}else if(w.depthBuffer&&w.stencilBuffer){let Q=Wt(w);W&&Nt(w)===!1?r.renderbufferStorageMultisample(36161,Q,35056,w.width,w.height):Nt(w)?u.renderbufferStorageMultisampleEXT(36161,Q,35056,w.width,w.height):r.renderbufferStorage(36161,34041,w.width,w.height),r.framebufferRenderbuffer(36160,33306,36161,E)}else{let Q=w.isWebGLMultipleRenderTargets===!0?w.texture:[w.texture];for(let tt=0;tt<Q.length;tt++){let st=Q[tt],yt=s.convert(st.format,st.encoding),rt=s.convert(st.type),X=y(st.internalFormat,yt,rt,st.encoding),mt=Wt(w);W&&Nt(w)===!1?r.renderbufferStorageMultisample(36161,mt,X,w.width,w.height):Nt(w)?u.renderbufferStorageMultisampleEXT(36161,mt,X,w.width,w.height):r.renderbufferStorage(36161,X,w.width,w.height)}}r.bindRenderbuffer(36161,null)}function bt(E,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,E),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(w.depthTexture).__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),J(w.depthTexture,0);let Q=n.get(w.depthTexture).__webglTexture,tt=Wt(w);if(w.depthTexture.format===Ln)Nt(w)?u.framebufferTexture2DMultisampleEXT(36160,36096,3553,Q,0,tt):r.framebufferTexture2D(36160,36096,3553,Q,0);else if(w.depthTexture.format===hi)Nt(w)?u.framebufferTexture2DMultisampleEXT(36160,33306,3553,Q,0,tt):r.framebufferTexture2D(36160,33306,3553,Q,0);else throw new Error("Unknown depthTexture format")}function _t(E){let w=n.get(E),W=E.isWebGLCubeRenderTarget===!0;if(E.depthTexture&&!w.__autoAllocateDepthBuffer){if(W)throw new Error("target.depthTexture not supported in Cube render targets");bt(w.__webglFramebuffer,E)}else if(W){w.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)e.bindFramebuffer(36160,w.__webglFramebuffer[Q]),w.__webglDepthbuffer[Q]=r.createRenderbuffer(),Ft(w.__webglDepthbuffer[Q],E,!1)}else e.bindFramebuffer(36160,w.__webglFramebuffer),w.__webglDepthbuffer=r.createRenderbuffer(),Ft(w.__webglDepthbuffer,E,!1);e.bindFramebuffer(36160,null)}function se(E,w,W){let Q=n.get(E);w!==void 0&&at(Q.__webglFramebuffer,E,E.texture,36064,3553),W!==void 0&&_t(E)}function Ae(E){let w=E.texture,W=n.get(E),Q=n.get(w);E.addEventListener("dispose",B),E.isWebGLMultipleRenderTargets!==!0&&(Q.__webglTexture===void 0&&(Q.__webglTexture=r.createTexture()),Q.__version=w.version,a.memory.textures++);let tt=E.isWebGLCubeRenderTarget===!0,st=E.isWebGLMultipleRenderTargets===!0,yt=v(E)||o;if(tt){W.__webglFramebuffer=[];for(let rt=0;rt<6;rt++)W.__webglFramebuffer[rt]=r.createFramebuffer()}else{if(W.__webglFramebuffer=r.createFramebuffer(),st)if(i.drawBuffers){let rt=E.texture;for(let X=0,mt=rt.length;X<mt;X++){let xt=n.get(rt[X]);xt.__webglTexture===void 0&&(xt.__webglTexture=r.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&E.samples>0&&Nt(E)===!1){let rt=st?w:[w];W.__webglMultisampledFramebuffer=r.createFramebuffer(),W.__webglColorRenderbuffer=[],e.bindFramebuffer(36160,W.__webglMultisampledFramebuffer);for(let X=0;X<rt.length;X++){let mt=rt[X];W.__webglColorRenderbuffer[X]=r.createRenderbuffer(),r.bindRenderbuffer(36161,W.__webglColorRenderbuffer[X]);let xt=s.convert(mt.format,mt.encoding),ct=s.convert(mt.type),gt=y(mt.internalFormat,xt,ct,mt.encoding,E.isXRRenderTarget===!0),ft=Wt(E);r.renderbufferStorageMultisample(36161,ft,gt,E.width,E.height),r.framebufferRenderbuffer(36160,36064+X,36161,W.__webglColorRenderbuffer[X])}r.bindRenderbuffer(36161,null),E.depthBuffer&&(W.__webglDepthRenderbuffer=r.createRenderbuffer(),Ft(W.__webglDepthRenderbuffer,E,!0)),e.bindFramebuffer(36160,null)}}if(tt){e.bindTexture(34067,Q.__webglTexture),U(34067,w,yt);for(let rt=0;rt<6;rt++)at(W.__webglFramebuffer[rt],E,w,36064,34069+rt);A(w,yt)&&C(34067),e.unbindTexture()}else if(st){let rt=E.texture;for(let X=0,mt=rt.length;X<mt;X++){let xt=rt[X],ct=n.get(xt);e.bindTexture(3553,ct.__webglTexture),U(3553,xt,yt),at(W.__webglFramebuffer,E,xt,36064+X,3553),A(xt,yt)&&C(3553)}e.unbindTexture()}else{let rt=3553;(E.isWebGL3DRenderTarget||E.isWebGLArrayRenderTarget)&&(o?rt=E.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),e.bindTexture(rt,Q.__webglTexture),U(rt,w,yt),at(W.__webglFramebuffer,E,w,36064,rt),A(w,yt)&&C(rt),e.unbindTexture()}E.depthBuffer&&_t(E)}function te(E){let w=v(E)||o,W=E.isWebGLMultipleRenderTargets===!0?E.texture:[E.texture];for(let Q=0,tt=W.length;Q<tt;Q++){let st=W[Q];if(A(st,w)){let yt=E.isWebGLCubeRenderTarget?34067:3553,rt=n.get(st).__webglTexture;e.bindTexture(yt,rt),C(yt),e.unbindTexture()}}}function Ee(E){if(o&&E.samples>0&&Nt(E)===!1){let w=E.isWebGLMultipleRenderTargets?E.texture:[E.texture],W=E.width,Q=E.height,tt=16384,st=[],yt=E.stencilBuffer?33306:36096,rt=n.get(E),X=E.isWebGLMultipleRenderTargets===!0;if(X)for(let mt=0;mt<w.length;mt++)e.bindFramebuffer(36160,rt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064+mt,36161,null),e.bindFramebuffer(36160,rt.__webglFramebuffer),r.framebufferTexture2D(36009,36064+mt,3553,null,0);e.bindFramebuffer(36008,rt.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,rt.__webglFramebuffer);for(let mt=0;mt<w.length;mt++){st.push(36064+mt),E.depthBuffer&&st.push(yt);let xt=rt.__ignoreDepthValues!==void 0?rt.__ignoreDepthValues:!1;if(xt===!1&&(E.depthBuffer&&(tt|=256),E.stencilBuffer&&(tt|=1024)),X&&r.framebufferRenderbuffer(36008,36064,36161,rt.__webglColorRenderbuffer[mt]),xt===!0&&(r.invalidateFramebuffer(36008,[yt]),r.invalidateFramebuffer(36009,[yt])),X){let ct=n.get(w[mt]).__webglTexture;r.framebufferTexture2D(36009,36064,3553,ct,0)}r.blitFramebuffer(0,0,W,Q,0,0,W,Q,tt,9728),m&&r.invalidateFramebuffer(36008,st)}if(e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,null),X)for(let mt=0;mt<w.length;mt++){e.bindFramebuffer(36160,rt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064+mt,36161,rt.__webglColorRenderbuffer[mt]);let xt=n.get(w[mt]).__webglTexture;e.bindFramebuffer(36160,rt.__webglFramebuffer),r.framebufferTexture2D(36009,36064+mt,3553,xt,0)}e.bindFramebuffer(36009,rt.__webglMultisampledFramebuffer)}}function Wt(E){return Math.min(f,E.samples)}function Nt(E){let w=n.get(E);return o&&E.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function Ze(E){let w=a.render.frame;x.get(E)!==w&&(x.set(E,w),E.update())}function De(E,w){let W=E.encoding,Q=E.format,tt=E.type;return E.isCompressedTexture===!0||E.isVideoTexture===!0||E.format===Ir||W!==Nn&&(W===Ot?o===!1?t.has("EXT_sRGB")===!0&&Q===Be?(E.format=Ir,E.minFilter=Re,E.generateMipmaps=!1):w=vs.sRGBToLinear(w):(Q!==Be||tt!==Dn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",W)),w}this.allocateTextureUnit=H,this.resetTextureUnits=Z,this.setTexture2D=J,this.setTexture2DArray=dt,this.setTexture3D=z,this.setTextureCube=K,this.rebindTextures=se,this.setupRenderTarget=Ae,this.updateRenderTargetMipmap=te,this.updateMultisampleRenderTarget=Ee,this.setupDepthRenderbuffer=_t,this.setupFrameBufferTexture=at,this.useMultisampledRTT=Nt}function ap(r,t,e){let n=e.isWebGL2;function i(s,a=null){let o;if(s===Dn)return 5121;if(s===cl)return 32819;if(s===ll)return 32820;if(s===rl)return 5120;if(s===ol)return 5122;if(s===Ja)return 5123;if(s===al)return 5124;if(s===Pn)return 5125;if(s===Rn)return 5126;if(s===Bi)return n?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===hl)return 6406;if(s===Be)return 6408;if(s===ul)return 6409;if(s===fl)return 6410;if(s===Ln)return 6402;if(s===hi)return 34041;if(s===Ir)return o=t.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(s===dl)return 6403;if(s===pl)return 36244;if(s===ml)return 33319;if(s===gl)return 33320;if(s===xl)return 36249;if(s===Js||s===$s||s===Ks||s===js)if(a===Ot)if(o=t.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(s===Js)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===$s)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Ks)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===js)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=t.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===Js)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===$s)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Ks)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===js)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===zo||s===Oo||s===Bo||s===Uo)if(o=t.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===zo)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Oo)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Bo)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Uo)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===_l)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===ko||s===Vo)if(o=t.get("WEBGL_compressed_texture_etc"),o!==null){if(s===ko)return a===Ot?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(s===Vo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Go||s===Ho||s===Wo||s===qo||s===Xo||s===Yo||s===Zo||s===Jo||s===$o||s===Ko||s===jo||s===Qo||s===ta||s===ea)if(o=t.get("WEBGL_compressed_texture_astc"),o!==null){if(s===Go)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Ho)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Wo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===qo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Xo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Yo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Zo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Jo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===$o)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Ko)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===jo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Qo)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ta)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===ea)return a===Ot?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Qs)if(o=t.get("EXT_texture_compression_bptc"),o!==null){if(s===Qs)return a===Ot?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===yl||s===na||s===ia||s===sa)if(o=t.get("EXT_texture_compression_rgtc"),o!==null){if(s===Qs)return o.COMPRESSED_RED_RGTC1_EXT;if(s===na)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===ia)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===sa)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===oi?n?34042:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):r[s]!==void 0?r[s]:null}return{convert:i}}var Yr=class extends Se{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},si=class extends pe{constructor(){super(),this.isGroup=!0,this.type="Group"}},cp={type:"move"},zi=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new si,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new si,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new R,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new R),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new si,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new R,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new R),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,a=null,o=this._targetRay,c=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){a=!0;for(let p of t.hand.values()){let d=e.getJointPose(p,n),g=this._getHandJoint(l,p);d!==null&&(g.matrix.fromArray(d.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.jointRadius=d.radius),g.visible=d!==null}let h=l.joints["index-finger-tip"],f=l.joints["thumb-tip"],u=h.position.distanceTo(f.position),m=.02,x=.005;l.inputState.pinching&&u>m+x?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&u<=m-x&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(cp)))}return o!==null&&(o.visible=i!==null),c!==null&&(c.visible=s!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new si;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},Zr=class extends ue{constructor(t,e,n,i,s,a,o,c,l,h){if(h=h!==void 0?h:Ln,h!==Ln&&h!==hi)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Ln&&(n=Pn),n===void 0&&h===hi&&(n=oi),super(null,i,s,a,o,c,h,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:ce,this.minFilter=c!==void 0?c:ce,this.flipY=!1,this.generateMipmaps=!1}},Jr=class extends mn{constructor(t,e){super();let n=this,i=null,s=1,a=null,o="local-floor",c=1,l=null,h=null,f=null,u=null,m=null,x=null,p=e.getContextAttributes(),d=null,g=null,M=[],_=[],v=new Set,b=new Map,A=new Se;A.layers.enable(1),A.viewport=new Xt;let C=new Se;C.layers.enable(2),C.viewport=new Xt;let y=[A,C],S=new Yr;S.layers.enable(1),S.layers.enable(2);let P=null,O=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(z){let K=M[z];return K===void 0&&(K=new zi,M[z]=K),K.getTargetRaySpace()},this.getControllerGrip=function(z){let K=M[z];return K===void 0&&(K=new zi,M[z]=K),K.getGripSpace()},this.getHand=function(z){let K=M[z];return K===void 0&&(K=new zi,M[z]=K),K.getHandSpace()};function B(z){let K=_.indexOf(z.inputSource);if(K===-1)return;let nt=M[K];nt!==void 0&&nt.dispatchEvent({type:z.type,data:z.inputSource})}function D(){i.removeEventListener("select",B),i.removeEventListener("selectstart",B),i.removeEventListener("selectend",B),i.removeEventListener("squeeze",B),i.removeEventListener("squeezestart",B),i.removeEventListener("squeezeend",B),i.removeEventListener("end",D),i.removeEventListener("inputsourceschange",I);for(let z=0;z<M.length;z++){let K=_[z];K!==null&&(_[z]=null,M[z].disconnect(K))}P=null,O=null,t.setRenderTarget(d),m=null,u=null,f=null,i=null,g=null,dt.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(z){s=z,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(z){o=z,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(z){l=z},this.getBaseLayer=function(){return u!==null?u:m},this.getBinding=function(){return f},this.getFrame=function(){return x},this.getSession=function(){return i},this.setSession=async function(z){if(i=z,i!==null){if(d=t.getRenderTarget(),i.addEventListener("select",B),i.addEventListener("selectstart",B),i.addEventListener("selectend",B),i.addEventListener("squeeze",B),i.addEventListener("squeezestart",B),i.addEventListener("squeezeend",B),i.addEventListener("end",D),i.addEventListener("inputsourceschange",I),p.xrCompatible!==!0&&await e.makeXRCompatible(),i.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let K={antialias:i.renderState.layers===void 0?p.antialias:!0,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(i,e,K),i.updateRenderState({baseLayer:m}),g=new rn(m.framebufferWidth,m.framebufferHeight,{format:Be,type:Dn,encoding:t.outputEncoding,stencilBuffer:p.stencil})}else{let K=null,nt=null,it=null;p.depth&&(it=p.stencil?35056:33190,K=p.stencil?hi:Ln,nt=p.stencil?oi:Pn);let U={colorFormat:32856,depthFormat:it,scaleFactor:s};f=new XRWebGLBinding(i,e),u=f.createProjectionLayer(U),i.updateRenderState({layers:[u]}),g=new rn(u.textureWidth,u.textureHeight,{format:Be,type:Dn,depthTexture:new Zr(u.textureWidth,u.textureHeight,nt,void 0,void 0,void 0,void 0,void 0,void 0,K),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0});let Mt=t.properties.get(g);Mt.__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(c),l=null,a=await i.requestReferenceSpace(o),dt.setContext(i),dt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function I(z){for(let K=0;K<z.removed.length;K++){let nt=z.removed[K],it=_.indexOf(nt);it>=0&&(_[it]=null,M[it].disconnect(nt))}for(let K=0;K<z.added.length;K++){let nt=z.added[K],it=_.indexOf(nt);if(it===-1){for(let Mt=0;Mt<M.length;Mt++)if(Mt>=_.length){_.push(nt),it=Mt;break}else if(_[Mt]===null){_[Mt]=nt,it=Mt;break}if(it===-1)break}let U=M[it];U&&U.connect(nt)}}let k=new R,Y=new R;function Z(z,K,nt){k.setFromMatrixPosition(K.matrixWorld),Y.setFromMatrixPosition(nt.matrixWorld);let it=k.distanceTo(Y),U=K.projectionMatrix.elements,Mt=nt.projectionMatrix.elements,ht=U[14]/(U[10]-1),ut=U[14]/(U[10]+1),at=(U[9]+1)/U[5],Ft=(U[9]-1)/U[5],bt=(U[8]-1)/U[0],_t=(Mt[8]+1)/Mt[0],se=ht*bt,Ae=ht*_t,te=it/(-bt+_t),Ee=te*-bt;K.matrixWorld.decompose(z.position,z.quaternion,z.scale),z.translateX(Ee),z.translateZ(te),z.matrixWorld.compose(z.position,z.quaternion,z.scale),z.matrixWorldInverse.copy(z.matrixWorld).invert();let Wt=ht+te,Nt=ut+te,Ze=se-Ee,De=Ae+(it-Ee),E=at*ut/Nt*Wt,w=Ft*ut/Nt*Wt;z.projectionMatrix.makePerspective(Ze,De,E,w,Wt,Nt)}function H(z,K){K===null?z.matrixWorld.copy(z.matrix):z.matrixWorld.multiplyMatrices(K.matrixWorld,z.matrix),z.matrixWorldInverse.copy(z.matrixWorld).invert()}this.updateCamera=function(z){if(i===null)return;S.near=C.near=A.near=z.near,S.far=C.far=A.far=z.far,(P!==S.near||O!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),P=S.near,O=S.far);let K=z.parent,nt=S.cameras;H(S,K);for(let U=0;U<nt.length;U++)H(nt[U],K);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),z.matrix.copy(S.matrix),z.matrix.decompose(z.position,z.quaternion,z.scale);let it=z.children;for(let U=0,Mt=it.length;U<Mt;U++)it[U].updateMatrixWorld(!0);nt.length===2?Z(S,A,C):S.projectionMatrix.copy(A.projectionMatrix)},this.getCamera=function(){return S},this.getFoveation=function(){if(!(u===null&&m===null))return c},this.setFoveation=function(z){c=z,u!==null&&(u.fixedFoveation=z),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=z)},this.getPlanes=function(){return v};let $=null;function J(z,K){if(h=K.getViewerPose(l||a),x=K,h!==null){let nt=h.views;m!==null&&(t.setRenderTargetFramebuffer(g,m.framebuffer),t.setRenderTarget(g));let it=!1;nt.length!==S.cameras.length&&(S.cameras.length=0,it=!0);for(let U=0;U<nt.length;U++){let Mt=nt[U],ht=null;if(m!==null)ht=m.getViewport(Mt);else{let at=f.getViewSubImage(u,Mt);ht=at.viewport,U===0&&(t.setRenderTargetTextures(g,at.colorTexture,u.ignoreDepthValues?void 0:at.depthStencilTexture),t.setRenderTarget(g))}let ut=y[U];ut===void 0&&(ut=new Se,ut.layers.enable(U),ut.viewport=new Xt,y[U]=ut),ut.matrix.fromArray(Mt.transform.matrix),ut.projectionMatrix.fromArray(Mt.projectionMatrix),ut.viewport.set(ht.x,ht.y,ht.width,ht.height),U===0&&S.matrix.copy(ut.matrix),it===!0&&S.cameras.push(ut)}}for(let nt=0;nt<M.length;nt++){let it=_[nt],U=M[nt];it!==null&&U!==void 0&&U.update(it,K,l||a)}if($&&$(z,K),K.detectedPlanes){n.dispatchEvent({type:"planesdetected",data:K.detectedPlanes});let nt=null;for(let it of v)K.detectedPlanes.has(it)||(nt===null&&(nt=[]),nt.push(it));if(nt!==null)for(let it of nt)v.delete(it),b.delete(it),n.dispatchEvent({type:"planeremoved",data:it});for(let it of K.detectedPlanes)if(!v.has(it))v.add(it),b.set(it,K.lastChangedTime),n.dispatchEvent({type:"planeadded",data:it});else{let U=b.get(it);it.lastChangedTime>U&&(b.set(it,it.lastChangedTime),n.dispatchEvent({type:"planechanged",data:it}))}}x=null}let dt=new Qa;dt.setAnimationLoop(J),this.setAnimationLoop=function(z){$=z},this.dispose=function(){}}};function lp(r,t){function e(p,d){d.color.getRGB(p.fogColor.value,ja(r)),d.isFog?(p.fogNear.value=d.near,p.fogFar.value=d.far):d.isFogExp2&&(p.fogDensity.value=d.density)}function n(p,d,g,M,_){d.isMeshBasicMaterial||d.isMeshLambertMaterial?i(p,d):d.isMeshToonMaterial?(i(p,d),h(p,d)):d.isMeshPhongMaterial?(i(p,d),l(p,d)):d.isMeshStandardMaterial?(i(p,d),f(p,d),d.isMeshPhysicalMaterial&&u(p,d,_)):d.isMeshMatcapMaterial?(i(p,d),m(p,d)):d.isMeshDepthMaterial?i(p,d):d.isMeshDistanceMaterial?(i(p,d),x(p,d)):d.isMeshNormalMaterial?i(p,d):d.isLineBasicMaterial?(s(p,d),d.isLineDashedMaterial&&a(p,d)):d.isPointsMaterial?o(p,d,g,M):d.isSpriteMaterial?c(p,d):d.isShadowMaterial?(p.color.value.copy(d.color),p.opacity.value=d.opacity):d.isShaderMaterial&&(d.uniformsNeedUpdate=!1)}function i(p,d){p.opacity.value=d.opacity,d.color&&p.diffuse.value.copy(d.color),d.emissive&&p.emissive.value.copy(d.emissive).multiplyScalar(d.emissiveIntensity),d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===he&&(p.bumpScale.value*=-1)),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===he&&p.normalScale.value.negate()),d.specularMap&&(p.specularMap.value=d.specularMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let g=t.get(d).envMap;if(g&&(p.envMap.value=g,p.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=d.reflectivity,p.ior.value=d.ior,p.refractionRatio.value=d.refractionRatio),d.lightMap){p.lightMap.value=d.lightMap;let v=r.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=d.lightMapIntensity*v}d.aoMap&&(p.aoMap.value=d.aoMap,p.aoMapIntensity.value=d.aoMapIntensity);let M;d.map?M=d.map:d.specularMap?M=d.specularMap:d.displacementMap?M=d.displacementMap:d.normalMap?M=d.normalMap:d.bumpMap?M=d.bumpMap:d.roughnessMap?M=d.roughnessMap:d.metalnessMap?M=d.metalnessMap:d.alphaMap?M=d.alphaMap:d.emissiveMap?M=d.emissiveMap:d.clearcoatMap?M=d.clearcoatMap:d.clearcoatNormalMap?M=d.clearcoatNormalMap:d.clearcoatRoughnessMap?M=d.clearcoatRoughnessMap:d.iridescenceMap?M=d.iridescenceMap:d.iridescenceThicknessMap?M=d.iridescenceThicknessMap:d.specularIntensityMap?M=d.specularIntensityMap:d.specularColorMap?M=d.specularColorMap:d.transmissionMap?M=d.transmissionMap:d.thicknessMap?M=d.thicknessMap:d.sheenColorMap?M=d.sheenColorMap:d.sheenRoughnessMap&&(M=d.sheenRoughnessMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uvTransform.value.copy(M.matrix));let _;d.aoMap?_=d.aoMap:d.lightMap&&(_=d.lightMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uv2Transform.value.copy(_.matrix))}function s(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity}function a(p,d){p.dashSize.value=d.dashSize,p.totalSize.value=d.dashSize+d.gapSize,p.scale.value=d.scale}function o(p,d,g,M){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.size.value=d.size*g,p.scale.value=M*.5,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let _;d.map?_=d.map:d.alphaMap&&(_=d.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uvTransform.value.copy(_.matrix))}function c(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.rotation.value=d.rotation,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let g;d.map?g=d.map:d.alphaMap&&(g=d.alphaMap),g!==void 0&&(g.matrixAutoUpdate===!0&&g.updateMatrix(),p.uvTransform.value.copy(g.matrix))}function l(p,d){p.specular.value.copy(d.specular),p.shininess.value=Math.max(d.shininess,1e-4)}function h(p,d){d.gradientMap&&(p.gradientMap.value=d.gradientMap)}function f(p,d){p.roughness.value=d.roughness,p.metalness.value=d.metalness,d.roughnessMap&&(p.roughnessMap.value=d.roughnessMap),d.metalnessMap&&(p.metalnessMap.value=d.metalnessMap),t.get(d).envMap&&(p.envMapIntensity.value=d.envMapIntensity)}function u(p,d,g){p.ior.value=d.ior,d.sheen>0&&(p.sheenColor.value.copy(d.sheenColor).multiplyScalar(d.sheen),p.sheenRoughness.value=d.sheenRoughness,d.sheenColorMap&&(p.sheenColorMap.value=d.sheenColorMap),d.sheenRoughnessMap&&(p.sheenRoughnessMap.value=d.sheenRoughnessMap)),d.clearcoat>0&&(p.clearcoat.value=d.clearcoat,p.clearcoatRoughness.value=d.clearcoatRoughness,d.clearcoatMap&&(p.clearcoatMap.value=d.clearcoatMap),d.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=d.clearcoatRoughnessMap),d.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(d.clearcoatNormalScale),p.clearcoatNormalMap.value=d.clearcoatNormalMap,d.side===he&&p.clearcoatNormalScale.value.negate())),d.iridescence>0&&(p.iridescence.value=d.iridescence,p.iridescenceIOR.value=d.iridescenceIOR,p.iridescenceThicknessMinimum.value=d.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=d.iridescenceThicknessRange[1],d.iridescenceMap&&(p.iridescenceMap.value=d.iridescenceMap),d.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=d.iridescenceThicknessMap)),d.transmission>0&&(p.transmission.value=d.transmission,p.transmissionSamplerMap.value=g.texture,p.transmissionSamplerSize.value.set(g.width,g.height),d.transmissionMap&&(p.transmissionMap.value=d.transmissionMap),p.thickness.value=d.thickness,d.thicknessMap&&(p.thicknessMap.value=d.thicknessMap),p.attenuationDistance.value=d.attenuationDistance,p.attenuationColor.value.copy(d.attenuationColor)),p.specularIntensity.value=d.specularIntensity,p.specularColor.value.copy(d.specularColor),d.specularIntensityMap&&(p.specularIntensityMap.value=d.specularIntensityMap),d.specularColorMap&&(p.specularColorMap.value=d.specularColorMap)}function m(p,d){d.matcap&&(p.matcap.value=d.matcap)}function x(p,d){p.referencePosition.value.copy(d.referencePosition),p.nearDistance.value=d.nearDistance,p.farDistance.value=d.farDistance}return{refreshFogUniforms:e,refreshMaterialUniforms:n}}function hp(r,t,e,n){let i={},s={},a=[],o=e.isWebGL2?r.getParameter(35375):0;function c(M,_){let v=_.program;n.uniformBlockBinding(M,v)}function l(M,_){let v=i[M.id];v===void 0&&(x(M),v=h(M),i[M.id]=v,M.addEventListener("dispose",d));let b=_.program;n.updateUBOMapping(M,b);let A=t.render.frame;s[M.id]!==A&&(u(M),s[M.id]=A)}function h(M){let _=f();M.__bindingPointIndex=_;let v=r.createBuffer(),b=M.__size,A=M.usage;return r.bindBuffer(35345,v),r.bufferData(35345,b,A),r.bindBuffer(35345,null),r.bindBufferBase(35345,_,v),v}function f(){for(let M=0;M<o;M++)if(a.indexOf(M)===-1)return a.push(M),M;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(M){let _=i[M.id],v=M.uniforms,b=M.__cache;r.bindBuffer(35345,_);for(let A=0,C=v.length;A<C;A++){let y=v[A];if(m(y,A,b)===!0){let S=y.__offset,P=Array.isArray(y.value)?y.value:[y.value],O=0;for(let B=0;B<P.length;B++){let D=P[B],I=p(D);typeof D=="number"?(y.__data[0]=D,r.bufferSubData(35345,S+O,y.__data)):D.isMatrix3?(y.__data[0]=D.elements[0],y.__data[1]=D.elements[1],y.__data[2]=D.elements[2],y.__data[3]=D.elements[0],y.__data[4]=D.elements[3],y.__data[5]=D.elements[4],y.__data[6]=D.elements[5],y.__data[7]=D.elements[0],y.__data[8]=D.elements[6],y.__data[9]=D.elements[7],y.__data[10]=D.elements[8],y.__data[11]=D.elements[0]):(D.toArray(y.__data,O),O+=I.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(35345,S,y.__data)}}r.bindBuffer(35345,null)}function m(M,_,v){let b=M.value;if(v[_]===void 0){if(typeof b=="number")v[_]=b;else{let A=Array.isArray(b)?b:[b],C=[];for(let y=0;y<A.length;y++)C.push(A[y].clone());v[_]=C}return!0}else if(typeof b=="number"){if(v[_]!==b)return v[_]=b,!0}else{let A=Array.isArray(v[_])?v[_]:[v[_]],C=Array.isArray(b)?b:[b];for(let y=0;y<A.length;y++){let S=A[y];if(S.equals(C[y])===!1)return S.copy(C[y]),!0}}return!1}function x(M){let _=M.uniforms,v=0,b=16,A=0;for(let C=0,y=_.length;C<y;C++){let S=_[C],P={boundary:0,storage:0},O=Array.isArray(S.value)?S.value:[S.value];for(let B=0,D=O.length;B<D;B++){let I=O[B],k=p(I);P.boundary+=k.boundary,P.storage+=k.storage}if(S.__data=new Float32Array(P.storage/Float32Array.BYTES_PER_ELEMENT),S.__offset=v,C>0){A=v%b;let B=b-A;A!==0&&B-P.boundary<0&&(v+=b-A,S.__offset=v)}v+=P.storage}return A=v%b,A>0&&(v+=b-A),M.__size=v,M.__cache={},this}function p(M){let _={boundary:0,storage:0};return typeof M=="number"?(_.boundary=4,_.storage=4):M.isVector2?(_.boundary=8,_.storage=8):M.isVector3||M.isColor?(_.boundary=16,_.storage=12):M.isVector4?(_.boundary=16,_.storage=16):M.isMatrix3?(_.boundary=48,_.storage=48):M.isMatrix4?(_.boundary=64,_.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),_}function d(M){let _=M.target;_.removeEventListener("dispose",d);let v=a.indexOf(_.__bindingPointIndex);a.splice(v,1),r.deleteBuffer(i[_.id]),delete i[_.id],delete s[_.id]}function g(){for(let M in i)r.deleteBuffer(i[M]);a=[],i={},s={}}return{bind:c,update:l,dispose:g}}function up(){let r=ys("canvas");return r.style.display="block",r}function fp(r={}){this.isWebGLRenderer=!0;let t=r.canvas!==void 0?r.canvas:up(),e=r.context!==void 0?r.context:null,n=r.depth!==void 0?r.depth:!0,i=r.stencil!==void 0?r.stencil:!0,s=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,o=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",l=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h;e!==null?h=e.getContextAttributes().alpha:h=r.alpha!==void 0?r.alpha:!1;let f=null,u=null,m=[],x=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Nn,this.physicallyCorrectLights=!1,this.toneMapping=nn,this.toneMappingExposure=1;let p=this,d=!1,g=0,M=0,_=null,v=-1,b=null,A=new Xt,C=new Xt,y=null,S=t.width,P=t.height,O=1,B=null,D=null,I=new Xt(0,0,S,P),k=new Xt(0,0,S,P),Y=!1,Z=new Ps,H=!1,$=!1,J=null,dt=new zt,z=new At,K=new R,nt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function it(){return _===null?O:1}let U=e;function Mt(T,F){for(let G=0;G<T.length;G++){let N=T[G],q=t.getContext(N,F);if(q!==null)return q}return null}try{let T={alpha:!0,depth:n,stencil:i,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:o,powerPreference:c,failIfMajorPerformanceCaveat:l};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ro}`),t.addEventListener("webglcontextlost",gt,!1),t.addEventListener("webglcontextrestored",ft,!1),t.addEventListener("webglcontextcreationerror",Rt,!1),U===null){let F=["webgl2","webgl","experimental-webgl"];if(p.isWebGL1Renderer===!0&&F.shift(),U=Mt(F,T),U===null)throw Mt(F)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}U.getShaderPrecisionFormat===void 0&&(U.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(T){throw console.error("THREE.WebGLRenderer: "+T.message),T}let ht,ut,at,Ft,bt,_t,se,Ae,te,Ee,Wt,Nt,Ze,De,E,w,W,Q,tt,st,yt,rt,X,mt;function xt(){ht=new If(U),ut=new Af(U,ht,r),ht.init(ut),rt=new ap(U,ht,ut),at=new rp(U,ht,ut),Ft=new Ff,bt=new Yd,_t=new op(U,ht,at,bt,ut,rt,Ft),se=new Cf(p),Ae=new Lf(p),te=new Hl(U,ut),X=new Sf(U,ht,te,ut),Ee=new Df(U,te,Ft,X),Wt=new Uf(U,Ee,te,Ft),tt=new Bf(U,ut,_t),w=new Ef(bt),Nt=new Xd(p,se,Ae,ht,ut,X,w),Ze=new lp(p,bt),De=new Jd,E=new ep(ht,ut),Q=new wf(p,se,Ae,at,Wt,h,a),W=new sp(p,Wt,ut),mt=new hp(U,Ft,ut,at),st=new Tf(U,ht,Ft,ut),yt=new Nf(U,ht,Ft,ut),Ft.programs=Nt.programs,p.capabilities=ut,p.extensions=ht,p.properties=bt,p.renderLists=De,p.shadowMap=W,p.state=at,p.info=Ft}xt();let ct=new Jr(p,U);this.xr=ct,this.getContext=function(){return U},this.getContextAttributes=function(){return U.getContextAttributes()},this.forceContextLoss=function(){let T=ht.get("WEBGL_lose_context");T&&T.loseContext()},this.forceContextRestore=function(){let T=ht.get("WEBGL_lose_context");T&&T.restoreContext()},this.getPixelRatio=function(){return O},this.setPixelRatio=function(T){T!==void 0&&(O=T,this.setSize(S,P,!1))},this.getSize=function(T){return T.set(S,P)},this.setSize=function(T,F,G){if(ct.isPresenting){console.warn("THREE.WebGLRenderer: Can\'t change size while VR device is presenting.");return}S=T,P=F,t.width=Math.floor(T*O),t.height=Math.floor(F*O),G!==!1&&(t.style.width=T+"px",t.style.height=F+"px"),this.setViewport(0,0,T,F)},this.getDrawingBufferSize=function(T){return T.set(S*O,P*O).floor()},this.setDrawingBufferSize=function(T,F,G){S=T,P=F,O=G,t.width=Math.floor(T*G),t.height=Math.floor(F*G),this.setViewport(0,0,T,F)},this.getCurrentViewport=function(T){return T.copy(A)},this.getViewport=function(T){return T.copy(I)},this.setViewport=function(T,F,G,N){T.isVector4?I.set(T.x,T.y,T.z,T.w):I.set(T,F,G,N),at.viewport(A.copy(I).multiplyScalar(O).floor())},this.getScissor=function(T){return T.copy(k)},this.setScissor=function(T,F,G,N){T.isVector4?k.set(T.x,T.y,T.z,T.w):k.set(T,F,G,N),at.scissor(C.copy(k).multiplyScalar(O).floor())},this.getScissorTest=function(){return Y},this.setScissorTest=function(T){at.setScissorTest(Y=T)},this.setOpaqueSort=function(T){B=T},this.setTransparentSort=function(T){D=T},this.getClearColor=function(T){return T.copy(Q.getClearColor())},this.setClearColor=function(){Q.setClearColor.apply(Q,arguments)},this.getClearAlpha=function(){return Q.getClearAlpha()},this.setClearAlpha=function(){Q.setClearAlpha.apply(Q,arguments)},this.clear=function(T=!0,F=!0,G=!0){let N=0;T&&(N|=16384),F&&(N|=256),G&&(N|=1024),U.clear(N)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",gt,!1),t.removeEventListener("webglcontextrestored",ft,!1),t.removeEventListener("webglcontextcreationerror",Rt,!1),De.dispose(),E.dispose(),bt.dispose(),se.dispose(),Ae.dispose(),Wt.dispose(),X.dispose(),mt.dispose(),Nt.dispose(),ct.dispose(),ct.removeEventListener("sessionstart",ot),ct.removeEventListener("sessionend",lt),J&&(J.dispose(),J=null),It.stop()};function gt(T){T.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),d=!0}function ft(){console.log("THREE.WebGLRenderer: Context Restored."),d=!1;let T=Ft.autoReset,F=W.enabled,G=W.autoUpdate,N=W.needsUpdate,q=W.type;xt(),Ft.autoReset=T,W.enabled=F,W.autoUpdate=G,W.needsUpdate=N,W.type=q}function Rt(T){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",T.statusMessage)}function Ut(T){let F=T.target;F.removeEventListener("dispose",Ut),$t(F)}function $t(T){L(T),bt.remove(T)}function L(T){let F=bt.get(T).programs;F!==void 0&&(F.forEach(function(G){Nt.releaseProgram(G)}),T.isShaderMaterial&&Nt.releaseShaderCache(T))}this.renderBufferDirect=function(T,F,G,N,q,pt){F===null&&(F=nt);let vt=q.isMesh&&q.matrixWorld.determinant()<0,St=vc(T,F,G,N,q);at.setMaterial(N,vt);let Tt=G.index,Lt=1;N.wireframe===!0&&(Tt=Ee.getWireframeAttribute(G),Lt=2);let Et=G.drawRange,Ct=G.attributes.position,Vt=Et.start*Lt,ye=(Et.start+Et.count)*Lt;pt!==null&&(Vt=Math.max(Vt,pt.start*Lt),ye=Math.min(ye,(pt.start+pt.count)*Lt)),Tt!==null?(Vt=Math.max(Vt,0),ye=Math.min(ye,Tt.count)):Ct!=null&&(Vt=Math.max(Vt,0),ye=Math.min(ye,Ct.count));let $e=ye-Vt;if($e<0||$e===1/0)return;X.setup(q,N,St,G,Tt);let Mn,Gt=st;if(Tt!==null&&(Mn=te.get(Tt),Gt=yt,Gt.setIndex(Mn)),q.isMesh)N.wireframe===!0?(at.setLineWidth(N.wireframeLinewidth*it()),Gt.setMode(1)):Gt.setMode(4);else if(q.isLine){let Pt=N.linewidth;Pt===void 0&&(Pt=1),at.setLineWidth(Pt*it()),q.isLineSegments?Gt.setMode(1):q.isLineLoop?Gt.setMode(2):Gt.setMode(3)}else q.isPoints?Gt.setMode(0):q.isSprite&&Gt.setMode(4);if(q.isInstancedMesh)Gt.renderInstances(Vt,$e,q.count);else if(G.isInstancedBufferGeometry){let Pt=G._maxInstanceCount!==void 0?G._maxInstanceCount:1/0,Ws=Math.min(G.instanceCount,Pt);Gt.renderInstances(Vt,$e,Ws)}else Gt.render(Vt,$e)},this.compile=function(T,F){function G(N,q,pt){N.transparent===!0&&N.side===We&&N.forceSinglePass===!1?(N.side=he,N.needsUpdate=!0,Ce(N,q,pt),N.side=Ue,N.needsUpdate=!0,Ce(N,q,pt),N.side=We):Ce(N,q,pt)}u=E.get(T),u.init(),x.push(u),T.traverseVisible(function(N){N.isLight&&N.layers.test(F.layers)&&(u.pushLight(N),N.castShadow&&u.pushShadow(N))}),u.setupLights(p.physicallyCorrectLights),T.traverse(function(N){let q=N.material;if(q)if(Array.isArray(q))for(let pt=0;pt<q.length;pt++){let vt=q[pt];G(vt,T,N)}else G(q,T,N)}),x.pop(),u=null};let V=null;function j(T){V&&V(T)}function ot(){It.stop()}function lt(){It.start()}let It=new Qa;It.setAnimationLoop(j),typeof self!="undefined"&&It.setContext(self),this.setAnimationLoop=function(T){V=T,ct.setAnimationLoop(T),T===null?It.stop():It.start()},ct.addEventListener("sessionstart",ot),ct.addEventListener("sessionend",lt),this.render=function(T,F){if(F!==void 0&&F.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(d===!0)return;T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),F.parent===null&&F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ct.enabled===!0&&ct.isPresenting===!0&&(ct.cameraAutoUpdate===!0&&ct.updateCamera(F),F=ct.getCamera()),T.isScene===!0&&T.onBeforeRender(p,T,F,_),u=E.get(T,x.length),u.init(),x.push(u),dt.multiplyMatrices(F.projectionMatrix,F.matrixWorldInverse),Z.setFromProjectionMatrix(dt),$=this.localClippingEnabled,H=w.init(this.clippingPlanes,$),f=De.get(T,m.length),f.init(),m.push(f),Kt(T,F,0,p.sortObjects),f.finish(),p.sortObjects===!0&&f.sort(B,D),H===!0&&w.beginShadows();let G=u.state.shadowsArray;if(W.render(G,T,F),H===!0&&w.endShadows(),this.info.autoReset===!0&&this.info.reset(),Q.render(f,T),u.setupLights(p.physicallyCorrectLights),F.isArrayCamera){let N=F.cameras;for(let q=0,pt=N.length;q<pt;q++){let vt=N[q];ee(f,T,vt,vt.viewport)}}else ee(f,T,F);_!==null&&(_t.updateMultisampleRenderTarget(_),_t.updateRenderTargetMipmap(_)),T.isScene===!0&&T.onAfterRender(p,T,F),X.resetDefaultState(),v=-1,b=null,x.pop(),x.length>0?u=x[x.length-1]:u=null,m.pop(),m.length>0?f=m[m.length-1]:f=null};function Kt(T,F,G,N){if(T.visible===!1)return;if(T.layers.test(F.layers)){if(T.isGroup)G=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(F);else if(T.isLight)u.pushLight(T),T.castShadow&&u.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||Z.intersectsSprite(T)){N&&K.setFromMatrixPosition(T.matrixWorld).applyMatrix4(dt);let vt=Wt.update(T),St=T.material;St.visible&&f.push(T,vt,St,G,K.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(T.isSkinnedMesh&&T.skeleton.frame!==Ft.render.frame&&(T.skeleton.update(),T.skeleton.frame=Ft.render.frame),!T.frustumCulled||Z.intersectsObject(T))){N&&K.setFromMatrixPosition(T.matrixWorld).applyMatrix4(dt);let vt=Wt.update(T),St=T.material;if(Array.isArray(St)){let Tt=vt.groups;for(let Lt=0,Et=Tt.length;Lt<Et;Lt++){let Ct=Tt[Lt],Vt=St[Ct.materialIndex];Vt&&Vt.visible&&f.push(T,vt,Vt,G,K.z,Ct)}}else St.visible&&f.push(T,vt,St,G,K.z,null)}}let pt=T.children;for(let vt=0,St=pt.length;vt<St;vt++)Kt(pt[vt],F,G,N)}function ee(T,F,G,N){let q=T.opaque,pt=T.transmissive,vt=T.transparent;u.setupLightsView(G),H===!0&&w.setGlobalState(p.clippingPlanes,G),pt.length>0&&vn(q,F,G),N&&at.viewport(A.copy(N)),q.length>0&&kt(q,F,G),pt.length>0&&kt(pt,F,G),vt.length>0&&kt(vt,F,G),at.buffers.depth.setTest(!0),at.buffers.depth.setMask(!0),at.buffers.color.setMask(!0),at.setPolygonOffset(!1)}function vn(T,F,G){let N=ut.isWebGL2;J===null&&(J=new rn(1,1,{generateMipmaps:!0,type:ht.has("EXT_color_buffer_half_float")?Bi:Dn,minFilter:Oi,samples:N&&s===!0?4:0})),p.getDrawingBufferSize(z),N?J.setSize(z.x,z.y):J.setSize(Dr(z.x),Dr(z.y));let q=p.getRenderTarget();p.setRenderTarget(J),p.clear();let pt=p.toneMapping;p.toneMapping=nn,kt(T,F,G),p.toneMapping=pt,_t.updateMultisampleRenderTarget(J),_t.updateRenderTargetMipmap(J),p.setRenderTarget(q)}function kt(T,F,G){let N=F.isScene===!0?F.overrideMaterial:null;for(let q=0,pt=T.length;q<pt;q++){let vt=T[q],St=vt.object,Tt=vt.geometry,Lt=N===null?vt.material:N,Et=vt.group;St.layers.test(G.layers)&&Je(St,F,G,Tt,Lt,Et)}}function Je(T,F,G,N,q,pt){T.onBeforeRender(p,F,G,N,q,pt),T.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,T.matrixWorld),T.normalMatrix.getNormalMatrix(T.modelViewMatrix),q.onBeforeRender(p,F,G,N,T,pt),q.transparent===!0&&q.side===We&&q.forceSinglePass===!1?(q.side=he,q.needsUpdate=!0,p.renderBufferDirect(G,F,N,q,T,pt),q.side=Ue,q.needsUpdate=!0,p.renderBufferDirect(G,F,N,q,T,pt),q.side=We):p.renderBufferDirect(G,F,N,q,T,pt),T.onAfterRender(p,F,G,N,q,pt)}function Ce(T,F,G){F.isScene!==!0&&(F=nt);let N=bt.get(T),q=u.state.lights,pt=u.state.shadowsArray,vt=q.state.version,St=Nt.getParameters(T,q.state,pt,F,G),Tt=Nt.getProgramCacheKey(St),Lt=N.programs;N.environment=T.isMeshStandardMaterial?F.environment:null,N.fog=F.fog,N.envMap=(T.isMeshStandardMaterial?Ae:se).get(T.envMap||N.environment),Lt===void 0&&(T.addEventListener("dispose",Ut),Lt=new Map,N.programs=Lt);let Et=Lt.get(Tt);if(Et!==void 0){if(N.currentProgram===Et&&N.lightsStateVersion===vt)return wo(T,St),Et}else St.uniforms=Nt.getUniforms(T),T.onBuild(G,St,p),T.onBeforeCompile(St,p),Et=Nt.acquireProgram(St,Tt),Lt.set(Tt,Et),N.uniforms=St.uniforms;let Ct=N.uniforms;(!T.isShaderMaterial&&!T.isRawShaderMaterial||T.clipping===!0)&&(Ct.clippingPlanes=w.uniform),wo(T,St),N.needsLights=bc(T),N.lightsStateVersion=vt,N.needsLights&&(Ct.ambientLightColor.value=q.state.ambient,Ct.lightProbe.value=q.state.probe,Ct.directionalLights.value=q.state.directional,Ct.directionalLightShadows.value=q.state.directionalShadow,Ct.spotLights.value=q.state.spot,Ct.spotLightShadows.value=q.state.spotShadow,Ct.rectAreaLights.value=q.state.rectArea,Ct.ltc_1.value=q.state.rectAreaLTC1,Ct.ltc_2.value=q.state.rectAreaLTC2,Ct.pointLights.value=q.state.point,Ct.pointLightShadows.value=q.state.pointShadow,Ct.hemisphereLights.value=q.state.hemi,Ct.directionalShadowMap.value=q.state.directionalShadowMap,Ct.directionalShadowMatrix.value=q.state.directionalShadowMatrix,Ct.spotShadowMap.value=q.state.spotShadowMap,Ct.spotLightMatrix.value=q.state.spotLightMatrix,Ct.spotLightMap.value=q.state.spotLightMap,Ct.pointShadowMap.value=q.state.pointShadowMap,Ct.pointShadowMatrix.value=q.state.pointShadowMatrix);let Vt=Et.getUniforms(),ye=ai.seqWithValue(Vt.seq,Ct);return N.currentProgram=Et,N.uniformsList=ye,Et}function wo(T,F){let G=bt.get(T);G.outputEncoding=F.outputEncoding,G.instancing=F.instancing,G.skinning=F.skinning,G.morphTargets=F.morphTargets,G.morphNormals=F.morphNormals,G.morphColors=F.morphColors,G.morphTargetsCount=F.morphTargetsCount,G.numClippingPlanes=F.numClippingPlanes,G.numIntersection=F.numClipIntersection,G.vertexAlphas=F.vertexAlphas,G.vertexTangents=F.vertexTangents,G.toneMapping=F.toneMapping}function vc(T,F,G,N,q){F.isScene!==!0&&(F=nt),_t.resetTextureUnits();let pt=F.fog,vt=N.isMeshStandardMaterial?F.environment:null,St=_===null?p.outputEncoding:_.isXRRenderTarget===!0?_.texture.encoding:Nn,Tt=(N.isMeshStandardMaterial?Ae:se).get(N.envMap||vt),Lt=N.vertexColors===!0&&!!G.attributes.color&&G.attributes.color.itemSize===4,Et=!!N.normalMap&&!!G.attributes.tangent,Ct=!!G.morphAttributes.position,Vt=!!G.morphAttributes.normal,ye=!!G.morphAttributes.color,$e=N.toneMapped?p.toneMapping:nn,Mn=G.morphAttributes.position||G.morphAttributes.normal||G.morphAttributes.color,Gt=Mn!==void 0?Mn.length:0,Pt=bt.get(N),Ws=u.state.lights;if(H===!0&&($===!0||T!==b)){let ve=T===b&&N.id===v;w.setState(N,T,ve)}let jt=!1;N.version===Pt.__version?(Pt.needsLights&&Pt.lightsStateVersion!==Ws.state.version||Pt.outputEncoding!==St||q.isInstancedMesh&&Pt.instancing===!1||!q.isInstancedMesh&&Pt.instancing===!0||q.isSkinnedMesh&&Pt.skinning===!1||!q.isSkinnedMesh&&Pt.skinning===!0||Pt.envMap!==Tt||N.fog===!0&&Pt.fog!==pt||Pt.numClippingPlanes!==void 0&&(Pt.numClippingPlanes!==w.numPlanes||Pt.numIntersection!==w.numIntersection)||Pt.vertexAlphas!==Lt||Pt.vertexTangents!==Et||Pt.morphTargets!==Ct||Pt.morphNormals!==Vt||Pt.morphColors!==ye||Pt.toneMapping!==$e||ut.isWebGL2===!0&&Pt.morphTargetsCount!==Gt)&&(jt=!0):(jt=!0,Pt.__version=N.version);let bn=Pt.currentProgram;jt===!0&&(bn=Ce(N,F,q));let So=!1,Ai=!1,qs=!1,re=bn.getUniforms(),wn=Pt.uniforms;if(at.useProgram(bn.program)&&(So=!0,Ai=!0,qs=!0),N.id!==v&&(v=N.id,Ai=!0),So||b!==T){if(re.setValue(U,"projectionMatrix",T.projectionMatrix),ut.logarithmicDepthBuffer&&re.setValue(U,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),b!==T&&(b=T,Ai=!0,qs=!0),N.isShaderMaterial||N.isMeshPhongMaterial||N.isMeshToonMaterial||N.isMeshStandardMaterial||N.envMap){let ve=re.map.cameraPosition;ve!==void 0&&ve.setValue(U,K.setFromMatrixPosition(T.matrixWorld))}(N.isMeshPhongMaterial||N.isMeshToonMaterial||N.isMeshLambertMaterial||N.isMeshBasicMaterial||N.isMeshStandardMaterial||N.isShaderMaterial)&&re.setValue(U,"isOrthographic",T.isOrthographicCamera===!0),(N.isMeshPhongMaterial||N.isMeshToonMaterial||N.isMeshLambertMaterial||N.isMeshBasicMaterial||N.isMeshStandardMaterial||N.isShaderMaterial||N.isShadowMaterial||q.isSkinnedMesh)&&re.setValue(U,"viewMatrix",T.matrixWorldInverse)}if(q.isSkinnedMesh){re.setOptional(U,q,"bindMatrix"),re.setOptional(U,q,"bindMatrixInverse");let ve=q.skeleton;ve&&(ut.floatVertexTextures?(ve.boneTexture===null&&ve.computeBoneTexture(),re.setValue(U,"boneTexture",ve.boneTexture,_t),re.setValue(U,"boneTextureSize",ve.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}let Xs=G.morphAttributes;if((Xs.position!==void 0||Xs.normal!==void 0||Xs.color!==void 0&&ut.isWebGL2===!0)&&tt.update(q,G,N,bn),(Ai||Pt.receiveShadow!==q.receiveShadow)&&(Pt.receiveShadow=q.receiveShadow,re.setValue(U,"receiveShadow",q.receiveShadow)),N.isMeshGouraudMaterial&&N.envMap!==null&&(wn.envMap.value=Tt,wn.flipEnvMap.value=Tt.isCubeTexture&&Tt.isRenderTargetTexture===!1?-1:1),Ai&&(re.setValue(U,"toneMappingExposure",p.toneMappingExposure),Pt.needsLights&&Mc(wn,qs),pt&&N.fog===!0&&Ze.refreshFogUniforms(wn,pt),Ze.refreshMaterialUniforms(wn,N,O,P,J),ai.upload(U,Pt.uniformsList,wn,_t)),N.isShaderMaterial&&N.uniformsNeedUpdate===!0&&(ai.upload(U,Pt.uniformsList,wn,_t),N.uniformsNeedUpdate=!1),N.isSpriteMaterial&&re.setValue(U,"center",q.center),re.setValue(U,"modelViewMatrix",q.modelViewMatrix),re.setValue(U,"normalMatrix",q.normalMatrix),re.setValue(U,"modelMatrix",q.matrixWorld),N.isShaderMaterial||N.isRawShaderMaterial){let ve=N.uniformsGroups;for(let Ys=0,wc=ve.length;Ys<wc;Ys++)if(ut.isWebGL2){let To=ve[Ys];mt.update(To,bn),mt.bind(To,bn)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return bn}function Mc(T,F){T.ambientLightColor.needsUpdate=F,T.lightProbe.needsUpdate=F,T.directionalLights.needsUpdate=F,T.directionalLightShadows.needsUpdate=F,T.pointLights.needsUpdate=F,T.pointLightShadows.needsUpdate=F,T.spotLights.needsUpdate=F,T.spotLightShadows.needsUpdate=F,T.rectAreaLights.needsUpdate=F,T.hemisphereLights.needsUpdate=F}function bc(T){return T.isMeshLambertMaterial||T.isMeshToonMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isShadowMaterial||T.isShaderMaterial&&T.lights===!0}this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return _},this.setRenderTargetTextures=function(T,F,G){bt.get(T.texture).__webglTexture=F,bt.get(T.depthTexture).__webglTexture=G;let N=bt.get(T);N.__hasExternalTextures=!0,N.__hasExternalTextures&&(N.__autoAllocateDepthBuffer=G===void 0,N.__autoAllocateDepthBuffer||ht.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),N.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(T,F){let G=bt.get(T);G.__webglFramebuffer=F,G.__useDefaultFramebuffer=F===void 0},this.setRenderTarget=function(T,F=0,G=0){_=T,g=F,M=G;let N=!0,q=null,pt=!1,vt=!1;if(T){let Tt=bt.get(T);Tt.__useDefaultFramebuffer!==void 0?(at.bindFramebuffer(36160,null),N=!1):Tt.__webglFramebuffer===void 0?_t.setupRenderTarget(T):Tt.__hasExternalTextures&&_t.rebindTextures(T,bt.get(T.texture).__webglTexture,bt.get(T.depthTexture).__webglTexture);let Lt=T.texture;(Lt.isData3DTexture||Lt.isDataArrayTexture||Lt.isCompressedArrayTexture)&&(vt=!0);let Et=bt.get(T).__webglFramebuffer;T.isWebGLCubeRenderTarget?(q=Et[F],pt=!0):ut.isWebGL2&&T.samples>0&&_t.useMultisampledRTT(T)===!1?q=bt.get(T).__webglMultisampledFramebuffer:q=Et,A.copy(T.viewport),C.copy(T.scissor),y=T.scissorTest}else A.copy(I).multiplyScalar(O).floor(),C.copy(k).multiplyScalar(O).floor(),y=Y;if(at.bindFramebuffer(36160,q)&&ut.drawBuffers&&N&&at.drawBuffers(T,q),at.viewport(A),at.scissor(C),at.setScissorTest(y),pt){let Tt=bt.get(T.texture);U.framebufferTexture2D(36160,36064,34069+F,Tt.__webglTexture,G)}else if(vt){let Tt=bt.get(T.texture),Lt=F||0;U.framebufferTextureLayer(36160,36064,Tt.__webglTexture,G||0,Lt)}v=-1},this.readRenderTargetPixels=function(T,F,G,N,q,pt,vt){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let St=bt.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&vt!==void 0&&(St=St[vt]),St){at.bindFramebuffer(36160,St);try{let Tt=T.texture,Lt=Tt.format,Et=Tt.type;if(Lt!==Be&&rt.convert(Lt)!==U.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Ct=Et===Bi&&(ht.has("EXT_color_buffer_half_float")||ut.isWebGL2&&ht.has("EXT_color_buffer_float"));if(Et!==Dn&&rt.convert(Et)!==U.getParameter(35738)&&!(Et===Rn&&(ut.isWebGL2||ht.has("OES_texture_float")||ht.has("WEBGL_color_buffer_float")))&&!Ct){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}F>=0&&F<=T.width-N&&G>=0&&G<=T.height-q&&U.readPixels(F,G,N,q,rt.convert(Lt),rt.convert(Et),pt)}finally{let Tt=_!==null?bt.get(_).__webglFramebuffer:null;at.bindFramebuffer(36160,Tt)}}},this.copyFramebufferToTexture=function(T,F,G=0){let N=Math.pow(2,-G),q=Math.floor(F.image.width*N),pt=Math.floor(F.image.height*N);_t.setTexture2D(F,0),U.copyTexSubImage2D(3553,G,0,0,T.x,T.y,q,pt),at.unbindTexture()},this.copyTextureToTexture=function(T,F,G,N=0){let q=F.image.width,pt=F.image.height,vt=rt.convert(G.format),St=rt.convert(G.type);_t.setTexture2D(G,0),U.pixelStorei(37440,G.flipY),U.pixelStorei(37441,G.premultiplyAlpha),U.pixelStorei(3317,G.unpackAlignment),F.isDataTexture?U.texSubImage2D(3553,N,T.x,T.y,q,pt,vt,St,F.image.data):F.isCompressedTexture?U.compressedTexSubImage2D(3553,N,T.x,T.y,F.mipmaps[0].width,F.mipmaps[0].height,vt,F.mipmaps[0].data):U.texSubImage2D(3553,N,T.x,T.y,vt,St,F.image),N===0&&G.generateMipmaps&&U.generateMipmap(3553),at.unbindTexture()},this.copyTextureToTexture3D=function(T,F,G,N,q=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let pt=T.max.x-T.min.x+1,vt=T.max.y-T.min.y+1,St=T.max.z-T.min.z+1,Tt=rt.convert(N.format),Lt=rt.convert(N.type),Et;if(N.isData3DTexture)_t.setTexture3D(N,0),Et=32879;else if(N.isDataArrayTexture)_t.setTexture2DArray(N,0),Et=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}U.pixelStorei(37440,N.flipY),U.pixelStorei(37441,N.premultiplyAlpha),U.pixelStorei(3317,N.unpackAlignment);let Ct=U.getParameter(3314),Vt=U.getParameter(32878),ye=U.getParameter(3316),$e=U.getParameter(3315),Mn=U.getParameter(32877),Gt=G.isCompressedTexture?G.mipmaps[0]:G.image;U.pixelStorei(3314,Gt.width),U.pixelStorei(32878,Gt.height),U.pixelStorei(3316,T.min.x),U.pixelStorei(3315,T.min.y),U.pixelStorei(32877,T.min.z),G.isDataTexture||G.isData3DTexture?U.texSubImage3D(Et,q,F.x,F.y,F.z,pt,vt,St,Tt,Lt,Gt.data):G.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),U.compressedTexSubImage3D(Et,q,F.x,F.y,F.z,pt,vt,St,Tt,Gt.data)):U.texSubImage3D(Et,q,F.x,F.y,F.z,pt,vt,St,Tt,Lt,Gt),U.pixelStorei(3314,Ct),U.pixelStorei(32878,Vt),U.pixelStorei(3316,ye),U.pixelStorei(3315,$e),U.pixelStorei(32877,Mn),q===0&&N.generateMipmaps&&U.generateMipmap(Et),at.unbindTexture()},this.initTexture=function(T){T.isCubeTexture?_t.setTextureCube(T,0):T.isData3DTexture?_t.setTexture3D(T,0):T.isDataArrayTexture||T.isCompressedArrayTexture?_t.setTexture2DArray(T,0):_t.setTexture2D(T,0),at.unbindTexture()},this.resetState=function(){g=0,M=0,_=null,at.reset(),X.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var $r=class extends fp{};$r.prototype.isWebGL1Renderer=!0;function dn(r,t,e){return sc(r)?new r.constructor(r.subarray(t,e!==void 0?e:r.length)):r.slice(t,e)}function ps(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function sc(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var pi=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let a;e:{i:if(!(t<i)){for(let o=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(s=i,i=e[++n],t<i)break t}a=e.length;break e}if(!(t>=s)){let o=e[1];t<o&&(n=2,s=o);for(let c=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(i=s,s=e[--n-1],t>=s)break t}a=n,n=0;break e}break n}for(;n<a;){let o=n+a>>>1;t<e[o]?a=o:n=o+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let a=0;a!==i;++a)e[a]=n[s+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Kr=class extends pi{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ra,endingEnd:ra}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,a=t+1,o=i[s],c=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case oa:s=t,o=2*e-n;break;case aa:s=i.length-2,o=e+i[s]-i[s+1];break;default:s=t,o=n}if(c===void 0)switch(this.getSettings_().endingEnd){case oa:a=t,c=2*n-e;break;case aa:a=1,c=n+i[1]-i[0];break;default:a=t-1,c=e}let l=(n-e)*.5,h=this.valueSize;this._weightPrev=l/(e-o),this._weightNext=l/(c-n),this._offsetPrev=s*h,this._offsetNext=a*h}interpolate_(t,e,n,i){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=t*o,l=c-o,h=this._offsetPrev,f=this._offsetNext,u=this._weightPrev,m=this._weightNext,x=(n-e)/(i-e),p=x*x,d=p*x,g=-u*d+2*u*p-u*x,M=(1+u)*d+(-1.5-2*u)*p+(-.5+u)*x+1,_=(-1-m)*d+(1.5+m)*p+.5*x,v=m*d-m*p;for(let b=0;b!==o;++b)s[b]=g*a[h+b]+M*a[l+b]+_*a[c+b]+v*a[f+b];return s}},jr=class extends pi{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=t*o,l=c-o,h=(n-e)/(i-e),f=1-h;for(let u=0;u!==o;++u)s[u]=a[l+u]*f+a[c+u]*h;return s}},Qr=class extends pi{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},Ve=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ps(e,this.TimeBufferType),this.values=ps(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:ps(t.times,Array),values:ps(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new Qr(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new jr(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Kr(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case xs:e=this.InterpolantFactoryMethodDiscrete;break;case _s:e=this.InterpolantFactoryMethodLinear;break;case tr:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return xs;case this.InterpolantFactoryMethodLinear:return _s;case this.InterpolantFactoryMethodSmooth:return tr}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,a=i-1;for(;s!==i&&n[s]<t;)++s;for(;a!==-1&&n[a]>e;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);let o=this.getValueSize();this.times=dn(n,s,a),this.values=dn(this.values,s*o,a*o)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==s;o++){let c=n[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),t=!1;break}if(a!==null&&a>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,a),t=!1;break}a=c}if(i!==void 0&&sc(i))for(let o=0,c=i.length;o!==c;++o){let l=i[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),t=!1;break}}return t}optimize(){let t=dn(this.times),e=dn(this.values),n=this.getValueSize(),i=this.getInterpolation()===tr,s=t.length-1,a=1;for(let o=1;o<s;++o){let c=!1,l=t[o],h=t[o+1];if(l!==h&&(o!==1||l!==t[0]))if(i)c=!0;else{let f=o*n,u=f-n,m=f+n;for(let x=0;x!==n;++x){let p=e[f+x];if(p!==e[u+x]||p!==e[m+x]){c=!0;break}}}if(c){if(o!==a){t[a]=t[o];let f=o*n,u=a*n;for(let m=0;m!==n;++m)e[u+m]=e[f+m]}++a}}if(s>0){t[a]=t[s];for(let o=s*n,c=a*n,l=0;l!==n;++l)e[c+l]=e[o+l];++a}return a!==t.length?(this.times=dn(t,0,a),this.values=dn(e,0,a*n)):(this.times=t,this.values=e),this}clone(){let t=dn(this.times,0),e=dn(this.values,0),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};Ve.prototype.TimeBufferType=Float32Array;Ve.prototype.ValueBufferType=Float32Array;Ve.prototype.DefaultInterpolation=_s;var On=class extends Ve{};On.prototype.ValueTypeName="bool";On.prototype.ValueBufferType=Array;On.prototype.DefaultInterpolation=xs;On.prototype.InterpolantFactoryMethodLinear=void 0;On.prototype.InterpolantFactoryMethodSmooth=void 0;var to=class extends Ve{};to.prototype.ValueTypeName="color";var eo=class extends Ve{};eo.prototype.ValueTypeName="number";var no=class extends pi{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=(n-e)/(i-e),l=t*o;for(let h=l+o;l!==h;l+=4)gn.slerpFlat(s,0,a,l-o,a,l,c);return s}},Vi=class extends Ve{InterpolantFactoryMethodLinear(t){return new no(this.times,this.values,this.getValueSize(),t)}};Vi.prototype.ValueTypeName="quaternion";Vi.prototype.DefaultInterpolation=_s;Vi.prototype.InterpolantFactoryMethodSmooth=void 0;var Bn=class extends Ve{};Bn.prototype.ValueTypeName="string";Bn.prototype.ValueBufferType=Array;Bn.prototype.DefaultInterpolation=xs;Bn.prototype.InterpolantFactoryMethodLinear=void 0;Bn.prototype.InterpolantFactoryMethodSmooth=void 0;var io=class extends Ve{};io.prototype.ValueTypeName="vector";var ao="\\\\[\\\\]\\\\.:\\\\/",dp=new RegExp("["+ao+"]","g"),co="[^"+ao+"]",pp="[^"+ao.replace("\\\\.","")+"]",mp=/((?:WC+[\\/:])*)/.source.replace("WC",co),gp=/(WCOD+)?/.source.replace("WCOD",pp),xp=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",co),_p=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",co),yp=new RegExp("^"+mp+gp+xp+_p+"$"),vp=["material","materials","bones","map"],so=class{constructor(t,e,n){let i=n||Dt.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},Dt=class{constructor(t,e,n){this.path=e,this.parsedPath=n||Dt.parseTrackName(e),this.node=Dt.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new Dt.Composite(t,e,n):new Dt(t,e,n)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(dp,"")}static parseTrackName(t){let e=yp.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);vp.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let a=0;a<s.length;a++){let o=s[a];if(o.name===e||o.uuid===e)return o;let c=n(o.children);if(c)return c}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=Dt.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn\'t found.");return}if(n){let l=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===l){l=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(l!==void 0){if(t[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[l]}}let a=t[i];if(a===void 0){let l=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+i+" but it wasn\'t found.",t);return}let o=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}c=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(c=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Dt.Composite=so;Dt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Dt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Dt.prototype.GetterByBindingType=[Dt.prototype._getValue_direct,Dt.prototype._getValue_array,Dt.prototype._getValue_arrayElement,Dt.prototype._getValue_toArray];Dt.prototype.SetterByBindingTypeAndVersioning=[[Dt.prototype._setValue_direct,Dt.prototype._setValue_direct_setNeedsUpdate,Dt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_array,Dt.prototype._setValue_array_setNeedsUpdate,Dt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_arrayElement,Dt.prototype._setValue_arrayElement_setNeedsUpdate,Dt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_fromArray,Dt.prototype._setValue_fromArray_setNeedsUpdate,Dt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Gp=new Float32Array(1);var Ha=new R,ms=new R,me=class{constructor(t=new R,e=new R){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Ha.subVectors(t,this.start),ms.subVectors(this.end,this.start);let n=ms.dot(ms),s=ms.dot(Ha)/n;return e&&(s=de(s,0,1)),s}closestPointToPoint(t,e,n){let i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}};typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ro}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ro);var rc=Math.pow(2,-24);var Un=class{constructor(){}};function Le(r,t,e){return e.min.x=t[r],e.min.y=t[r+1],e.min.z=t[r+2],e.max.x=t[r+3],e.max.y=t[r+4],e.max.z=t[r+5],e}function lo(r){let t=-1,e=-1/0;for(let n=0;n<3;n++){let i=r[n+3]-r[n];i>e&&(e=i,t=n)}return t}function ho(r,t){t.set(r)}function uo(r,t,e){let n,i;for(let s=0;s<3;s++){let a=s+3;n=r[s],i=t[s],e[s]=n<i?n:i,n=r[a],i=t[a],e[a]=n>i?n:i}}function Hi(r,t,e){for(let n=0;n<3;n++){let i=t[r+2*n],s=t[r+2*n+1],a=i-s,o=i+s;a<e[n]&&(e[n]=a),o>e[n+3]&&(e[n+3]=o)}}function gi(r){let t=r[3]-r[0],e=r[4]-r[1],n=r[5]-r[2];return 2*(t*e+e*n+n*t)}function wp(r,t){if(!r.index){let e=r.attributes.position.count,n=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i;e>65535?i=new Uint32Array(new n(4*e)):i=new Uint16Array(new n(2*e)),r.setIndex(new Yt(i,1));for(let s=0;s<e;s++)i[s]=s}}function Sp(r){if(!r.groups||!r.groups.length)return[{offset:0,count:r.index.count/3}];let t=[],e=new Set;for(let i of r.groups)e.add(i.start),e.add(i.start+i.count);let n=Array.from(e.values()).sort((i,s)=>i-s);for(let i=0;i<n.length-1;i++){let s=n[i],a=n[i+1];t.push({offset:s/3,count:(a-s)/3})}return t}function po(r,t,e,n,i=null){let s=1/0,a=1/0,o=1/0,c=-1/0,l=-1/0,h=-1/0,f=1/0,u=1/0,m=1/0,x=-1/0,p=-1/0,d=-1/0,g=i!==null;for(let M=t*6,_=(t+e)*6;M<_;M+=6){let v=r[M+0],b=r[M+1],A=v-b,C=v+b;A<s&&(s=A),C>c&&(c=C),g&&v<f&&(f=v),g&&v>x&&(x=v);let y=r[M+2],S=r[M+3],P=y-S,O=y+S;P<a&&(a=P),O>l&&(l=O),g&&y<u&&(u=y),g&&y>p&&(p=y);let B=r[M+4],D=r[M+5],I=B-D,k=B+D;I<o&&(o=I),k>h&&(h=k),g&&B<m&&(m=B),g&&B>d&&(d=B)}n[0]=s,n[1]=a,n[2]=o,n[3]=c,n[4]=l,n[5]=h,g&&(i[0]=f,i[1]=u,i[2]=m,i[3]=x,i[4]=p,i[5]=d)}function Tp(r,t,e,n){let i=1/0,s=1/0,a=1/0,o=-1/0,c=-1/0,l=-1/0;for(let h=t*6,f=(t+e)*6;h<f;h+=6){let u=r[h+0];u<i&&(i=u),u>o&&(o=u);let m=r[h+2];m<s&&(s=m),m>c&&(c=m);let x=r[h+4];x<a&&(a=x),x>l&&(l=x)}n[0]=i,n[1]=s,n[2]=a,n[3]=o,n[4]=c,n[5]=l}function Ap(r,t,e,n,i){let s=e,a=e+n-1,o=i.pos,c=i.axis*2;for(;;){for(;s<=a&&t[s*6+c]<o;)s++;for(;s<=a&&t[a*6+c]>=o;)a--;if(s<a){for(let l=0;l<3;l++){let h=r[s*3+l];r[s*3+l]=r[a*3+l],r[a*3+l]=h;let f=t[s*6+l*2+0];t[s*6+l*2+0]=t[a*6+l*2+0],t[a*6+l*2+0]=f;let u=t[s*6+l*2+1];t[s*6+l*2+1]=t[a*6+l*2+1],t[a*6+l*2+1]=u}s++,a--}else return s}}var an=32,Ep=(r,t)=>r.candidate-t.candidate,xn=new Array(an).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Ds=new Float32Array(6);function Cp(r,t,e,n,i,s){let a=-1,o=0;if(s===0)a=lo(t),a!==-1&&(o=(t[a]+t[a+3])/2);else if(s===1)a=lo(r),a!==-1&&(o=Pp(e,n,i,a));else if(s===2){let c=gi(r),l=1.25*i,h=n*6,f=(n+i)*6;for(let u=0;u<3;u++){let m=t[u],d=(t[u+3]-m)/an;if(i<an/4){let g=[...xn];g.length=i;let M=0;for(let v=h;v<f;v+=6,M++){let b=g[M];b.candidate=e[v+2*u],b.count=0;let{bounds:A,leftCacheBounds:C,rightCacheBounds:y}=b;for(let S=0;S<3;S++)y[S]=1/0,y[S+3]=-1/0,C[S]=1/0,C[S+3]=-1/0,A[S]=1/0,A[S+3]=-1/0;Hi(v,e,A)}g.sort(Ep);let _=i;for(let v=0;v<_;v++){let b=g[v];for(;v+1<_&&g[v+1].candidate===b.candidate;)g.splice(v+1,1),_--}for(let v=h;v<f;v+=6){let b=e[v+2*u];for(let A=0;A<_;A++){let C=g[A];b>=C.candidate?Hi(v,e,C.rightCacheBounds):(Hi(v,e,C.leftCacheBounds),C.count++)}}for(let v=0;v<_;v++){let b=g[v],A=b.count,C=i-b.count,y=b.leftCacheBounds,S=b.rightCacheBounds,P=0;A!==0&&(P=gi(y)/c);let O=0;C!==0&&(O=gi(S)/c);let B=1+1.25*(P*A+O*C);B<l&&(a=u,l=B,o=b.candidate)}}else{for(let _=0;_<an;_++){let v=xn[_];v.count=0,v.candidate=m+d+_*d;let b=v.bounds;for(let A=0;A<3;A++)b[A]=1/0,b[A+3]=-1/0}for(let _=h;_<f;_+=6){let A=~~((e[_+2*u]-m)/d);A>=an&&(A=an-1);let C=xn[A];C.count++,Hi(_,e,C.bounds)}let g=xn[an-1];ho(g.bounds,g.rightCacheBounds);for(let _=an-2;_>=0;_--){let v=xn[_],b=xn[_+1];uo(v.bounds,b.rightCacheBounds,v.rightCacheBounds)}let M=0;for(let _=0;_<an-1;_++){let v=xn[_],b=v.count,A=v.bounds,y=xn[_+1].rightCacheBounds;b!==0&&(M===0?ho(A,Ds):uo(A,Ds,Ds)),M+=b;let S=0,P=0;M!==0&&(S=gi(Ds)/c);let O=i-M;O!==0&&(P=gi(y)/c);let B=1+1.25*(S*M+P*O);B<l&&(a=u,l=B,o=v.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:a,pos:o}}function Pp(r,t,e,n){let i=0;for(let s=t,a=t+e;s<a;s++)i+=r[s*6+n*2];return i/e}function Rp(r,t){let e=r.attributes.position,n=r.index.array,i=n.length/3,s=new Float32Array(i*6),a=e.normalized,o=e.array,c=e.offset||0,l=3;e.isInterleavedBufferAttribute&&(l=e.data.stride);let h=["getX","getY","getZ"];for(let f=0;f<i;f++){let u=f*3,m=f*6,x,p,d;a?(x=n[u+0],p=n[u+1],d=n[u+2]):(x=n[u+0]*l+c,p=n[u+1]*l+c,d=n[u+2]*l+c);for(let g=0;g<3;g++){let M,_,v;a?(M=e[h[g]](x),_=e[h[g]](p),v=e[h[g]](d)):(M=o[x+g],_=o[p+g],v=o[d+g]);let b=M;_<b&&(b=_),v<b&&(b=v);let A=M;_>A&&(A=_),v>A&&(A=v);let C=(A-b)/2,y=g*2;s[m+y+0]=b+C,s[m+y+1]=C+(Math.abs(b)+C)*rc,b<t[g]&&(t[g]=b),A>t[g+3]&&(t[g+3]=A)}}return s}function Lp(r,t){function e(g){u&&u(g/m)}function n(g,M,_,v=null,b=0){if(!x&&b>=c&&(x=!0,l&&(console.warn(`MeshBVH: Max depth of ${c} reached when generating BVH. Consider increasing maxDepth.`),console.warn(r))),_<=h||b>=c)return e(M+_),g.offset=M,g.count=_,g;let A=Cp(g.boundingData,v,a,M,_,f);if(A.axis===-1)return e(M+_),g.offset=M,g.count=_,g;let C=Ap(o,a,M,_,A);if(C===M||C===M+_)e(M+_),g.offset=M,g.count=_;else{g.splitAxis=A.axis;let y=new Un,S=M,P=C-M;g.left=y,y.boundingData=new Float32Array(6),po(a,S,P,y.boundingData,s),n(y,S,P,s,b+1);let O=new Un,B=C,D=_-P;g.right=O,O.boundingData=new Float32Array(6),po(a,B,D,O.boundingData,s),n(O,B,D,s,b+1)}return g}wp(r,t);let i=new Float32Array(6),s=new Float32Array(6),a=Rp(r,i),o=r.index.array,c=t.maxDepth,l=t.verbose,h=t.maxLeafTris,f=t.strategy,u=t.onProgress,m=r.index.count/3,x=!1,p=[],d=Sp(r);if(d.length===1){let g=d[0],M=new Un;M.boundingData=i,Tp(a,g.offset,g.count,s),n(M,g.offset,g.count,s),p.push(M)}else for(let g of d){let M=new Un;M.boundingData=new Float32Array(6),po(a,g.offset,g.count,M.boundingData,s),n(M,g.offset,g.count,s),p.push(M)}return p}function cc(r,t){let e=Lp(r,t),n,i,s,a=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let h=0;h<e.length;h++){let f=e[h],u=c(f),m=new o(32*u);n=new Float32Array(m),i=new Uint32Array(m),s=new Uint16Array(m),l(0,f),a.push(m)}return a;function c(h){return h.count?1:1+c(h.left)+c(h.right)}function l(h,f){let u=h/4,m=h/2,x=!!f.count,p=f.boundingData;for(let d=0;d<6;d++)n[u+d]=p[d];if(x){let d=f.offset,g=f.count;return i[u+6]=d,s[m+14]=g,s[m+15]=65535,h+32}else{let d=f.left,g=f.right,M=f.splitAxis,_;if(_=l(h+32,d),_/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return i[u+6]=_/4,_=l(_,g),i[u+7]=M,_}}}var ge=class{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,e){let n=1/0,i=-1/0;for(let s=0,a=t.length;s<a;s++){let c=t[s][e];n=c<n?c:n,i=c>i?c:i}this.min=n,this.max=i}setFromPoints(t,e){let n=1/0,i=-1/0;for(let s=0,a=e.length;s<a;s++){let o=e[s],c=t.dot(o);n=c<n?c:n,i=c>i?c:i}this.min=n,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}};ge.prototype.setFromBox=function(){let r=new R;return function(e,n){let i=n.min,s=n.max,a=1/0,o=-1/0;for(let c=0;c<=1;c++)for(let l=0;l<=1;l++)for(let h=0;h<=1;h++){r.x=i.x*c+s.x*(1-c),r.y=i.y*l+s.y*(1-l),r.z=i.z*h+s.z*(1-h);let f=e.dot(r);a=Math.min(f,a),o=Math.max(f,o)}this.min=a,this.max=o}}();var Qp=function(){let r=new ge;return function(e,n){let i=e.points,s=e.satAxes,a=e.satBounds,o=n.points,c=n.satAxes,l=n.satBounds;for(let h=0;h<3;h++){let f=a[h],u=s[h];if(r.setFromPoints(u,o),f.isSeparated(r))return!1}for(let h=0;h<3;h++){let f=l[h],u=c[h];if(r.setFromPoints(u,i),f.isSeparated(r))return!1}}}();var Ip=function(){let r=new R,t=new R,e=new R;return function(i,s,a){let o=i.start,c=r,l=s.start,h=t;e.subVectors(o,l),r.subVectors(i.end,i.start),t.subVectors(s.end,s.start);let f=e.dot(h),u=h.dot(c),m=h.dot(h),x=e.dot(c),d=c.dot(c)*m-u*u,g,M;d!==0?g=(f*u-x*m)/d:g=0,M=(f+g*u)/m,a.x=g,a.y=M}}(),Wi=function(){let r=new At,t=new R,e=new R;return function(i,s,a,o){Ip(i,s,r);let c=r.x,l=r.y;if(c>=0&&c<=1&&l>=0&&l<=1){i.at(c,a),s.at(l,o);return}else if(c>=0&&c<=1){l<0?s.at(0,o):s.at(1,o),i.closestPointToPoint(o,!0,a);return}else if(l>=0&&l<=1){c<0?i.at(0,a):i.at(1,a),s.closestPointToPoint(a,!0,o);return}else{let h;c<0?h=i.start:h=i.end;let f;l<0?f=s.start:f=s.end;let u=t,m=e;if(i.closestPointToPoint(f,!0,t),s.closestPointToPoint(h,!0,e),u.distanceToSquared(f)<=m.distanceToSquared(h)){a.copy(u),o.copy(f);return}else{a.copy(h),o.copy(m);return}}}}(),lc=function(){let r=new R,t=new R,e=new Te,n=new me;return function(s,a){let{radius:o,center:c}=s,{a:l,b:h,c:f}=a;if(n.start=l,n.end=h,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o||(n.start=l,n.end=f,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o)||(n.start=h,n.end=f,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o))return!0;let p=a.getPlane(e);if(Math.abs(p.distanceToPoint(c))<=o){let g=p.projectPoint(c,t);if(a.containsPoint(g))return!0}return!1}}();var Dp=1e-15;function xi(r){return Math.abs(r)<Dp}var xe=class extends ie{constructor(...t){super(...t),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new R),this.satBounds=new Array(4).fill().map(()=>new ge),this.points=[this.a,this.b,this.c],this.sphere=new Fn,this.plane=new Te,this.needsUpdate=!0}intersectsSphere(t){return lc(t,this)}update(){let t=this.a,e=this.b,n=this.c,i=this.points,s=this.satAxes,a=this.satBounds,o=s[0],c=a[0];this.getNormal(o),c.setFromPoints(o,i);let l=s[1],h=a[1];l.subVectors(t,e),h.setFromPoints(l,i);let f=s[2],u=a[2];f.subVectors(e,n),u.setFromPoints(f,i);let m=s[3],x=a[3];m.subVectors(n,t),x.setFromPoints(m,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,t),this.needsUpdate=!1}};xe.prototype.closestPointToSegment=function(){let r=new R,t=new R,e=new me;return function(i,s=null,a=null){let{start:o,end:c}=i,l=this.points,h,f=1/0;for(let u=0;u<3;u++){let m=(u+1)%3;e.start.copy(l[u]),e.end.copy(l[m]),Wi(e,i,r,t),h=r.distanceToSquared(t),h<f&&(f=h,s&&s.copy(r),a&&a.copy(t))}return this.closestPointToPoint(o,r),h=o.distanceToSquared(r),h<f&&(f=h,s&&s.copy(r),a&&a.copy(o)),this.closestPointToPoint(c,r),h=c.distanceToSquared(r),h<f&&(f=h,s&&s.copy(r),a&&a.copy(c)),Math.sqrt(f)}}();xe.prototype.intersectsTriangle=function(){let r=new xe,t=new Array(3),e=new Array(3),n=new ge,i=new ge,s=new R,a=new R,o=new R,c=new R,l=new me,h=new me,f=new me;return function(m,x=null,p=!1){this.needsUpdate&&this.update(),m.isExtendedTriangle?m.needsUpdate&&m.update():(r.copy(m),r.update(),m=r);let d=this.plane,g=m.plane;if(Math.abs(d.normal.dot(g.normal))>1-1e-10){let M=this.satBounds,_=this.satAxes;e[0]=m.a,e[1]=m.b,e[2]=m.c;for(let A=0;A<4;A++){let C=M[A],y=_[A];if(n.setFromPoints(y,e),C.isSeparated(n))return!1}let v=m.satBounds,b=m.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let A=0;A<4;A++){let C=v[A],y=b[A];if(n.setFromPoints(y,t),C.isSeparated(n))return!1}for(let A=0;A<4;A++){let C=_[A];for(let y=0;y<4;y++){let S=b[y];if(s.crossVectors(C,S),n.setFromPoints(s,t),i.setFromPoints(s,e),n.isSeparated(i))return!1}}return x&&(p||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),x.start.set(0,0,0),x.end.set(0,0,0)),!0}else{let M=this.points,_=!1,v=0;for(let I=0;I<3;I++){let k=M[I],Y=M[(I+1)%3];l.start.copy(k),l.end.copy(Y),l.delta(a);let Z=_?h.start:h.end,H=xi(g.distanceToPoint(k));if(xi(g.normal.dot(a))&&H){h.copy(l),v=2;break}if((g.intersectLine(l,Z)||H)&&!xi(Z.distanceTo(Y))){if(v++,_)break;_=!0}}if(v===1&&m.containsPoint(h.end))return x&&(x.start.copy(h.end),x.end.copy(h.end)),!0;if(v!==2)return!1;let b=m.points,A=!1,C=0;for(let I=0;I<3;I++){let k=b[I],Y=b[(I+1)%3];l.start.copy(k),l.end.copy(Y),l.delta(o);let Z=A?f.start:f.end,H=xi(d.distanceToPoint(k));if(xi(d.normal.dot(o))&&H){f.copy(l),C=2;break}if((d.intersectLine(l,Z)||H)&&!xi(Z.distanceTo(Y))){if(C++,A)break;A=!0}}if(C===1&&this.containsPoint(f.end))return x&&(x.start.copy(f.end),x.end.copy(f.end)),!0;if(C!==2)return!1;if(h.delta(a),f.delta(o),a.dot(o)<0){let I=f.start;f.start=f.end,f.end=I}let y=h.start.dot(a),S=h.end.dot(a),P=f.start.dot(a),O=f.end.dot(a),B=S<P,D=y<O;return y!==O&&P!==S&&B===D?!1:(x&&(c.subVectors(h.start,f.start),c.dot(a)>0?x.start.copy(h.start):x.start.copy(f.start),c.subVectors(h.end,f.end),c.dot(a)<0?x.end.copy(h.end):x.end.copy(f.end)),!0)}}}();xe.prototype.distanceToPoint=function(){let r=new R;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}();xe.prototype.distanceToTriangle=function(){let r=new R,t=new R,e=["a","b","c"],n=new me,i=new me;return function(a,o=null,c=null){let l=o||c?n:null;if(this.intersectsTriangle(a,l))return(o||c)&&(o&&l.getCenter(o),c&&l.getCenter(c)),0;let h=1/0;for(let f=0;f<3;f++){let u,m=e[f],x=a[m];this.closestPointToPoint(x,r),u=x.distanceToSquared(r),u<h&&(h=u,o&&o.copy(r),c&&c.copy(x));let p=this[m];a.closestPointToPoint(p,r),u=p.distanceToSquared(r),u<h&&(h=u,o&&o.copy(p),c&&c.copy(r))}for(let f=0;f<3;f++){let u=e[f],m=e[(f+1)%3];n.set(this[u],this[m]);for(let x=0;x<3;x++){let p=e[x],d=e[(x+1)%3];i.set(a[p],a[d]),Wi(n,i,r,t);let g=r.distanceToSquared(t);g<h&&(h=g,o&&o.copy(r),c&&c.copy(t))}}return Math.sqrt(h)}}();var _e=class{constructor(t,e,n){this.isOrientedBox=!0,this.min=new R,this.max=new R,this.matrix=new zt,this.invMatrix=new zt,this.points=new Array(8).fill().map(()=>new R),this.satAxes=new Array(3).fill().map(()=>new R),this.satBounds=new Array(3).fill().map(()=>new ge),this.alignedSatBounds=new Array(3).fill().map(()=>new ge),this.needsUpdate=!1,t&&this.min.copy(t),e&&this.max.copy(e),n&&this.matrix.copy(n)}set(t,e,n){this.min.copy(t),this.max.copy(e),this.matrix.copy(n),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}};_e.prototype.update=function(){return function(){let t=this.matrix,e=this.min,n=this.max,i=this.points;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let f=0;f<=1;f++){let u=1*l|2*h|4*f,m=i[u];m.x=l?n.x:e.x,m.y=h?n.y:e.y,m.z=f?n.z:e.z,m.applyMatrix4(t)}let s=this.satBounds,a=this.satAxes,o=i[0];for(let l=0;l<3;l++){let h=a[l],f=s[l],u=1<<l,m=i[u];h.subVectors(o,m),f.setFromPoints(h,i)}let c=this.alignedSatBounds;c[0].setFromPointsField(i,"x"),c[1].setFromPointsField(i,"y"),c[2].setFromPointsField(i,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}();_e.prototype.intersectsBox=function(){let r=new ge;return function(e){this.needsUpdate&&this.update();let n=e.min,i=e.max,s=this.satBounds,a=this.satAxes,o=this.alignedSatBounds;if(r.min=n.x,r.max=i.x,o[0].isSeparated(r)||(r.min=n.y,r.max=i.y,o[1].isSeparated(r))||(r.min=n.z,r.max=i.z,o[2].isSeparated(r)))return!1;for(let c=0;c<3;c++){let l=a[c],h=s[c];if(r.setFromBox(l,e),h.isSeparated(r))return!1}return!0}}();_e.prototype.intersectsTriangle=function(){let r=new xe,t=new Array(3),e=new ge,n=new ge,i=new R;return function(a){this.needsUpdate&&this.update(),a.isExtendedTriangle?a.needsUpdate&&a.update():(r.copy(a),r.update(),a=r);let o=this.satBounds,c=this.satAxes;t[0]=a.a,t[1]=a.b,t[2]=a.c;for(let u=0;u<3;u++){let m=o[u],x=c[u];if(e.setFromPoints(x,t),m.isSeparated(e))return!1}let l=a.satBounds,h=a.satAxes,f=this.points;for(let u=0;u<3;u++){let m=l[u],x=h[u];if(e.setFromPoints(x,f),m.isSeparated(e))return!1}for(let u=0;u<3;u++){let m=c[u];for(let x=0;x<4;x++){let p=h[x];if(i.crossVectors(m,p),e.setFromPoints(i,t),n.setFromPoints(i,f),e.isSeparated(n))return!1}}return!0}}();_e.prototype.closestPointToPoint=function(){return function(t,e){return this.needsUpdate&&this.update(),e.copy(t).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}();_e.prototype.distanceToPoint=function(){let r=new R;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}();_e.prototype.distanceToBox=function(){let r=["x","y","z"],t=new Array(12).fill().map(()=>new me),e=new Array(12).fill().map(()=>new me),n=new R,i=new R;return function(a,o=0,c=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(a))return(c||l)&&(a.getCenter(i),this.closestPointToPoint(i,n),a.closestPointToPoint(n,i),c&&c.copy(n),l&&l.copy(i)),0;let h=o*o,f=a.min,u=a.max,m=this.points,x=1/0;for(let d=0;d<8;d++){let g=m[d];i.copy(g).clamp(f,u);let M=g.distanceToSquared(i);if(M<x&&(x=M,c&&c.copy(g),l&&l.copy(i),M<h))return Math.sqrt(M)}let p=0;for(let d=0;d<3;d++)for(let g=0;g<=1;g++)for(let M=0;M<=1;M++){let _=(d+1)%3,v=(d+2)%3,b=g<<_|M<<v,A=1<<d|g<<_|M<<v,C=m[b],y=m[A];t[p].set(C,y);let P=r[d],O=r[_],B=r[v],D=e[p],I=D.start,k=D.end;I[P]=f[P],I[O]=g?f[O]:u[O],I[B]=M?f[B]:u[O],k[P]=u[P],k[O]=g?f[O]:u[O],k[B]=M?f[B]:u[O],p++}for(let d=0;d<=1;d++)for(let g=0;g<=1;g++)for(let M=0;M<=1;M++){i.x=d?u.x:f.x,i.y=g?u.y:f.y,i.z=M?u.z:f.z,this.closestPointToPoint(i,n);let _=i.distanceToSquared(n);if(_<x&&(x=_,c&&c.copy(n),l&&l.copy(i),_<h))return Math.sqrt(_)}for(let d=0;d<12;d++){let g=t[d];for(let M=0;M<12;M++){let _=e[M];Wi(g,_,n,i);let v=n.distanceToSquared(i);if(v<x&&(x=v,c&&c.copy(n),l&&l.copy(i),v<h))return Math.sqrt(v)}}return Math.sqrt(x)}}();var Fs=new R,zs=new R,Os=new R,hc=new At,uc=new At,fc=new At,dc=new R;function Np(r,t,e,n,i,s){let a;return s===he?a=r.intersectTriangle(n,e,t,!0,i):a=r.intersectTriangle(t,e,n,s!==We,i),a===null?null:{distance:r.origin.distanceTo(i),point:i.clone()}}function Fp(r,t,e,n,i,s,a){Fs.fromBufferAttribute(t,n),zs.fromBufferAttribute(t,i),Os.fromBufferAttribute(t,s);let o=Np(r,Fs,zs,Os,dc,a);if(o){e&&(hc.fromBufferAttribute(e,n),uc.fromBufferAttribute(e,i),fc.fromBufferAttribute(e,s),o.uv=ie.getUV(dc,Fs,zs,Os,hc,uc,fc,new At));let c={a:n,b:i,c:s,normal:new R,materialIndex:0};ie.getNormal(Fs,zs,Os,c.normal),o.face=c,o.faceIndex=n}return o}function go(r,t,e,n,i){let s=n*3,a=r.index.getX(s),o=r.index.getX(s+1),c=r.index.getX(s+2),l=Fp(e,r.attributes.position,r.attributes.uv,a,o,c,t);return l?(l.faceIndex=n,i&&i.push(l),l):null}function pc(r,t,e,n,i,s){for(let a=n,o=n+i;a<o;a++)go(r,t,e,a,s)}function mc(r,t,e,n,i){let s=1/0,a=null;for(let o=n,c=n+i;o<c;o++){let l=go(r,t,e,o);l&&l.distance<s&&(a=l,s=l.distance)}return a}function Ie(r,t,e,n){let i=r.a,s=r.b,a=r.c,o=t,c=t+1,l=t+2;e&&(o=e.getX(t),c=e.getX(t+1),l=e.getX(t+2)),i.x=n.getX(o),i.y=n.getY(o),i.z=n.getZ(o),s.x=n.getX(c),s.y=n.getY(c),s.z=n.getZ(c),a.x=n.getX(l),a.y=n.getY(l),a.z=n.getZ(l)}function xo(r,t,e,n,i,s,a){let o=e.index,c=e.attributes.position;for(let l=r,h=t+r;l<h;l++)if(Ie(a,l*3,o,c),a.needsUpdate=!0,n(a,l,i,s))return!0;return!1}var _i=class{constructor(t){this._getNewPrimitive=t,this._primitives=[]}getPrimitive(){let t=this._primitives;return t.length===0?this._getNewPrimitive():t.pop()}releasePrimitive(t){this._primitives.push(t)}};function cn(r,t){return t[r+15]===65535}function kn(r,t){return t[r+6]}function yi(r,t){return t[r+14]}function vi(r){return r+8}function Mi(r,t){return t[r+6]}function gc(r,t){return t[r+7]}var bi=new fe,Us=new R,Op=["x","y","z"];function ks(r,t,e,n,i){let s=r*2,a=wi,o=_n,c=yn;if(cn(s,o)){let h=kn(r,c),f=yi(s,o);pc(t,e,n,h,f,i)}else{let h=vi(r);Gs(h,a,n,Us)&&ks(h,t,e,n,i);let f=Mi(r,c);Gs(f,a,n,Us)&&ks(f,t,e,n,i)}}function Vs(r,t,e,n){let i=r*2,s=wi,a=_n,o=yn;if(cn(i,a)){let l=kn(r,o),h=yi(i,a);return mc(t,e,n,l,h)}else{let l=gc(r,o),h=Op[l],u=n.direction[h]>=0,m,x;u?(m=vi(r),x=Mi(r,o)):(m=Mi(r,o),x=vi(r));let d=Gs(m,s,n,Us)?Vs(m,t,e,n):null;if(d){let _=d.point[h];if(u?_<=s[x+l]:_>=s[x+l+3])return d}let M=Gs(x,s,n,Us)?Vs(x,t,e,n):null;return d&&M?d.distance<=M.distance?d:M:d||M||null}}var xc=function(){let r,t,e=[],n=new _i(()=>new fe);return function(...a){r=n.getPrimitive(),t=n.getPrimitive(),e.push(r,t);let o=i(...a);n.releasePrimitive(r),n.releasePrimitive(t),e.pop(),e.pop();let c=e.length;return c>0&&(t=e[c-1],r=e[c-2]),o};function i(s,a,o,c,l=null,h=0,f=0){function u(_){let v=_*2,b=_n,A=yn;for(;!cn(v,b);)_=vi(_),v=_*2;return kn(_,A)}function m(_){let v=_*2,b=_n,A=yn;for(;!cn(v,b);)_=Mi(_,A),v=_*2;return kn(_,A)+yi(v,b)}let x=s*2,p=wi,d=_n,g=yn;if(cn(x,d)){let _=kn(s,g),v=yi(x,d);return Le(s,p,r),c(_,v,!1,f,h+s,r)}else{let _=vi(s),v=Mi(s,g),b=_,A=v,C,y,S,P;if(l&&(S=r,P=t,Le(b,p,S),Le(A,p,P),C=l(S),y=l(P),y<C)){b=v,A=_;let Z=C;C=y,y=Z,S=P}S||(S=r,Le(b,p,S));let O=cn(b*2,d),B=o(S,O,C,f+1,h+b),D;if(B===2){let Z=u(b),$=m(b)-Z;D=c(Z,$,!0,f+1,h+b,S)}else D=B&&i(b,a,o,c,l,h,f+1);if(D)return!0;P=t,Le(A,p,P);let I=cn(A*2,d),k=o(P,I,y,f+1,h+A),Y;if(k===2){let Z=u(A),$=m(A)-Z;Y=c(Z,$,!0,f+1,h+A,P)}else Y=k&&i(A,a,o,c,l,h,f+1);return!!Y}}}(),_c=function(){let r=new xe,t=new xe,e=new zt,n=new _e,i=new _e;return function s(a,o,c,l,h=null){let f=a*2,u=wi,m=_n,x=yn;if(h===null&&(c.boundingBox||c.computeBoundingBox(),n.set(c.boundingBox.min,c.boundingBox.max,l),h=n),cn(f,m)){let d=o,g=d.index,M=d.attributes.position,_=c.index,v=c.attributes.position,b=kn(a,x),A=yi(f,m);if(e.copy(l).invert(),c.boundsTree)return Le(a,u,i),i.matrix.copy(e),i.needsUpdate=!0,c.boundsTree.shapecast({intersectsBounds:y=>i.intersectsBox(y),intersectsTriangle:y=>{y.a.applyMatrix4(l),y.b.applyMatrix4(l),y.c.applyMatrix4(l),y.needsUpdate=!0;for(let S=b*3,P=(A+b)*3;S<P;S+=3)if(Ie(t,S,g,M),t.needsUpdate=!0,y.intersectsTriangle(t))return!0;return!1}});for(let C=b*3,y=A+b*3;C<y;C+=3){Ie(r,C,g,M),r.a.applyMatrix4(e),r.b.applyMatrix4(e),r.c.applyMatrix4(e),r.needsUpdate=!0;for(let S=0,P=_.count;S<P;S+=3)if(Ie(t,S,_,v),t.needsUpdate=!0,r.intersectsTriangle(t))return!0}}else{let d=a+8,g=x[a+6];return Le(d,u,bi),!!(h.intersectsBox(bi)&&s(d,o,c,l,h)||(Le(g,u,bi),h.intersectsBox(bi)&&s(g,o,c,l,h)))}}}();function Gs(r,t,e,n){return Le(r,t,bi),e.intersectBox(bi,n)}var _o=[],Bs,wi,_n,yn;function Si(r){Bs&&_o.push(Bs),Bs=r,wi=new Float32Array(r),_n=new Uint16Array(r),yn=new Uint32Array(r)}function qi(){Bs=null,wi=null,_n=null,yn=null,_o.length&&Si(_o.pop())}var yo=Symbol("skip tree generation"),vo=new fe,Mo=new fe,Ti=new zt,Vn=new _e,Xi=new _e,Yi=new R,Hs=new R,Bp=new R,Up=new R,kp=new R,yc=new fe,Xe=new _i(()=>new xe),Ye=class{static serialize(t,e={}){if(e.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),Ye.serialize(arguments[0],{cloneBuffers:arguments[2]===void 0?!0:arguments[2]});e=Zi({cloneBuffers:!0},e);let n=t.geometry,i=t._roots,s=n.getIndex(),a;return e.cloneBuffers?a={roots:i.map(o=>o.slice()),index:s.array.slice()}:a={roots:i,index:s.array},a}static deserialize(t,e,n={}){if(typeof n=="boolean")return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),Ye.deserialize(arguments[0],arguments[1],{setIndex:arguments[2]===void 0?!0:arguments[2]});n=Zi({setIndex:!0},n);let{index:i,roots:s}=t,a=new Ye(e,Co(Zi({},n),{[yo]:!0}));if(a._roots=s,n.setIndex){let o=e.getIndex();if(o===null){let c=new Yt(t.index,1,!1);e.setIndex(c)}else o.array!==i&&(o.array.set(i),o.needsUpdate=!0)}return a}constructor(t,e={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e=Object.assign({strategy:0,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[yo]:!1},e),e.useSharedArrayBuffer&&typeof SharedArrayBuffer=="undefined")throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,e[yo]||(this._roots=cc(t,e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new fe))),this.geometry=t}refit(t=null){t&&Array.isArray(t)&&(t=new Set(t));let e=this.geometry,n=e.index.array,i=e.attributes.position,s,a,o,c,l=0,h=this._roots;for(let u=0,m=h.length;u<m;u++)s=h[u],a=new Uint32Array(s),o=new Uint16Array(s),c=new Float32Array(s),f(0,l),l+=s.byteLength;function f(u,m,x=!1){let p=u*2;if(o[p+15]===65535){let g=a[u+6],M=o[p+14],_=1/0,v=1/0,b=1/0,A=-1/0,C=-1/0,y=-1/0;for(let S=3*g,P=3*(g+M);S<P;S++){let O=n[S],B=i.getX(O),D=i.getY(O),I=i.getZ(O);B<_&&(_=B),B>A&&(A=B),D<v&&(v=D),D>C&&(C=D),I<b&&(b=I),I>y&&(y=I)}return c[u+0]!==_||c[u+1]!==v||c[u+2]!==b||c[u+3]!==A||c[u+4]!==C||c[u+5]!==y?(c[u+0]=_,c[u+1]=v,c[u+2]=b,c[u+3]=A,c[u+4]=C,c[u+5]=y,!0):!1}else{let g=u+8,M=a[u+6],_=g+m,v=M+m,b=x,A=!1,C=!1;t?b||(A=t.has(_),C=t.has(v),b=!A&&!C):(A=!0,C=!0);let y=b||A,S=b||C,P=!1;y&&(P=f(g,m,b));let O=!1;S&&(O=f(M,m,b));let B=P||O;if(B)for(let D=0;D<3;D++){let I=g+D,k=M+D,Y=c[I],Z=c[I+3],H=c[k],$=c[k+3];c[u+D]=Y<H?Y:H,c[u+D+3]=Z>$?Z:$}return B}}}traverse(t,e=0){let n=this._roots[e],i=new Uint32Array(n),s=new Uint16Array(n);a(0);function a(o,c=0){let l=o*2,h=s[l+15]===65535;if(h){let f=i[o+6],u=s[l+14];t(c,h,new Float32Array(n,o*4,6),f,u)}else{let f=o+32/4,u=i[o+6],m=i[o+7];t(c,h,new Float32Array(n,o*4,6),m)||(a(f,c+1),a(u,c+1))}}}raycast(t,e=Ue){let n=this._roots,i=this.geometry,s=[],a=e.isMaterial,o=Array.isArray(e),c=i.groups,l=a?e.side:e;for(let h=0,f=n.length;h<f;h++){let u=o?e[c[h].materialIndex].side:l,m=s.length;if(Si(n[h]),ks(0,i,u,t,s),qi(),o){let x=c[h].materialIndex;for(let p=m,d=s.length;p<d;p++)s[p].face.materialIndex=x}}return s}raycastFirst(t,e=Ue){let n=this._roots,i=this.geometry,s=e.isMaterial,a=Array.isArray(e),o=null,c=i.groups,l=s?e.side:e;for(let h=0,f=n.length;h<f;h++){let u=a?e[c[h].materialIndex].side:l;Si(n[h]);let m=Vs(0,i,u,t);qi(),m!=null&&(o==null||m.distance<o.distance)&&(o=m,a&&(m.face.materialIndex=c[h].materialIndex))}return o}intersectsGeometry(t,e){let n=this.geometry,i=!1;for(let s of this._roots)if(Si(s),i=_c(0,n,t,e),qi(),i)break;return i}shapecast(t,e,n){let i=this.geometry;if(t instanceof Function){if(e){let u=e;e=(m,x,p,d)=>{let g=x*3;return u(m,g,g+1,g+2,p,d)}}t={boundsTraverseOrder:n,intersectsBounds:t,intersectsTriangle:e,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}let s=Xe.getPrimitive(),{boundsTraverseOrder:a,intersectsBounds:o,intersectsRange:c,intersectsTriangle:l}=t;if(c&&l){let u=c;c=(m,x,p,d,g)=>u(m,x,p,d,g)?!0:xo(m,x,i,l,p,d,s)}else c||(l?c=(u,m,x,p)=>xo(u,m,i,l,x,p,s):c=(u,m,x)=>x);let h=!1,f=0;for(let u of this._roots){if(Si(u),h=xc(0,i,o,c,a,f),qi(),h)break;f+=u.byteLength}return Xe.releasePrimitive(s),h}bvhcast(t,e,n){let{intersectsRanges:i,intersectsTriangles:s}=n,a=this.geometry.index,o=this.geometry.attributes.position,c=t.geometry.index,l=t.geometry.attributes.position;Ti.copy(e).invert();let h=Xe.getPrimitive(),f=Xe.getPrimitive();if(s){let m=function(x,p,d,g,M,_,v,b){for(let A=d,C=d+g;A<C;A++){Ie(f,A*3,c,l),f.a.applyMatrix4(e),f.b.applyMatrix4(e),f.c.applyMatrix4(e),f.needsUpdate=!0;for(let y=x,S=x+p;y<S;y++)if(Ie(h,y*3,a,o),h.needsUpdate=!0,s(h,f,y,A,M,_,v,b))return!0}return!1};if(i){let x=i;i=function(p,d,g,M,_,v,b,A){return x(p,d,g,M,_,v,b,A)?!0:m(p,d,g,M,_,v,b,A)}}else i=m}t.getBoundingBox(Mo),Mo.applyMatrix4(e);let u=this.shapecast({intersectsBounds:m=>Mo.intersectsBox(m),intersectsRange:(m,x,p,d,g,M)=>(vo.copy(M),vo.applyMatrix4(Ti),t.shapecast({intersectsBounds:_=>vo.intersectsBox(_),intersectsRange:(_,v,b,A,C)=>i(m,x,_,v,d,g,A,C)}))});return Xe.releasePrimitive(h),Xe.releasePrimitive(f),u}intersectsBox(t,e){return Vn.set(t.min,t.max,e),Vn.needsUpdate=!0,this.shapecast({intersectsBounds:n=>Vn.intersectsBox(n),intersectsTriangle:n=>Vn.intersectsTriangle(n)})}intersectsSphere(t){return this.shapecast({intersectsBounds:e=>t.intersectsBox(e),intersectsTriangle:e=>e.intersectsSphere(t)})}closestPointToGeometry(t,e,n={},i={},s=0,a=1/0){t.boundingBox||t.computeBoundingBox(),Vn.set(t.boundingBox.min,t.boundingBox.max,e),Vn.needsUpdate=!0;let o=this.geometry,c=o.attributes.position,l=o.index,h=t.attributes.position,f=t.index,u=Xe.getPrimitive(),m=Xe.getPrimitive(),x=Hs,p=Bp,d=null,g=null;i&&(d=Up,g=kp);let M=1/0,_=null,v=null;return Ti.copy(e).invert(),Xi.matrix.copy(Ti),this.shapecast({boundsTraverseOrder:b=>Vn.distanceToBox(b),intersectsBounds:(b,A,C)=>C<M&&C<a?(A&&(Xi.min.copy(b.min),Xi.max.copy(b.max),Xi.needsUpdate=!0),!0):!1,intersectsRange:(b,A)=>{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:C=>Xi.distanceToBox(C),intersectsBounds:(C,y,S)=>S<M&&S<a,intersectsRange:(C,y)=>{for(let S=C*3,P=(C+y)*3;S<P;S+=3){Ie(m,S,f,h),m.a.applyMatrix4(e),m.b.applyMatrix4(e),m.c.applyMatrix4(e),m.needsUpdate=!0;for(let O=b*3,B=(b+A)*3;O<B;O+=3){Ie(u,O,l,c),u.needsUpdate=!0;let D=u.distanceToTriangle(m,x,d);if(D<M&&(p.copy(x),g&&g.copy(d),M=D,_=O/3,v=S/3),D<s)return!0}}}});{let C=f?f.count:h.count;for(let y=0,S=C;y<S;y+=3){Ie(m,y,f,h),m.a.applyMatrix4(e),m.b.applyMatrix4(e),m.c.applyMatrix4(e),m.needsUpdate=!0;for(let P=b*3,O=(b+A)*3;P<O;P+=3){Ie(u,P,l,c),u.needsUpdate=!0;let B=u.distanceToTriangle(m,x,d);if(B<M&&(p.copy(x),g&&g.copy(d),M=B,_=P/3,v=y/3),B<s)return!0}}}}}),Xe.releasePrimitive(u),Xe.releasePrimitive(m),M===1/0?null:(n.point?n.point.copy(p):n.point=p.clone(),n.distance=M,n.faceIndex=_,i&&(i.point?i.point.copy(g):i.point=g.clone(),i.point.applyMatrix4(Ti),p.applyMatrix4(Ti),i.distance=p.sub(i.point).length(),i.faceIndex=v),n)}closestPointToPoint(t,e={},n=0,i=1/0){let s=n*n,a=i*i,o=1/0,c=null;if(this.shapecast({boundsTraverseOrder:h=>(Yi.copy(t).clamp(h.min,h.max),Yi.distanceToSquared(t)),intersectsBounds:(h,f,u)=>u<o&&u<a,intersectsTriangle:(h,f)=>{h.closestPointToPoint(t,Yi);let u=t.distanceToSquared(Yi);return u<o&&(Hs.copy(Yi),o=u,c=f),u<s}}),o===1/0)return null;let l=Math.sqrt(o);return e.point?e.point.copy(Hs):e.point=Hs.clone(),e.distance=l,e.faceIndex=c,e}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(n=>{Le(0,new Float32Array(n),yc),t.union(yc)}),t}};var bo=self;bo.addEventListener("message",async function({data:r}){let t=performance.now();function e(o){let c=performance.now();(c-t>=10||o===1)&&(postMessage({error:void 0,serialized:void 0,position:void 0,progress:o}),t=c)}let{id:n,index:i,position:s,options:a}=r;try{let o=new ke;if(o.setAttribute("position",new Yt(s,3,!1)),i&&o.setIndex(new Yt(i,1,!1)),a.includedProgressCallback&&(a.onProgress=e),a.groups){let h=a.groups;for(let f in h){let u=h[f];o.addGroup(u.start,u.count,u.materialIndex)}}let c=new Ye(o,a),l=Ye.serialize(c,{cloneBuffers:!1});bo.postMessage({id:n,error:void 0,serialized:l,position:s,progress:1},[l.index.buffer,s.buffer,...l.roots])}catch(o){bo.postMessage({id:n,error:o,serialized:void 0,position:void 0,progress:1})}});\n/*! Bundled license information:\n\nthree/build/three.module.js:\n (**\n * @license\n * Copyright 2010-2023 Three.js Authors\n * SPDX-License-Identifier: MIT\n *)\n*/\n')}var sA=class{constructor(){this.running=!1,this.worker=new Ek,this.worker.onerror=e=>{throw e.message?new Error(`[GenerateMeshBVHWorker] Could not create Web Worker with error "${e.message}"`):new Error("[GenerateMeshBVHWorker] Could not create Web Worker.")}}isRunning(){return this.running}generate(e,t={}){if(this.running)return void re.warn("[GenerateMeshBVHWorker] Already running job.");if(!this.worker)return void re.warn("[GenerateMeshBVHWorker] Worker has been disposed.");let{worker:i}=this;this.running=!0;let r=new Map;e.forEach((e=>{r.set(e.id,e)}));let n=0;return new Promise(((e,s)=>{let a=()=>{++n===r.size&&(this.running=!1,i.onmessage=null,e())};i.onerror=e=>{re.warn(`[GenerateMeshBVHWorker] ${e.message}`),s(new Error(`[GenerateMeshBVHWorker] ${e.message}`)),this.running=!1},i.onmessage=e=>{this.running=!1;let{data:i}=e;if(i.error)re.warn(i.error),a();else if(i.serialized){let{serialized:e,position:n,id:s}=i,o=r.get(s),l=Wc.deserialize(e,o,{setIndex:!1}),h=Object.assign({setBoundingBox:!0},t);if(h.transferred&&(o.attributes.position.array=n),o.index)t.saveOriginalIndex&&!o.userData.originalIndex&&(o.userData.originalIndex=o.index.array),re.debug("before update, index:",o.index.array),o.index.array=e.index;else{let t=new Wt(e.index,1,!1);o.setIndex(t)}o.index&&(re.debug("after update, index:",o.index.array),o.index.needsUpdate=!0),h.setBoundingBox&&!o.boundingBox&&(o.boundingBox=l.getBoundingBox(new Rt)),o.boundsTree=l,a()}else t.onProgress&&t.onProgress(i.progress)};for(let n of r){let e=n[0],r=n[1],s=r.index?r.index.array:void 0,o=r.attributes.position,l=o.array;if(o.isInterleavedBufferAttribute||s&&s.isInterleavedBufferAttribute){re.warn("[GenerateMeshBVHWorker] InterleavedBufferAttribute are not supported for the geometry attributes."),a();continue}let h=[];t.transferred&&(h.push(l),s&&(h.push(s),t.saveOriginalIndex&&(r.userData.originalIndex=s.slice()))),i.postMessage({id:e,index:s,position:l,options:Ln(Mr({},t),{onProgress:null,includedProgressCallback:Boolean(t.onProgress),groups:[...r.groups]})},h.length>0?h.map((e=>e.buffer)):[])}}))}dispose(){this.worker.terminate(),this.worker=void 0}};function Tk(){return eI('var vr="149";var co=0,Pr=1,ho=2;var Ga=1,uo=2,li=3,nn=0,ye=1,tn=2;var en=0,Gn=1,Rr=2,Lr=3,Ir=4,fo=5,Bn=100,po=101,mo=102,Dr=103,Nr=104,go=200,_o=201,xo=202,yo=203,Ha=204,Wa=205,vo=206,Mo=207,bo=208,wo=209,So=210,To=0,Ao=1,Eo=2,Gs=3,Co=4,Po=5,Ro=6,Lo=7,Xa=0,Io=1,Do=2,We=0,No=1,Fo=2,zo=3,Oo=4,Uo=5,qa=300,Xn=301,qn=302,Hs=303,Ws=304,ns=306,Xs=1e3,Pe=1001,qs=1002,ae=1003,Fr=1004;var us=1005;var Se=1006,Bo=1007;var pi=1008;var yn=1009,ko=1010,Vo=1011,Ya=1012,Go=1013,mn=1014,gn=1015,mi=1016,Ho=1017,Wo=1018,Hn=1020,Xo=1021,Re=1023,qo=1024,Yo=1025,_n=1026,Yn=1027,Zo=1028,Jo=1029,$o=1030,Ko=1031,jo=1033,ds=33776,fs=33777,ps=33778,ms=33779,zr=35840,Or=35841,Ur=35842,Br=35843,Qo=36196,kr=37492,Vr=37496,Gr=37808,Hr=37809,Wr=37810,Xr=37811,qr=37812,Yr=37813,Zr=37814,Jr=37815,$r=37816,Kr=37817,jr=37818,Qr=37819,ta=37820,ea=37821,gs=36492,tl=36283,na=36284,ia=36285,sa=36286;var ki=2300,Vi=2301,_s=2302,ra=2400,aa=2401,oa=2402;var vn=3e3,zt=3001,el=3200,nl=3201,il=0,sl=1;var Ie="srgb",gi="srgb-linear";var xs=7680;var rl=519,la=35044;var ca="300 es",Ys=1035,sn=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,t);t.target=null}}},ee=["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"],ha=1234567,ui=Math.PI/180,Gi=180/Math.PI;function jn(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ee[r&255]+ee[r>>8&255]+ee[r>>16&255]+ee[r>>24&255]+"-"+ee[t&255]+ee[t>>8&255]+"-"+ee[t>>16&15|64]+ee[t>>24&255]+"-"+ee[e&63|128]+ee[e>>8&255]+"-"+ee[e>>16&255]+ee[e>>24&255]+ee[n&255]+ee[n>>8&255]+ee[n>>16&255]+ee[n>>24&255]).toLowerCase()}function ue(r,t,e){return Math.max(t,Math.min(e,r))}function Mr(r,t){return(r%t+t)%t}function al(r,t,e,n,i){return n+(r-t)*(i-n)/(e-t)}function ol(r,t,e){return r!==t?(e-r)/(t-r):0}function di(r,t,e){return(1-e)*r+e*t}function ll(r,t,e,n){return di(r,t,1-Math.exp(-e*n))}function cl(r,t=1){return t-Math.abs(Mr(r,t*2)-t)}function hl(r,t,e){return r<=t?0:r>=e?1:(r=(r-t)/(e-t),r*r*(3-2*r))}function ul(r,t,e){return r<=t?0:r>=e?1:(r=(r-t)/(e-t),r*r*r*(r*(r*6-15)+10))}function dl(r,t){return r+Math.floor(Math.random()*(t-r+1))}function fl(r,t){return r+Math.random()*(t-r)}function pl(r){return r*(.5-Math.random())}function ml(r){r!==void 0&&(ha=r);let t=ha+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function gl(r){return r*ui}function _l(r){return r*Gi}function Zs(r){return(r&r-1)===0&&r!==0}function xl(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Hi(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function yl(r,t,e,n,i){let s=Math.cos,o=Math.sin,a=s(e/2),c=o(e/2),l=s((t+n)/2),h=o((t+n)/2),f=s((t-n)/2),u=o((t-n)/2),m=s((n-t)/2),_=o((n-t)/2);switch(i){case"XYX":r.set(a*h,c*f,c*u,a*l);break;case"YZY":r.set(c*u,a*h,c*f,a*l);break;case"ZXZ":r.set(c*f,c*u,a*h,a*l);break;case"XZX":r.set(a*h,c*_,c*m,a*l);break;case"YXY":r.set(c*m,a*h,c*_,a*l);break;case"ZYZ":r.set(c*_,c*m,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function ci(r,t){switch(t.constructor){case Float32Array:return r;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function he(r,t){switch(t.constructor){case Float32Array:return r;case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var Za=Object.freeze({__proto__:null,DEG2RAD:ui,RAD2DEG:Gi,ceilPowerOfTwo:xl,clamp:ue,damp:ll,degToRad:gl,denormalize:ci,euclideanModulo:Mr,floorPowerOfTwo:Hi,generateUUID:jn,inverseLerp:ol,isPowerOfTwo:Zs,lerp:di,mapLinear:al,normalize:he,pingpong:cl,radToDeg:_l,randFloat:fl,randFloatSpread:pl,randInt:dl,seededRandom:ml,setQuaternionFromProperEuler:yl,smootherstep:ul,smoothstep:hl}),Nt=class{constructor(t=0,e=0){Nt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*i+t.x,this.y=s*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},oe=class{constructor(){oe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,n,i,s,o,a,c,l){let h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=s,h[5]=c,h[6]=n,h[7]=o,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],c=n[6],l=n[1],h=n[4],f=n[7],u=n[2],m=n[5],_=n[8],p=i[0],d=i[3],v=i[6],T=i[1],b=i[4],M=i[7],A=i[2],C=i[5],I=i[8];return s[0]=o*p+a*T+c*A,s[3]=o*d+a*b+c*C,s[6]=o*v+a*M+c*I,s[1]=l*p+h*T+f*A,s[4]=l*d+h*b+f*C,s[7]=l*v+h*M+f*I,s[2]=u*p+m*T+_*A,s[5]=u*d+m*b+_*C,s[8]=u*v+m*M+_*I,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],l=t[7],h=t[8];return e*o*h-e*a*l-n*s*h+n*a*c+i*s*l-i*o*c}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],l=t[7],h=t[8],f=h*o-a*l,u=a*c-h*s,m=l*s-o*c,_=e*f+n*u+i*m;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/_;return t[0]=f*p,t[1]=(i*l-h*n)*p,t[2]=(a*n-i*o)*p,t[3]=u*p,t[4]=(h*e-i*c)*p,t[5]=(i*s-a*e)*p,t[6]=m*p,t[7]=(n*c-l*e)*p,t[8]=(o*e-n*s)*p,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,o,a){let c=Math.cos(s),l=Math.sin(s);return this.set(n*c,n*l,-n*(c*o+l*a)+o+t,-i*l,i*c,-i*(-l*o+c*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(ys.makeScale(t,e)),this}rotate(t){return this.premultiply(ys.makeRotation(-t)),this}translate(t,e){return this.premultiply(ys.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},ys=new oe;function Ja(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function Wi(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function xn(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Bi(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var vs={[Ie]:{[gi]:xn},[gi]:{[Ie]:Bi}},se={legacyMode:!0,get workingColorSpace(){return gi},set workingColorSpace(r){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(r,t,e){if(this.legacyMode||t===e||!t||!e)return r;if(vs[t]&&vs[t][e]!==void 0){let n=vs[t][e];return r.r=n(r.r),r.g=n(r.g),r.b=n(r.b),r}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(r,t){return this.convert(r,this.workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this.workingColorSpace)}},$a={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Wt={r:0,g:0,b:0},Ae={h:0,s:0,l:0},vi={h:0,s:0,l:0};function Ms(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}function Mi(r,t){return t.r=r.r,t.g=r.g,t.b=r.b,t}var Ot=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,e===void 0&&n===void 0?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ie){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,se.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=se.workingColorSpace){return this.r=t,this.g=e,this.b=n,se.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=se.workingColorSpace){if(t=Mr(t,1),e=ue(e,0,1),n=ue(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=Ms(o,s,t+1/3),this.g=Ms(o,s,t),this.b=Ms(o,s,t-1/3)}return se.toWorkingColorSpace(this,i),this}setStyle(t,e=Ie){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(t)){let s,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(s[1],10))/255,this.g=Math.min(255,parseInt(s[2],10))/255,this.b=Math.min(255,parseInt(s[3],10))/255,se.toWorkingColorSpace(this,e),n(s[4]),this;if(s=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(s[1],10))/100,this.g=Math.min(100,parseInt(s[2],10))/100,this.b=Math.min(100,parseInt(s[3],10))/100,se.toWorkingColorSpace(this,e),n(s[4]),this;break;case"hsl":case"hsla":if(s=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a)){let c=parseFloat(s[1])/360,l=parseFloat(s[2])/100,h=parseFloat(s[3])/100;return n(s[4]),this.setHSL(c,l,h,e)}break}}else if(i=/^\\#([A-Fa-f\\d]+)$/.exec(t)){let s=i[1],o=s.length;if(o===3)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,se.toWorkingColorSpace(this,e),this;if(o===6)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,se.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=Ie){let n=$a[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=xn(t.r),this.g=xn(t.g),this.b=xn(t.b),this}copyLinearToSRGB(t){return this.r=Bi(t.r),this.g=Bi(t.g),this.b=Bi(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ie){return se.fromWorkingColorSpace(Mi(this,Wt),t),ue(Wt.r*255,0,255)<<16^ue(Wt.g*255,0,255)<<8^ue(Wt.b*255,0,255)<<0}getHexString(t=Ie){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=se.workingColorSpace){se.fromWorkingColorSpace(Mi(this,Wt),e);let n=Wt.r,i=Wt.g,s=Wt.b,o=Math.max(n,i,s),a=Math.min(n,i,s),c,l,h=(a+o)/2;if(a===o)c=0,l=0;else{let f=o-a;switch(l=h<=.5?f/(o+a):f/(2-o-a),o){case n:c=(i-s)/f+(i<s?6:0);break;case i:c=(s-n)/f+2;break;case s:c=(n-i)/f+4;break}c/=6}return t.h=c,t.s=l,t.l=h,t}getRGB(t,e=se.workingColorSpace){return se.fromWorkingColorSpace(Mi(this,Wt),e),t.r=Wt.r,t.g=Wt.g,t.b=Wt.b,t}getStyle(t=Ie){return se.fromWorkingColorSpace(Mi(this,Wt),t),t!==Ie?`color(${t} ${Wt.r} ${Wt.g} ${Wt.b})`:`rgb(${Wt.r*255|0},${Wt.g*255|0},${Wt.b*255|0})`}offsetHSL(t,e,n){return this.getHSL(Ae),Ae.h+=t,Ae.s+=e,Ae.l+=n,this.setHSL(Ae.h,Ae.s,Ae.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Ae),t.getHSL(vi);let n=di(Ae.h,vi.h,e),i=di(Ae.s,vi.s,e),s=di(Ae.l,vi.l,e);return this.setHSL(n,i,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};Ot.NAMES=$a;var Tn,Xi=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Tn===void 0&&(Tn=Wi("canvas")),Tn.width=t.width,Tn.height=t.height;let n=Tn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Tn}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap){let e=Wi("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=xn(s[o]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(xn(e[n]/255)*255):e[n]=xn(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},qi=class{constructor(t=null){this.isSource=!0,this.uuid=jn(),this.data=t,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(bs(i[o].image)):s.push(bs(i[o]))}else s=bs(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function bs(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Xi.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var vl=0,le=class extends sn{constructor(t=le.DEFAULT_IMAGE,e=le.DEFAULT_MAPPING,n=Pe,i=Pe,s=Se,o=pi,a=Re,c=yn,l=le.DEFAULT_ANISOTROPY,h=vn){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:vl++}),this.uuid=jn(),this.name="",this.source=new qi(t),this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=c,this.offset=new Nt(0,0),this.repeat=new Nt(1,1),this.center=new Nt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new oe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,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,type:this.type,encoding:this.encoding,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),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==qa)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Xs:t.x=t.x-Math.floor(t.x);break;case Pe:t.x=t.x<0?0:1;break;case qs:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Xs:t.y=t.y-Math.floor(t.y);break;case Pe:t.y=t.y<0?0:1;break;case qs:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}};le.DEFAULT_IMAGE=null;le.DEFAULT_MAPPING=qa;le.DEFAULT_ANISOTROPY=1;var Xt=class{constructor(t=0,e=0,n=0,i=1){Xt.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s,c=t.elements,l=c[0],h=c[4],f=c[8],u=c[1],m=c[5],_=c[9],p=c[2],d=c[6],v=c[10];if(Math.abs(h-u)<.01&&Math.abs(f-p)<.01&&Math.abs(_-d)<.01){if(Math.abs(h+u)<.1&&Math.abs(f+p)<.1&&Math.abs(_+d)<.1&&Math.abs(l+m+v-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let b=(l+1)/2,M=(m+1)/2,A=(v+1)/2,C=(h+u)/4,I=(f+p)/4,x=(_+d)/4;return b>M&&b>A?b<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(b),i=C/n,s=I/n):M>A?M<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),n=C/i,s=x/i):A<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(A),n=I/s,i=x/s),this.set(n,i,s,e),this}let T=Math.sqrt((d-_)*(d-_)+(f-p)*(f-p)+(u-h)*(u-h));return Math.abs(T)<.001&&(T=1),this.x=(d-_)/T,this.y=(f-p)/T,this.z=(u-h)/T,this.w=Math.acos((l+m+v-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},qe=class extends sn{constructor(t=1,e=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Xt(0,0,t,e),this.scissorTest=!1,this.viewport=new Xt(0,0,t,e);let i={width:t,height:e,depth:1};this.texture=new le(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.internalFormat=n.internalFormat!==void 0?n.internalFormat:null,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Se,this.depthBuffer=n.depthBuffer!==void 0?n.depthBuffer:!0,this.stencilBuffer=n.stencilBuffer!==void 0?n.stencilBuffer:!1,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null,this.samples=n.samples!==void 0?n.samples:0}setSize(t,e,n=1){(this.width!==t||this.height!==e||this.depth!==n)&&(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new qi(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Yi=class extends le{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ae,this.minFilter=ae,this.wrapR=Pe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Js=class extends le{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ae,this.minFilter=ae,this.wrapR=Pe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var rn=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,o,a){let c=n[i+0],l=n[i+1],h=n[i+2],f=n[i+3],u=s[o+0],m=s[o+1],_=s[o+2],p=s[o+3];if(a===0){t[e+0]=c,t[e+1]=l,t[e+2]=h,t[e+3]=f;return}if(a===1){t[e+0]=u,t[e+1]=m,t[e+2]=_,t[e+3]=p;return}if(f!==p||c!==u||l!==m||h!==_){let d=1-a,v=c*u+l*m+h*_+f*p,T=v>=0?1:-1,b=1-v*v;if(b>Number.EPSILON){let A=Math.sqrt(b),C=Math.atan2(A,v*T);d=Math.sin(d*C)/A,a=Math.sin(a*C)/A}let M=a*T;if(c=c*d+u*M,l=l*d+m*M,h=h*d+_*M,f=f*d+p*M,d===1-a){let A=1/Math.sqrt(c*c+l*l+h*h+f*f);c*=A,l*=A,h*=A,f*=A}}t[e]=c,t[e+1]=l,t[e+2]=h,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],c=n[i+1],l=n[i+2],h=n[i+3],f=s[o],u=s[o+1],m=s[o+2],_=s[o+3];return t[e]=a*_+h*f+c*m-l*u,t[e+1]=c*_+h*u+l*f-a*m,t[e+2]=l*_+h*m+a*u-c*f,t[e+3]=h*_-a*f-c*u-l*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){let n=t._x,i=t._y,s=t._z,o=t._order,a=Math.cos,c=Math.sin,l=a(n/2),h=a(i/2),f=a(s/2),u=c(n/2),m=c(i/2),_=c(s/2);switch(o){case"XYZ":this._x=u*h*f+l*m*_,this._y=l*m*f-u*h*_,this._z=l*h*_+u*m*f,this._w=l*h*f-u*m*_;break;case"YXZ":this._x=u*h*f+l*m*_,this._y=l*m*f-u*h*_,this._z=l*h*_-u*m*f,this._w=l*h*f+u*m*_;break;case"ZXY":this._x=u*h*f-l*m*_,this._y=l*m*f+u*h*_,this._z=l*h*_+u*m*f,this._w=l*h*f-u*m*_;break;case"ZYX":this._x=u*h*f-l*m*_,this._y=l*m*f+u*h*_,this._z=l*h*_-u*m*f,this._w=l*h*f+u*m*_;break;case"YZX":this._x=u*h*f+l*m*_,this._y=l*m*f+u*h*_,this._z=l*h*_-u*m*f,this._w=l*h*f-u*m*_;break;case"XZY":this._x=u*h*f-l*m*_,this._y=l*m*f-u*h*_,this._z=l*h*_+u*m*f,this._w=l*h*f+u*m*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],o=e[1],a=e[5],c=e[9],l=e[2],h=e[6],f=e[10],u=n+a+f;if(u>0){let m=.5/Math.sqrt(u+1);this._w=.25/m,this._x=(h-c)*m,this._y=(s-l)*m,this._z=(o-i)*m}else if(n>a&&n>f){let m=2*Math.sqrt(1+n-a-f);this._w=(h-c)/m,this._x=.25*m,this._y=(i+o)/m,this._z=(s+l)/m}else if(a>f){let m=2*Math.sqrt(1+a-n-f);this._w=(s-l)/m,this._x=(i+o)/m,this._y=.25*m,this._z=(c+h)/m}else{let m=2*Math.sqrt(1+f-n-a);this._w=(o-i)/m,this._x=(s+l)/m,this._y=(c+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ue(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,o=t._w,a=e._x,c=e._y,l=e._z,h=e._w;return this._x=n*h+o*a+i*l-s*c,this._y=i*h+o*c+s*a-n*l,this._z=s*h+o*l+n*c-i*a,this._w=o*h-n*a-i*c-s*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let c=1-a*a;if(c<=Number.EPSILON){let m=1-e;return this._w=m*o+e*this._w,this._x=m*n+e*this._x,this._y=m*i+e*this._y,this._z=m*s+e*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(c),h=Math.atan2(l,a),f=Math.sin((1-e)*h)/l,u=Math.sin(e*h)/l;return this._w=o*f+this._w*u,this._x=n*f+this._x*u,this._y=i*f+this._y*u,this._z=s*f+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(s),n*Math.cos(s),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},N=class{constructor(t=0,e=0,n=0){N.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ua.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ua.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,o=t.y,a=t.z,c=t.w,l=c*e+o*i-a*n,h=c*n+a*e-s*i,f=c*i+s*n-o*e,u=-s*e-o*n-a*i;return this.x=l*c+u*-s+h*-a-f*-o,this.y=h*c+u*-o+f*-s-l*-a,this.z=f*c+u*-a+l*-o-h*-s,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,o=e.x,a=e.y,c=e.z;return this.x=i*c-s*a,this.y=s*o-n*c,this.z=n*a-i*o,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return ws.copy(this).projectOnVector(t),this.sub(ws)}reflect(t){return this.sub(ws.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(ue(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},ws=new N,ua=new rn,Mn=class{constructor(t=new N(1/0,1/0,1/0),e=new N(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,l=t.length;c<l;c+=3){let h=t[c],f=t[c+1],u=t[c+2];h<e&&(e=h),f<n&&(n=f),u<i&&(i=u),h>s&&(s=h),f>o&&(o=f),u>a&&(a=u)}return this.min.set(e,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,l=t.count;c<l;c++){let h=t.getX(c),f=t.getY(c),u=t.getZ(c);h<e&&(e=h),f<n&&(n=f),u<i&&(i=u),h>s&&(s=h),f>o&&(o=f),u>a&&(a=u)}return this.min.set(e,n,i),this.max.set(s,o,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=hn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0)if(e&&n.attributes!=null&&n.attributes.position!==void 0){let s=n.attributes.position;for(let o=0,a=s.count;o<a;o++)hn.fromBufferAttribute(s,o).applyMatrix4(t.matrixWorld),this.expandByPoint(hn)}else n.boundingBox===null&&n.computeBoundingBox(),Ss.copy(n.boundingBox),Ss.applyMatrix4(t.matrixWorld),this.union(Ss);let i=t.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,hn),hn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ei),bi.subVectors(this.max,ei),An.subVectors(t.a,ei),En.subVectors(t.b,ei),Cn.subVectors(t.c,ei),Je.subVectors(En,An),$e.subVectors(Cn,En),un.subVectors(An,Cn);let e=[0,-Je.z,Je.y,0,-$e.z,$e.y,0,-un.z,un.y,Je.z,0,-Je.x,$e.z,0,-$e.x,un.z,0,-un.x,-Je.y,Je.x,0,-$e.y,$e.x,0,-un.y,un.x,0];return!Ts(e,An,En,Cn,bi)||(e=[1,0,0,0,1,0,0,0,1],!Ts(e,An,En,Cn,bi))?!1:(wi.crossVectors(Je,$e),e=[wi.x,wi.y,wi.z],Ts(e,An,En,Cn,bi))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return hn.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=this.getSize(hn).length()*.5,t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Ue[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ue[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ue[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ue[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ue[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ue[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ue[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ue[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ue),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Ue=[new N,new N,new N,new N,new N,new N,new N,new N],hn=new N,Ss=new Mn,An=new N,En=new N,Cn=new N,Je=new N,$e=new N,un=new N,ei=new N,bi=new N,wi=new N,dn=new N;function Ts(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){dn.fromArray(r,s);let a=i.x*Math.abs(dn.x)+i.y*Math.abs(dn.y)+i.z*Math.abs(dn.z),c=t.dot(dn),l=e.dot(dn),h=n.dot(dn);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>a)return!1}return!0}var Ml=new Mn,ni=new N,As=new N,_i=class{constructor(t=new N,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Ml.setFromPoints(t).getCenter(n);let i=0;for(let s=0,o=t.length;s<o;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ni.subVectors(t,this.center);let e=ni.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(ni,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(As.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ni.copy(t.center).add(As)),this.expandByPoint(ni.copy(t.center).sub(As))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Be=new N,Es=new N,Si=new N,Ke=new N,Cs=new N,Ti=new N,Ps=new N,$s=class{constructor(t=new N,e=new N(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Be)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=Be.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Be.copy(this.direction).multiplyScalar(e).add(this.origin),Be.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Es.copy(t).add(e).multiplyScalar(.5),Si.copy(e).sub(t).normalize(),Ke.copy(this.origin).sub(Es);let s=t.distanceTo(e)*.5,o=-this.direction.dot(Si),a=Ke.dot(this.direction),c=-Ke.dot(Si),l=Ke.lengthSq(),h=Math.abs(1-o*o),f,u,m,_;if(h>0)if(f=o*c-a,u=o*a-c,_=s*h,f>=0)if(u>=-_)if(u<=_){let p=1/h;f*=p,u*=p,m=f*(f+o*u+2*a)+u*(o*f+u+2*c)+l}else u=s,f=Math.max(0,-(o*u+a)),m=-f*f+u*(u+2*c)+l;else u=-s,f=Math.max(0,-(o*u+a)),m=-f*f+u*(u+2*c)+l;else u<=-_?(f=Math.max(0,-(-o*s+a)),u=f>0?-s:Math.min(Math.max(-s,-c),s),m=-f*f+u*(u+2*c)+l):u<=_?(f=0,u=Math.min(Math.max(-s,-c),s),m=u*(u+2*c)+l):(f=Math.max(0,-(o*s+a)),u=f>0?s:Math.min(Math.max(-s,-c),s),m=-f*f+u*(u+2*c)+l);else u=o>0?-s:s,f=Math.max(0,-(o*u+a)),m=-f*f+u*(u+2*c)+l;return n&&n.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(Si).multiplyScalar(u).add(Es),m}intersectSphere(t,e){Be.subVectors(t.center,this.origin);let n=Be.dot(this.direction),i=Be.dot(Be)-n*n,s=t.radius*t.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,c=n+o;return a<0&&c<0?null:a<0?this.at(c,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,o,a,c,l=1/this.direction.x,h=1/this.direction.y,f=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),h>=0?(s=(t.min.y-u.y)*h,o=(t.max.y-u.y)*h):(s=(t.max.y-u.y)*h,o=(t.min.y-u.y)*h),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),f>=0?(a=(t.min.z-u.z)*f,c=(t.max.z-u.z)*f):(a=(t.max.z-u.z)*f,c=(t.min.z-u.z)*f),n>c||a>i)||((a>n||n!==n)&&(n=a),(c<i||i!==i)&&(i=c),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Be)!==null}intersectTriangle(t,e,n,i,s){Cs.subVectors(e,t),Ti.subVectors(n,t),Ps.crossVectors(Cs,Ti);let o=this.direction.dot(Ps),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ke.subVectors(this.origin,t);let c=a*this.direction.dot(Ti.crossVectors(Ke,Ti));if(c<0)return null;let l=a*this.direction.dot(Cs.cross(Ke));if(l<0||c+l>o)return null;let h=-a*Ke.dot(Ps);return h<0?null:this.at(h/o,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},qt=class{constructor(){qt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,n,i,s,o,a,c,l,h,f,u,m,_,p,d){let v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=i,v[1]=s,v[5]=o,v[9]=a,v[13]=c,v[2]=l,v[6]=h,v[10]=f,v[14]=u,v[3]=m,v[7]=_,v[11]=p,v[15]=d,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new qt().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/Pn.setFromMatrixColumn(t,0).length(),s=1/Pn.setFromMatrixColumn(t,1).length(),o=1/Pn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),c=Math.cos(i),l=Math.sin(i),h=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let u=o*h,m=o*f,_=a*h,p=a*f;e[0]=c*h,e[4]=-c*f,e[8]=l,e[1]=m+_*l,e[5]=u-p*l,e[9]=-a*c,e[2]=p-u*l,e[6]=_+m*l,e[10]=o*c}else if(t.order==="YXZ"){let u=c*h,m=c*f,_=l*h,p=l*f;e[0]=u+p*a,e[4]=_*a-m,e[8]=o*l,e[1]=o*f,e[5]=o*h,e[9]=-a,e[2]=m*a-_,e[6]=p+u*a,e[10]=o*c}else if(t.order==="ZXY"){let u=c*h,m=c*f,_=l*h,p=l*f;e[0]=u-p*a,e[4]=-o*f,e[8]=_+m*a,e[1]=m+_*a,e[5]=o*h,e[9]=p-u*a,e[2]=-o*l,e[6]=a,e[10]=o*c}else if(t.order==="ZYX"){let u=o*h,m=o*f,_=a*h,p=a*f;e[0]=c*h,e[4]=_*l-m,e[8]=u*l+p,e[1]=c*f,e[5]=p*l+u,e[9]=m*l-_,e[2]=-l,e[6]=a*c,e[10]=o*c}else if(t.order==="YZX"){let u=o*c,m=o*l,_=a*c,p=a*l;e[0]=c*h,e[4]=p-u*f,e[8]=_*f+m,e[1]=f,e[5]=o*h,e[9]=-a*h,e[2]=-l*h,e[6]=m*f+_,e[10]=u-p*f}else if(t.order==="XZY"){let u=o*c,m=o*l,_=a*c,p=a*l;e[0]=c*h,e[4]=-f,e[8]=l*h,e[1]=u*f+p,e[5]=o*h,e[9]=m*f-_,e[2]=_*f-m,e[6]=a*h,e[10]=p*f+u}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(bl,t,wl)}lookAt(t,e,n){let i=this.elements;return me.subVectors(t,e),me.lengthSq()===0&&(me.z=1),me.normalize(),je.crossVectors(n,me),je.lengthSq()===0&&(Math.abs(n.z)===1?me.x+=1e-4:me.z+=1e-4,me.normalize(),je.crossVectors(n,me)),je.normalize(),Ai.crossVectors(me,je),i[0]=je.x,i[4]=Ai.x,i[8]=me.x,i[1]=je.y,i[5]=Ai.y,i[9]=me.y,i[2]=je.z,i[6]=Ai.z,i[10]=me.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[4],c=n[8],l=n[12],h=n[1],f=n[5],u=n[9],m=n[13],_=n[2],p=n[6],d=n[10],v=n[14],T=n[3],b=n[7],M=n[11],A=n[15],C=i[0],I=i[4],x=i[8],S=i[12],L=i[1],X=i[5],q=i[9],z=i[13],R=i[2],G=i[6],Y=i[10],j=i[14],W=i[3],Q=i[7],Z=i[11],ft=i[15];return s[0]=o*C+a*L+c*R+l*W,s[4]=o*I+a*X+c*G+l*Q,s[8]=o*x+a*q+c*Y+l*Z,s[12]=o*S+a*z+c*j+l*ft,s[1]=h*C+f*L+u*R+m*W,s[5]=h*I+f*X+u*G+m*Q,s[9]=h*x+f*q+u*Y+m*Z,s[13]=h*S+f*z+u*j+m*ft,s[2]=_*C+p*L+d*R+v*W,s[6]=_*I+p*X+d*G+v*Q,s[10]=_*x+p*q+d*Y+v*Z,s[14]=_*S+p*z+d*j+v*ft,s[3]=T*C+b*L+M*R+A*W,s[7]=T*I+b*X+M*G+A*Q,s[11]=T*x+b*q+M*Y+A*Z,s[15]=T*S+b*z+M*j+A*ft,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],o=t[1],a=t[5],c=t[9],l=t[13],h=t[2],f=t[6],u=t[10],m=t[14],_=t[3],p=t[7],d=t[11],v=t[15];return _*(+s*c*f-i*l*f-s*a*u+n*l*u+i*a*m-n*c*m)+p*(+e*c*m-e*l*u+s*o*u-i*o*m+i*l*h-s*c*h)+d*(+e*l*f-e*a*m-s*o*f+n*o*m+s*a*h-n*l*h)+v*(-i*a*h-e*c*f+e*a*u+i*o*f-n*o*u+n*c*h)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],l=t[7],h=t[8],f=t[9],u=t[10],m=t[11],_=t[12],p=t[13],d=t[14],v=t[15],T=f*d*l-p*u*l+p*c*m-a*d*m-f*c*v+a*u*v,b=_*u*l-h*d*l-_*c*m+o*d*m+h*c*v-o*u*v,M=h*p*l-_*f*l+_*a*m-o*p*m-h*a*v+o*f*v,A=_*f*c-h*p*c-_*a*u+o*p*u+h*a*d-o*f*d,C=e*T+n*b+i*M+s*A;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let I=1/C;return t[0]=T*I,t[1]=(p*u*s-f*d*s-p*i*m+n*d*m+f*i*v-n*u*v)*I,t[2]=(a*d*s-p*c*s+p*i*l-n*d*l-a*i*v+n*c*v)*I,t[3]=(f*c*s-a*u*s-f*i*l+n*u*l+a*i*m-n*c*m)*I,t[4]=b*I,t[5]=(h*d*s-_*u*s+_*i*m-e*d*m-h*i*v+e*u*v)*I,t[6]=(_*c*s-o*d*s-_*i*l+e*d*l+o*i*v-e*c*v)*I,t[7]=(o*u*s-h*c*s+h*i*l-e*u*l-o*i*m+e*c*m)*I,t[8]=M*I,t[9]=(_*f*s-h*p*s-_*n*m+e*p*m+h*n*v-e*f*v)*I,t[10]=(o*p*s-_*a*s+_*n*l-e*p*l-o*n*v+e*a*v)*I,t[11]=(h*a*s-o*f*s-h*n*l+e*f*l+o*n*m-e*a*m)*I,t[12]=A*I,t[13]=(h*p*i-_*f*i+_*n*u-e*p*u-h*n*d+e*f*d)*I,t[14]=(_*a*i-o*p*i-_*n*c+e*p*c+o*n*d-e*a*d)*I,t[15]=(o*f*i-h*a*i+h*n*c-e*f*c-o*n*u+e*a*u)*I,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,o=t.x,a=t.y,c=t.z,l=s*o,h=s*a;return this.set(l*o+n,l*a-i*c,l*c+i*a,0,l*a+i*c,h*a+n,h*c-i*o,0,l*c-i*a,h*c+i*o,s*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,o){return this.set(1,n,s,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,o=e._y,a=e._z,c=e._w,l=s+s,h=o+o,f=a+a,u=s*l,m=s*h,_=s*f,p=o*h,d=o*f,v=a*f,T=c*l,b=c*h,M=c*f,A=n.x,C=n.y,I=n.z;return i[0]=(1-(p+v))*A,i[1]=(m+M)*A,i[2]=(_-b)*A,i[3]=0,i[4]=(m-M)*C,i[5]=(1-(u+v))*C,i[6]=(d+T)*C,i[7]=0,i[8]=(_+b)*I,i[9]=(d-T)*I,i[10]=(1-(u+p))*I,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=Pn.set(i[0],i[1],i[2]).length(),o=Pn.set(i[4],i[5],i[6]).length(),a=Pn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],Ee.copy(this);let l=1/s,h=1/o,f=1/a;return Ee.elements[0]*=l,Ee.elements[1]*=l,Ee.elements[2]*=l,Ee.elements[4]*=h,Ee.elements[5]*=h,Ee.elements[6]*=h,Ee.elements[8]*=f,Ee.elements[9]*=f,Ee.elements[10]*=f,e.setFromRotationMatrix(Ee),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o){let a=this.elements,c=2*s/(e-t),l=2*s/(n-i),h=(e+t)/(e-t),f=(n+i)/(n-i),u=-(o+s)/(o-s),m=-2*o*s/(o-s);return a[0]=c,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=l,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,s,o){let a=this.elements,c=1/(e-t),l=1/(n-i),h=1/(o-s),f=(e+t)*c,u=(n+i)*l,m=(o+s)*h;return a[0]=2*c,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-m,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Pn=new N,Ee=new qt,bl=new N(0,0,0),wl=new N(1,1,1),je=new N,Ai=new N,me=new N,da=new qt,fa=new rn,Zn=class{constructor(t=0,e=0,n=0,i=Zn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],o=i[4],a=i[8],c=i[1],l=i[5],h=i[9],f=i[2],u=i[6],m=i[10];switch(e){case"XYZ":this._y=Math.asin(ue(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-ue(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(ue(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-ue(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(u,m),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(ue(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-ue(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return da.makeRotationFromQuaternion(t),this.setFromRotationMatrix(da,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return fa.setFromEuler(this),this.setFromQuaternion(fa,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Zn.DEFAULT_ORDER="XYZ";var Zi=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},Sl=0,pa=new N,Rn=new rn,ke=new qt,Ei=new N,ii=new N,Tl=new N,Al=new rn,ma=new N(1,0,0),ga=new N(0,1,0),_a=new N(0,0,1),El={type:"added"},xa={type:"removed"},de=class extends sn{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Sl++}),this.uuid=jn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=de.DEFAULT_UP.clone();let t=new N,e=new Zn,n=new rn,i=new N(1,1,1);function s(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new qt},normalMatrix:{value:new oe}}),this.matrix=new qt,this.matrixWorld=new qt,this.matrixAutoUpdate=de.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=de.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new Zi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Rn.setFromAxisAngle(t,e),this.quaternion.multiply(Rn),this}rotateOnWorldAxis(t,e){return Rn.setFromAxisAngle(t,e),this.quaternion.premultiply(Rn),this}rotateX(t){return this.rotateOnAxis(ma,t)}rotateY(t){return this.rotateOnAxis(ga,t)}rotateZ(t){return this.rotateOnAxis(_a,t)}translateOnAxis(t,e){return pa.copy(t).applyQuaternion(this.quaternion),this.position.add(pa.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(ma,t)}translateY(t){return this.translateOnAxis(ga,t)}translateZ(t){return this.translateOnAxis(_a,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ke.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Ei.copy(t):Ei.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),ii.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ke.lookAt(ii,Ei,this.up):ke.lookAt(Ei,ii,this.up),this.quaternion.setFromRotationMatrix(ke),i&&(ke.extractRotation(i.matrixWorld),Rn.setFromRotationMatrix(ke),this.quaternion.premultiply(Rn.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can\'t be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(El)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(xa)),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){let e=this.children[t];e.parent=null,e.dispatchEvent(xa)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),ke.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),ke.multiply(t.parent.matrixWorld)),t.applyMatrix4(ke),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getObjectsByProperty(t,e){let n=[];this[t]===e&&n.push(this);for(let i=0,s=this.children.length;i<s;i++){let o=this.children[i].getObjectsByProperty(t,e);o.length>0&&(n=n.concat(o))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ii,t,Tl),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ii,Al,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,o=i.length;s<o;s++){let a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON()));function s(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(t)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let c=a.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l<h;l++){let f=c[l];s(t.shapes,f)}else s(t.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let c=0,l=this.material.length;c<l;c++)a.push(s(t.materials,this.material[c]));i.material=a}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){let c=this.animations[a];i.animations.push(s(t.animations,c))}}if(e){let a=o(t.geometries),c=o(t.materials),l=o(t.textures),h=o(t.images),f=o(t.shapes),u=o(t.skeletons),m=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),u.length>0&&(n.skeletons=u),m.length>0&&(n.animations=m),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let c=[];for(let l in a){let h=a[l];delete h.metadata,c.push(h)}return c}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};de.DEFAULT_UP=new N(0,1,0);de.DEFAULT_MATRIX_AUTO_UPDATE=!0;de.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Ce=new N,Ve=new N,Rs=new N,Ge=new N,Ln=new N,In=new N,ya=new N,Ls=new N,Is=new N,Ds=new N,xe=class{constructor(t=new N,e=new N,n=new N){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),Ce.subVectors(t,e),i.cross(Ce);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){Ce.subVectors(i,e),Ve.subVectors(n,e),Rs.subVectors(t,e);let o=Ce.dot(Ce),a=Ce.dot(Ve),c=Ce.dot(Rs),l=Ve.dot(Ve),h=Ve.dot(Rs),f=o*l-a*a;if(f===0)return s.set(-2,-1,-1);let u=1/f,m=(l*c-a*h)*u,_=(o*h-a*c)*u;return s.set(1-m-_,_,m)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Ge),Ge.x>=0&&Ge.y>=0&&Ge.x+Ge.y<=1}static getUV(t,e,n,i,s,o,a,c){return this.getBarycoord(t,e,n,i,Ge),c.set(0,0),c.addScaledVector(s,Ge.x),c.addScaledVector(o,Ge.y),c.addScaledVector(a,Ge.z),c}static isFrontFacing(t,e,n,i){return Ce.subVectors(n,e),Ve.subVectors(t,e),Ce.cross(Ve).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Ce.subVectors(this.c,this.b),Ve.subVectors(this.a,this.b),Ce.cross(Ve).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return xe.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return xe.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,s){return xe.getUV(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return xe.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return xe.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,o,a;Ln.subVectors(i,n),In.subVectors(s,n),Ls.subVectors(t,n);let c=Ln.dot(Ls),l=In.dot(Ls);if(c<=0&&l<=0)return e.copy(n);Is.subVectors(t,i);let h=Ln.dot(Is),f=In.dot(Is);if(h>=0&&f<=h)return e.copy(i);let u=c*f-h*l;if(u<=0&&c>=0&&h<=0)return o=c/(c-h),e.copy(n).addScaledVector(Ln,o);Ds.subVectors(t,s);let m=Ln.dot(Ds),_=In.dot(Ds);if(_>=0&&m<=_)return e.copy(s);let p=m*l-c*_;if(p<=0&&l>=0&&_<=0)return a=l/(l-_),e.copy(n).addScaledVector(In,a);let d=h*_-m*f;if(d<=0&&f-h>=0&&m-_>=0)return ya.subVectors(s,i),a=(f-h)/(f-h+(m-_)),e.copy(i).addScaledVector(ya,a);let v=1/(d+p+u);return o=p*v,a=u*v,e.copy(n).addScaledVector(Ln,o).addScaledVector(In,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},Cl=0,Jn=class extends sn{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Cl++}),this.uuid=jn(),this.name="",this.type="Material",this.blending=Gn,this.side=nn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Ha,this.blendDst=Wa,this.blendEquation=Bn,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Gs,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=rl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=xs,this.stencilZFail=xs,this.stencilZPass=xs,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn("THREE.Material: \'"+e+"\' parameter is undefined.");continue}let i=this[e];if(i===void 0){console.warn("THREE."+this.type+": \'"+e+"\' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Gn&&(n.blending=this.blending),this.side!==nn&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(n.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let c=s[a];delete c.metadata,o.push(c)}return o}if(e){let s=i(t.textures),o=i(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},Ji=class extends Jn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Xa,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}},Gt=new N,Ci=new Nt,ce=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=la,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)Ci.fromBufferAttribute(this,e),Ci.applyMatrix3(t),this.setXY(e,Ci.x,Ci.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Gt.fromBufferAttribute(this,e),Gt.applyMatrix3(t),this.setXYZ(e,Gt.x,Gt.y,Gt.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Gt.fromBufferAttribute(this,e),Gt.applyMatrix4(t),this.setXYZ(e,Gt.x,Gt.y,Gt.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Gt.fromBufferAttribute(this,e),Gt.applyNormalMatrix(t),this.setXYZ(e,Gt.x,Gt.y,Gt.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Gt.fromBufferAttribute(this,e),Gt.transformDirection(t),this.setXYZ(e,Gt.x,Gt.y,Gt.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=ci(e,this.array)),e}setX(t,e){return this.normalized&&(e=he(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=ci(e,this.array)),e}setY(t,e){return this.normalized&&(e=he(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=ci(e,this.array)),e}setZ(t,e){return this.normalized&&(e=he(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=ci(e,this.array)),e}setW(t,e){return this.normalized&&(e=he(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=he(e,this.array),n=he(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=he(e,this.array),n=he(n,this.array),i=he(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=he(e,this.array),n=he(n,this.array),i=he(i,this.array),s=he(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==la&&(t.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}};var $i=class extends ce{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Ki=class extends ce{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var Xe=class extends ce{constructor(t,e,n){super(new Float32Array(t),e,n)}};var Pl=0,we=new qt,Ns=new de,Dn=new N,ge=new Mn,si=new Mn,jt=new N,Ye=class extends sn{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Pl++}),this.uuid=jn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(Ja(t)?Ki:$i)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new oe().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return we.makeRotationFromQuaternion(t),this.applyMatrix4(we),this}rotateX(t){return we.makeRotationX(t),this.applyMatrix4(we),this}rotateY(t){return we.makeRotationY(t),this.applyMatrix4(we),this}rotateZ(t){return we.makeRotationZ(t),this.applyMatrix4(we),this}translate(t,e,n){return we.makeTranslation(t,e,n),this.applyMatrix4(we),this}scale(t,e,n){return we.makeScale(t,e,n),this.applyMatrix4(we),this}lookAt(t){return Ns.lookAt(t),Ns.updateMatrix(),this.applyMatrix4(Ns.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Dn).negate(),this.translate(Dn.x,Dn.y,Dn.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Xe(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Mn);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error(\'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".\',this),this.boundingBox.set(new N(-1/0,-1/0,-1/0),new N(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];ge.setFromBufferAttribute(s),this.morphTargetsRelative?(jt.addVectors(this.boundingBox.min,ge.min),this.boundingBox.expandByPoint(jt),jt.addVectors(this.boundingBox.max,ge.max),this.boundingBox.expandByPoint(jt)):(this.boundingBox.expandByPoint(ge.min),this.boundingBox.expandByPoint(ge.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error(\'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.\',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new _i);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error(\'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".\',this),this.boundingSphere.set(new N,1/0);return}if(t){let n=this.boundingSphere.center;if(ge.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];si.setFromBufferAttribute(a),this.morphTargetsRelative?(jt.addVectors(ge.min,si.min),ge.expandByPoint(jt),jt.addVectors(ge.max,si.max),ge.expandByPoint(jt)):(ge.expandByPoint(si.min),ge.expandByPoint(si.max))}ge.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)jt.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(jt));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],c=this.morphTargetsRelative;for(let l=0,h=a.count;l<h;l++)jt.fromBufferAttribute(a,l),c&&(Dn.fromBufferAttribute(t,l),jt.add(Dn)),i=Math.max(i,n.distanceToSquared(jt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error(\'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.\',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=t.array,i=e.position.array,s=e.normal.array,o=e.uv.array,a=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ce(new Float32Array(4*a),4));let c=this.getAttribute("tangent").array,l=[],h=[];for(let L=0;L<a;L++)l[L]=new N,h[L]=new N;let f=new N,u=new N,m=new N,_=new Nt,p=new Nt,d=new Nt,v=new N,T=new N;function b(L,X,q){f.fromArray(i,L*3),u.fromArray(i,X*3),m.fromArray(i,q*3),_.fromArray(o,L*2),p.fromArray(o,X*2),d.fromArray(o,q*2),u.sub(f),m.sub(f),p.sub(_),d.sub(_);let z=1/(p.x*d.y-d.x*p.y);isFinite(z)&&(v.copy(u).multiplyScalar(d.y).addScaledVector(m,-p.y).multiplyScalar(z),T.copy(m).multiplyScalar(p.x).addScaledVector(u,-d.x).multiplyScalar(z),l[L].add(v),l[X].add(v),l[q].add(v),h[L].add(T),h[X].add(T),h[q].add(T))}let M=this.groups;M.length===0&&(M=[{start:0,count:n.length}]);for(let L=0,X=M.length;L<X;++L){let q=M[L],z=q.start,R=q.count;for(let G=z,Y=z+R;G<Y;G+=3)b(n[G+0],n[G+1],n[G+2])}let A=new N,C=new N,I=new N,x=new N;function S(L){I.fromArray(s,L*3),x.copy(I);let X=l[L];A.copy(X),A.sub(I.multiplyScalar(I.dot(X))).normalize(),C.crossVectors(x,X);let z=C.dot(h[L])<0?-1:1;c[L*4]=A.x,c[L*4+1]=A.y,c[L*4+2]=A.z,c[L*4+3]=z}for(let L=0,X=M.length;L<X;++L){let q=M[L],z=q.start,R=q.count;for(let G=z,Y=z+R;G<Y;G+=3)S(n[G+0]),S(n[G+1]),S(n[G+2])}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new ce(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let u=0,m=n.count;u<m;u++)n.setXYZ(u,0,0,0);let i=new N,s=new N,o=new N,a=new N,c=new N,l=new N,h=new N,f=new N;if(t)for(let u=0,m=t.count;u<m;u+=3){let _=t.getX(u+0),p=t.getX(u+1),d=t.getX(u+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,p),o.fromBufferAttribute(e,d),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),a.fromBufferAttribute(n,_),c.fromBufferAttribute(n,p),l.fromBufferAttribute(n,d),a.add(h),c.add(h),l.add(h),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(p,c.x,c.y,c.z),n.setXYZ(d,l.x,l.y,l.z)}else for(let u=0,m=e.count;u<m;u+=3)i.fromBufferAttribute(e,u+0),s.fromBufferAttribute(e,u+1),o.fromBufferAttribute(e,u+2),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),n.setXYZ(u+0,h.x,h.y,h.z),n.setXYZ(u+1,h.x,h.y,h.z),n.setXYZ(u+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)jt.fromBufferAttribute(t,e),jt.normalize(),t.setXYZ(e,jt.x,jt.y,jt.z)}toNonIndexed(){function t(a,c){let l=a.array,h=a.itemSize,f=a.normalized,u=new l.constructor(c.length*h),m=0,_=0;for(let p=0,d=c.length;p<d;p++){a.isInterleavedBufferAttribute?m=c[p]*a.data.stride+a.offset:m=c[p]*h;for(let v=0;v<h;v++)u[_++]=l[m++]}return new ce(u,h,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new Ye,n=this.index.array,i=this.attributes;for(let a in i){let c=i[a],l=t(c,n);e.setAttribute(a,l)}let s=this.morphAttributes;for(let a in s){let c=[],l=s[a];for(let h=0,f=l.length;h<f;h++){let u=l[h],m=t(u,n);c.push(m)}e.morphAttributes[a]=c}e.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,c=o.length;a<c;a++){let l=o[a];e.addGroup(l.start,l.count,l.materialIndex)}return e}toJSON(){let t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(t[l]=c[l]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let c in n){let l=n[c];t.data.attributes[c]=l.toJSON(t.data)}let i={},s=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let f=0,u=l.length;f<u;f++){let m=l[f];h.push(m.toJSON(t.data))}h.length>0&&(i[c]=h,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let l in i){let h=i[l];this.setAttribute(l,h.clone(e))}let s=t.morphAttributes;for(let l in s){let h=[],f=s[l];for(let u=0,m=f.length;u<m;u++)h.push(f[u].clone(e));this.morphAttributes[l]=h}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let l=0,h=o.length;l<h;l++){let f=o[l];this.addGroup(f.start,f.count,f.materialIndex)}let a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());let c=t.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,t.parameters!==void 0&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}},va=new qt,Nn=new $s,Fs=new _i,ri=new N,ai=new N,oi=new N,zs=new N,Pi=new N,Ri=new Nt,Li=new Nt,Ii=new Nt,Os=new N,Di=new N,Ne=class extends de{constructor(t=new Ye,e=new Ji){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let a=this.morphTargetInfluences;if(s&&a){Pi.set(0,0,0);for(let c=0,l=s.length;c<l;c++){let h=a[c],f=s[c];h!==0&&(zs.fromBufferAttribute(f,t),o?Pi.addScaledVector(zs,h):Pi.addScaledVector(zs.sub(e),h))}e.add(Pi)}return this.isSkinnedMesh&&this.boneTransform(t,e),e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),Fs.copy(n.boundingSphere),Fs.applyMatrix4(s),t.ray.intersectsSphere(Fs)===!1)||(va.copy(s).invert(),Nn.copy(t.ray).applyMatrix4(va),n.boundingBox!==null&&Nn.intersectsBox(n.boundingBox)===!1))return;let o,a=n.index,c=n.attributes.position,l=n.attributes.uv,h=n.attributes.uv2,f=n.groups,u=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,_=f.length;m<_;m++){let p=f[m],d=i[p.materialIndex],v=Math.max(p.start,u.start),T=Math.min(a.count,Math.min(p.start+p.count,u.start+u.count));for(let b=v,M=T;b<M;b+=3){let A=a.getX(b),C=a.getX(b+1),I=a.getX(b+2);o=Ni(this,d,t,Nn,l,h,A,C,I),o&&(o.faceIndex=Math.floor(b/3),o.face.materialIndex=p.materialIndex,e.push(o))}}else{let m=Math.max(0,u.start),_=Math.min(a.count,u.start+u.count);for(let p=m,d=_;p<d;p+=3){let v=a.getX(p),T=a.getX(p+1),b=a.getX(p+2);o=Ni(this,i,t,Nn,l,h,v,T,b),o&&(o.faceIndex=Math.floor(p/3),e.push(o))}}else if(c!==void 0)if(Array.isArray(i))for(let m=0,_=f.length;m<_;m++){let p=f[m],d=i[p.materialIndex],v=Math.max(p.start,u.start),T=Math.min(c.count,Math.min(p.start+p.count,u.start+u.count));for(let b=v,M=T;b<M;b+=3){let A=b,C=b+1,I=b+2;o=Ni(this,d,t,Nn,l,h,A,C,I),o&&(o.faceIndex=Math.floor(b/3),o.face.materialIndex=p.materialIndex,e.push(o))}}else{let m=Math.max(0,u.start),_=Math.min(c.count,u.start+u.count);for(let p=m,d=_;p<d;p+=3){let v=p,T=p+1,b=p+2;o=Ni(this,i,t,Nn,l,h,v,T,b),o&&(o.faceIndex=Math.floor(p/3),e.push(o))}}}};function Rl(r,t,e,n,i,s,o,a){let c;if(t.side===ye?c=n.intersectTriangle(o,s,i,!0,a):c=n.intersectTriangle(i,s,o,t.side===nn,a),c===null)return null;Di.copy(a),Di.applyMatrix4(r.matrixWorld);let l=e.ray.origin.distanceTo(Di);return l<e.near||l>e.far?null:{distance:l,point:Di.clone(),object:r}}function Ni(r,t,e,n,i,s,o,a,c){r.getVertexPosition(o,ri),r.getVertexPosition(a,ai),r.getVertexPosition(c,oi);let l=Rl(r,t,e,n,ri,ai,oi,Os);if(l){i&&(Ri.fromBufferAttribute(i,o),Li.fromBufferAttribute(i,a),Ii.fromBufferAttribute(i,c),l.uv=xe.getUV(Os,ri,ai,oi,Ri,Li,Ii,new Nt)),s&&(Ri.fromBufferAttribute(s,o),Li.fromBufferAttribute(s,a),Ii.fromBufferAttribute(s,c),l.uv2=xe.getUV(Os,ri,ai,oi,Ri,Li,Ii,new Nt));let h={a:o,b:a,c,normal:new N,materialIndex:0};xe.getNormal(ri,ai,oi,h.normal),l.face=h}return l}var bn=class extends Ye{constructor(t=1,e=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};let a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);let c=[],l=[],h=[],f=[],u=0,m=0;_("z","y","x",-1,-1,n,e,t,o,s,0),_("z","y","x",1,-1,n,e,-t,o,s,1),_("x","z","y",1,1,t,n,e,i,o,2),_("x","z","y",1,-1,t,n,-e,i,o,3),_("x","y","z",1,-1,t,e,n,i,s,4),_("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(c),this.setAttribute("position",new Xe(l,3)),this.setAttribute("normal",new Xe(h,3)),this.setAttribute("uv",new Xe(f,2));function _(p,d,v,T,b,M,A,C,I,x,S){let L=M/I,X=A/x,q=M/2,z=A/2,R=C/2,G=I+1,Y=x+1,j=0,W=0,Q=new N;for(let Z=0;Z<Y;Z++){let ft=Z*X-z;for(let F=0;F<G;F++){let J=F*L-q;Q[p]=J*T,Q[d]=ft*b,Q[v]=R,l.push(Q.x,Q.y,Q.z),Q[p]=0,Q[d]=0,Q[v]=C>0?1:-1,h.push(Q.x,Q.y,Q.z),f.push(F/I),f.push(1-Z/x),j+=1}}for(let Z=0;Z<x;Z++)for(let ft=0;ft<I;ft++){let F=u+ft+G*Z,J=u+ft+G*(Z+1),nt=u+(ft+1)+G*(Z+1),it=u+(ft+1)+G*Z;c.push(F,J,it),c.push(J,nt,it),W+=6}a.addGroup(m,W,S),m+=W,u+=j}}static fromJSON(t){return new bn(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function $n(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function re(r){let t={};for(let e=0;e<r.length;e++){let n=$n(r[e]);for(let i in n)t[i]=n[i]}return t}function Ll(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function Ka(r){return r.getRenderTarget()===null&&r.outputEncoding===zt?Ie:gi}var Il={clone:$n,merge:re},Dl=`void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`,Nl=`void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}`,Ze=class extends Jn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Dl,this.fragmentShader=Nl,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=$n(t.uniforms),this.uniformsGroups=Ll(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let o=this.uniforms[i].value;o&&o.isTexture?e.uniforms[i]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[i]={type:"m4",value:o.toArray()}:e.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},ji=class extends de{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qt,this.projectionMatrix=new qt,this.projectionMatrixInverse=new qt}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},_e=class extends ji{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Gi*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(ui*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Gi*2*Math.atan(Math.tan(ui*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,s,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(ui*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let c=o.fullWidth,l=o.fullHeight;s+=o.offsetX*i/c,e-=o.offsetY*n/l,i*=o.width/c,n*=o.height/l}let a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Fn=-90,zn=1,Ks=class extends de{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n;let i=new _e(Fn,zn,t,e);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(1,0,0),this.add(i);let s=new _e(Fn,zn,t,e);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(-1,0,0),this.add(s);let o=new _e(Fn,zn,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);let a=new _e(Fn,zn,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);let c=new _e(Fn,zn,t,e);c.layers=this.layers,c.up.set(0,1,0),c.lookAt(0,0,1),this.add(c);let l=new _e(Fn,zn,t,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(t,e){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,c,l]=this.children,h=t.getRenderTarget(),f=t.toneMapping,u=t.xr.enabled;t.toneMapping=We,t.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,s),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,c),n.texture.generateMipmaps=m,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(h),t.toneMapping=f,t.xr.enabled=u,n.texture.needsPMREMUpdate=!0}},Qi=class extends le{constructor(t,e,n,i,s,o,a,c,l,h){t=t!==void 0?t:[],e=e!==void 0?e:Xn,super(t,e,n,i,s,o,a,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},js=class extends qe{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Qi(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:Se}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,fragmentShader:`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`},i=new bn(5,5,5),s=new Ze({name:"CubemapFromEquirect",uniforms:$n(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:ye,blending:en});s.uniforms.tEquirect.value=e;let o=new Ne(i,s),a=e.minFilter;return e.minFilter===pi&&(e.minFilter=Se),new Ks(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(s)}},Us=new N,Fl=new N,zl=new oe,He=class{constructor(t=new N(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Us.subVectors(n,e).cross(Fl.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){let n=t.delta(Us),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(n).multiplyScalar(s).add(t.start)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||zl.getNormalMatrix(t),i=this.coplanarPoint(Us).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},On=new _i,Fi=new N,ts=class{constructor(t=new He,e=new He,n=new He,i=new He,s=new He,o=new He){this.planes=[t,e,n,i,s,o]}set(t,e,n,i,s,o){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){let e=this.planes,n=t.elements,i=n[0],s=n[1],o=n[2],a=n[3],c=n[4],l=n[5],h=n[6],f=n[7],u=n[8],m=n[9],_=n[10],p=n[11],d=n[12],v=n[13],T=n[14],b=n[15];return e[0].setComponents(a-i,f-c,p-u,b-d).normalize(),e[1].setComponents(a+i,f+c,p+u,b+d).normalize(),e[2].setComponents(a+s,f+l,p+m,b+v).normalize(),e[3].setComponents(a-s,f-l,p-m,b-v).normalize(),e[4].setComponents(a-o,f-h,p-_,b-T).normalize(),e[5].setComponents(a+o,f+h,p+_,b+T).normalize(),this}intersectsObject(t){let e=t.geometry;return e.boundingSphere===null&&e.computeBoundingSphere(),On.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(On)}intersectsSprite(t){return On.center.set(0,0,0),On.radius=.7071067811865476,On.applyMatrix4(t.matrixWorld),this.intersectsSphere(On)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let n=0;n<6;n++){let i=e[n];if(Fi.x=i.normal.x>0?t.max.x:t.min.x,Fi.y=i.normal.y>0?t.max.y:t.min.y,Fi.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Fi)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function ja(){let r=null,t=!1,e=null,n=null;function i(s,o){e(s,o),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function Ol(r,t){let e=t.isWebGL2,n=new WeakMap;function i(l,h){let f=l.array,u=l.usage,m=r.createBuffer();r.bindBuffer(h,m),r.bufferData(h,f,u),l.onUploadCallback();let _;if(f instanceof Float32Array)_=5126;else if(f instanceof Uint16Array)if(l.isFloat16BufferAttribute)if(e)_=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else _=5123;else if(f instanceof Int16Array)_=5122;else if(f instanceof Uint32Array)_=5125;else if(f instanceof Int32Array)_=5124;else if(f instanceof Int8Array)_=5120;else if(f instanceof Uint8Array)_=5121;else if(f instanceof Uint8ClampedArray)_=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:m,type:_,bytesPerElement:f.BYTES_PER_ELEMENT,version:l.version}}function s(l,h,f){let u=h.array,m=h.updateRange;r.bindBuffer(f,l),m.count===-1?r.bufferSubData(f,0,u):(e?r.bufferSubData(f,m.offset*u.BYTES_PER_ELEMENT,u,m.offset,m.count):r.bufferSubData(f,m.offset*u.BYTES_PER_ELEMENT,u.subarray(m.offset,m.offset+m.count)),m.count=-1),h.onUploadCallback()}function o(l){return l.isInterleavedBufferAttribute&&(l=l.data),n.get(l)}function a(l){l.isInterleavedBufferAttribute&&(l=l.data);let h=n.get(l);h&&(r.deleteBuffer(h.buffer),n.delete(l))}function c(l,h){if(l.isGLBufferAttribute){let u=n.get(l);(!u||u.version<l.version)&&n.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}l.isInterleavedBufferAttribute&&(l=l.data);let f=n.get(l);f===void 0?n.set(l,i(l,h)):f.version<l.version&&(s(f.buffer,l,h),f.version=l.version)}return{get:o,remove:a,update:c}}var xi=class extends Ye{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};let s=t/2,o=e/2,a=Math.floor(n),c=Math.floor(i),l=a+1,h=c+1,f=t/a,u=e/c,m=[],_=[],p=[],d=[];for(let v=0;v<h;v++){let T=v*u-o;for(let b=0;b<l;b++){let M=b*f-s;_.push(M,-T,0),p.push(0,0,1),d.push(b/a),d.push(1-v/c)}}for(let v=0;v<c;v++)for(let T=0;T<a;T++){let b=T+l*v,M=T+l*(v+1),A=T+1+l*(v+1),C=T+1+l*v;m.push(b,M,C),m.push(M,A,C)}this.setIndex(m),this.setAttribute("position",new Xe(_,3)),this.setAttribute("normal",new Xe(p,3)),this.setAttribute("uv",new Xe(d,2))}static fromJSON(t){return new xi(t.width,t.height,t.widthSegments,t.heightSegments)}},Ul=`#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif`,Bl=`#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`,kl=`#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif`,Vl=`#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif`,Gl=`#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif`,Hl=`#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif`,Wl="vec3 transformed = vec3( position );",Xl=`vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif`,ql=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif`,Yl=`#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif`,Zl=`#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif`,Jl=`#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif`,$l=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`,Kl=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif`,jl=`#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif`,Ql=`#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif`,tc=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif`,ec=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif`,nc=`#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif`,ic=`#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}`,sc=`#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif`,rc=`vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif`,ac=`#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif`,oc=`#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif`,lc=`#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif`,cc=`#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif`,hc="gl_FragColor = linearToOutputTexel( gl_FragColor );",uc=`vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}`,dc=`#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif`,fc=`#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif`,pc=`#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif`,mc=`#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif`,gc=`#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif`,_c=`#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif`,xc=`#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif`,yc=`#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif`,vc=`#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif`,Mc=`#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}`,bc=`#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif`,wc=`#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif`,Sc=`LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;`,Tc=`varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert`,Ac=`uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif`,Ec=`#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif`,Cc=`ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;`,Pc=`varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon`,Rc=`BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,Lc=`varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong`,Ic=`PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif`,Dc=`struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}`,Nc=`\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif`,Fc=`#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif`,zc=`#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif`,Oc=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`,Uc=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`,Bc=`#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif`,kc=`#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif`,Vc=`#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif`,Gc=`#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif`,Hc=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif`,Wc=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`,Xc=`float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif`,qc=`#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif`,Yc=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif`,Zc=`#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif`,Jc=`#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif`,$c=`#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif`,Kc=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;`,jc=`#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif`,Qc=`#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`,th=`#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`,eh=`#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif`,nh=`#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif`,ih=`#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif`,sh=`#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif`,rh=`#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif`,ah=`#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif`,oh=`#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );`,lh=`vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}`,ch=`#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif`,hh=`vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`,uh=`#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`,dh=`#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif`,fh=`float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif`,ph=`#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif`,mh=`#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif`,gh=`#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif`,_h=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif`,xh=`float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}`,yh=`#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif`,vh=`#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif`,Mh=`#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif`,bh=`#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif`,wh=`float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif`,Sh=`#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif`,Th=`#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`,Ah=`#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }`,Eh=`#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif`,Ch=`#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif`,Ph=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif`,Rh=`#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif`,Lh=`#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif`,Ih=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif`,Dh=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif`,Nh=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif`,Fh=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif`,zh=`varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}`,Oh=`uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,Uh=`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}`,Bh=`#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,kh=`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}`,Vh=`uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,Gh=`#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}`,Hh=`#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}`,Wh=`#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}`,Xh=`#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}`,qh=`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}`,Yh=`uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}`,Zh=`uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}`,Jh=`uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}`,$h=`#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}`,Kh=`uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,jh=`#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,Qh=`#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,tu=`#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}`,eu=`#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,nu=`#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}`,iu=`#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}`,su=`#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,ru=`#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,au=`#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}`,ou=`#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,lu=`#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,cu=`#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,hu=`uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}`,uu=`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}`,du=`#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,fu=`uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}`,pu=`uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}`,mu=`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}`,wt={alphamap_fragment:Ul,alphamap_pars_fragment:Bl,alphatest_fragment:kl,alphatest_pars_fragment:Vl,aomap_fragment:Gl,aomap_pars_fragment:Hl,begin_vertex:Wl,beginnormal_vertex:Xl,bsdfs:ql,iridescence_fragment:Yl,bumpmap_pars_fragment:Zl,clipping_planes_fragment:Jl,clipping_planes_pars_fragment:$l,clipping_planes_pars_vertex:Kl,clipping_planes_vertex:jl,color_fragment:Ql,color_pars_fragment:tc,color_pars_vertex:ec,color_vertex:nc,common:ic,cube_uv_reflection_fragment:sc,defaultnormal_vertex:rc,displacementmap_pars_vertex:ac,displacementmap_vertex:oc,emissivemap_fragment:lc,emissivemap_pars_fragment:cc,encodings_fragment:hc,encodings_pars_fragment:uc,envmap_fragment:dc,envmap_common_pars_fragment:fc,envmap_pars_fragment:pc,envmap_pars_vertex:mc,envmap_physical_pars_fragment:Ec,envmap_vertex:gc,fog_vertex:_c,fog_pars_vertex:xc,fog_fragment:yc,fog_pars_fragment:vc,gradientmap_pars_fragment:Mc,lightmap_fragment:bc,lightmap_pars_fragment:wc,lights_lambert_fragment:Sc,lights_lambert_pars_fragment:Tc,lights_pars_begin:Ac,lights_toon_fragment:Cc,lights_toon_pars_fragment:Pc,lights_phong_fragment:Rc,lights_phong_pars_fragment:Lc,lights_physical_fragment:Ic,lights_physical_pars_fragment:Dc,lights_fragment_begin:Nc,lights_fragment_maps:Fc,lights_fragment_end:zc,logdepthbuf_fragment:Oc,logdepthbuf_pars_fragment:Uc,logdepthbuf_pars_vertex:Bc,logdepthbuf_vertex:kc,map_fragment:Vc,map_pars_fragment:Gc,map_particle_fragment:Hc,map_particle_pars_fragment:Wc,metalnessmap_fragment:Xc,metalnessmap_pars_fragment:qc,morphcolor_vertex:Yc,morphnormal_vertex:Zc,morphtarget_pars_vertex:Jc,morphtarget_vertex:$c,normal_fragment_begin:Kc,normal_fragment_maps:jc,normal_pars_fragment:Qc,normal_pars_vertex:th,normal_vertex:eh,normalmap_pars_fragment:nh,clearcoat_normal_fragment_begin:ih,clearcoat_normal_fragment_maps:sh,clearcoat_pars_fragment:rh,iridescence_pars_fragment:ah,output_fragment:oh,packing:lh,premultiplied_alpha_fragment:ch,project_vertex:hh,dithering_fragment:uh,dithering_pars_fragment:dh,roughnessmap_fragment:fh,roughnessmap_pars_fragment:ph,shadowmap_pars_fragment:mh,shadowmap_pars_vertex:gh,shadowmap_vertex:_h,shadowmask_pars_fragment:xh,skinbase_vertex:yh,skinning_pars_vertex:vh,skinning_vertex:Mh,skinnormal_vertex:bh,specularmap_fragment:wh,specularmap_pars_fragment:Sh,tonemapping_fragment:Th,tonemapping_pars_fragment:Ah,transmission_fragment:Eh,transmission_pars_fragment:Ch,uv_pars_fragment:Ph,uv_pars_vertex:Rh,uv_vertex:Lh,uv2_pars_fragment:Ih,uv2_pars_vertex:Dh,uv2_vertex:Nh,worldpos_vertex:Fh,background_vert:zh,background_frag:Oh,backgroundCube_vert:Uh,backgroundCube_frag:Bh,cube_vert:kh,cube_frag:Vh,depth_vert:Gh,depth_frag:Hh,distanceRGBA_vert:Wh,distanceRGBA_frag:Xh,equirect_vert:qh,equirect_frag:Yh,linedashed_vert:Zh,linedashed_frag:Jh,meshbasic_vert:$h,meshbasic_frag:Kh,meshlambert_vert:jh,meshlambert_frag:Qh,meshmatcap_vert:tu,meshmatcap_frag:eu,meshnormal_vert:nu,meshnormal_frag:iu,meshphong_vert:su,meshphong_frag:ru,meshphysical_vert:au,meshphysical_frag:ou,meshtoon_vert:lu,meshtoon_frag:cu,points_vert:hu,points_frag:uu,shadow_vert:du,shadow_frag:fu,sprite_vert:pu,sprite_frag:mu},et={common:{diffuse:{value:new Ot(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new oe},uv2Transform:{value:new oe},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Nt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new oe}},sprite:{diffuse:{value:new Ot(16777215)},opacity:{value:1},center:{value:new Nt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new oe}}},De={basic:{uniforms:re([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.fog]),vertexShader:wt.meshbasic_vert,fragmentShader:wt.meshbasic_frag},lambert:{uniforms:re([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.fog,et.lights,{emissive:{value:new Ot(0)}}]),vertexShader:wt.meshlambert_vert,fragmentShader:wt.meshlambert_frag},phong:{uniforms:re([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.fog,et.lights,{emissive:{value:new Ot(0)},specular:{value:new Ot(1118481)},shininess:{value:30}}]),vertexShader:wt.meshphong_vert,fragmentShader:wt.meshphong_frag},standard:{uniforms:re([et.common,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.roughnessmap,et.metalnessmap,et.fog,et.lights,{emissive:{value:new Ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag},toon:{uniforms:re([et.common,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.gradientmap,et.fog,et.lights,{emissive:{value:new Ot(0)}}]),vertexShader:wt.meshtoon_vert,fragmentShader:wt.meshtoon_frag},matcap:{uniforms:re([et.common,et.bumpmap,et.normalmap,et.displacementmap,et.fog,{matcap:{value:null}}]),vertexShader:wt.meshmatcap_vert,fragmentShader:wt.meshmatcap_frag},points:{uniforms:re([et.points,et.fog]),vertexShader:wt.points_vert,fragmentShader:wt.points_frag},dashed:{uniforms:re([et.common,et.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wt.linedashed_vert,fragmentShader:wt.linedashed_frag},depth:{uniforms:re([et.common,et.displacementmap]),vertexShader:wt.depth_vert,fragmentShader:wt.depth_frag},normal:{uniforms:re([et.common,et.bumpmap,et.normalmap,et.displacementmap,{opacity:{value:1}}]),vertexShader:wt.meshnormal_vert,fragmentShader:wt.meshnormal_frag},sprite:{uniforms:re([et.sprite,et.fog]),vertexShader:wt.sprite_vert,fragmentShader:wt.sprite_frag},background:{uniforms:{uvTransform:{value:new oe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:wt.background_vert,fragmentShader:wt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:wt.backgroundCube_vert,fragmentShader:wt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:wt.cube_vert,fragmentShader:wt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wt.equirect_vert,fragmentShader:wt.equirect_frag},distanceRGBA:{uniforms:re([et.common,et.displacementmap,{referencePosition:{value:new N},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wt.distanceRGBA_vert,fragmentShader:wt.distanceRGBA_frag},shadow:{uniforms:re([et.lights,et.fog,{color:{value:new Ot(0)},opacity:{value:1}}]),vertexShader:wt.shadow_vert,fragmentShader:wt.shadow_frag}};De.physical={uniforms:re([De.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Nt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Ot(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Nt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ot(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ot(1,1,1)},specularColorMap:{value:null}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag};var zi={r:0,b:0,g:0};function gu(r,t,e,n,i,s,o){let a=new Ot(0),c=s===!0?0:1,l,h,f=null,u=0,m=null;function _(d,v){let T=!1,b=v.isScene===!0?v.background:null;b&&b.isTexture&&(b=(v.backgroundBlurriness>0?e:t).get(b));let M=r.xr,A=M.getSession&&M.getSession();A&&A.environmentBlendMode==="additive"&&(b=null),b===null?p(a,c):b&&b.isColor&&(p(b,1),T=!0),(r.autoClear||T)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),b&&(b.isCubeTexture||b.mapping===ns)?(h===void 0&&(h=new Ne(new bn(1,1,1),new Ze({name:"BackgroundCubeMaterial",uniforms:$n(De.backgroundCube.uniforms),vertexShader:De.backgroundCube.vertexShader,fragmentShader:De.backgroundCube.fragmentShader,side:ye,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,I,x){this.matrixWorld.copyPosition(x.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),h.material.uniforms.envMap.value=b,h.material.uniforms.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.toneMapped=b.encoding!==zt,(f!==b||u!==b.version||m!==r.toneMapping)&&(h.material.needsUpdate=!0,f=b,u=b.version,m=r.toneMapping),h.layers.enableAll(),d.unshift(h,h.geometry,h.material,0,0,null)):b&&b.isTexture&&(l===void 0&&(l=new Ne(new xi(2,2),new Ze({name:"BackgroundMaterial",uniforms:$n(De.background.uniforms),vertexShader:De.background.vertexShader,fragmentShader:De.background.fragmentShader,side:nn,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=b,l.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,l.material.toneMapped=b.encoding!==zt,b.matrixAutoUpdate===!0&&b.updateMatrix(),l.material.uniforms.uvTransform.value.copy(b.matrix),(f!==b||u!==b.version||m!==r.toneMapping)&&(l.material.needsUpdate=!0,f=b,u=b.version,m=r.toneMapping),l.layers.enableAll(),d.unshift(l,l.geometry,l.material,0,0,null))}function p(d,v){d.getRGB(zi,Ka(r)),n.buffers.color.setClear(zi.r,zi.g,zi.b,v,o)}return{getClearColor:function(){return a},setClearColor:function(d,v=1){a.set(d),c=v,p(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(d){c=d,p(a,c)},render:_}}function _u(r,t,e,n){let i=r.getParameter(34921),s=n.isWebGL2?null:t.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},c=d(null),l=c,h=!1;function f(R,G,Y,j,W){let Q=!1;if(o){let Z=p(j,Y,G);l!==Z&&(l=Z,m(l.object)),Q=v(R,j,Y,W),Q&&T(R,j,Y,W)}else{let Z=G.wireframe===!0;(l.geometry!==j.id||l.program!==Y.id||l.wireframe!==Z)&&(l.geometry=j.id,l.program=Y.id,l.wireframe=Z,Q=!0)}W!==null&&e.update(W,34963),(Q||h)&&(h=!1,x(R,G,Y,j),W!==null&&r.bindBuffer(34963,e.get(W).buffer))}function u(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function m(R){return n.isWebGL2?r.bindVertexArray(R):s.bindVertexArrayOES(R)}function _(R){return n.isWebGL2?r.deleteVertexArray(R):s.deleteVertexArrayOES(R)}function p(R,G,Y){let j=Y.wireframe===!0,W=a[R.id];W===void 0&&(W={},a[R.id]=W);let Q=W[G.id];Q===void 0&&(Q={},W[G.id]=Q);let Z=Q[j];return Z===void 0&&(Z=d(u()),Q[j]=Z),Z}function d(R){let G=[],Y=[],j=[];for(let W=0;W<i;W++)G[W]=0,Y[W]=0,j[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:G,enabledAttributes:Y,attributeDivisors:j,object:R,attributes:{},index:null}}function v(R,G,Y,j){let W=l.attributes,Q=G.attributes,Z=0,ft=Y.getAttributes();for(let F in ft)if(ft[F].location>=0){let nt=W[F],it=Q[F];if(it===void 0&&(F==="instanceMatrix"&&R.instanceMatrix&&(it=R.instanceMatrix),F==="instanceColor"&&R.instanceColor&&(it=R.instanceColor)),nt===void 0||nt.attribute!==it||it&&nt.data!==it.data)return!0;Z++}return l.attributesNum!==Z||l.index!==j}function T(R,G,Y,j){let W={},Q=G.attributes,Z=0,ft=Y.getAttributes();for(let F in ft)if(ft[F].location>=0){let nt=Q[F];nt===void 0&&(F==="instanceMatrix"&&R.instanceMatrix&&(nt=R.instanceMatrix),F==="instanceColor"&&R.instanceColor&&(nt=R.instanceColor));let it={};it.attribute=nt,nt&&nt.data&&(it.data=nt.data),W[F]=it,Z++}l.attributes=W,l.attributesNum=Z,l.index=j}function b(){let R=l.newAttributes;for(let G=0,Y=R.length;G<Y;G++)R[G]=0}function M(R){A(R,0)}function A(R,G){let Y=l.newAttributes,j=l.enabledAttributes,W=l.attributeDivisors;Y[R]=1,j[R]===0&&(r.enableVertexAttribArray(R),j[R]=1),W[R]!==G&&((n.isWebGL2?r:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](R,G),W[R]=G)}function C(){let R=l.newAttributes,G=l.enabledAttributes;for(let Y=0,j=G.length;Y<j;Y++)G[Y]!==R[Y]&&(r.disableVertexAttribArray(Y),G[Y]=0)}function I(R,G,Y,j,W,Q){n.isWebGL2===!0&&(Y===5124||Y===5125)?r.vertexAttribIPointer(R,G,Y,W,Q):r.vertexAttribPointer(R,G,Y,j,W,Q)}function x(R,G,Y,j){if(n.isWebGL2===!1&&(R.isInstancedMesh||j.isInstancedBufferGeometry)&&t.get("ANGLE_instanced_arrays")===null)return;b();let W=j.attributes,Q=Y.getAttributes(),Z=G.defaultAttributeValues;for(let ft in Q){let F=Q[ft];if(F.location>=0){let J=W[ft];if(J===void 0&&(ft==="instanceMatrix"&&R.instanceMatrix&&(J=R.instanceMatrix),ft==="instanceColor"&&R.instanceColor&&(J=R.instanceColor)),J!==void 0){let nt=J.normalized,it=J.itemSize,O=e.get(J);if(O===void 0)continue;let Mt=O.buffer,ht=O.type,ut=O.bytesPerElement;if(J.isInterleavedBufferAttribute){let ot=J.data,Ft=ot.stride,bt=J.offset;if(ot.isInstancedInterleavedBuffer){for(let xt=0;xt<F.locationSize;xt++)A(F.location+xt,ot.meshPerAttribute);R.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=ot.meshPerAttribute*ot.count)}else for(let xt=0;xt<F.locationSize;xt++)M(F.location+xt);r.bindBuffer(34962,Mt);for(let xt=0;xt<F.locationSize;xt++)I(F.location+xt,it/F.locationSize,ht,nt,Ft*ut,(bt+it/F.locationSize*xt)*ut)}else{if(J.isInstancedBufferAttribute){for(let ot=0;ot<F.locationSize;ot++)A(F.location+ot,J.meshPerAttribute);R.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let ot=0;ot<F.locationSize;ot++)M(F.location+ot);r.bindBuffer(34962,Mt);for(let ot=0;ot<F.locationSize;ot++)I(F.location+ot,it/F.locationSize,ht,nt,it*ut,it/F.locationSize*ot*ut)}}else if(Z!==void 0){let nt=Z[ft];if(nt!==void 0)switch(nt.length){case 2:r.vertexAttrib2fv(F.location,nt);break;case 3:r.vertexAttrib3fv(F.location,nt);break;case 4:r.vertexAttrib4fv(F.location,nt);break;default:r.vertexAttrib1fv(F.location,nt)}}}}C()}function S(){q();for(let R in a){let G=a[R];for(let Y in G){let j=G[Y];for(let W in j)_(j[W].object),delete j[W];delete G[Y]}delete a[R]}}function L(R){if(a[R.id]===void 0)return;let G=a[R.id];for(let Y in G){let j=G[Y];for(let W in j)_(j[W].object),delete j[W];delete G[Y]}delete a[R.id]}function X(R){for(let G in a){let Y=a[G];if(Y[R.id]===void 0)continue;let j=Y[R.id];for(let W in j)_(j[W].object),delete j[W];delete Y[R.id]}}function q(){z(),h=!0,l!==c&&(l=c,m(l.object))}function z(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:f,reset:q,resetDefaultState:z,dispose:S,releaseStatesOfGeometry:L,releaseStatesOfProgram:X,initAttributes:b,enableAttribute:M,disableUnusedAttributes:C}}function xu(r,t,e,n){let i=n.isWebGL2,s;function o(l){s=l}function a(l,h){r.drawArrays(s,l,h),e.update(h,s,1)}function c(l,h,f){if(f===0)return;let u,m;if(i)u=r,m="drawArraysInstanced";else if(u=t.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",u===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}u[m](s,l,h,f),e.update(h,s,f)}this.setMode=o,this.render=a,this.renderInstances=c}function yu(r,t,e){let n;function i(){if(n!==void 0)return n;if(t.has("EXT_texture_filter_anisotropic")===!0){let I=t.get("EXT_texture_filter_anisotropic");n=r.getParameter(I.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(I){if(I==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";I="mediump"}return I==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext,a=e.precision!==void 0?e.precision:"highp",c=s(a);c!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",c,"instead."),a=c);let l=o||t.has("WEBGL_draw_buffers"),h=e.logarithmicDepthBuffer===!0,f=r.getParameter(34930),u=r.getParameter(35660),m=r.getParameter(3379),_=r.getParameter(34076),p=r.getParameter(34921),d=r.getParameter(36347),v=r.getParameter(36348),T=r.getParameter(36349),b=u>0,M=o||t.has("OES_texture_float"),A=b&&M,C=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:f,maxVertexTextures:u,maxTextureSize:m,maxCubemapSize:_,maxAttributes:p,maxVertexUniforms:d,maxVaryings:v,maxFragmentUniforms:T,vertexTextures:b,floatFragmentTextures:M,floatVertexTextures:A,maxSamples:C}}function vu(r){let t=this,e=null,n=0,i=!1,s=!1,o=new He,a=new oe,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(f,u){let m=f.length!==0||u||n!==0||i;return i=u,n=f.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,u){e=h(f,u,0)},this.setState=function(f,u,m){let _=f.clippingPlanes,p=f.clipIntersection,d=f.clipShadows,v=r.get(f);if(!i||_===null||_.length===0||s&&!d)s?h(null):l();else{let T=s?0:n,b=T*4,M=v.clippingState||null;c.value=M,M=h(_,u,b,m);for(let A=0;A!==b;++A)M[A]=e[A];v.clippingState=M,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=T}};function l(){c.value!==e&&(c.value=e,c.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(f,u,m,_){let p=f!==null?f.length:0,d=null;if(p!==0){if(d=c.value,_!==!0||d===null){let v=m+p*4,T=u.matrixWorldInverse;a.getNormalMatrix(T),(d===null||d.length<v)&&(d=new Float32Array(v));for(let b=0,M=m;b!==p;++b,M+=4)o.copy(f[b]).applyMatrix4(T,a),o.normal.toArray(d,M),d[M+3]=o.constant}c.value=d,c.needsUpdate=!0}return t.numPlanes=p,t.numIntersection=0,d}}function Mu(r){let t=new WeakMap;function e(o,a){return a===Hs?o.mapping=Xn:a===Ws&&(o.mapping=qn),o}function n(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){let a=o.mapping;if(a===Hs||a===Ws)if(t.has(o)){let c=t.get(o).texture;return e(c,o.mapping)}else{let c=o.image;if(c&&c.height>0){let l=new js(c.height/2);return l.fromEquirectangularTexture(r,o),t.set(o,l),o.addEventListener("dispose",i),e(l.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let c=t.get(a);c!==void 0&&(t.delete(a),c.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var Qs=class extends ji{constructor(t=-1,e=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,o=n+t,a=i+e,c=i-e;if(this.view!==null&&this.view.enabled){let l=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=l*this.view.offsetX,o=s+l*this.view.width,a-=h*this.view.offsetY,c=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,c,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},kn=4,Ma=[.125,.215,.35,.446,.526,.582],pn=20,Bs=new Qs,ba=new Ot,ks=null,fn=(1+Math.sqrt(5))/2,Un=1/fn,wa=[new N(1,1,1),new N(-1,1,1),new N(1,1,-1),new N(-1,1,-1),new N(0,fn,Un),new N(0,fn,-Un),new N(Un,0,fn),new N(-Un,0,fn),new N(fn,Un,0),new N(-fn,Un,0)],es=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){ks=this._renderer.getRenderTarget(),this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Aa(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Ta(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(ks),t.scissorTest=!1,Oi(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Xn||t.mapping===qn?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),ks=this._renderer.getRenderTarget();let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:Se,minFilter:Se,generateMipmaps:!1,type:mi,format:Re,encoding:vn,depthBuffer:!1},i=Sa(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Sa(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=bu(s)),this._blurMaterial=wu(s,t,e)}return i}_compileMaterial(t){let e=new Ne(this._lodPlanes[0],t);this._renderer.compile(e,Bs)}_sceneToCubeUV(t,e,n,i){let a=new _e(90,1,e,n),c=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,u=h.toneMapping;h.getClearColor(ba),h.toneMapping=We,h.autoClear=!1;let m=new Ji({name:"PMREM.Background",side:ye,depthWrite:!1,depthTest:!1}),_=new Ne(new bn,m),p=!1,d=t.background;d?d.isColor&&(m.color.copy(d),t.background=null,p=!0):(m.color.copy(ba),p=!0);for(let v=0;v<6;v++){let T=v%3;T===0?(a.up.set(0,c[v],0),a.lookAt(l[v],0,0)):T===1?(a.up.set(0,0,c[v]),a.lookAt(0,l[v],0)):(a.up.set(0,c[v],0),a.lookAt(0,0,l[v]));let b=this._cubeSize;Oi(i,T*b,v>2?b:0,b,b),h.setRenderTarget(i),p&&h.render(_,a),h.render(t,a)}_.geometry.dispose(),_.material.dispose(),h.toneMapping=u,h.autoClear=f,t.background=d}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===Xn||t.mapping===qn;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Aa()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Ta());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new Ne(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let c=this._cubeSize;Oi(e,0,0,3*c,2*c),n.setRenderTarget(e),n.render(o,Bs)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){let s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=wa[(i-1)%wa.length];this._blur(t,i-1,i,s,o)}e.autoClear=n}_blur(t,e,n,i,s){let o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",s),this._halfBlur(o,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,o,a){let c=this._renderer,l=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let h=3,f=new Ne(this._lodPlanes[i],l),u=l.uniforms,m=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*pn-1),p=s/_,d=isFinite(s)?1+Math.floor(h*p):pn;d>pn&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${d} samples when the maximum is set to ${pn}`);let v=[],T=0;for(let I=0;I<pn;++I){let x=I/p,S=Math.exp(-x*x/2);v.push(S),I===0?T+=S:I<d&&(T+=2*S)}for(let I=0;I<v.length;I++)v[I]=v[I]/T;u.envMap.value=t.texture,u.samples.value=d,u.weights.value=v,u.latitudinal.value=o==="latitudinal",a&&(u.poleAxis.value=a);let{_lodMax:b}=this;u.dTheta.value=_,u.mipInt.value=b-n;let M=this._sizeLods[i],A=3*M*(i>b-kn?i-b+kn:0),C=4*(this._cubeSize-M);Oi(e,A,C,3*M,2*M),c.setRenderTarget(e),c.render(f,Bs)}};function bu(r){let t=[],e=[],n=[],i=r,s=r-kn+1+Ma.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let c=1/a;o>r-kn?c=Ma[o-r+kn-1]:o===0&&(c=0),n.push(c);let l=1/(a-2),h=-l,f=1+l,u=[h,h,f,h,f,f,h,h,f,f,h,f],m=6,_=6,p=3,d=2,v=1,T=new Float32Array(p*_*m),b=new Float32Array(d*_*m),M=new Float32Array(v*_*m);for(let C=0;C<m;C++){let I=C%3*2/3-1,x=C>2?0:-1,S=[I,x,0,I+2/3,x,0,I+2/3,x+1,0,I,x,0,I+2/3,x+1,0,I,x+1,0];T.set(S,p*_*C),b.set(u,d*_*C);let L=[C,C,C,C,C,C];M.set(L,v*_*C)}let A=new Ye;A.setAttribute("position",new ce(T,p)),A.setAttribute("uv",new ce(b,d)),A.setAttribute("faceIndex",new ce(M,v)),t.push(A),i>kn&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Sa(r,t,e){let n=new qe(r,t,e);return n.texture.mapping=ns,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Oi(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function wu(r,t,e){let n=new Float32Array(pn),i=new N(0,1,0);return new Ze({name:"SphericalGaussianBlur",defines:{n:pn,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:br(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues\' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,blending:en,depthTest:!1,depthWrite:!1})}function Ta(){return new Ze({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:br(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,blending:en,depthTest:!1,depthWrite:!1})}function Aa(){return new Ze({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:br(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,blending:en,depthTest:!1,depthWrite:!1})}function br(){return`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`}function Su(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let c=a.mapping,l=c===Hs||c===Ws,h=c===Xn||c===qn;if(l||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let f=t.get(a);return e===null&&(e=new es(r)),f=l?e.fromEquirectangular(a,f):e.fromCubemap(a,f),t.set(a,f),f.texture}else{if(t.has(a))return t.get(a).texture;{let f=a.image;if(l&&f&&f.height>0||h&&f&&i(f)){e===null&&(e=new es(r));let u=l?e.fromEquirectangular(a):e.fromCubemap(a);return t.set(a,u),a.addEventListener("dispose",s),u.texture}else return null}}}return a}function i(a){let c=0,l=6;for(let h=0;h<l;h++)a[h]!==void 0&&c++;return c===l}function s(a){let c=a.target;c.removeEventListener("dispose",s);let l=t.get(c);l!==void 0&&(t.delete(c),l.dispose())}function o(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:o}}function Tu(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(n){n.isWebGL2?e("EXT_color_buffer_float"):(e("WEBGL_depth_texture"),e("OES_texture_float"),e("OES_texture_half_float"),e("OES_texture_half_float_linear"),e("OES_standard_derivatives"),e("OES_element_index_uint"),e("OES_vertex_array_object"),e("ANGLE_instanced_arrays")),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function Au(r,t,e,n){let i={},s=new WeakMap;function o(f){let u=f.target;u.index!==null&&t.remove(u.index);for(let _ in u.attributes)t.remove(u.attributes[_]);u.removeEventListener("dispose",o),delete i[u.id];let m=s.get(u);m&&(t.remove(m),s.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,e.memory.geometries--}function a(f,u){return i[u.id]===!0||(u.addEventListener("dispose",o),i[u.id]=!0,e.memory.geometries++),u}function c(f){let u=f.attributes;for(let _ in u)t.update(u[_],34962);let m=f.morphAttributes;for(let _ in m){let p=m[_];for(let d=0,v=p.length;d<v;d++)t.update(p[d],34962)}}function l(f){let u=[],m=f.index,_=f.attributes.position,p=0;if(m!==null){let T=m.array;p=m.version;for(let b=0,M=T.length;b<M;b+=3){let A=T[b+0],C=T[b+1],I=T[b+2];u.push(A,C,C,I,I,A)}}else{let T=_.array;p=_.version;for(let b=0,M=T.length/3-1;b<M;b+=3){let A=b+0,C=b+1,I=b+2;u.push(A,C,C,I,I,A)}}let d=new(Ja(u)?Ki:$i)(u,1);d.version=p;let v=s.get(f);v&&t.remove(v),s.set(f,d)}function h(f){let u=s.get(f);if(u){let m=f.index;m!==null&&u.version<m.version&&l(f)}else l(f);return s.get(f)}return{get:a,update:c,getWireframeAttribute:h}}function Eu(r,t,e,n){let i=n.isWebGL2,s;function o(u){s=u}let a,c;function l(u){a=u.type,c=u.bytesPerElement}function h(u,m){r.drawElements(s,m,a,u*c),e.update(m,s,1)}function f(u,m,_){if(_===0)return;let p,d;if(i)p=r,d="drawElementsInstanced";else if(p=t.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",p===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[d](s,m,a,u*c,_),e.update(m,s,_)}this.setMode=o,this.setIndex=l,this.render=h,this.renderInstances=f}function Cu(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(e.calls++,o){case 4:e.triangles+=a*(s/3);break;case 1:e.lines+=a*(s/2);break;case 3:e.lines+=a*(s-1);break;case 2:e.lines+=a*s;break;case 0:e.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function Pu(r,t){return r[0]-t[0]}function Ru(r,t){return Math.abs(t[1])-Math.abs(r[1])}function Lu(r,t,e){let n={},i=new Float32Array(8),s=new WeakMap,o=new Xt,a=[];for(let l=0;l<8;l++)a[l]=[l,0];function c(l,h,f,u){let m=l.morphTargetInfluences;if(t.isWebGL2===!0){let _=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,p=_!==void 0?_.length:0,d=s.get(h);if(d===void 0||d.count!==p){let G=function(){z.dispose(),s.delete(h),h.removeEventListener("dispose",G)};d!==void 0&&d.texture.dispose();let b=h.morphAttributes.position!==void 0,M=h.morphAttributes.normal!==void 0,A=h.morphAttributes.color!==void 0,C=h.morphAttributes.position||[],I=h.morphAttributes.normal||[],x=h.morphAttributes.color||[],S=0;b===!0&&(S=1),M===!0&&(S=2),A===!0&&(S=3);let L=h.attributes.position.count*S,X=1;L>t.maxTextureSize&&(X=Math.ceil(L/t.maxTextureSize),L=t.maxTextureSize);let q=new Float32Array(L*X*4*p),z=new Yi(q,L,X,p);z.type=gn,z.needsUpdate=!0;let R=S*4;for(let Y=0;Y<p;Y++){let j=C[Y],W=I[Y],Q=x[Y],Z=L*X*4*Y;for(let ft=0;ft<j.count;ft++){let F=ft*R;b===!0&&(o.fromBufferAttribute(j,ft),q[Z+F+0]=o.x,q[Z+F+1]=o.y,q[Z+F+2]=o.z,q[Z+F+3]=0),M===!0&&(o.fromBufferAttribute(W,ft),q[Z+F+4]=o.x,q[Z+F+5]=o.y,q[Z+F+6]=o.z,q[Z+F+7]=0),A===!0&&(o.fromBufferAttribute(Q,ft),q[Z+F+8]=o.x,q[Z+F+9]=o.y,q[Z+F+10]=o.z,q[Z+F+11]=Q.itemSize===4?o.w:1)}}d={count:p,texture:z,size:new Nt(L,X)},s.set(h,d),h.addEventListener("dispose",G)}let v=0;for(let b=0;b<m.length;b++)v+=m[b];let T=h.morphTargetsRelative?1:1-v;u.getUniforms().setValue(r,"morphTargetBaseInfluence",T),u.getUniforms().setValue(r,"morphTargetInfluences",m),u.getUniforms().setValue(r,"morphTargetsTexture",d.texture,e),u.getUniforms().setValue(r,"morphTargetsTextureSize",d.size)}else{let _=m===void 0?0:m.length,p=n[h.id];if(p===void 0||p.length!==_){p=[];for(let M=0;M<_;M++)p[M]=[M,0];n[h.id]=p}for(let M=0;M<_;M++){let A=p[M];A[0]=M,A[1]=m[M]}p.sort(Ru);for(let M=0;M<8;M++)M<_&&p[M][1]?(a[M][0]=p[M][0],a[M][1]=p[M][1]):(a[M][0]=Number.MAX_SAFE_INTEGER,a[M][1]=0);a.sort(Pu);let d=h.morphAttributes.position,v=h.morphAttributes.normal,T=0;for(let M=0;M<8;M++){let A=a[M],C=A[0],I=A[1];C!==Number.MAX_SAFE_INTEGER&&I?(d&&h.getAttribute("morphTarget"+M)!==d[C]&&h.setAttribute("morphTarget"+M,d[C]),v&&h.getAttribute("morphNormal"+M)!==v[C]&&h.setAttribute("morphNormal"+M,v[C]),i[M]=I,T+=I):(d&&h.hasAttribute("morphTarget"+M)===!0&&h.deleteAttribute("morphTarget"+M),v&&h.hasAttribute("morphNormal"+M)===!0&&h.deleteAttribute("morphNormal"+M),i[M]=0)}let b=h.morphTargetsRelative?1:1-T;u.getUniforms().setValue(r,"morphTargetBaseInfluence",b),u.getUniforms().setValue(r,"morphTargetInfluences",i)}}return{update:c}}function Iu(r,t,e,n){let i=new WeakMap;function s(c){let l=n.render.frame,h=c.geometry,f=t.get(c,h);return i.get(f)!==l&&(t.update(f),i.set(f,l)),c.isInstancedMesh&&(c.hasEventListener("dispose",a)===!1&&c.addEventListener("dispose",a),e.update(c.instanceMatrix,34962),c.instanceColor!==null&&e.update(c.instanceColor,34962)),f}function o(){i=new WeakMap}function a(c){let l=c.target;l.removeEventListener("dispose",a),e.remove(l.instanceMatrix),l.instanceColor!==null&&e.remove(l.instanceColor)}return{update:s,dispose:o}}var Qa=new le,to=new Yi,eo=new Js,no=new Qi,Ea=[],Ca=[],Pa=new Float32Array(16),Ra=new Float32Array(9),La=new Float32Array(4);function Qn(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=Ea[i];if(s===void 0&&(s=new Float32Array(i),Ea[i]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,r[o].toArray(s,a)}return s}function Yt(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function Zt(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function is(r,t){let e=Ca[t];e===void 0&&(e=new Int32Array(t),Ca[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function Du(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function Nu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Yt(e,t))return;r.uniform2fv(this.addr,t),Zt(e,t)}}function Fu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Yt(e,t))return;r.uniform3fv(this.addr,t),Zt(e,t)}}function zu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Yt(e,t))return;r.uniform4fv(this.addr,t),Zt(e,t)}}function Ou(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Yt(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Zt(e,t)}else{if(Yt(e,n))return;La.set(n),r.uniformMatrix2fv(this.addr,!1,La),Zt(e,n)}}function Uu(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Yt(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Zt(e,t)}else{if(Yt(e,n))return;Ra.set(n),r.uniformMatrix3fv(this.addr,!1,Ra),Zt(e,n)}}function Bu(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Yt(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Zt(e,t)}else{if(Yt(e,n))return;Pa.set(n),r.uniformMatrix4fv(this.addr,!1,Pa),Zt(e,n)}}function ku(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function Vu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Yt(e,t))return;r.uniform2iv(this.addr,t),Zt(e,t)}}function Gu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Yt(e,t))return;r.uniform3iv(this.addr,t),Zt(e,t)}}function Hu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Yt(e,t))return;r.uniform4iv(this.addr,t),Zt(e,t)}}function Wu(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function Xu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Yt(e,t))return;r.uniform2uiv(this.addr,t),Zt(e,t)}}function qu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Yt(e,t))return;r.uniform3uiv(this.addr,t),Zt(e,t)}}function Yu(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Yt(e,t))return;r.uniform4uiv(this.addr,t),Zt(e,t)}}function Zu(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2D(t||Qa,i)}function Ju(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||eo,i)}function $u(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||no,i)}function Ku(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||to,i)}function ju(r){switch(r){case 5126:return Du;case 35664:return Nu;case 35665:return Fu;case 35666:return zu;case 35674:return Ou;case 35675:return Uu;case 35676:return Bu;case 5124:case 35670:return ku;case 35667:case 35671:return Vu;case 35668:case 35672:return Gu;case 35669:case 35673:return Hu;case 5125:return Wu;case 36294:return Xu;case 36295:return qu;case 36296:return Yu;case 35678:case 36198:case 36298:case 36306:case 35682:return Zu;case 35679:case 36299:case 36307:return Ju;case 35680:case 36300:case 36308:case 36293:return $u;case 36289:case 36303:case 36311:case 36292:return Ku}}function Qu(r,t){r.uniform1fv(this.addr,t)}function td(r,t){let e=Qn(t,this.size,2);r.uniform2fv(this.addr,e)}function ed(r,t){let e=Qn(t,this.size,3);r.uniform3fv(this.addr,e)}function nd(r,t){let e=Qn(t,this.size,4);r.uniform4fv(this.addr,e)}function id(r,t){let e=Qn(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function sd(r,t){let e=Qn(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function rd(r,t){let e=Qn(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function ad(r,t){r.uniform1iv(this.addr,t)}function od(r,t){r.uniform2iv(this.addr,t)}function ld(r,t){r.uniform3iv(this.addr,t)}function cd(r,t){r.uniform4iv(this.addr,t)}function hd(r,t){r.uniform1uiv(this.addr,t)}function ud(r,t){r.uniform2uiv(this.addr,t)}function dd(r,t){r.uniform3uiv(this.addr,t)}function fd(r,t){r.uniform4uiv(this.addr,t)}function pd(r,t,e){let n=this.cache,i=t.length,s=is(e,i);Yt(n,s)||(r.uniform1iv(this.addr,s),Zt(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||Qa,s[o])}function md(r,t,e){let n=this.cache,i=t.length,s=is(e,i);Yt(n,s)||(r.uniform1iv(this.addr,s),Zt(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||eo,s[o])}function gd(r,t,e){let n=this.cache,i=t.length,s=is(e,i);Yt(n,s)||(r.uniform1iv(this.addr,s),Zt(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||no,s[o])}function _d(r,t,e){let n=this.cache,i=t.length,s=is(e,i);Yt(n,s)||(r.uniform1iv(this.addr,s),Zt(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||to,s[o])}function xd(r){switch(r){case 5126:return Qu;case 35664:return td;case 35665:return ed;case 35666:return nd;case 35674:return id;case 35675:return sd;case 35676:return rd;case 5124:case 35670:return ad;case 35667:case 35671:return od;case 35668:case 35672:return ld;case 35669:case 35673:return cd;case 5125:return hd;case 36294:return ud;case 36295:return dd;case 36296:return fd;case 35678:case 36198:case 36298:case 36306:case 35682:return pd;case 35679:case 36299:case 36307:return md;case 35680:case 36300:case 36308:case 36293:return gd;case 36289:case 36303:case 36311:case 36292:return _d}}var tr=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=ju(e.type)}},er=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=xd(e.type)}},nr=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,o=i.length;s!==o;++s){let a=i[s];a.setValue(t,e[a.id],n)}}},Vs=/(\\w+)(\\])?(\\[|\\.)?/g;function Ia(r,t){r.seq.push(t),r.map[t.id]=t}function yd(r,t,e){let n=r.name,i=n.length;for(Vs.lastIndex=0;;){let s=Vs.exec(n),o=Vs.lastIndex,a=s[1],c=s[2]==="]",l=s[3];if(c&&(a=a|0),l===void 0||l==="["&&o+2===i){Ia(e,l===void 0?new tr(a,r,t):new er(a,r,t));break}else{let f=e.map[a];f===void 0&&(f=new nr(a),Ia(e,f)),e=f}}}var Wn=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,35718);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),o=t.getUniformLocation(e,s.name);yd(s,o,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,o=e.length;s!==o;++s){let a=e[s],c=n[a.id];c.needsUpdate!==!1&&a.setValue(t,c.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let o=t[i];o.id in e&&n.push(o)}return n}};function Da(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var vd=0;function Md(r,t){let e=r.split(`\n`),n=[],i=Math.max(t-6,0),s=Math.min(t+6,e.length);for(let o=i;o<s;o++){let a=o+1;n.push(`${a===t?">":" "} ${a}: ${e[o]}`)}return n.join(`\n`)}function bd(r){switch(r){case vn:return["Linear","( value )"];case zt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",r),["Linear","( value )"]}}function Na(r,t,e){let n=r.getShaderParameter(t,35713),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\\d+)/.exec(i);if(s){let o=parseInt(s[1]);return e.toUpperCase()+`\n\n`+i+`\n\n`+Md(r.getShaderSource(t),o)}else return i}function wd(r,t){let e=bd(t);return"vec4 "+r+"( vec4 value ) { return LinearTo"+e[0]+e[1]+"; }"}function Sd(r,t){let e;switch(t){case No:e="Linear";break;case Fo:e="Reinhard";break;case zo:e="OptimizedCineon";break;case Oo:e="ACESFilmic";break;case Uo:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function Td(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.tangentSpaceNormalMap||r.clearcoatNormalMap||r.flatShading||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(hi).join(`\n`)}function Ad(r){let t=[];for(let e in r){let n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`\n`)}function Ed(r,t){let e={},n=r.getProgramParameter(t,35721);for(let i=0;i<n;i++){let s=r.getActiveAttrib(t,i),o=s.name,a=1;s.type===35674&&(a=2),s.type===35675&&(a=3),s.type===35676&&(a=4),e[o]={type:s.type,location:r.getAttribLocation(t,o),locationSize:a}}return e}function hi(r){return r!==""}function Fa(r,t){let e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,e).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function za(r,t){return r.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Cd=/^[ \\t]*#include +<([\\w\\d./]+)>/gm;function ir(r){return r.replace(Cd,Pd)}function Pd(r,t){let e=wt[t];if(e===void 0)throw new Error("Can not resolve #include <"+t+">");return ir(e)}var Rd=/#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;function Oa(r){return r.replace(Rd,Ld)}function Ld(r,t,e,n){let i="";for(let s=parseInt(t);s<parseInt(e);s++)i+=n.replace(/\\[\\s*i\\s*\\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Ua(r){let t="precision "+r.precision+` float;\nprecision `+r.precision+" int;";return r.precision==="highp"?t+=`\n#define HIGH_PRECISION`:r.precision==="mediump"?t+=`\n#define MEDIUM_PRECISION`:r.precision==="lowp"&&(t+=`\n#define LOW_PRECISION`),t}function Id(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Ga?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===uo?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===li&&(t="SHADOWMAP_TYPE_VSM"),t}function Dd(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Xn:case qn:t="ENVMAP_TYPE_CUBE";break;case ns:t="ENVMAP_TYPE_CUBE_UV";break}return t}function Nd(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case qn:t="ENVMAP_MODE_REFRACTION";break}return t}function Fd(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case Xa:t="ENVMAP_BLENDING_MULTIPLY";break;case Io:t="ENVMAP_BLENDING_MIX";break;case Do:t="ENVMAP_BLENDING_ADD";break}return t}function zd(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function Od(r,t,e,n){let i=r.getContext(),s=e.defines,o=e.vertexShader,a=e.fragmentShader,c=Id(e),l=Dd(e),h=Nd(e),f=Fd(e),u=zd(e),m=e.isWebGL2?"":Td(e),_=Ad(s),p=i.createProgram(),d,v,T=e.glslVersion?"#version "+e.glslVersion+`\n`:"";e.isRawShaderMaterial?(d=[_].filter(hi).join(`\n`),d.length>0&&(d+=`\n`),v=[m,_].filter(hi).join(`\n`),v.length>0&&(v+=`\n`)):(d=[Ua(e),"#define SHADER_NAME "+e.shaderName,_,e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.displacementMap&&e.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",e.specularColorMap?"#define USE_SPECULARCOLORMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEENCOLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors&&e.isWebGL2?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",`\n`].filter(hi).join(`\n`),v=[m,Ua(e),"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.envMap?"#define "+h:"",e.envMap?"#define "+f:"",u?"#define CUBEUV_TEXEL_WIDTH "+u.texelWidth:"",u?"#define CUBEUV_TEXEL_HEIGHT "+u.texelHeight:"",u?"#define CUBEUV_MAX_MIP "+u.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",e.specularColorMap?"#define USE_SPECULARCOLORMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEENCOLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==We?"#define TONE_MAPPING":"",e.toneMapping!==We?wt.tonemapping_pars_fragment:"",e.toneMapping!==We?Sd("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",wt.encodings_pars_fragment,wd("linearToOutputTexel",e.outputEncoding),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`\n`].filter(hi).join(`\n`)),o=ir(o),o=Fa(o,e),o=za(o,e),a=ir(a),a=Fa(a,e),a=za(a,e),o=Oa(o),a=Oa(a),e.isWebGL2&&e.isRawShaderMaterial!==!0&&(T=`#version 300 es\n`,d=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`\n`)+`\n`+d,v=["#define varying in",e.glslVersion===ca?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===ca?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`\n`)+`\n`+v);let b=T+d+o,M=T+v+a,A=Da(i,35633,b),C=Da(i,35632,M);if(i.attachShader(p,A),i.attachShader(p,C),e.index0AttributeName!==void 0?i.bindAttribLocation(p,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(p,0,"position"),i.linkProgram(p),r.debug.checkShaderErrors){let S=i.getProgramInfoLog(p).trim(),L=i.getShaderInfoLog(A).trim(),X=i.getShaderInfoLog(C).trim(),q=!0,z=!0;if(i.getProgramParameter(p,35714)===!1){q=!1;let R=Na(i,A,"vertex"),G=Na(i,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(p,35715)+`\n\nProgram Info Log: `+S+`\n`+R+`\n`+G)}else S!==""?console.warn("THREE.WebGLProgram: Program Info Log:",S):(L===""||X==="")&&(z=!1);z&&(this.diagnostics={runnable:q,programLog:S,vertexShader:{log:L,prefix:d},fragmentShader:{log:X,prefix:v}})}i.deleteShader(A),i.deleteShader(C);let I;this.getUniforms=function(){return I===void 0&&(I=new Wn(i,p)),I};let x;return this.getAttributes=function(){return x===void 0&&(x=Ed(i,p)),x},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(p),this.program=void 0},this.name=e.shaderName,this.id=vd++,this.cacheKey=t,this.usedTimes=1,this.program=p,this.vertexShader=A,this.fragmentShader=C,this}var Ud=0,sr=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new rr(t),e.set(t,n)),n}},rr=class{constructor(t){this.id=Ud++,this.code=t,this.usedTimes=0}};function Bd(r,t,e,n,i,s,o){let a=new Zi,c=new sr,l=[],h=i.isWebGL2,f=i.logarithmicDepthBuffer,u=i.vertexTextures,m=i.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function p(x,S,L,X,q){let z=X.fog,R=q.geometry,G=x.isMeshStandardMaterial?X.environment:null,Y=(x.isMeshStandardMaterial?e:t).get(x.envMap||G),j=Y&&Y.mapping===ns?Y.image.height:null,W=_[x.type];x.precision!==null&&(m=i.getMaxPrecision(x.precision),m!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",m,"instead."));let Q=R.morphAttributes.position||R.morphAttributes.normal||R.morphAttributes.color,Z=Q!==void 0?Q.length:0,ft=0;R.morphAttributes.position!==void 0&&(ft=1),R.morphAttributes.normal!==void 0&&(ft=2),R.morphAttributes.color!==void 0&&(ft=3);let F,J,nt,it;if(W){let Ft=De[W];F=Ft.vertexShader,J=Ft.fragmentShader}else F=x.vertexShader,J=x.fragmentShader,c.update(x),nt=c.getVertexShaderID(x),it=c.getFragmentShaderID(x);let O=r.getRenderTarget(),Mt=x.alphaTest>0,ht=x.clearcoat>0,ut=x.iridescence>0;return{isWebGL2:h,shaderID:W,shaderName:x.type,vertexShader:F,fragmentShader:J,defines:x.defines,customVertexShaderID:nt,customFragmentShaderID:it,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:m,instancing:q.isInstancedMesh===!0,instancingColor:q.isInstancedMesh===!0&&q.instanceColor!==null,supportsVertexTextures:u,outputEncoding:O===null?r.outputEncoding:O.isXRRenderTarget===!0?O.texture.encoding:vn,map:!!x.map,matcap:!!x.matcap,envMap:!!Y,envMapMode:Y&&Y.mapping,envMapCubeUVHeight:j,lightMap:!!x.lightMap,aoMap:!!x.aoMap,emissiveMap:!!x.emissiveMap,bumpMap:!!x.bumpMap,normalMap:!!x.normalMap,objectSpaceNormalMap:x.normalMapType===sl,tangentSpaceNormalMap:x.normalMapType===il,decodeVideoTexture:!!x.map&&x.map.isVideoTexture===!0&&x.map.encoding===zt,clearcoat:ht,clearcoatMap:ht&&!!x.clearcoatMap,clearcoatRoughnessMap:ht&&!!x.clearcoatRoughnessMap,clearcoatNormalMap:ht&&!!x.clearcoatNormalMap,iridescence:ut,iridescenceMap:ut&&!!x.iridescenceMap,iridescenceThicknessMap:ut&&!!x.iridescenceThicknessMap,displacementMap:!!x.displacementMap,roughnessMap:!!x.roughnessMap,metalnessMap:!!x.metalnessMap,specularMap:!!x.specularMap,specularIntensityMap:!!x.specularIntensityMap,specularColorMap:!!x.specularColorMap,opaque:x.transparent===!1&&x.blending===Gn,alphaMap:!!x.alphaMap,alphaTest:Mt,gradientMap:!!x.gradientMap,sheen:x.sheen>0,sheenColorMap:!!x.sheenColorMap,sheenRoughnessMap:!!x.sheenRoughnessMap,transmission:x.transmission>0,transmissionMap:!!x.transmissionMap,thicknessMap:!!x.thicknessMap,combine:x.combine,vertexTangents:!!x.normalMap&&!!R.attributes.tangent,vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!R.attributes.color&&R.attributes.color.itemSize===4,vertexUvs:!!x.map||!!x.bumpMap||!!x.normalMap||!!x.specularMap||!!x.alphaMap||!!x.emissiveMap||!!x.roughnessMap||!!x.metalnessMap||!!x.clearcoatMap||!!x.clearcoatRoughnessMap||!!x.clearcoatNormalMap||!!x.iridescenceMap||!!x.iridescenceThicknessMap||!!x.displacementMap||!!x.transmissionMap||!!x.thicknessMap||!!x.specularIntensityMap||!!x.specularColorMap||!!x.sheenColorMap||!!x.sheenRoughnessMap,uvsVertexOnly:!(x.map||x.bumpMap||x.normalMap||x.specularMap||x.alphaMap||x.emissiveMap||x.roughnessMap||x.metalnessMap||x.clearcoatNormalMap||x.iridescenceMap||x.iridescenceThicknessMap||x.transmission>0||x.transmissionMap||x.thicknessMap||x.specularIntensityMap||x.specularColorMap||x.sheen>0||x.sheenColorMap||x.sheenRoughnessMap)&&!!x.displacementMap,fog:!!z,useFog:x.fog===!0,fogExp2:z&&z.isFogExp2,flatShading:!!x.flatShading,sizeAttenuation:x.sizeAttenuation,logarithmicDepthBuffer:f,skinning:q.isSkinnedMesh===!0,morphTargets:R.morphAttributes.position!==void 0,morphNormals:R.morphAttributes.normal!==void 0,morphColors:R.morphAttributes.color!==void 0,morphTargetsCount:Z,morphTextureStride:ft,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:x.toneMapped?r.toneMapping:We,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===tn,flipSided:x.side===ye,useDepthPacking:!!x.depthPacking,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionDerivatives:x.extensions&&x.extensions.derivatives,extensionFragDepth:x.extensions&&x.extensions.fragDepth,extensionDrawBuffers:x.extensions&&x.extensions.drawBuffers,extensionShaderTextureLOD:x.extensions&&x.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||n.has("EXT_shader_texture_lod"),customProgramCacheKey:x.customProgramCacheKey()}}function d(x){let S=[];if(x.shaderID?S.push(x.shaderID):(S.push(x.customVertexShaderID),S.push(x.customFragmentShaderID)),x.defines!==void 0)for(let L in x.defines)S.push(L),S.push(x.defines[L]);return x.isRawShaderMaterial===!1&&(v(S,x),T(S,x),S.push(r.outputEncoding)),S.push(x.customProgramCacheKey),S.join()}function v(x,S){x.push(S.precision),x.push(S.outputEncoding),x.push(S.envMapMode),x.push(S.envMapCubeUVHeight),x.push(S.combine),x.push(S.vertexUvs),x.push(S.fogExp2),x.push(S.sizeAttenuation),x.push(S.morphTargetsCount),x.push(S.morphAttributeCount),x.push(S.numDirLights),x.push(S.numPointLights),x.push(S.numSpotLights),x.push(S.numSpotLightMaps),x.push(S.numHemiLights),x.push(S.numRectAreaLights),x.push(S.numDirLightShadows),x.push(S.numPointLightShadows),x.push(S.numSpotLightShadows),x.push(S.numSpotLightShadowsWithMaps),x.push(S.shadowMapType),x.push(S.toneMapping),x.push(S.numClippingPlanes),x.push(S.numClipIntersection),x.push(S.depthPacking)}function T(x,S){a.disableAll(),S.isWebGL2&&a.enable(0),S.supportsVertexTextures&&a.enable(1),S.instancing&&a.enable(2),S.instancingColor&&a.enable(3),S.map&&a.enable(4),S.matcap&&a.enable(5),S.envMap&&a.enable(6),S.lightMap&&a.enable(7),S.aoMap&&a.enable(8),S.emissiveMap&&a.enable(9),S.bumpMap&&a.enable(10),S.normalMap&&a.enable(11),S.objectSpaceNormalMap&&a.enable(12),S.tangentSpaceNormalMap&&a.enable(13),S.clearcoat&&a.enable(14),S.clearcoatMap&&a.enable(15),S.clearcoatRoughnessMap&&a.enable(16),S.clearcoatNormalMap&&a.enable(17),S.iridescence&&a.enable(18),S.iridescenceMap&&a.enable(19),S.iridescenceThicknessMap&&a.enable(20),S.displacementMap&&a.enable(21),S.specularMap&&a.enable(22),S.roughnessMap&&a.enable(23),S.metalnessMap&&a.enable(24),S.gradientMap&&a.enable(25),S.alphaMap&&a.enable(26),S.alphaTest&&a.enable(27),S.vertexColors&&a.enable(28),S.vertexAlphas&&a.enable(29),S.vertexUvs&&a.enable(30),S.vertexTangents&&a.enable(31),S.uvsVertexOnly&&a.enable(32),x.push(a.mask),a.disableAll(),S.fog&&a.enable(0),S.useFog&&a.enable(1),S.flatShading&&a.enable(2),S.logarithmicDepthBuffer&&a.enable(3),S.skinning&&a.enable(4),S.morphTargets&&a.enable(5),S.morphNormals&&a.enable(6),S.morphColors&&a.enable(7),S.premultipliedAlpha&&a.enable(8),S.shadowMapEnabled&&a.enable(9),S.physicallyCorrectLights&&a.enable(10),S.doubleSided&&a.enable(11),S.flipSided&&a.enable(12),S.useDepthPacking&&a.enable(13),S.dithering&&a.enable(14),S.specularIntensityMap&&a.enable(15),S.specularColorMap&&a.enable(16),S.transmission&&a.enable(17),S.transmissionMap&&a.enable(18),S.thicknessMap&&a.enable(19),S.sheen&&a.enable(20),S.sheenColorMap&&a.enable(21),S.sheenRoughnessMap&&a.enable(22),S.decodeVideoTexture&&a.enable(23),S.opaque&&a.enable(24),x.push(a.mask)}function b(x){let S=_[x.type],L;if(S){let X=De[S];L=Il.clone(X.uniforms)}else L=x.uniforms;return L}function M(x,S){let L;for(let X=0,q=l.length;X<q;X++){let z=l[X];if(z.cacheKey===S){L=z,++L.usedTimes;break}}return L===void 0&&(L=new Od(r,S,x,s),l.push(L)),L}function A(x){if(--x.usedTimes===0){let S=l.indexOf(x);l[S]=l[l.length-1],l.pop(),x.destroy()}}function C(x){c.remove(x)}function I(){c.dispose()}return{getParameters:p,getProgramCacheKey:d,getUniforms:b,acquireProgram:M,releaseProgram:A,releaseShaderCache:C,programs:l,dispose:I}}function kd(){let r=new WeakMap;function t(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function e(s){r.delete(s)}function n(s,o,a){r.get(s)[o]=a}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function Vd(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function Ba(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function ka(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(f,u,m,_,p,d){let v=r[t];return v===void 0?(v={id:f.id,object:f,geometry:u,material:m,groupOrder:_,renderOrder:f.renderOrder,z:p,group:d},r[t]=v):(v.id=f.id,v.object=f,v.geometry=u,v.material=m,v.groupOrder=_,v.renderOrder=f.renderOrder,v.z=p,v.group=d),t++,v}function a(f,u,m,_,p,d){let v=o(f,u,m,_,p,d);m.transmission>0?n.push(v):m.transparent===!0?i.push(v):e.push(v)}function c(f,u,m,_,p,d){let v=o(f,u,m,_,p,d);m.transmission>0?n.unshift(v):m.transparent===!0?i.unshift(v):e.unshift(v)}function l(f,u){e.length>1&&e.sort(f||Vd),n.length>1&&n.sort(u||Ba),i.length>1&&i.sort(u||Ba)}function h(){for(let f=t,u=r.length;f<u;f++){let m=r[f];if(m.id===null)break;m.id=null,m.object=null,m.geometry=null,m.material=null,m.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:c,finish:h,sort:l}}function Gd(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new ka,r.set(n,[o])):i>=s.length?(o=new ka,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function Hd(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new N,color:new Ot};break;case"SpotLight":e={position:new N,direction:new N,color:new Ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new N,color:new Ot,distance:0,decay:0};break;case"HemisphereLight":e={direction:new N,skyColor:new Ot,groundColor:new Ot};break;case"RectAreaLight":e={color:new Ot,position:new N,halfWidth:new N,halfHeight:new N};break}return r[t.id]=e,e}}}function Wd(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Nt};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Nt};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Nt,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var Xd=0;function qd(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function Yd(r,t){let e=new Hd,n=Wd(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let h=0;h<9;h++)i.probe.push(new N);let s=new N,o=new qt,a=new qt;function c(h,f){let u=0,m=0,_=0;for(let X=0;X<9;X++)i.probe[X].set(0,0,0);let p=0,d=0,v=0,T=0,b=0,M=0,A=0,C=0,I=0,x=0;h.sort(qd);let S=f!==!0?Math.PI:1;for(let X=0,q=h.length;X<q;X++){let z=h[X],R=z.color,G=z.intensity,Y=z.distance,j=z.shadow&&z.shadow.map?z.shadow.map.texture:null;if(z.isAmbientLight)u+=R.r*G*S,m+=R.g*G*S,_+=R.b*G*S;else if(z.isLightProbe)for(let W=0;W<9;W++)i.probe[W].addScaledVector(z.sh.coefficients[W],G);else if(z.isDirectionalLight){let W=e.get(z);if(W.color.copy(z.color).multiplyScalar(z.intensity*S),z.castShadow){let Q=z.shadow,Z=n.get(z);Z.shadowBias=Q.bias,Z.shadowNormalBias=Q.normalBias,Z.shadowRadius=Q.radius,Z.shadowMapSize=Q.mapSize,i.directionalShadow[p]=Z,i.directionalShadowMap[p]=j,i.directionalShadowMatrix[p]=z.shadow.matrix,M++}i.directional[p]=W,p++}else if(z.isSpotLight){let W=e.get(z);W.position.setFromMatrixPosition(z.matrixWorld),W.color.copy(R).multiplyScalar(G*S),W.distance=Y,W.coneCos=Math.cos(z.angle),W.penumbraCos=Math.cos(z.angle*(1-z.penumbra)),W.decay=z.decay,i.spot[v]=W;let Q=z.shadow;if(z.map&&(i.spotLightMap[I]=z.map,I++,Q.updateMatrices(z),z.castShadow&&x++),i.spotLightMatrix[v]=Q.matrix,z.castShadow){let Z=n.get(z);Z.shadowBias=Q.bias,Z.shadowNormalBias=Q.normalBias,Z.shadowRadius=Q.radius,Z.shadowMapSize=Q.mapSize,i.spotShadow[v]=Z,i.spotShadowMap[v]=j,C++}v++}else if(z.isRectAreaLight){let W=e.get(z);W.color.copy(R).multiplyScalar(G),W.halfWidth.set(z.width*.5,0,0),W.halfHeight.set(0,z.height*.5,0),i.rectArea[T]=W,T++}else if(z.isPointLight){let W=e.get(z);if(W.color.copy(z.color).multiplyScalar(z.intensity*S),W.distance=z.distance,W.decay=z.decay,z.castShadow){let Q=z.shadow,Z=n.get(z);Z.shadowBias=Q.bias,Z.shadowNormalBias=Q.normalBias,Z.shadowRadius=Q.radius,Z.shadowMapSize=Q.mapSize,Z.shadowCameraNear=Q.camera.near,Z.shadowCameraFar=Q.camera.far,i.pointShadow[d]=Z,i.pointShadowMap[d]=j,i.pointShadowMatrix[d]=z.shadow.matrix,A++}i.point[d]=W,d++}else if(z.isHemisphereLight){let W=e.get(z);W.skyColor.copy(z.color).multiplyScalar(G*S),W.groundColor.copy(z.groundColor).multiplyScalar(G*S),i.hemi[b]=W,b++}}T>0&&(t.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=et.LTC_FLOAT_1,i.rectAreaLTC2=et.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=et.LTC_HALF_1,i.rectAreaLTC2=et.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=u,i.ambient[1]=m,i.ambient[2]=_;let L=i.hash;(L.directionalLength!==p||L.pointLength!==d||L.spotLength!==v||L.rectAreaLength!==T||L.hemiLength!==b||L.numDirectionalShadows!==M||L.numPointShadows!==A||L.numSpotShadows!==C||L.numSpotMaps!==I)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=T,i.point.length=d,i.hemi.length=b,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=C,i.spotShadowMap.length=C,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=C+I-x,i.spotLightMap.length=I,i.numSpotLightShadowsWithMaps=x,L.directionalLength=p,L.pointLength=d,L.spotLength=v,L.rectAreaLength=T,L.hemiLength=b,L.numDirectionalShadows=M,L.numPointShadows=A,L.numSpotShadows=C,L.numSpotMaps=I,i.version=Xd++)}function l(h,f){let u=0,m=0,_=0,p=0,d=0,v=f.matrixWorldInverse;for(let T=0,b=h.length;T<b;T++){let M=h[T];if(M.isDirectionalLight){let A=i.directional[u];A.direction.setFromMatrixPosition(M.matrixWorld),s.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(v),u++}else if(M.isSpotLight){let A=i.spot[_];A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(v),A.direction.setFromMatrixPosition(M.matrixWorld),s.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(v),_++}else if(M.isRectAreaLight){let A=i.rectArea[p];A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(v),a.identity(),o.copy(M.matrixWorld),o.premultiply(v),a.extractRotation(o),A.halfWidth.set(M.width*.5,0,0),A.halfHeight.set(0,M.height*.5,0),A.halfWidth.applyMatrix4(a),A.halfHeight.applyMatrix4(a),p++}else if(M.isPointLight){let A=i.point[m];A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(v),m++}else if(M.isHemisphereLight){let A=i.hemi[d];A.direction.setFromMatrixPosition(M.matrixWorld),A.direction.transformDirection(v),d++}}}return{setup:c,setupView:l,state:i}}function Va(r,t){let e=new Yd(r,t),n=[],i=[];function s(){n.length=0,i.length=0}function o(f){n.push(f)}function a(f){i.push(f)}function c(f){e.setup(n,f)}function l(f){e.setupView(n,f)}return{init:s,state:{lightsArray:n,shadowsArray:i,lights:e},setupLights:c,setupLightsView:l,pushLight:o,pushShadow:a}}function Zd(r,t){let e=new WeakMap;function n(s,o=0){let a=e.get(s),c;return a===void 0?(c=new Va(r,t),e.set(s,[c])):o>=a.length?(c=new Va(r,t),a.push(c)):c=a[o],c}function i(){e=new WeakMap}return{get:n,dispose:i}}var ar=class extends Jn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=el,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},or=class extends Jn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new N,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},Jd=`void main() {\n\tgl_Position = vec4( position, 1.0 );\n}`,$d=`uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}`;function Kd(r,t,e){let n=new ts,i=new Nt,s=new Nt,o=new Xt,a=new ar({depthPacking:nl}),c=new or,l={},h=e.maxTextureSize,f={[nn]:ye,[ye]:nn,[tn]:tn},u=new Ze({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Nt},radius:{value:4}},vertexShader:Jd,fragmentShader:$d}),m=u.clone();m.defines.HORIZONTAL_PASS=1;let _=new Ye;_.setAttribute("position",new ce(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new Ne(_,u),d=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ga,this.render=function(M,A,C){if(d.enabled===!1||d.autoUpdate===!1&&d.needsUpdate===!1||M.length===0)return;let I=r.getRenderTarget(),x=r.getActiveCubeFace(),S=r.getActiveMipmapLevel(),L=r.state;L.setBlending(en),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let X=0,q=M.length;X<q;X++){let z=M[X],R=z.shadow;if(R===void 0){console.warn("THREE.WebGLShadowMap:",z,"has no shadow.");continue}if(R.autoUpdate===!1&&R.needsUpdate===!1)continue;i.copy(R.mapSize);let G=R.getFrameExtents();if(i.multiply(G),s.copy(R.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null){let j=this.type!==li?{minFilter:ae,magFilter:ae}:{};R.map=new qe(i.x,i.y,j),R.map.texture.name=z.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let Y=R.getViewportCount();for(let j=0;j<Y;j++){let W=R.getViewport(j);o.set(s.x*W.x,s.y*W.y,s.x*W.z,s.y*W.w),L.viewport(o),R.updateMatrices(z,j),n=R.getFrustum(),b(A,C,R.camera,z,this.type)}R.isPointLightShadow!==!0&&this.type===li&&v(R,C),R.needsUpdate=!1}d.needsUpdate=!1,r.setRenderTarget(I,x,S)};function v(M,A){let C=t.update(p);u.defines.VSM_SAMPLES!==M.blurSamples&&(u.defines.VSM_SAMPLES=M.blurSamples,m.defines.VSM_SAMPLES=M.blurSamples,u.needsUpdate=!0,m.needsUpdate=!0),M.mapPass===null&&(M.mapPass=new qe(i.x,i.y)),u.uniforms.shadow_pass.value=M.map.texture,u.uniforms.resolution.value=M.mapSize,u.uniforms.radius.value=M.radius,r.setRenderTarget(M.mapPass),r.clear(),r.renderBufferDirect(A,null,C,u,p,null),m.uniforms.shadow_pass.value=M.mapPass.texture,m.uniforms.resolution.value=M.mapSize,m.uniforms.radius.value=M.radius,r.setRenderTarget(M.map),r.clear(),r.renderBufferDirect(A,null,C,m,p,null)}function T(M,A,C,I,x,S){let L=null,X=C.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(X!==void 0)L=X;else if(L=C.isPointLight===!0?c:a,r.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0){let q=L.uuid,z=A.uuid,R=l[q];R===void 0&&(R={},l[q]=R);let G=R[z];G===void 0&&(G=L.clone(),R[z]=G),L=G}return L.visible=A.visible,L.wireframe=A.wireframe,S===li?L.side=A.shadowSide!==null?A.shadowSide:A.side:L.side=A.shadowSide!==null?A.shadowSide:f[A.side],L.alphaMap=A.alphaMap,L.alphaTest=A.alphaTest,L.map=A.map,L.clipShadows=A.clipShadows,L.clippingPlanes=A.clippingPlanes,L.clipIntersection=A.clipIntersection,L.displacementMap=A.displacementMap,L.displacementScale=A.displacementScale,L.displacementBias=A.displacementBias,L.wireframeLinewidth=A.wireframeLinewidth,L.linewidth=A.linewidth,C.isPointLight===!0&&L.isMeshDistanceMaterial===!0&&(L.referencePosition.setFromMatrixPosition(C.matrixWorld),L.nearDistance=I,L.farDistance=x),L}function b(M,A,C,I,x){if(M.visible===!1)return;if(M.layers.test(A.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&x===li)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,M.matrixWorld);let X=t.update(M),q=M.material;if(Array.isArray(q)){let z=X.groups;for(let R=0,G=z.length;R<G;R++){let Y=z[R],j=q[Y.materialIndex];if(j&&j.visible){let W=T(M,j,I,C.near,C.far,x);r.renderBufferDirect(C,null,X,W,M,Y)}}}else if(q.visible){let z=T(M,q,I,C.near,C.far,x);r.renderBufferDirect(C,null,X,z,M,null)}}let L=M.children;for(let X=0,q=L.length;X<q;X++)b(L[X],A,C,I,x)}}function jd(r,t,e){let n=e.isWebGL2;function i(){let E=!1,U=new Xt,$=null,at=new Xt(0,0,0,0);return{setMask:function(ct){$!==ct&&!E&&(r.colorMask(ct,ct,ct,ct),$=ct)},setLocked:function(ct){E=ct},setClear:function(ct,Lt,$t,te,an){an===!0&&(ct*=te,Lt*=te,$t*=te),U.set(ct,Lt,$t,te),at.equals(U)===!1&&(r.clearColor(ct,Lt,$t,te),at.copy(U))},reset:function(){E=!1,$=null,at.set(-1,0,0,0)}}}function s(){let E=!1,U=null,$=null,at=null;return{setTest:function(ct){ct?Mt(2929):ht(2929)},setMask:function(ct){U!==ct&&!E&&(r.depthMask(ct),U=ct)},setFunc:function(ct){if($!==ct){switch(ct){case To:r.depthFunc(512);break;case Ao:r.depthFunc(519);break;case Eo:r.depthFunc(513);break;case Gs:r.depthFunc(515);break;case Co:r.depthFunc(514);break;case Po:r.depthFunc(518);break;case Ro:r.depthFunc(516);break;case Lo:r.depthFunc(517);break;default:r.depthFunc(515)}$=ct}},setLocked:function(ct){E=ct},setClear:function(ct){at!==ct&&(r.clearDepth(ct),at=ct)},reset:function(){E=!1,U=null,$=null,at=null}}}function o(){let E=!1,U=null,$=null,at=null,ct=null,Lt=null,$t=null,te=null,an=null;return{setTest:function(Bt){E||(Bt?Mt(2960):ht(2960))},setMask:function(Bt){U!==Bt&&!E&&(r.stencilMask(Bt),U=Bt)},setFunc:function(Bt,ze,be){($!==Bt||at!==ze||ct!==be)&&(r.stencilFunc(Bt,ze,be),$=Bt,at=ze,ct=be)},setOp:function(Bt,ze,be){(Lt!==Bt||$t!==ze||te!==be)&&(r.stencilOp(Bt,ze,be),Lt=Bt,$t=ze,te=be)},setLocked:function(Bt){E=Bt},setClear:function(Bt){an!==Bt&&(r.clearStencil(Bt),an=Bt)},reset:function(){E=!1,U=null,$=null,at=null,ct=null,Lt=null,$t=null,te=null,an=null}}}let a=new i,c=new s,l=new o,h=new WeakMap,f=new WeakMap,u={},m={},_=new WeakMap,p=[],d=null,v=!1,T=null,b=null,M=null,A=null,C=null,I=null,x=null,S=!1,L=null,X=null,q=null,z=null,R=null,G=r.getParameter(35661),Y=!1,j=0,W=r.getParameter(7938);W.indexOf("WebGL")!==-1?(j=parseFloat(/^WebGL (\\d)/.exec(W)[1]),Y=j>=1):W.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\\d)/.exec(W)[1]),Y=j>=2);let Q=null,Z={},ft=r.getParameter(3088),F=r.getParameter(2978),J=new Xt().fromArray(ft),nt=new Xt().fromArray(F);function it(E,U,$){let at=new Uint8Array(4),ct=r.createTexture();r.bindTexture(E,ct),r.texParameteri(E,10241,9728),r.texParameteri(E,10240,9728);for(let Lt=0;Lt<$;Lt++)r.texImage2D(U+Lt,0,6408,1,1,0,6408,5121,at);return ct}let O={};O[3553]=it(3553,3553,1),O[34067]=it(34067,34069,6),a.setClear(0,0,0,1),c.setClear(1),l.setClear(0),Mt(2929),c.setFunc(Gs),Qt(!1),Me(Pr),Mt(2884),ne(en);function Mt(E){u[E]!==!0&&(r.enable(E),u[E]=!0)}function ht(E){u[E]!==!1&&(r.disable(E),u[E]=!1)}function ut(E,U){return m[E]!==U?(r.bindFramebuffer(E,U),m[E]=U,n&&(E===36009&&(m[36160]=U),E===36160&&(m[36009]=U)),!0):!1}function ot(E,U){let $=p,at=!1;if(E)if($=_.get(U),$===void 0&&($=[],_.set(U,$)),E.isWebGLMultipleRenderTargets){let ct=E.texture;if($.length!==ct.length||$[0]!==36064){for(let Lt=0,$t=ct.length;Lt<$t;Lt++)$[Lt]=36064+Lt;$.length=ct.length,at=!0}}else $[0]!==36064&&($[0]=36064,at=!0);else $[0]!==1029&&($[0]=1029,at=!0);at&&(e.isWebGL2?r.drawBuffers($):t.get("WEBGL_draw_buffers").drawBuffersWEBGL($))}function Ft(E){return d!==E?(r.useProgram(E),d=E,!0):!1}let bt={[Bn]:32774,[po]:32778,[mo]:32779};if(n)bt[Dr]=32775,bt[Nr]=32776;else{let E=t.get("EXT_blend_minmax");E!==null&&(bt[Dr]=E.MIN_EXT,bt[Nr]=E.MAX_EXT)}let xt={[go]:0,[_o]:1,[xo]:768,[Ha]:770,[So]:776,[bo]:774,[vo]:772,[yo]:769,[Wa]:771,[wo]:775,[Mo]:773};function ne(E,U,$,at,ct,Lt,$t,te){if(E===en){v===!0&&(ht(3042),v=!1);return}if(v===!1&&(Mt(3042),v=!0),E!==fo){if(E!==T||te!==S){if((b!==Bn||C!==Bn)&&(r.blendEquation(32774),b=Bn,C=Bn),te)switch(E){case Gn:r.blendFuncSeparate(1,771,1,771);break;case Rr:r.blendFunc(1,1);break;case Lr:r.blendFuncSeparate(0,769,0,1);break;case Ir:r.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",E);break}else switch(E){case Gn:r.blendFuncSeparate(770,771,1,771);break;case Rr:r.blendFunc(770,1);break;case Lr:r.blendFuncSeparate(0,769,0,1);break;case Ir:r.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",E);break}M=null,A=null,I=null,x=null,T=E,S=te}return}ct=ct||U,Lt=Lt||$,$t=$t||at,(U!==b||ct!==C)&&(r.blendEquationSeparate(bt[U],bt[ct]),b=U,C=ct),($!==M||at!==A||Lt!==I||$t!==x)&&(r.blendFuncSeparate(xt[$],xt[at],xt[Lt],xt[$t]),M=$,A=at,I=Lt,x=$t),T=E,S=!1}function ve(E,U){E.side===tn?ht(2884):Mt(2884);let $=E.side===ye;U&&($=!$),Qt($),E.blending===Gn&&E.transparent===!1?ne(en):ne(E.blending,E.blendEquation,E.blendSrc,E.blendDst,E.blendEquationAlpha,E.blendSrcAlpha,E.blendDstAlpha,E.premultipliedAlpha),c.setFunc(E.depthFunc),c.setTest(E.depthTest),c.setMask(E.depthWrite),a.setMask(E.colorWrite);let at=E.stencilWrite;l.setTest(at),at&&(l.setMask(E.stencilWriteMask),l.setFunc(E.stencilFunc,E.stencilRef,E.stencilFuncMask),l.setOp(E.stencilFail,E.stencilZFail,E.stencilZPass)),Dt(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),E.alphaToCoverage===!0?Mt(32926):ht(32926)}function Qt(E){L!==E&&(E?r.frontFace(2304):r.frontFace(2305),L=E)}function Me(E){E!==co?(Mt(2884),E!==X&&(E===Pr?r.cullFace(1029):E===ho?r.cullFace(1028):r.cullFace(1032))):ht(2884),X=E}function Ht(E){E!==q&&(Y&&r.lineWidth(E),q=E)}function Dt(E,U,$){E?(Mt(32823),(z!==U||R!==$)&&(r.polygonOffset(U,$),z=U,R=$)):ht(32823)}function Fe(E){E?Mt(3089):ht(3089)}function Te(E){E===void 0&&(E=33984+G-1),Q!==E&&(r.activeTexture(E),Q=E)}function w(E,U,$){$===void 0&&(Q===null?$=33984+G-1:$=Q);let at=Z[$];at===void 0&&(at={type:void 0,texture:void 0},Z[$]=at),(at.type!==E||at.texture!==U)&&(Q!==$&&(r.activeTexture($),Q=$),r.bindTexture(E,U||O[E]),at.type=E,at.texture=U)}function g(){let E=Z[Q];E!==void 0&&E.type!==void 0&&(r.bindTexture(E.type,null),E.type=void 0,E.texture=void 0)}function k(){try{r.compressedTexImage2D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function K(){try{r.compressedTexImage3D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function tt(){try{r.texSubImage2D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function st(){try{r.texSubImage3D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function yt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function rt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function H(){try{r.texStorage2D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function mt(){try{r.texStorage3D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function _t(){try{r.texImage2D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function lt(){try{r.texImage3D.apply(r,arguments)}catch(E){console.error("THREE.WebGLState:",E)}}function gt(E){J.equals(E)===!1&&(r.scissor(E.x,E.y,E.z,E.w),J.copy(E))}function dt(E){nt.equals(E)===!1&&(r.viewport(E.x,E.y,E.z,E.w),nt.copy(E))}function Pt(E,U){let $=f.get(U);$===void 0&&($=new WeakMap,f.set(U,$));let at=$.get(E);at===void 0&&(at=r.getUniformBlockIndex(U,E.name),$.set(E,at))}function Ut(E,U){let at=f.get(U).get(E);h.get(U)!==at&&(r.uniformBlockBinding(U,at,E.__bindingPointIndex),h.set(U,at))}function Jt(){r.disable(3042),r.disable(2884),r.disable(2929),r.disable(32823),r.disable(3089),r.disable(2960),r.disable(32926),r.blendEquation(32774),r.blendFunc(1,0),r.blendFuncSeparate(1,0,1,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(513),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(519,0,4294967295),r.stencilOp(7680,7680,7680),r.clearStencil(0),r.cullFace(1029),r.frontFace(2305),r.polygonOffset(0,0),r.activeTexture(33984),r.bindFramebuffer(36160,null),n===!0&&(r.bindFramebuffer(36009,null),r.bindFramebuffer(36008,null)),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},Q=null,Z={},m={},_=new WeakMap,p=[],d=null,v=!1,T=null,b=null,M=null,A=null,C=null,I=null,x=null,S=!1,L=null,X=null,q=null,z=null,R=null,J.set(0,0,r.canvas.width,r.canvas.height),nt.set(0,0,r.canvas.width,r.canvas.height),a.reset(),c.reset(),l.reset()}return{buffers:{color:a,depth:c,stencil:l},enable:Mt,disable:ht,bindFramebuffer:ut,drawBuffers:ot,useProgram:Ft,setBlending:ne,setMaterial:ve,setFlipSided:Qt,setCullFace:Me,setLineWidth:Ht,setPolygonOffset:Dt,setScissorTest:Fe,activeTexture:Te,bindTexture:w,unbindTexture:g,compressedTexImage2D:k,compressedTexImage3D:K,texImage2D:_t,texImage3D:lt,updateUBOMapping:Pt,uniformBlockBinding:Ut,texStorage2D:H,texStorage3D:mt,texSubImage2D:tt,texSubImage3D:st,compressedTexSubImage2D:yt,compressedTexSubImage3D:rt,scissor:gt,viewport:dt,reset:Jt}}function Qd(r,t,e,n,i,s,o){let a=i.isWebGL2,c=i.maxTextures,l=i.maxCubemapSize,h=i.maxTextureSize,f=i.maxSamples,u=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator=="undefined"?!1:/OculusBrowser/g.test(navigator.userAgent),_=new WeakMap,p,d=new WeakMap,v=!1;try{v=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(w){}function T(w,g){return v?new OffscreenCanvas(w,g):Wi("canvas")}function b(w,g,k,K){let tt=1;if((w.width>K||w.height>K)&&(tt=K/Math.max(w.width,w.height)),tt<1||g===!0)if(typeof HTMLImageElement!="undefined"&&w instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&w instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&w instanceof ImageBitmap){let st=g?Hi:Math.floor,yt=st(tt*w.width),rt=st(tt*w.height);p===void 0&&(p=T(yt,rt));let H=k?T(yt,rt):p;return H.width=yt,H.height=rt,H.getContext("2d").drawImage(w,0,0,yt,rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+w.width+"x"+w.height+") to ("+yt+"x"+rt+")."),H}else return"data"in w&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+w.width+"x"+w.height+")."),w;return w}function M(w){return Zs(w.width)&&Zs(w.height)}function A(w){return a?!1:w.wrapS!==Pe||w.wrapT!==Pe||w.minFilter!==ae&&w.minFilter!==Se}function C(w,g){return w.generateMipmaps&&g&&w.minFilter!==ae&&w.minFilter!==Se}function I(w){r.generateMipmap(w)}function x(w,g,k,K,tt=!1){if(a===!1)return g;if(w!==null){if(r[w]!==void 0)return r[w];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \'"+w+"\'")}let st=g;return g===6403&&(k===5126&&(st=33326),k===5131&&(st=33325),k===5121&&(st=33321)),g===33319&&(k===5126&&(st=33328),k===5131&&(st=33327),k===5121&&(st=33323)),g===6408&&(k===5126&&(st=34836),k===5131&&(st=34842),k===5121&&(st=K===zt&&tt===!1?35907:32856),k===32819&&(st=32854),k===32820&&(st=32855)),(st===33325||st===33326||st===33327||st===33328||st===34842||st===34836)&&t.get("EXT_color_buffer_float"),st}function S(w,g,k){return C(w,k)===!0||w.isFramebufferTexture&&w.minFilter!==ae&&w.minFilter!==Se?Math.log2(Math.max(g.width,g.height))+1:w.mipmaps!==void 0&&w.mipmaps.length>0?w.mipmaps.length:w.isCompressedTexture&&Array.isArray(w.image)?g.mipmaps.length:1}function L(w){return w===ae||w===Fr||w===us?9728:9729}function X(w){let g=w.target;g.removeEventListener("dispose",X),z(g),g.isVideoTexture&&_.delete(g)}function q(w){let g=w.target;g.removeEventListener("dispose",q),G(g)}function z(w){let g=n.get(w);if(g.__webglInit===void 0)return;let k=w.source,K=d.get(k);if(K){let tt=K[g.__cacheKey];tt.usedTimes--,tt.usedTimes===0&&R(w),Object.keys(K).length===0&&d.delete(k)}n.remove(w)}function R(w){let g=n.get(w);r.deleteTexture(g.__webglTexture);let k=w.source,K=d.get(k);delete K[g.__cacheKey],o.memory.textures--}function G(w){let g=w.texture,k=n.get(w),K=n.get(g);if(K.__webglTexture!==void 0&&(r.deleteTexture(K.__webglTexture),o.memory.textures--),w.depthTexture&&w.depthTexture.dispose(),w.isWebGLCubeRenderTarget)for(let tt=0;tt<6;tt++)r.deleteFramebuffer(k.__webglFramebuffer[tt]),k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[tt]);else{if(r.deleteFramebuffer(k.__webglFramebuffer),k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let tt=0;tt<k.__webglColorRenderbuffer.length;tt++)k.__webglColorRenderbuffer[tt]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[tt]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}if(w.isWebGLMultipleRenderTargets)for(let tt=0,st=g.length;tt<st;tt++){let yt=n.get(g[tt]);yt.__webglTexture&&(r.deleteTexture(yt.__webglTexture),o.memory.textures--),n.remove(g[tt])}n.remove(g),n.remove(w)}let Y=0;function j(){Y=0}function W(){let w=Y;return w>=c&&console.warn("THREE.WebGLTextures: Trying to use "+w+" texture units while this GPU supports only "+c),Y+=1,w}function Q(w){let g=[];return g.push(w.wrapS),g.push(w.wrapT),g.push(w.wrapR||0),g.push(w.magFilter),g.push(w.minFilter),g.push(w.anisotropy),g.push(w.internalFormat),g.push(w.format),g.push(w.type),g.push(w.generateMipmaps),g.push(w.premultiplyAlpha),g.push(w.flipY),g.push(w.unpackAlignment),g.push(w.encoding),g.join()}function Z(w,g){let k=n.get(w);if(w.isVideoTexture&&Fe(w),w.isRenderTargetTexture===!1&&w.version>0&&k.__version!==w.version){let K=w.image;if(K===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ht(k,w,g);return}}e.bindTexture(3553,k.__webglTexture,33984+g)}function ft(w,g){let k=n.get(w);if(w.version>0&&k.__version!==w.version){ht(k,w,g);return}e.bindTexture(35866,k.__webglTexture,33984+g)}function F(w,g){let k=n.get(w);if(w.version>0&&k.__version!==w.version){ht(k,w,g);return}e.bindTexture(32879,k.__webglTexture,33984+g)}function J(w,g){let k=n.get(w);if(w.version>0&&k.__version!==w.version){ut(k,w,g);return}e.bindTexture(34067,k.__webglTexture,33984+g)}let nt={[Xs]:10497,[Pe]:33071,[qs]:33648},it={[ae]:9728,[Fr]:9984,[us]:9986,[Se]:9729,[Bo]:9985,[pi]:9987};function O(w,g,k){if(k?(r.texParameteri(w,10242,nt[g.wrapS]),r.texParameteri(w,10243,nt[g.wrapT]),(w===32879||w===35866)&&r.texParameteri(w,32882,nt[g.wrapR]),r.texParameteri(w,10240,it[g.magFilter]),r.texParameteri(w,10241,it[g.minFilter])):(r.texParameteri(w,10242,33071),r.texParameteri(w,10243,33071),(w===32879||w===35866)&&r.texParameteri(w,32882,33071),(g.wrapS!==Pe||g.wrapT!==Pe)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(w,10240,L(g.magFilter)),r.texParameteri(w,10241,L(g.minFilter)),g.minFilter!==ae&&g.minFilter!==Se&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){let K=t.get("EXT_texture_filter_anisotropic");if(g.magFilter===ae||g.minFilter!==us&&g.minFilter!==pi||g.type===gn&&t.has("OES_texture_float_linear")===!1||a===!1&&g.type===mi&&t.has("OES_texture_half_float_linear")===!1)return;(g.anisotropy>1||n.get(g).__currentAnisotropy)&&(r.texParameterf(w,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,i.getMaxAnisotropy())),n.get(g).__currentAnisotropy=g.anisotropy)}}function Mt(w,g){let k=!1;w.__webglInit===void 0&&(w.__webglInit=!0,g.addEventListener("dispose",X));let K=g.source,tt=d.get(K);tt===void 0&&(tt={},d.set(K,tt));let st=Q(g);if(st!==w.__cacheKey){tt[st]===void 0&&(tt[st]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,k=!0),tt[st].usedTimes++;let yt=tt[w.__cacheKey];yt!==void 0&&(tt[w.__cacheKey].usedTimes--,yt.usedTimes===0&&R(g)),w.__cacheKey=st,w.__webglTexture=tt[st].texture}return k}function ht(w,g,k){let K=3553;(g.isDataArrayTexture||g.isCompressedArrayTexture)&&(K=35866),g.isData3DTexture&&(K=32879);let tt=Mt(w,g),st=g.source;e.bindTexture(K,w.__webglTexture,33984+k);let yt=n.get(st);if(st.version!==yt.__version||tt===!0){e.activeTexture(33984+k),r.pixelStorei(37440,g.flipY),r.pixelStorei(37441,g.premultiplyAlpha),r.pixelStorei(3317,g.unpackAlignment),r.pixelStorei(37443,0);let rt=A(g)&&M(g.image)===!1,H=b(g.image,rt,!1,h);H=Te(g,H);let mt=M(H)||a,_t=s.convert(g.format,g.encoding),lt=s.convert(g.type),gt=x(g.internalFormat,_t,lt,g.encoding,g.isVideoTexture);O(K,g,mt);let dt,Pt=g.mipmaps,Ut=a&&g.isVideoTexture!==!0,Jt=yt.__version===void 0||tt===!0,E=S(g,H,mt);if(g.isDepthTexture)gt=6402,a?g.type===gn?gt=36012:g.type===mn?gt=33190:g.type===Hn?gt=35056:gt=33189:g.type===gn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),g.format===_n&>===6402&&g.type!==Ya&&g.type!==mn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),g.type=mn,lt=s.convert(g.type)),g.format===Yn&>===6402&&(gt=34041,g.type!==Hn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),g.type=Hn,lt=s.convert(g.type))),Jt&&(Ut?e.texStorage2D(3553,1,gt,H.width,H.height):e.texImage2D(3553,0,gt,H.width,H.height,0,_t,lt,null));else if(g.isDataTexture)if(Pt.length>0&&mt){Ut&&Jt&&e.texStorage2D(3553,E,gt,Pt[0].width,Pt[0].height);for(let U=0,$=Pt.length;U<$;U++)dt=Pt[U],Ut?e.texSubImage2D(3553,U,0,0,dt.width,dt.height,_t,lt,dt.data):e.texImage2D(3553,U,gt,dt.width,dt.height,0,_t,lt,dt.data);g.generateMipmaps=!1}else Ut?(Jt&&e.texStorage2D(3553,E,gt,H.width,H.height),e.texSubImage2D(3553,0,0,0,H.width,H.height,_t,lt,H.data)):e.texImage2D(3553,0,gt,H.width,H.height,0,_t,lt,H.data);else if(g.isCompressedTexture)if(g.isCompressedArrayTexture){Ut&&Jt&&e.texStorage3D(35866,E,gt,Pt[0].width,Pt[0].height,H.depth);for(let U=0,$=Pt.length;U<$;U++)dt=Pt[U],g.format!==Re?_t!==null?Ut?e.compressedTexSubImage3D(35866,U,0,0,0,dt.width,dt.height,H.depth,_t,dt.data,0,0):e.compressedTexImage3D(35866,U,gt,dt.width,dt.height,H.depth,0,dt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ut?e.texSubImage3D(35866,U,0,0,0,dt.width,dt.height,H.depth,_t,lt,dt.data):e.texImage3D(35866,U,gt,dt.width,dt.height,H.depth,0,_t,lt,dt.data)}else{Ut&&Jt&&e.texStorage2D(3553,E,gt,Pt[0].width,Pt[0].height);for(let U=0,$=Pt.length;U<$;U++)dt=Pt[U],g.format!==Re?_t!==null?Ut?e.compressedTexSubImage2D(3553,U,0,0,dt.width,dt.height,_t,dt.data):e.compressedTexImage2D(3553,U,gt,dt.width,dt.height,0,dt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ut?e.texSubImage2D(3553,U,0,0,dt.width,dt.height,_t,lt,dt.data):e.texImage2D(3553,U,gt,dt.width,dt.height,0,_t,lt,dt.data)}else if(g.isDataArrayTexture)Ut?(Jt&&e.texStorage3D(35866,E,gt,H.width,H.height,H.depth),e.texSubImage3D(35866,0,0,0,0,H.width,H.height,H.depth,_t,lt,H.data)):e.texImage3D(35866,0,gt,H.width,H.height,H.depth,0,_t,lt,H.data);else if(g.isData3DTexture)Ut?(Jt&&e.texStorage3D(32879,E,gt,H.width,H.height,H.depth),e.texSubImage3D(32879,0,0,0,0,H.width,H.height,H.depth,_t,lt,H.data)):e.texImage3D(32879,0,gt,H.width,H.height,H.depth,0,_t,lt,H.data);else if(g.isFramebufferTexture){if(Jt)if(Ut)e.texStorage2D(3553,E,gt,H.width,H.height);else{let U=H.width,$=H.height;for(let at=0;at<E;at++)e.texImage2D(3553,at,gt,U,$,0,_t,lt,null),U>>=1,$>>=1}}else if(Pt.length>0&&mt){Ut&&Jt&&e.texStorage2D(3553,E,gt,Pt[0].width,Pt[0].height);for(let U=0,$=Pt.length;U<$;U++)dt=Pt[U],Ut?e.texSubImage2D(3553,U,0,0,_t,lt,dt):e.texImage2D(3553,U,gt,_t,lt,dt);g.generateMipmaps=!1}else Ut?(Jt&&e.texStorage2D(3553,E,gt,H.width,H.height),e.texSubImage2D(3553,0,0,0,_t,lt,H)):e.texImage2D(3553,0,gt,_t,lt,H);C(g,mt)&&I(K),yt.__version=st.version,g.onUpdate&&g.onUpdate(g)}w.__version=g.version}function ut(w,g,k){if(g.image.length!==6)return;let K=Mt(w,g),tt=g.source;e.bindTexture(34067,w.__webglTexture,33984+k);let st=n.get(tt);if(tt.version!==st.__version||K===!0){e.activeTexture(33984+k),r.pixelStorei(37440,g.flipY),r.pixelStorei(37441,g.premultiplyAlpha),r.pixelStorei(3317,g.unpackAlignment),r.pixelStorei(37443,0);let yt=g.isCompressedTexture||g.image[0].isCompressedTexture,rt=g.image[0]&&g.image[0].isDataTexture,H=[];for(let U=0;U<6;U++)!yt&&!rt?H[U]=b(g.image[U],!1,!0,l):H[U]=rt?g.image[U].image:g.image[U],H[U]=Te(g,H[U]);let mt=H[0],_t=M(mt)||a,lt=s.convert(g.format,g.encoding),gt=s.convert(g.type),dt=x(g.internalFormat,lt,gt,g.encoding),Pt=a&&g.isVideoTexture!==!0,Ut=st.__version===void 0||K===!0,Jt=S(g,mt,_t);O(34067,g,_t);let E;if(yt){Pt&&Ut&&e.texStorage2D(34067,Jt,dt,mt.width,mt.height);for(let U=0;U<6;U++){E=H[U].mipmaps;for(let $=0;$<E.length;$++){let at=E[$];g.format!==Re?lt!==null?Pt?e.compressedTexSubImage2D(34069+U,$,0,0,at.width,at.height,lt,at.data):e.compressedTexImage2D(34069+U,$,dt,at.width,at.height,0,at.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Pt?e.texSubImage2D(34069+U,$,0,0,at.width,at.height,lt,gt,at.data):e.texImage2D(34069+U,$,dt,at.width,at.height,0,lt,gt,at.data)}}}else{E=g.mipmaps,Pt&&Ut&&(E.length>0&&Jt++,e.texStorage2D(34067,Jt,dt,H[0].width,H[0].height));for(let U=0;U<6;U++)if(rt){Pt?e.texSubImage2D(34069+U,0,0,0,H[U].width,H[U].height,lt,gt,H[U].data):e.texImage2D(34069+U,0,dt,H[U].width,H[U].height,0,lt,gt,H[U].data);for(let $=0;$<E.length;$++){let ct=E[$].image[U].image;Pt?e.texSubImage2D(34069+U,$+1,0,0,ct.width,ct.height,lt,gt,ct.data):e.texImage2D(34069+U,$+1,dt,ct.width,ct.height,0,lt,gt,ct.data)}}else{Pt?e.texSubImage2D(34069+U,0,0,0,lt,gt,H[U]):e.texImage2D(34069+U,0,dt,lt,gt,H[U]);for(let $=0;$<E.length;$++){let at=E[$];Pt?e.texSubImage2D(34069+U,$+1,0,0,lt,gt,at.image[U]):e.texImage2D(34069+U,$+1,dt,lt,gt,at.image[U])}}}C(g,_t)&&I(34067),st.__version=tt.version,g.onUpdate&&g.onUpdate(g)}w.__version=g.version}function ot(w,g,k,K,tt){let st=s.convert(k.format,k.encoding),yt=s.convert(k.type),rt=x(k.internalFormat,st,yt,k.encoding);n.get(g).__hasExternalTextures||(tt===32879||tt===35866?e.texImage3D(tt,0,rt,g.width,g.height,g.depth,0,st,yt,null):e.texImage2D(tt,0,rt,g.width,g.height,0,st,yt,null)),e.bindFramebuffer(36160,w),Dt(g)?u.framebufferTexture2DMultisampleEXT(36160,K,tt,n.get(k).__webglTexture,0,Ht(g)):(tt===3553||tt>=34069&&tt<=34074)&&r.framebufferTexture2D(36160,K,tt,n.get(k).__webglTexture,0),e.bindFramebuffer(36160,null)}function Ft(w,g,k){if(r.bindRenderbuffer(36161,w),g.depthBuffer&&!g.stencilBuffer){let K=33189;if(k||Dt(g)){let tt=g.depthTexture;tt&&tt.isDepthTexture&&(tt.type===gn?K=36012:tt.type===mn&&(K=33190));let st=Ht(g);Dt(g)?u.renderbufferStorageMultisampleEXT(36161,st,K,g.width,g.height):r.renderbufferStorageMultisample(36161,st,K,g.width,g.height)}else r.renderbufferStorage(36161,K,g.width,g.height);r.framebufferRenderbuffer(36160,36096,36161,w)}else if(g.depthBuffer&&g.stencilBuffer){let K=Ht(g);k&&Dt(g)===!1?r.renderbufferStorageMultisample(36161,K,35056,g.width,g.height):Dt(g)?u.renderbufferStorageMultisampleEXT(36161,K,35056,g.width,g.height):r.renderbufferStorage(36161,34041,g.width,g.height),r.framebufferRenderbuffer(36160,33306,36161,w)}else{let K=g.isWebGLMultipleRenderTargets===!0?g.texture:[g.texture];for(let tt=0;tt<K.length;tt++){let st=K[tt],yt=s.convert(st.format,st.encoding),rt=s.convert(st.type),H=x(st.internalFormat,yt,rt,st.encoding),mt=Ht(g);k&&Dt(g)===!1?r.renderbufferStorageMultisample(36161,mt,H,g.width,g.height):Dt(g)?u.renderbufferStorageMultisampleEXT(36161,mt,H,g.width,g.height):r.renderbufferStorage(36161,H,g.width,g.height)}}r.bindRenderbuffer(36161,null)}function bt(w,g){if(g&&g.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,w),!(g.depthTexture&&g.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(g.depthTexture).__webglTexture||g.depthTexture.image.width!==g.width||g.depthTexture.image.height!==g.height)&&(g.depthTexture.image.width=g.width,g.depthTexture.image.height=g.height,g.depthTexture.needsUpdate=!0),Z(g.depthTexture,0);let K=n.get(g.depthTexture).__webglTexture,tt=Ht(g);if(g.depthTexture.format===_n)Dt(g)?u.framebufferTexture2DMultisampleEXT(36160,36096,3553,K,0,tt):r.framebufferTexture2D(36160,36096,3553,K,0);else if(g.depthTexture.format===Yn)Dt(g)?u.framebufferTexture2DMultisampleEXT(36160,33306,3553,K,0,tt):r.framebufferTexture2D(36160,33306,3553,K,0);else throw new Error("Unknown depthTexture format")}function xt(w){let g=n.get(w),k=w.isWebGLCubeRenderTarget===!0;if(w.depthTexture&&!g.__autoAllocateDepthBuffer){if(k)throw new Error("target.depthTexture not supported in Cube render targets");bt(g.__webglFramebuffer,w)}else if(k){g.__webglDepthbuffer=[];for(let K=0;K<6;K++)e.bindFramebuffer(36160,g.__webglFramebuffer[K]),g.__webglDepthbuffer[K]=r.createRenderbuffer(),Ft(g.__webglDepthbuffer[K],w,!1)}else e.bindFramebuffer(36160,g.__webglFramebuffer),g.__webglDepthbuffer=r.createRenderbuffer(),Ft(g.__webglDepthbuffer,w,!1);e.bindFramebuffer(36160,null)}function ne(w,g,k){let K=n.get(w);g!==void 0&&ot(K.__webglFramebuffer,w,w.texture,36064,3553),k!==void 0&&xt(w)}function ve(w){let g=w.texture,k=n.get(w),K=n.get(g);w.addEventListener("dispose",q),w.isWebGLMultipleRenderTargets!==!0&&(K.__webglTexture===void 0&&(K.__webglTexture=r.createTexture()),K.__version=g.version,o.memory.textures++);let tt=w.isWebGLCubeRenderTarget===!0,st=w.isWebGLMultipleRenderTargets===!0,yt=M(w)||a;if(tt){k.__webglFramebuffer=[];for(let rt=0;rt<6;rt++)k.__webglFramebuffer[rt]=r.createFramebuffer()}else{if(k.__webglFramebuffer=r.createFramebuffer(),st)if(i.drawBuffers){let rt=w.texture;for(let H=0,mt=rt.length;H<mt;H++){let _t=n.get(rt[H]);_t.__webglTexture===void 0&&(_t.__webglTexture=r.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&w.samples>0&&Dt(w)===!1){let rt=st?g:[g];k.__webglMultisampledFramebuffer=r.createFramebuffer(),k.__webglColorRenderbuffer=[],e.bindFramebuffer(36160,k.__webglMultisampledFramebuffer);for(let H=0;H<rt.length;H++){let mt=rt[H];k.__webglColorRenderbuffer[H]=r.createRenderbuffer(),r.bindRenderbuffer(36161,k.__webglColorRenderbuffer[H]);let _t=s.convert(mt.format,mt.encoding),lt=s.convert(mt.type),gt=x(mt.internalFormat,_t,lt,mt.encoding,w.isXRRenderTarget===!0),dt=Ht(w);r.renderbufferStorageMultisample(36161,dt,gt,w.width,w.height),r.framebufferRenderbuffer(36160,36064+H,36161,k.__webglColorRenderbuffer[H])}r.bindRenderbuffer(36161,null),w.depthBuffer&&(k.__webglDepthRenderbuffer=r.createRenderbuffer(),Ft(k.__webglDepthRenderbuffer,w,!0)),e.bindFramebuffer(36160,null)}}if(tt){e.bindTexture(34067,K.__webglTexture),O(34067,g,yt);for(let rt=0;rt<6;rt++)ot(k.__webglFramebuffer[rt],w,g,36064,34069+rt);C(g,yt)&&I(34067),e.unbindTexture()}else if(st){let rt=w.texture;for(let H=0,mt=rt.length;H<mt;H++){let _t=rt[H],lt=n.get(_t);e.bindTexture(3553,lt.__webglTexture),O(3553,_t,yt),ot(k.__webglFramebuffer,w,_t,36064+H,3553),C(_t,yt)&&I(3553)}e.unbindTexture()}else{let rt=3553;(w.isWebGL3DRenderTarget||w.isWebGLArrayRenderTarget)&&(a?rt=w.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),e.bindTexture(rt,K.__webglTexture),O(rt,g,yt),ot(k.__webglFramebuffer,w,g,36064,rt),C(g,yt)&&I(rt),e.unbindTexture()}w.depthBuffer&&xt(w)}function Qt(w){let g=M(w)||a,k=w.isWebGLMultipleRenderTargets===!0?w.texture:[w.texture];for(let K=0,tt=k.length;K<tt;K++){let st=k[K];if(C(st,g)){let yt=w.isWebGLCubeRenderTarget?34067:3553,rt=n.get(st).__webglTexture;e.bindTexture(yt,rt),I(yt),e.unbindTexture()}}}function Me(w){if(a&&w.samples>0&&Dt(w)===!1){let g=w.isWebGLMultipleRenderTargets?w.texture:[w.texture],k=w.width,K=w.height,tt=16384,st=[],yt=w.stencilBuffer?33306:36096,rt=n.get(w),H=w.isWebGLMultipleRenderTargets===!0;if(H)for(let mt=0;mt<g.length;mt++)e.bindFramebuffer(36160,rt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064+mt,36161,null),e.bindFramebuffer(36160,rt.__webglFramebuffer),r.framebufferTexture2D(36009,36064+mt,3553,null,0);e.bindFramebuffer(36008,rt.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,rt.__webglFramebuffer);for(let mt=0;mt<g.length;mt++){st.push(36064+mt),w.depthBuffer&&st.push(yt);let _t=rt.__ignoreDepthValues!==void 0?rt.__ignoreDepthValues:!1;if(_t===!1&&(w.depthBuffer&&(tt|=256),w.stencilBuffer&&(tt|=1024)),H&&r.framebufferRenderbuffer(36008,36064,36161,rt.__webglColorRenderbuffer[mt]),_t===!0&&(r.invalidateFramebuffer(36008,[yt]),r.invalidateFramebuffer(36009,[yt])),H){let lt=n.get(g[mt]).__webglTexture;r.framebufferTexture2D(36009,36064,3553,lt,0)}r.blitFramebuffer(0,0,k,K,0,0,k,K,tt,9728),m&&r.invalidateFramebuffer(36008,st)}if(e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,null),H)for(let mt=0;mt<g.length;mt++){e.bindFramebuffer(36160,rt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064+mt,36161,rt.__webglColorRenderbuffer[mt]);let _t=n.get(g[mt]).__webglTexture;e.bindFramebuffer(36160,rt.__webglFramebuffer),r.framebufferTexture2D(36009,36064+mt,3553,_t,0)}e.bindFramebuffer(36009,rt.__webglMultisampledFramebuffer)}}function Ht(w){return Math.min(f,w.samples)}function Dt(w){let g=n.get(w);return a&&w.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&g.__useRenderToTexture!==!1}function Fe(w){let g=o.render.frame;_.get(w)!==g&&(_.set(w,g),w.update())}function Te(w,g){let k=w.encoding,K=w.format,tt=w.type;return w.isCompressedTexture===!0||w.isVideoTexture===!0||w.format===Ys||k!==vn&&(k===zt?a===!1?t.has("EXT_sRGB")===!0&&K===Re?(w.format=Ys,w.minFilter=Se,w.generateMipmaps=!1):g=Xi.sRGBToLinear(g):(K!==Re||tt!==yn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",k)),g}this.allocateTextureUnit=W,this.resetTextureUnits=j,this.setTexture2D=Z,this.setTexture2DArray=ft,this.setTexture3D=F,this.setTextureCube=J,this.rebindTextures=ne,this.setupRenderTarget=ve,this.updateRenderTargetMipmap=Qt,this.updateMultisampleRenderTarget=Me,this.setupDepthRenderbuffer=xt,this.setupFrameBufferTexture=ot,this.useMultisampledRTT=Dt}function tf(r,t,e){let n=e.isWebGL2;function i(s,o=null){let a;if(s===yn)return 5121;if(s===Ho)return 32819;if(s===Wo)return 32820;if(s===ko)return 5120;if(s===Vo)return 5122;if(s===Ya)return 5123;if(s===Go)return 5124;if(s===mn)return 5125;if(s===gn)return 5126;if(s===mi)return n?5131:(a=t.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===Xo)return 6406;if(s===Re)return 6408;if(s===qo)return 6409;if(s===Yo)return 6410;if(s===_n)return 6402;if(s===Yn)return 34041;if(s===Ys)return a=t.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===Zo)return 6403;if(s===Jo)return 36244;if(s===$o)return 33319;if(s===Ko)return 33320;if(s===jo)return 36249;if(s===ds||s===fs||s===ps||s===ms)if(o===zt)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===ds)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===fs)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===ps)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===ms)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===ds)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===fs)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===ps)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===ms)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===zr||s===Or||s===Ur||s===Br)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===zr)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Or)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Ur)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Br)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Qo)return a=t.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===kr||s===Vr)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(s===kr)return o===zt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Vr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Gr||s===Hr||s===Wr||s===Xr||s===qr||s===Yr||s===Zr||s===Jr||s===$r||s===Kr||s===jr||s===Qr||s===ta||s===ea)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Gr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Hr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Wr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Xr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===qr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Yr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Zr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Jr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===$r)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Kr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===jr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Qr)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ta)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===ea)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===gs)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(s===gs)return o===zt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===tl||s===na||s===ia||s===sa)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(s===gs)return a.COMPRESSED_RED_RGTC1_EXT;if(s===na)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===ia)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===sa)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Hn?n?34042:(a=t.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):r[s]!==void 0?r[s]:null}return{convert:i}}var lr=class extends _e{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},Vn=class extends de{constructor(){super(),this.isGroup=!0,this.type="Group"}},ef={type:"move"},fi=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Vn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Vn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new N,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new N),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Vn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new N,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new N),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,o=null,a=this._targetRay,c=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){o=!0;for(let p of t.hand.values()){let d=e.getJointPose(p,n),v=this._getHandJoint(l,p);d!==null&&(v.matrix.fromArray(d.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=d.radius),v.visible=d!==null}let h=l.joints["index-finger-tip"],f=l.joints["thumb-tip"],u=h.position.distanceTo(f.position),m=.02,_=.005;l.inputState.pinching&&u>m+_?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&u<=m-_&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(ef)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=s!==null),l!==null&&(l.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new Vn;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},cr=class extends le{constructor(t,e,n,i,s,o,a,c,l,h){if(h=h!==void 0?h:_n,h!==_n&&h!==Yn)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===_n&&(n=mn),n===void 0&&h===Yn&&(n=Hn),super(null,i,s,o,a,c,h,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:ae,this.minFilter=c!==void 0?c:ae,this.flipY=!1,this.generateMipmaps=!1}},hr=class extends sn{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",c=1,l=null,h=null,f=null,u=null,m=null,_=null,p=e.getContextAttributes(),d=null,v=null,T=[],b=[],M=new Set,A=new Map,C=new _e;C.layers.enable(1),C.viewport=new Xt;let I=new _e;I.layers.enable(2),I.viewport=new Xt;let x=[C,I],S=new lr;S.layers.enable(1),S.layers.enable(2);let L=null,X=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(F){let J=T[F];return J===void 0&&(J=new fi,T[F]=J),J.getTargetRaySpace()},this.getControllerGrip=function(F){let J=T[F];return J===void 0&&(J=new fi,T[F]=J),J.getGripSpace()},this.getHand=function(F){let J=T[F];return J===void 0&&(J=new fi,T[F]=J),J.getHandSpace()};function q(F){let J=b.indexOf(F.inputSource);if(J===-1)return;let nt=T[J];nt!==void 0&&nt.dispatchEvent({type:F.type,data:F.inputSource})}function z(){i.removeEventListener("select",q),i.removeEventListener("selectstart",q),i.removeEventListener("selectend",q),i.removeEventListener("squeeze",q),i.removeEventListener("squeezestart",q),i.removeEventListener("squeezeend",q),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",R);for(let F=0;F<T.length;F++){let J=b[F];J!==null&&(b[F]=null,T[F].disconnect(J))}L=null,X=null,t.setRenderTarget(d),m=null,u=null,f=null,i=null,v=null,ft.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(F){s=F,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){a=F,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(F){l=F},this.getBaseLayer=function(){return u!==null?u:m},this.getBinding=function(){return f},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(F){if(i=F,i!==null){if(d=t.getRenderTarget(),i.addEventListener("select",q),i.addEventListener("selectstart",q),i.addEventListener("selectend",q),i.addEventListener("squeeze",q),i.addEventListener("squeezestart",q),i.addEventListener("squeezeend",q),i.addEventListener("end",z),i.addEventListener("inputsourceschange",R),p.xrCompatible!==!0&&await e.makeXRCompatible(),i.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let J={antialias:i.renderState.layers===void 0?p.antialias:!0,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(i,e,J),i.updateRenderState({baseLayer:m}),v=new qe(m.framebufferWidth,m.framebufferHeight,{format:Re,type:yn,encoding:t.outputEncoding,stencilBuffer:p.stencil})}else{let J=null,nt=null,it=null;p.depth&&(it=p.stencil?35056:33190,J=p.stencil?Yn:_n,nt=p.stencil?Hn:mn);let O={colorFormat:32856,depthFormat:it,scaleFactor:s};f=new XRWebGLBinding(i,e),u=f.createProjectionLayer(O),i.updateRenderState({layers:[u]}),v=new qe(u.textureWidth,u.textureHeight,{format:Re,type:yn,depthTexture:new cr(u.textureWidth,u.textureHeight,nt,void 0,void 0,void 0,void 0,void 0,void 0,J),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0});let Mt=t.properties.get(v);Mt.__ignoreDepthValues=u.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(c),l=null,o=await i.requestReferenceSpace(a),ft.setContext(i),ft.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function R(F){for(let J=0;J<F.removed.length;J++){let nt=F.removed[J],it=b.indexOf(nt);it>=0&&(b[it]=null,T[it].disconnect(nt))}for(let J=0;J<F.added.length;J++){let nt=F.added[J],it=b.indexOf(nt);if(it===-1){for(let Mt=0;Mt<T.length;Mt++)if(Mt>=b.length){b.push(nt),it=Mt;break}else if(b[Mt]===null){b[Mt]=nt,it=Mt;break}if(it===-1)break}let O=T[it];O&&O.connect(nt)}}let G=new N,Y=new N;function j(F,J,nt){G.setFromMatrixPosition(J.matrixWorld),Y.setFromMatrixPosition(nt.matrixWorld);let it=G.distanceTo(Y),O=J.projectionMatrix.elements,Mt=nt.projectionMatrix.elements,ht=O[14]/(O[10]-1),ut=O[14]/(O[10]+1),ot=(O[9]+1)/O[5],Ft=(O[9]-1)/O[5],bt=(O[8]-1)/O[0],xt=(Mt[8]+1)/Mt[0],ne=ht*bt,ve=ht*xt,Qt=it/(-bt+xt),Me=Qt*-bt;J.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(Me),F.translateZ(Qt),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.copy(F.matrixWorld).invert();let Ht=ht+Qt,Dt=ut+Qt,Fe=ne-Me,Te=ve+(it-Me),w=ot*ut/Dt*Ht,g=Ft*ut/Dt*Ht;F.projectionMatrix.makePerspective(Fe,Te,w,g,Ht,Dt)}function W(F,J){J===null?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(J.matrixWorld,F.matrix),F.matrixWorldInverse.copy(F.matrixWorld).invert()}this.updateCamera=function(F){if(i===null)return;S.near=I.near=C.near=F.near,S.far=I.far=C.far=F.far,(L!==S.near||X!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),L=S.near,X=S.far);let J=F.parent,nt=S.cameras;W(S,J);for(let O=0;O<nt.length;O++)W(nt[O],J);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),F.matrix.copy(S.matrix),F.matrix.decompose(F.position,F.quaternion,F.scale);let it=F.children;for(let O=0,Mt=it.length;O<Mt;O++)it[O].updateMatrixWorld(!0);nt.length===2?j(S,C,I):S.projectionMatrix.copy(C.projectionMatrix)},this.getCamera=function(){return S},this.getFoveation=function(){if(!(u===null&&m===null))return c},this.setFoveation=function(F){c=F,u!==null&&(u.fixedFoveation=F),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=F)},this.getPlanes=function(){return M};let Q=null;function Z(F,J){if(h=J.getViewerPose(l||o),_=J,h!==null){let nt=h.views;m!==null&&(t.setRenderTargetFramebuffer(v,m.framebuffer),t.setRenderTarget(v));let it=!1;nt.length!==S.cameras.length&&(S.cameras.length=0,it=!0);for(let O=0;O<nt.length;O++){let Mt=nt[O],ht=null;if(m!==null)ht=m.getViewport(Mt);else{let ot=f.getViewSubImage(u,Mt);ht=ot.viewport,O===0&&(t.setRenderTargetTextures(v,ot.colorTexture,u.ignoreDepthValues?void 0:ot.depthStencilTexture),t.setRenderTarget(v))}let ut=x[O];ut===void 0&&(ut=new _e,ut.layers.enable(O),ut.viewport=new Xt,x[O]=ut),ut.matrix.fromArray(Mt.transform.matrix),ut.projectionMatrix.fromArray(Mt.projectionMatrix),ut.viewport.set(ht.x,ht.y,ht.width,ht.height),O===0&&S.matrix.copy(ut.matrix),it===!0&&S.cameras.push(ut)}}for(let nt=0;nt<T.length;nt++){let it=b[nt],O=T[nt];it!==null&&O!==void 0&&O.update(it,J,l||o)}if(Q&&Q(F,J),J.detectedPlanes){n.dispatchEvent({type:"planesdetected",data:J.detectedPlanes});let nt=null;for(let it of M)J.detectedPlanes.has(it)||(nt===null&&(nt=[]),nt.push(it));if(nt!==null)for(let it of nt)M.delete(it),A.delete(it),n.dispatchEvent({type:"planeremoved",data:it});for(let it of J.detectedPlanes)if(!M.has(it))M.add(it),A.set(it,J.lastChangedTime),n.dispatchEvent({type:"planeadded",data:it});else{let O=A.get(it);it.lastChangedTime>O&&(A.set(it,it.lastChangedTime),n.dispatchEvent({type:"planechanged",data:it}))}}_=null}let ft=new ja;ft.setAnimationLoop(Z),this.setAnimationLoop=function(F){Q=F},this.dispose=function(){}}};function nf(r,t){function e(p,d){d.color.getRGB(p.fogColor.value,Ka(r)),d.isFog?(p.fogNear.value=d.near,p.fogFar.value=d.far):d.isFogExp2&&(p.fogDensity.value=d.density)}function n(p,d,v,T,b){d.isMeshBasicMaterial||d.isMeshLambertMaterial?i(p,d):d.isMeshToonMaterial?(i(p,d),h(p,d)):d.isMeshPhongMaterial?(i(p,d),l(p,d)):d.isMeshStandardMaterial?(i(p,d),f(p,d),d.isMeshPhysicalMaterial&&u(p,d,b)):d.isMeshMatcapMaterial?(i(p,d),m(p,d)):d.isMeshDepthMaterial?i(p,d):d.isMeshDistanceMaterial?(i(p,d),_(p,d)):d.isMeshNormalMaterial?i(p,d):d.isLineBasicMaterial?(s(p,d),d.isLineDashedMaterial&&o(p,d)):d.isPointsMaterial?a(p,d,v,T):d.isSpriteMaterial?c(p,d):d.isShadowMaterial?(p.color.value.copy(d.color),p.opacity.value=d.opacity):d.isShaderMaterial&&(d.uniformsNeedUpdate=!1)}function i(p,d){p.opacity.value=d.opacity,d.color&&p.diffuse.value.copy(d.color),d.emissive&&p.emissive.value.copy(d.emissive).multiplyScalar(d.emissiveIntensity),d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===ye&&(p.bumpScale.value*=-1)),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===ye&&p.normalScale.value.negate()),d.specularMap&&(p.specularMap.value=d.specularMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let v=t.get(d).envMap;if(v&&(p.envMap.value=v,p.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=d.reflectivity,p.ior.value=d.ior,p.refractionRatio.value=d.refractionRatio),d.lightMap){p.lightMap.value=d.lightMap;let M=r.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=d.lightMapIntensity*M}d.aoMap&&(p.aoMap.value=d.aoMap,p.aoMapIntensity.value=d.aoMapIntensity);let T;d.map?T=d.map:d.specularMap?T=d.specularMap:d.displacementMap?T=d.displacementMap:d.normalMap?T=d.normalMap:d.bumpMap?T=d.bumpMap:d.roughnessMap?T=d.roughnessMap:d.metalnessMap?T=d.metalnessMap:d.alphaMap?T=d.alphaMap:d.emissiveMap?T=d.emissiveMap:d.clearcoatMap?T=d.clearcoatMap:d.clearcoatNormalMap?T=d.clearcoatNormalMap:d.clearcoatRoughnessMap?T=d.clearcoatRoughnessMap:d.iridescenceMap?T=d.iridescenceMap:d.iridescenceThicknessMap?T=d.iridescenceThicknessMap:d.specularIntensityMap?T=d.specularIntensityMap:d.specularColorMap?T=d.specularColorMap:d.transmissionMap?T=d.transmissionMap:d.thicknessMap?T=d.thicknessMap:d.sheenColorMap?T=d.sheenColorMap:d.sheenRoughnessMap&&(T=d.sheenRoughnessMap),T!==void 0&&(T.isWebGLRenderTarget&&(T=T.texture),T.matrixAutoUpdate===!0&&T.updateMatrix(),p.uvTransform.value.copy(T.matrix));let b;d.aoMap?b=d.aoMap:d.lightMap&&(b=d.lightMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uv2Transform.value.copy(b.matrix))}function s(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity}function o(p,d){p.dashSize.value=d.dashSize,p.totalSize.value=d.dashSize+d.gapSize,p.scale.value=d.scale}function a(p,d,v,T){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.size.value=d.size*v,p.scale.value=T*.5,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let b;d.map?b=d.map:d.alphaMap&&(b=d.alphaMap),b!==void 0&&(b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix))}function c(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.rotation.value=d.rotation,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let v;d.map?v=d.map:d.alphaMap&&(v=d.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),p.uvTransform.value.copy(v.matrix))}function l(p,d){p.specular.value.copy(d.specular),p.shininess.value=Math.max(d.shininess,1e-4)}function h(p,d){d.gradientMap&&(p.gradientMap.value=d.gradientMap)}function f(p,d){p.roughness.value=d.roughness,p.metalness.value=d.metalness,d.roughnessMap&&(p.roughnessMap.value=d.roughnessMap),d.metalnessMap&&(p.metalnessMap.value=d.metalnessMap),t.get(d).envMap&&(p.envMapIntensity.value=d.envMapIntensity)}function u(p,d,v){p.ior.value=d.ior,d.sheen>0&&(p.sheenColor.value.copy(d.sheenColor).multiplyScalar(d.sheen),p.sheenRoughness.value=d.sheenRoughness,d.sheenColorMap&&(p.sheenColorMap.value=d.sheenColorMap),d.sheenRoughnessMap&&(p.sheenRoughnessMap.value=d.sheenRoughnessMap)),d.clearcoat>0&&(p.clearcoat.value=d.clearcoat,p.clearcoatRoughness.value=d.clearcoatRoughness,d.clearcoatMap&&(p.clearcoatMap.value=d.clearcoatMap),d.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=d.clearcoatRoughnessMap),d.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(d.clearcoatNormalScale),p.clearcoatNormalMap.value=d.clearcoatNormalMap,d.side===ye&&p.clearcoatNormalScale.value.negate())),d.iridescence>0&&(p.iridescence.value=d.iridescence,p.iridescenceIOR.value=d.iridescenceIOR,p.iridescenceThicknessMinimum.value=d.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=d.iridescenceThicknessRange[1],d.iridescenceMap&&(p.iridescenceMap.value=d.iridescenceMap),d.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=d.iridescenceThicknessMap)),d.transmission>0&&(p.transmission.value=d.transmission,p.transmissionSamplerMap.value=v.texture,p.transmissionSamplerSize.value.set(v.width,v.height),d.transmissionMap&&(p.transmissionMap.value=d.transmissionMap),p.thickness.value=d.thickness,d.thicknessMap&&(p.thicknessMap.value=d.thicknessMap),p.attenuationDistance.value=d.attenuationDistance,p.attenuationColor.value.copy(d.attenuationColor)),p.specularIntensity.value=d.specularIntensity,p.specularColor.value.copy(d.specularColor),d.specularIntensityMap&&(p.specularIntensityMap.value=d.specularIntensityMap),d.specularColorMap&&(p.specularColorMap.value=d.specularColorMap)}function m(p,d){d.matcap&&(p.matcap.value=d.matcap)}function _(p,d){p.referencePosition.value.copy(d.referencePosition),p.nearDistance.value=d.nearDistance,p.farDistance.value=d.farDistance}return{refreshFogUniforms:e,refreshMaterialUniforms:n}}function sf(r,t,e,n){let i={},s={},o=[],a=e.isWebGL2?r.getParameter(35375):0;function c(T,b){let M=b.program;n.uniformBlockBinding(T,M)}function l(T,b){let M=i[T.id];M===void 0&&(_(T),M=h(T),i[T.id]=M,T.addEventListener("dispose",d));let A=b.program;n.updateUBOMapping(T,A);let C=t.render.frame;s[T.id]!==C&&(u(T),s[T.id]=C)}function h(T){let b=f();T.__bindingPointIndex=b;let M=r.createBuffer(),A=T.__size,C=T.usage;return r.bindBuffer(35345,M),r.bufferData(35345,A,C),r.bindBuffer(35345,null),r.bindBufferBase(35345,b,M),M}function f(){for(let T=0;T<a;T++)if(o.indexOf(T)===-1)return o.push(T),T;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(T){let b=i[T.id],M=T.uniforms,A=T.__cache;r.bindBuffer(35345,b);for(let C=0,I=M.length;C<I;C++){let x=M[C];if(m(x,C,A)===!0){let S=x.__offset,L=Array.isArray(x.value)?x.value:[x.value],X=0;for(let q=0;q<L.length;q++){let z=L[q],R=p(z);typeof z=="number"?(x.__data[0]=z,r.bufferSubData(35345,S+X,x.__data)):z.isMatrix3?(x.__data[0]=z.elements[0],x.__data[1]=z.elements[1],x.__data[2]=z.elements[2],x.__data[3]=z.elements[0],x.__data[4]=z.elements[3],x.__data[5]=z.elements[4],x.__data[6]=z.elements[5],x.__data[7]=z.elements[0],x.__data[8]=z.elements[6],x.__data[9]=z.elements[7],x.__data[10]=z.elements[8],x.__data[11]=z.elements[0]):(z.toArray(x.__data,X),X+=R.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(35345,S,x.__data)}}r.bindBuffer(35345,null)}function m(T,b,M){let A=T.value;if(M[b]===void 0){if(typeof A=="number")M[b]=A;else{let C=Array.isArray(A)?A:[A],I=[];for(let x=0;x<C.length;x++)I.push(C[x].clone());M[b]=I}return!0}else if(typeof A=="number"){if(M[b]!==A)return M[b]=A,!0}else{let C=Array.isArray(M[b])?M[b]:[M[b]],I=Array.isArray(A)?A:[A];for(let x=0;x<C.length;x++){let S=C[x];if(S.equals(I[x])===!1)return S.copy(I[x]),!0}}return!1}function _(T){let b=T.uniforms,M=0,A=16,C=0;for(let I=0,x=b.length;I<x;I++){let S=b[I],L={boundary:0,storage:0},X=Array.isArray(S.value)?S.value:[S.value];for(let q=0,z=X.length;q<z;q++){let R=X[q],G=p(R);L.boundary+=G.boundary,L.storage+=G.storage}if(S.__data=new Float32Array(L.storage/Float32Array.BYTES_PER_ELEMENT),S.__offset=M,I>0){C=M%A;let q=A-C;C!==0&&q-L.boundary<0&&(M+=A-C,S.__offset=M)}M+=L.storage}return C=M%A,C>0&&(M+=A-C),T.__size=M,T.__cache={},this}function p(T){let b={boundary:0,storage:0};return typeof T=="number"?(b.boundary=4,b.storage=4):T.isVector2?(b.boundary=8,b.storage=8):T.isVector3||T.isColor?(b.boundary=16,b.storage=12):T.isVector4?(b.boundary=16,b.storage=16):T.isMatrix3?(b.boundary=48,b.storage=48):T.isMatrix4?(b.boundary=64,b.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),b}function d(T){let b=T.target;b.removeEventListener("dispose",d);let M=o.indexOf(b.__bindingPointIndex);o.splice(M,1),r.deleteBuffer(i[b.id]),delete i[b.id],delete s[b.id]}function v(){for(let T in i)r.deleteBuffer(i[T]);o=[],i={},s={}}return{bind:c,update:l,dispose:v}}function rf(){let r=Wi("canvas");return r.style.display="block",r}function af(r={}){this.isWebGLRenderer=!0;let t=r.canvas!==void 0?r.canvas:rf(),e=r.context!==void 0?r.context:null,n=r.depth!==void 0?r.depth:!0,i=r.stencil!==void 0?r.stencil:!0,s=r.antialias!==void 0?r.antialias:!1,o=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,a=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",l=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h;e!==null?h=e.getContextAttributes().alpha:h=r.alpha!==void 0?r.alpha:!1;let f=null,u=null,m=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=vn,this.physicallyCorrectLights=!1,this.toneMapping=We,this.toneMappingExposure=1;let p=this,d=!1,v=0,T=0,b=null,M=-1,A=null,C=new Xt,I=new Xt,x=null,S=t.width,L=t.height,X=1,q=null,z=null,R=new Xt(0,0,S,L),G=new Xt(0,0,S,L),Y=!1,j=new ts,W=!1,Q=!1,Z=null,ft=new qt,F=new Nt,J=new N,nt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function it(){return b===null?X:1}let O=e;function Mt(y,D){for(let B=0;B<y.length;B++){let P=y[B],V=t.getContext(P,D);if(V!==null)return V}return null}try{let y={alpha:!0,depth:n,stencil:i,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:c,failIfMajorPerformanceCaveat:l};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${vr}`),t.addEventListener("webglcontextlost",gt,!1),t.addEventListener("webglcontextrestored",dt,!1),t.addEventListener("webglcontextcreationerror",Pt,!1),O===null){let D=["webgl2","webgl","experimental-webgl"];if(p.isWebGL1Renderer===!0&&D.shift(),O=Mt(D,y),O===null)throw Mt(D)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}O.getShaderPrecisionFormat===void 0&&(O.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(y){throw console.error("THREE.WebGLRenderer: "+y.message),y}let ht,ut,ot,Ft,bt,xt,ne,ve,Qt,Me,Ht,Dt,Fe,Te,w,g,k,K,tt,st,yt,rt,H,mt;function _t(){ht=new Tu(O),ut=new yu(O,ht,r),ht.init(ut),rt=new tf(O,ht,ut),ot=new jd(O,ht,ut),Ft=new Cu,bt=new kd,xt=new Qd(O,ht,ot,bt,ut,rt,Ft),ne=new Mu(p),ve=new Su(p),Qt=new Ol(O,ut),H=new _u(O,ht,Qt,ut),Me=new Au(O,Qt,Ft,H),Ht=new Iu(O,Me,Qt,Ft),tt=new Lu(O,ut,xt),g=new vu(bt),Dt=new Bd(p,ne,ve,ht,ut,H,g),Fe=new nf(p,bt),Te=new Gd,w=new Zd(ht,ut),K=new gu(p,ne,ve,ot,Ht,h,o),k=new Kd(p,Ht,ut),mt=new sf(O,Ft,ut,ot),st=new xu(O,ht,Ft,ut),yt=new Eu(O,ht,Ft,ut),Ft.programs=Dt.programs,p.capabilities=ut,p.extensions=ht,p.properties=bt,p.renderLists=Te,p.shadowMap=k,p.state=ot,p.info=Ft}_t();let lt=new hr(p,O);this.xr=lt,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){let y=ht.get("WEBGL_lose_context");y&&y.loseContext()},this.forceContextRestore=function(){let y=ht.get("WEBGL_lose_context");y&&y.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(y){y!==void 0&&(X=y,this.setSize(S,L,!1))},this.getSize=function(y){return y.set(S,L)},this.setSize=function(y,D,B){if(lt.isPresenting){console.warn("THREE.WebGLRenderer: Can\'t change size while VR device is presenting.");return}S=y,L=D,t.width=Math.floor(y*X),t.height=Math.floor(D*X),B!==!1&&(t.style.width=y+"px",t.style.height=D+"px"),this.setViewport(0,0,y,D)},this.getDrawingBufferSize=function(y){return y.set(S*X,L*X).floor()},this.setDrawingBufferSize=function(y,D,B){S=y,L=D,X=B,t.width=Math.floor(y*B),t.height=Math.floor(D*B),this.setViewport(0,0,y,D)},this.getCurrentViewport=function(y){return y.copy(C)},this.getViewport=function(y){return y.copy(R)},this.setViewport=function(y,D,B,P){y.isVector4?R.set(y.x,y.y,y.z,y.w):R.set(y,D,B,P),ot.viewport(C.copy(R).multiplyScalar(X).floor())},this.getScissor=function(y){return y.copy(G)},this.setScissor=function(y,D,B,P){y.isVector4?G.set(y.x,y.y,y.z,y.w):G.set(y,D,B,P),ot.scissor(I.copy(G).multiplyScalar(X).floor())},this.getScissorTest=function(){return Y},this.setScissorTest=function(y){ot.setScissorTest(Y=y)},this.setOpaqueSort=function(y){q=y},this.setTransparentSort=function(y){z=y},this.getClearColor=function(y){return y.copy(K.getClearColor())},this.setClearColor=function(){K.setClearColor.apply(K,arguments)},this.getClearAlpha=function(){return K.getClearAlpha()},this.setClearAlpha=function(){K.setClearAlpha.apply(K,arguments)},this.clear=function(y=!0,D=!0,B=!0){let P=0;y&&(P|=16384),D&&(P|=256),B&&(P|=1024),O.clear(P)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",gt,!1),t.removeEventListener("webglcontextrestored",dt,!1),t.removeEventListener("webglcontextcreationerror",Pt,!1),Te.dispose(),w.dispose(),bt.dispose(),ne.dispose(),ve.dispose(),Ht.dispose(),H.dispose(),mt.dispose(),Dt.dispose(),lt.dispose(),lt.removeEventListener("sessionstart",at),lt.removeEventListener("sessionend",ct),Z&&(Z.dispose(),Z=null),Lt.stop()};function gt(y){y.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),d=!0}function dt(){console.log("THREE.WebGLRenderer: Context Restored."),d=!1;let y=Ft.autoReset,D=k.enabled,B=k.autoUpdate,P=k.needsUpdate,V=k.type;_t(),Ft.autoReset=y,k.enabled=D,k.autoUpdate=B,k.needsUpdate=P,k.type=V}function Pt(y){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",y.statusMessage)}function Ut(y){let D=y.target;D.removeEventListener("dispose",Ut),Jt(D)}function Jt(y){E(y),bt.remove(y)}function E(y){let D=bt.get(y).programs;D!==void 0&&(D.forEach(function(B){Dt.releaseProgram(B)}),y.isShaderMaterial&&Dt.releaseShaderCache(y))}this.renderBufferDirect=function(y,D,B,P,V,pt){D===null&&(D=nt);let vt=V.isMesh&&V.matrixWorld.determinant()<0,St=ro(y,D,B,P,V);ot.setMaterial(P,vt);let Tt=B.index,Rt=1;P.wireframe===!0&&(Tt=Me.getWireframeAttribute(B),Rt=2);let At=B.drawRange,Et=B.attributes.position,kt=At.start*Rt,fe=(At.start+At.count)*Rt;pt!==null&&(kt=Math.max(kt,pt.start*Rt),fe=Math.min(fe,(pt.start+pt.count)*Rt)),Tt!==null?(kt=Math.max(kt,0),fe=Math.min(fe,Tt.count)):Et!=null&&(kt=Math.max(kt,0),fe=Math.min(fe,Et.count));let Oe=fe-kt;if(Oe<0||Oe===1/0)return;H.setup(V,P,St,B,Tt);let on,Vt=st;if(Tt!==null&&(on=Qt.get(Tt),Vt=yt,Vt.setIndex(on)),V.isMesh)P.wireframe===!0?(ot.setLineWidth(P.wireframeLinewidth*it()),Vt.setMode(1)):Vt.setMode(4);else if(V.isLine){let Ct=P.linewidth;Ct===void 0&&(Ct=1),ot.setLineWidth(Ct*it()),V.isLineSegments?Vt.setMode(1):V.isLineLoop?Vt.setMode(2):Vt.setMode(3)}else V.isPoints?Vt.setMode(0):V.isSprite&&Vt.setMode(4);if(V.isInstancedMesh)Vt.renderInstances(kt,Oe,V.count);else if(B.isInstancedBufferGeometry){let Ct=B._maxInstanceCount!==void 0?B._maxInstanceCount:1/0,os=Math.min(B.instanceCount,Ct);Vt.renderInstances(kt,Oe,os)}else Vt.render(kt,Oe)},this.compile=function(y,D){function B(P,V,pt){P.transparent===!0&&P.side===tn&&P.forceSinglePass===!1?(P.side=ye,P.needsUpdate=!0,be(P,V,pt),P.side=nn,P.needsUpdate=!0,be(P,V,pt),P.side=tn):be(P,V,pt)}u=w.get(y),u.init(),_.push(u),y.traverseVisible(function(P){P.isLight&&P.layers.test(D.layers)&&(u.pushLight(P),P.castShadow&&u.pushShadow(P))}),u.setupLights(p.physicallyCorrectLights),y.traverse(function(P){let V=P.material;if(V)if(Array.isArray(V))for(let pt=0;pt<V.length;pt++){let vt=V[pt];B(vt,y,P)}else B(V,y,P)}),_.pop(),u=null};let U=null;function $(y){U&&U(y)}function at(){Lt.stop()}function ct(){Lt.start()}let Lt=new ja;Lt.setAnimationLoop($),typeof self!="undefined"&&Lt.setContext(self),this.setAnimationLoop=function(y){U=y,lt.setAnimationLoop(y),y===null?Lt.stop():Lt.start()},lt.addEventListener("sessionstart",at),lt.addEventListener("sessionend",ct),this.render=function(y,D){if(D!==void 0&&D.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(d===!0)return;y.matrixWorldAutoUpdate===!0&&y.updateMatrixWorld(),D.parent===null&&D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),lt.enabled===!0&<.isPresenting===!0&&(lt.cameraAutoUpdate===!0&<.updateCamera(D),D=lt.getCamera()),y.isScene===!0&&y.onBeforeRender(p,y,D,b),u=w.get(y,_.length),u.init(),_.push(u),ft.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse),j.setFromProjectionMatrix(ft),Q=this.localClippingEnabled,W=g.init(this.clippingPlanes,Q),f=Te.get(y,m.length),f.init(),m.push(f),$t(y,D,0,p.sortObjects),f.finish(),p.sortObjects===!0&&f.sort(q,z),W===!0&&g.beginShadows();let B=u.state.shadowsArray;if(k.render(B,y,D),W===!0&&g.endShadows(),this.info.autoReset===!0&&this.info.reset(),K.render(f,y),u.setupLights(p.physicallyCorrectLights),D.isArrayCamera){let P=D.cameras;for(let V=0,pt=P.length;V<pt;V++){let vt=P[V];te(f,y,vt,vt.viewport)}}else te(f,y,D);b!==null&&(xt.updateMultisampleRenderTarget(b),xt.updateRenderTargetMipmap(b)),y.isScene===!0&&y.onAfterRender(p,y,D),H.resetDefaultState(),M=-1,A=null,_.pop(),_.length>0?u=_[_.length-1]:u=null,m.pop(),m.length>0?f=m[m.length-1]:f=null};function $t(y,D,B,P){if(y.visible===!1)return;if(y.layers.test(D.layers)){if(y.isGroup)B=y.renderOrder;else if(y.isLOD)y.autoUpdate===!0&&y.update(D);else if(y.isLight)u.pushLight(y),y.castShadow&&u.pushShadow(y);else if(y.isSprite){if(!y.frustumCulled||j.intersectsSprite(y)){P&&J.setFromMatrixPosition(y.matrixWorld).applyMatrix4(ft);let vt=Ht.update(y),St=y.material;St.visible&&f.push(y,vt,St,B,J.z,null)}}else if((y.isMesh||y.isLine||y.isPoints)&&(y.isSkinnedMesh&&y.skeleton.frame!==Ft.render.frame&&(y.skeleton.update(),y.skeleton.frame=Ft.render.frame),!y.frustumCulled||j.intersectsObject(y))){P&&J.setFromMatrixPosition(y.matrixWorld).applyMatrix4(ft);let vt=Ht.update(y),St=y.material;if(Array.isArray(St)){let Tt=vt.groups;for(let Rt=0,At=Tt.length;Rt<At;Rt++){let Et=Tt[Rt],kt=St[Et.materialIndex];kt&&kt.visible&&f.push(y,vt,kt,B,J.z,Et)}}else St.visible&&f.push(y,vt,St,B,J.z,null)}}let pt=y.children;for(let vt=0,St=pt.length;vt<St;vt++)$t(pt[vt],D,B,P)}function te(y,D,B,P){let V=y.opaque,pt=y.transmissive,vt=y.transparent;u.setupLightsView(B),W===!0&&g.setGlobalState(p.clippingPlanes,B),pt.length>0&&an(V,D,B),P&&ot.viewport(C.copy(P)),V.length>0&&Bt(V,D,B),pt.length>0&&Bt(pt,D,B),vt.length>0&&Bt(vt,D,B),ot.buffers.depth.setTest(!0),ot.buffers.depth.setMask(!0),ot.buffers.color.setMask(!0),ot.setPolygonOffset(!1)}function an(y,D,B){let P=ut.isWebGL2;Z===null&&(Z=new qe(1,1,{generateMipmaps:!0,type:ht.has("EXT_color_buffer_half_float")?mi:yn,minFilter:pi,samples:P&&s===!0?4:0})),p.getDrawingBufferSize(F),P?Z.setSize(F.x,F.y):Z.setSize(Hi(F.x),Hi(F.y));let V=p.getRenderTarget();p.setRenderTarget(Z),p.clear();let pt=p.toneMapping;p.toneMapping=We,Bt(y,D,B),p.toneMapping=pt,xt.updateMultisampleRenderTarget(Z),xt.updateRenderTargetMipmap(Z),p.setRenderTarget(V)}function Bt(y,D,B){let P=D.isScene===!0?D.overrideMaterial:null;for(let V=0,pt=y.length;V<pt;V++){let vt=y[V],St=vt.object,Tt=vt.geometry,Rt=P===null?vt.material:P,At=vt.group;St.layers.test(B.layers)&&ze(St,D,B,Tt,Rt,At)}}function ze(y,D,B,P,V,pt){y.onBeforeRender(p,D,B,P,V,pt),y.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,y.matrixWorld),y.normalMatrix.getNormalMatrix(y.modelViewMatrix),V.onBeforeRender(p,D,B,P,y,pt),V.transparent===!0&&V.side===tn&&V.forceSinglePass===!1?(V.side=ye,V.needsUpdate=!0,p.renderBufferDirect(B,D,P,V,y,pt),V.side=nn,V.needsUpdate=!0,p.renderBufferDirect(B,D,P,V,y,pt),V.side=tn):p.renderBufferDirect(B,D,P,V,y,pt),y.onAfterRender(p,D,B,P,V,pt)}function be(y,D,B){D.isScene!==!0&&(D=nt);let P=bt.get(y),V=u.state.lights,pt=u.state.shadowsArray,vt=V.state.version,St=Dt.getParameters(y,V.state,pt,D,B),Tt=Dt.getProgramCacheKey(St),Rt=P.programs;P.environment=y.isMeshStandardMaterial?D.environment:null,P.fog=D.fog,P.envMap=(y.isMeshStandardMaterial?ve:ne).get(y.envMap||P.environment),Rt===void 0&&(y.addEventListener("dispose",Ut),Rt=new Map,P.programs=Rt);let At=Rt.get(Tt);if(At!==void 0){if(P.currentProgram===At&&P.lightsStateVersion===vt)return Ar(y,St),At}else St.uniforms=Dt.getUniforms(y),y.onBuild(B,St,p),y.onBeforeCompile(St,p),At=Dt.acquireProgram(St,Tt),Rt.set(Tt,At),P.uniforms=St.uniforms;let Et=P.uniforms;(!y.isShaderMaterial&&!y.isRawShaderMaterial||y.clipping===!0)&&(Et.clippingPlanes=g.uniform),Ar(y,St),P.needsLights=oo(y),P.lightsStateVersion=vt,P.needsLights&&(Et.ambientLightColor.value=V.state.ambient,Et.lightProbe.value=V.state.probe,Et.directionalLights.value=V.state.directional,Et.directionalLightShadows.value=V.state.directionalShadow,Et.spotLights.value=V.state.spot,Et.spotLightShadows.value=V.state.spotShadow,Et.rectAreaLights.value=V.state.rectArea,Et.ltc_1.value=V.state.rectAreaLTC1,Et.ltc_2.value=V.state.rectAreaLTC2,Et.pointLights.value=V.state.point,Et.pointLightShadows.value=V.state.pointShadow,Et.hemisphereLights.value=V.state.hemi,Et.directionalShadowMap.value=V.state.directionalShadowMap,Et.directionalShadowMatrix.value=V.state.directionalShadowMatrix,Et.spotShadowMap.value=V.state.spotShadowMap,Et.spotLightMatrix.value=V.state.spotLightMatrix,Et.spotLightMap.value=V.state.spotLightMap,Et.pointShadowMap.value=V.state.pointShadowMap,Et.pointShadowMatrix.value=V.state.pointShadowMatrix);let kt=At.getUniforms(),fe=Wn.seqWithValue(kt.seq,Et);return P.currentProgram=At,P.uniformsList=fe,At}function Ar(y,D){let B=bt.get(y);B.outputEncoding=D.outputEncoding,B.instancing=D.instancing,B.skinning=D.skinning,B.morphTargets=D.morphTargets,B.morphNormals=D.morphNormals,B.morphColors=D.morphColors,B.morphTargetsCount=D.morphTargetsCount,B.numClippingPlanes=D.numClippingPlanes,B.numIntersection=D.numClipIntersection,B.vertexAlphas=D.vertexAlphas,B.vertexTangents=D.vertexTangents,B.toneMapping=D.toneMapping}function ro(y,D,B,P,V){D.isScene!==!0&&(D=nt),xt.resetTextureUnits();let pt=D.fog,vt=P.isMeshStandardMaterial?D.environment:null,St=b===null?p.outputEncoding:b.isXRRenderTarget===!0?b.texture.encoding:vn,Tt=(P.isMeshStandardMaterial?ve:ne).get(P.envMap||vt),Rt=P.vertexColors===!0&&!!B.attributes.color&&B.attributes.color.itemSize===4,At=!!P.normalMap&&!!B.attributes.tangent,Et=!!B.morphAttributes.position,kt=!!B.morphAttributes.normal,fe=!!B.morphAttributes.color,Oe=P.toneMapped?p.toneMapping:We,on=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,Vt=on!==void 0?on.length:0,Ct=bt.get(P),os=u.state.lights;if(W===!0&&(Q===!0||y!==A)){let pe=y===A&&P.id===M;g.setState(P,y,pe)}let Kt=!1;P.version===Ct.__version?(Ct.needsLights&&Ct.lightsStateVersion!==os.state.version||Ct.outputEncoding!==St||V.isInstancedMesh&&Ct.instancing===!1||!V.isInstancedMesh&&Ct.instancing===!0||V.isSkinnedMesh&&Ct.skinning===!1||!V.isSkinnedMesh&&Ct.skinning===!0||Ct.envMap!==Tt||P.fog===!0&&Ct.fog!==pt||Ct.numClippingPlanes!==void 0&&(Ct.numClippingPlanes!==g.numPlanes||Ct.numIntersection!==g.numIntersection)||Ct.vertexAlphas!==Rt||Ct.vertexTangents!==At||Ct.morphTargets!==Et||Ct.morphNormals!==kt||Ct.morphColors!==fe||Ct.toneMapping!==Oe||ut.isWebGL2===!0&&Ct.morphTargetsCount!==Vt)&&(Kt=!0):(Kt=!0,Ct.__version=P.version);let ln=Ct.currentProgram;Kt===!0&&(ln=be(P,D,V));let Er=!1,ti=!1,ls=!1,ie=ln.getUniforms(),cn=Ct.uniforms;if(ot.useProgram(ln.program)&&(Er=!0,ti=!0,ls=!0),P.id!==M&&(M=P.id,ti=!0),Er||A!==y){if(ie.setValue(O,"projectionMatrix",y.projectionMatrix),ut.logarithmicDepthBuffer&&ie.setValue(O,"logDepthBufFC",2/(Math.log(y.far+1)/Math.LN2)),A!==y&&(A=y,ti=!0,ls=!0),P.isShaderMaterial||P.isMeshPhongMaterial||P.isMeshToonMaterial||P.isMeshStandardMaterial||P.envMap){let pe=ie.map.cameraPosition;pe!==void 0&&pe.setValue(O,J.setFromMatrixPosition(y.matrixWorld))}(P.isMeshPhongMaterial||P.isMeshToonMaterial||P.isMeshLambertMaterial||P.isMeshBasicMaterial||P.isMeshStandardMaterial||P.isShaderMaterial)&&ie.setValue(O,"isOrthographic",y.isOrthographicCamera===!0),(P.isMeshPhongMaterial||P.isMeshToonMaterial||P.isMeshLambertMaterial||P.isMeshBasicMaterial||P.isMeshStandardMaterial||P.isShaderMaterial||P.isShadowMaterial||V.isSkinnedMesh)&&ie.setValue(O,"viewMatrix",y.matrixWorldInverse)}if(V.isSkinnedMesh){ie.setOptional(O,V,"bindMatrix"),ie.setOptional(O,V,"bindMatrixInverse");let pe=V.skeleton;pe&&(ut.floatVertexTextures?(pe.boneTexture===null&&pe.computeBoneTexture(),ie.setValue(O,"boneTexture",pe.boneTexture,xt),ie.setValue(O,"boneTextureSize",pe.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}let cs=B.morphAttributes;if((cs.position!==void 0||cs.normal!==void 0||cs.color!==void 0&&ut.isWebGL2===!0)&&tt.update(V,B,P,ln),(ti||Ct.receiveShadow!==V.receiveShadow)&&(Ct.receiveShadow=V.receiveShadow,ie.setValue(O,"receiveShadow",V.receiveShadow)),P.isMeshGouraudMaterial&&P.envMap!==null&&(cn.envMap.value=Tt,cn.flipEnvMap.value=Tt.isCubeTexture&&Tt.isRenderTargetTexture===!1?-1:1),ti&&(ie.setValue(O,"toneMappingExposure",p.toneMappingExposure),Ct.needsLights&&ao(cn,ls),pt&&P.fog===!0&&Fe.refreshFogUniforms(cn,pt),Fe.refreshMaterialUniforms(cn,P,X,L,Z),Wn.upload(O,Ct.uniformsList,cn,xt)),P.isShaderMaterial&&P.uniformsNeedUpdate===!0&&(Wn.upload(O,Ct.uniformsList,cn,xt),P.uniformsNeedUpdate=!1),P.isSpriteMaterial&&ie.setValue(O,"center",V.center),ie.setValue(O,"modelViewMatrix",V.modelViewMatrix),ie.setValue(O,"normalMatrix",V.normalMatrix),ie.setValue(O,"modelMatrix",V.matrixWorld),P.isShaderMaterial||P.isRawShaderMaterial){let pe=P.uniformsGroups;for(let hs=0,lo=pe.length;hs<lo;hs++)if(ut.isWebGL2){let Cr=pe[hs];mt.update(Cr,ln),mt.bind(Cr,ln)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return ln}function ao(y,D){y.ambientLightColor.needsUpdate=D,y.lightProbe.needsUpdate=D,y.directionalLights.needsUpdate=D,y.directionalLightShadows.needsUpdate=D,y.pointLights.needsUpdate=D,y.pointLightShadows.needsUpdate=D,y.spotLights.needsUpdate=D,y.spotLightShadows.needsUpdate=D,y.rectAreaLights.needsUpdate=D,y.hemisphereLights.needsUpdate=D}function oo(y){return y.isMeshLambertMaterial||y.isMeshToonMaterial||y.isMeshPhongMaterial||y.isMeshStandardMaterial||y.isShadowMaterial||y.isShaderMaterial&&y.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return b},this.setRenderTargetTextures=function(y,D,B){bt.get(y.texture).__webglTexture=D,bt.get(y.depthTexture).__webglTexture=B;let P=bt.get(y);P.__hasExternalTextures=!0,P.__hasExternalTextures&&(P.__autoAllocateDepthBuffer=B===void 0,P.__autoAllocateDepthBuffer||ht.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),P.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(y,D){let B=bt.get(y);B.__webglFramebuffer=D,B.__useDefaultFramebuffer=D===void 0},this.setRenderTarget=function(y,D=0,B=0){b=y,v=D,T=B;let P=!0,V=null,pt=!1,vt=!1;if(y){let Tt=bt.get(y);Tt.__useDefaultFramebuffer!==void 0?(ot.bindFramebuffer(36160,null),P=!1):Tt.__webglFramebuffer===void 0?xt.setupRenderTarget(y):Tt.__hasExternalTextures&&xt.rebindTextures(y,bt.get(y.texture).__webglTexture,bt.get(y.depthTexture).__webglTexture);let Rt=y.texture;(Rt.isData3DTexture||Rt.isDataArrayTexture||Rt.isCompressedArrayTexture)&&(vt=!0);let At=bt.get(y).__webglFramebuffer;y.isWebGLCubeRenderTarget?(V=At[D],pt=!0):ut.isWebGL2&&y.samples>0&&xt.useMultisampledRTT(y)===!1?V=bt.get(y).__webglMultisampledFramebuffer:V=At,C.copy(y.viewport),I.copy(y.scissor),x=y.scissorTest}else C.copy(R).multiplyScalar(X).floor(),I.copy(G).multiplyScalar(X).floor(),x=Y;if(ot.bindFramebuffer(36160,V)&&ut.drawBuffers&&P&&ot.drawBuffers(y,V),ot.viewport(C),ot.scissor(I),ot.setScissorTest(x),pt){let Tt=bt.get(y.texture);O.framebufferTexture2D(36160,36064,34069+D,Tt.__webglTexture,B)}else if(vt){let Tt=bt.get(y.texture),Rt=D||0;O.framebufferTextureLayer(36160,36064,Tt.__webglTexture,B||0,Rt)}M=-1},this.readRenderTargetPixels=function(y,D,B,P,V,pt,vt){if(!(y&&y.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let St=bt.get(y).__webglFramebuffer;if(y.isWebGLCubeRenderTarget&&vt!==void 0&&(St=St[vt]),St){ot.bindFramebuffer(36160,St);try{let Tt=y.texture,Rt=Tt.format,At=Tt.type;if(Rt!==Re&&rt.convert(Rt)!==O.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Et=At===mi&&(ht.has("EXT_color_buffer_half_float")||ut.isWebGL2&&ht.has("EXT_color_buffer_float"));if(At!==yn&&rt.convert(At)!==O.getParameter(35738)&&!(At===gn&&(ut.isWebGL2||ht.has("OES_texture_float")||ht.has("WEBGL_color_buffer_float")))&&!Et){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}D>=0&&D<=y.width-P&&B>=0&&B<=y.height-V&&O.readPixels(D,B,P,V,rt.convert(Rt),rt.convert(At),pt)}finally{let Tt=b!==null?bt.get(b).__webglFramebuffer:null;ot.bindFramebuffer(36160,Tt)}}},this.copyFramebufferToTexture=function(y,D,B=0){let P=Math.pow(2,-B),V=Math.floor(D.image.width*P),pt=Math.floor(D.image.height*P);xt.setTexture2D(D,0),O.copyTexSubImage2D(3553,B,0,0,y.x,y.y,V,pt),ot.unbindTexture()},this.copyTextureToTexture=function(y,D,B,P=0){let V=D.image.width,pt=D.image.height,vt=rt.convert(B.format),St=rt.convert(B.type);xt.setTexture2D(B,0),O.pixelStorei(37440,B.flipY),O.pixelStorei(37441,B.premultiplyAlpha),O.pixelStorei(3317,B.unpackAlignment),D.isDataTexture?O.texSubImage2D(3553,P,y.x,y.y,V,pt,vt,St,D.image.data):D.isCompressedTexture?O.compressedTexSubImage2D(3553,P,y.x,y.y,D.mipmaps[0].width,D.mipmaps[0].height,vt,D.mipmaps[0].data):O.texSubImage2D(3553,P,y.x,y.y,vt,St,D.image),P===0&&B.generateMipmaps&&O.generateMipmap(3553),ot.unbindTexture()},this.copyTextureToTexture3D=function(y,D,B,P,V=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let pt=y.max.x-y.min.x+1,vt=y.max.y-y.min.y+1,St=y.max.z-y.min.z+1,Tt=rt.convert(P.format),Rt=rt.convert(P.type),At;if(P.isData3DTexture)xt.setTexture3D(P,0),At=32879;else if(P.isDataArrayTexture)xt.setTexture2DArray(P,0),At=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}O.pixelStorei(37440,P.flipY),O.pixelStorei(37441,P.premultiplyAlpha),O.pixelStorei(3317,P.unpackAlignment);let Et=O.getParameter(3314),kt=O.getParameter(32878),fe=O.getParameter(3316),Oe=O.getParameter(3315),on=O.getParameter(32877),Vt=B.isCompressedTexture?B.mipmaps[0]:B.image;O.pixelStorei(3314,Vt.width),O.pixelStorei(32878,Vt.height),O.pixelStorei(3316,y.min.x),O.pixelStorei(3315,y.min.y),O.pixelStorei(32877,y.min.z),B.isDataTexture||B.isData3DTexture?O.texSubImage3D(At,V,D.x,D.y,D.z,pt,vt,St,Tt,Rt,Vt.data):B.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),O.compressedTexSubImage3D(At,V,D.x,D.y,D.z,pt,vt,St,Tt,Vt.data)):O.texSubImage3D(At,V,D.x,D.y,D.z,pt,vt,St,Tt,Rt,Vt),O.pixelStorei(3314,Et),O.pixelStorei(32878,kt),O.pixelStorei(3316,fe),O.pixelStorei(3315,Oe),O.pixelStorei(32877,on),V===0&&P.generateMipmaps&&O.generateMipmap(At),ot.unbindTexture()},this.initTexture=function(y){y.isCubeTexture?xt.setTextureCube(y,0):y.isData3DTexture?xt.setTexture3D(y,0):y.isDataArrayTexture||y.isCompressedArrayTexture?xt.setTexture2DArray(y,0):xt.setTexture2D(y,0),ot.unbindTexture()},this.resetState=function(){v=0,T=0,b=null,ot.reset(),H.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var ur=class extends af{};ur.prototype.isWebGL1Renderer=!0;function Qe(r,t,e){return io(r)?new r.constructor(r.subarray(t,e!==void 0?e:r.length)):r.slice(t,e)}function Ui(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function io(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Kn=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let o;e:{i:if(!(t<i)){for(let a=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(s=i,i=e[++n],t<i)break t}o=e.length;break e}if(!(t>=s)){let a=e[1];t<a&&(n=2,s=a);for(let c=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(i=s,s=e[--n-1],t>=s)break t}o=n,n=0;break e}break n}for(;n<o;){let a=n+o>>>1;t<e[a]?o=a:n=a+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let o=0;o!==i;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},dr=class extends Kn{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ra,endingEnd:ra}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,o=t+1,a=i[s],c=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case aa:s=t,a=2*e-n;break;case oa:s=i.length-2,a=e+i[s]-i[s+1];break;default:s=t,a=n}if(c===void 0)switch(this.getSettings_().endingEnd){case aa:o=t,c=2*n-e;break;case oa:o=1,c=n+i[1]-i[0];break;default:o=t-1,c=e}let l=(n-e)*.5,h=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(c-n),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=t*a,l=c-a,h=this._offsetPrev,f=this._offsetNext,u=this._weightPrev,m=this._weightNext,_=(n-e)/(i-e),p=_*_,d=p*_,v=-u*d+2*u*p-u*_,T=(1+u)*d+(-1.5-2*u)*p+(-.5+u)*_+1,b=(-1-m)*d+(1.5+m)*p+.5*_,M=m*d-m*p;for(let A=0;A!==a;++A)s[A]=v*o[h+A]+T*o[l+A]+b*o[c+A]+M*o[f+A];return s}},fr=class extends Kn{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=t*a,l=c-a,h=(n-e)/(i-e),f=1-h;for(let u=0;u!==a;++u)s[u]=o[l+u]*f+o[c+u]*h;return s}},pr=class extends Kn{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},Le=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Ui(e,this.TimeBufferType),this.values=Ui(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Ui(t.times,Array),values:Ui(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new pr(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new fr(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new dr(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case ki:e=this.InterpolantFactoryMethodDiscrete;break;case Vi:e=this.InterpolantFactoryMethodLinear;break;case _s:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ki;case this.InterpolantFactoryMethodLinear:return Vi;case this.InterpolantFactoryMethodSmooth:return _s}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,o=i-1;for(;s!==i&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Qe(n,s,o),this.values=Qe(this.values,s*a,o*a)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){let c=n[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),t=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),t=!1;break}o=c}if(i!==void 0&&io(i))for(let a=0,c=i.length;a!==c;++a){let l=i[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}return t}optimize(){let t=Qe(this.times),e=Qe(this.values),n=this.getValueSize(),i=this.getInterpolation()===_s,s=t.length-1,o=1;for(let a=1;a<s;++a){let c=!1,l=t[a],h=t[a+1];if(l!==h&&(a!==1||l!==t[0]))if(i)c=!0;else{let f=a*n,u=f-n,m=f+n;for(let _=0;_!==n;++_){let p=e[f+_];if(p!==e[u+_]||p!==e[m+_]){c=!0;break}}}if(c){if(a!==o){t[o]=t[a];let f=a*n,u=o*n;for(let m=0;m!==n;++m)e[u+m]=e[f+m]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,c=o*n,l=0;l!==n;++l)e[c+l]=e[a+l];++o}return o!==t.length?(this.times=Qe(t,0,o),this.values=Qe(e,0,o*n)):(this.times=t,this.values=e),this}clone(){let t=Qe(this.times,0),e=Qe(this.values,0),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};Le.prototype.TimeBufferType=Float32Array;Le.prototype.ValueBufferType=Float32Array;Le.prototype.DefaultInterpolation=Vi;var wn=class extends Le{};wn.prototype.ValueTypeName="bool";wn.prototype.ValueBufferType=Array;wn.prototype.DefaultInterpolation=ki;wn.prototype.InterpolantFactoryMethodLinear=void 0;wn.prototype.InterpolantFactoryMethodSmooth=void 0;var mr=class extends Le{};mr.prototype.ValueTypeName="color";var gr=class extends Le{};gr.prototype.ValueTypeName="number";var _r=class extends Kn{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(n-e)/(i-e),l=t*a;for(let h=l+a;l!==h;l+=4)rn.slerpFlat(s,0,o,l-a,o,l,c);return s}},yi=class extends Le{InterpolantFactoryMethodLinear(t){return new _r(this.times,this.values,this.getValueSize(),t)}};yi.prototype.ValueTypeName="quaternion";yi.prototype.DefaultInterpolation=Vi;yi.prototype.InterpolantFactoryMethodSmooth=void 0;var Sn=class extends Le{};Sn.prototype.ValueTypeName="string";Sn.prototype.ValueBufferType=Array;Sn.prototype.DefaultInterpolation=ki;Sn.prototype.InterpolantFactoryMethodLinear=void 0;Sn.prototype.InterpolantFactoryMethodSmooth=void 0;var xr=class extends Le{};xr.prototype.ValueTypeName="vector";var wr="\\\\[\\\\]\\\\.:\\\\/",of=new RegExp("["+wr+"]","g"),Sr="[^"+wr+"]",lf="[^"+wr.replace("\\\\.","")+"]",cf=/((?:WC+[\\/:])*)/.source.replace("WC",Sr),hf=/(WCOD+)?/.source.replace("WCOD",lf),uf=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Sr),df=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Sr),ff=new RegExp("^"+cf+hf+uf+df+"$"),pf=["material","materials","bones","map"],yr=class{constructor(t,e,n){let i=n||It.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},It=class{constructor(t,e,n){this.path=e,this.parsedPath=n||It.parseTrackName(e),this.node=It.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new It.Composite(t,e,n):new It(t,e,n)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(of,"")}static parseTrackName(t){let e=ff.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);pf.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===e||a.uuid===e)return a;let c=n(a.children);if(c)return c}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=It.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn\'t found.");return}if(n){let l=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===l){l=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(l!==void 0){if(t[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[l]}}let o=t[i];if(o===void 0){let l=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+i+" but it wasn\'t found.",t);return}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};It.Composite=yr;It.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};It.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};It.prototype.GetterByBindingType=[It.prototype._getValue_direct,It.prototype._getValue_array,It.prototype._getValue_arrayElement,It.prototype._getValue_toArray];It.prototype.SetterByBindingTypeAndVersioning=[[It.prototype._setValue_direct,It.prototype._setValue_direct_setNeedsUpdate,It.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[It.prototype._setValue_array,It.prototype._setValue_array_setNeedsUpdate,It.prototype._setValue_array_setMatrixWorldNeedsUpdate],[It.prototype._setValue_arrayElement,It.prototype._setValue_arrayElement_setNeedsUpdate,It.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[It.prototype._setValue_fromArray,It.prototype._setValue_fromArray_setNeedsUpdate,It.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var mf=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:vr}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=vr);var ss=new N,rs=new N,Tr=new N,as=new xe,so=self;so.addEventListener("message",async function(r){let t=JSON.parse(r.data),{id:e,position:n,index:i,thresholdAngle:s}=t;if(e&&n&&i&&s){let a=Math.pow(10,4),c=Math.cos(Za.DEG2RAD*s),l=i.type,h=n.type,f=new ce(new self[l](i.array),i.itemSize,i.normalized),u=new ce(new self[h](n.array),n.itemSize,n.normalized),m=f?f.count:u.count,_=[0,0,0],p=["a","b","c"],d=new Array(3),v={},T=[];for(let M=0;M<m;M+=3){f?(_[0]=f.getX(M),_[1]=f.getX(M+1),_[2]=f.getX(M+2)):(_[0]=M,_[1]=M+1,_[2]=M+2);let{a:A,b:C,c:I}=as;A.fromBufferAttribute(u,_[0]),C.fromBufferAttribute(u,_[1]),I.fromBufferAttribute(u,_[2]),as.getNormal(Tr);let x=S=>Math.round(S*a);if(d[0]=`${x(A.x)}, ${x(A.y)}, ${x(A.z)}`,d[1]=`${x(C.x)}, ${x(C.y)}, ${x(C.z)}`,d[2]=`${x(I.x)}, ${x(I.y)}, ${x(I.z)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let S=0;S<3;S++){let L=(S+1)%3,X=d[S],q=d[L],z=as[p[S]],R=as[p[L]],G=`${X}_${q}`,Y=`${q}_${X}`;Y in v&&v[Y]?(Tr.dot(v[Y].normal)<=c&&(T.push(z.x,z.y,z.z),T.push(R.x,R.y,R.z)),v[Y]=null):G in v||(v[G]={index0:_[S],index1:_[L],normal:Tr.clone()})}}for(let M in v)if(v[M]){let{index0:A,index1:C}=v[M];ss.fromBufferAttribute(u,A),rs.fromBufferAttribute(u,C),T.push(ss.x,ss.y,ss.z),T.push(rs.x,rs.y,rs.z)}let b=new self[h](T);so.postMessage({id:e,vertices:b},[b.buffer])}});\n/*! Bundled license information:\n\nthree/build/three.module.js:\n (**\n * @license\n * Copyright 2010-2023 Three.js Authors\n * SPDX-License-Identifier: MIT\n *)\n*/\n')}var tl,tI=class{constructor(){this.worker=new Tk,this.geometries=new Map,this.loadedGeometries=new Map,this.jobCount=0,this.init()}add(e,t){this.geometries.set(e,t),this.jobCount++}get(e){return this.geometries.get(e)}init(){this.worker.addEventListener("message",(e=>{let t=this.geometries.get(e.data.id.toString());(null==t?void 0:t.length)>0&&(t.forEach((t=>{null!=t&&t.geometry&&null!=t&&t.geom&&null!=t&&t.line&&(t.geom.parameters={geometry:t.geometry,thresholdAngle:5},t.geom.setAttribute("position",new dt(e.data.vertices,3)),t.line.geometry=t.geom,t.line.visible=!0)})),this.geometries.delete(e.data.id.toString()),this.jobCount--),this.loadedGeometries.set(e.data.id.toString(),e.data.vertices)}))}postMessage(e){this.worker.postMessage(JSON.stringify(e))}},w1t=new D(0,1,0),Yl=class{static resetObjectStyle(e){this.revertWireframeMode(e),this.revertObjectOpacity(e,[]),this.revertAppliedMaterialToObject(e),this.revertVisibleForFloors(e)}static resetObjectStyleById(e,t){let i=this.getObjectById(e,t);this.resetObjectStyle(i)}static setObjectOpacity(e,t=.3,i,r){let n=[],s=e=>{n.find((t=>t.id===e.id))||(n.push({id:e.id,opacity:e.opacity,transparent:e.transparent,side:e.side}),e.opacity*=t,e.transparent=!0,e.side=bi)},a=e=>{let i=n.find((t=>t.id===e.id));if(!i){let i=e.clone();return n.push({id:e.id,opacity:e.opacity,transparent:e.transparent,side:e.side,material:e,clonedMaterial:i}),i.opacity*=t,i.transparent=!0,i}return i.clonedMaterial};return e.traverse((e=>{if((!r||-1===r.indexOf(e.id))&&(!i||-1!==i.indexOf(e.id))&&e instanceof Je){let t=e;if(i||r){if(Array.isArray(t.material)){let e=[];t.material.forEach((t=>{let i=a(t);i&&e.push(i)})),t.material=e}else if(t.material){let e=a(t.material);e&&(t.material=e)}}else if(Array.isArray(t.material))t.material.forEach((e=>{s(e)}));else if(t.material){let e=t.material;s(e)}}})),n}static revertObjectOpacity(e,t,i,r){let n=e=>{let i=t.find((t=>t.id===e.id));i&&(e.opacity=i.opacity,e.transparent=i.transparent,e.side=i.side)},s=e=>{let i=t.find((t=>t.clonedMaterial&&t.clonedMaterial.id===e.id));if(i)return i.material};e.traverse((e=>{if((!r||-1===r.indexOf(e.id))&&(!i||-1!==i.indexOf(e.id))&&e instanceof Je)if(Array.isArray(e.material)){let t=[];e.material.forEach((e=>{let i=s(e);i?t.push(i):n(e)})),e.material=t}else if(e.material){let t=s(e.material);t?e.material=t:n(e.material)}}))}static setObjectOpacityById(e,t,i=.3,r,n){let s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);return Yl.setObjectOpacity(s,i,r,n)}static revertObjectOpacityById(e,t,i,r,n){let s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);Yl.revertObjectOpacity(s,i,r,n)}static applyMaterialToObject(e,t,i,r){e.traverse((e=>{r&&-1!==r.indexOf(e.id)||i&&-1===i.indexOf(e.id)||e instanceof Je&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),e.material=t)}))}static revertAppliedMaterialToObject(e,t,i){e.traverse((e=>{i&&-1!==i.indexOf(e.id)||t&&-1===t.indexOf(e.id)||e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,e.userData.originalMaterial=void 0)}))}static applyMaterialToObjectById(e,t,i,r,n){let s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);this.applyMaterialToObject(s,i,r,n)}static revertAppliedMaterialToObjectById(e,t,i,r){let n=e.getObjectById(t);if(!n)throw new Error(`Failed to find object by id: ${t}`);this.revertAppliedMaterialToObject(n,i,r)}static applyOpacityMaterialToObject(e,t,i){let r=new Xt({color:0,transparent:!0,opacity:.05});this.applyMaterialToObject(e,r,t,i)}static setWireframeMode(e){let t=new Xt({color:16732160,wireframe:!0,transparent:!0,opacity:.8});e.traverseVisible((e=>{if(e instanceof Je){let i=e;i.userData.materialForWireframe=i.material,i.material=t}}))}static setWireframeModeById(e,t){let i=e.getObjectById(t);if(!i)throw new Error(`Failed to find object by id: ${t}`);Yl.setWireframeMode(i)}static revertWireframeMode(e){e.traverseVisible((e=>{e instanceof Je&&e.userData.materialForWireframe&&(e.material=e.userData.materialForWireframe,e.userData.materialForWireframe=void 0)}))}static revertWireframeModeById(e,t){let i=e.getObjectById(t);if(!i)throw new Error(`Failed to find object by id: ${t}`);Yl.revertWireframeMode(i)}static findInner(e,t,i=[],r=!1){let n=t.toLowerCase(),s=[],a=e=>-1!==e.toLowerCase().indexOf(n),o=e=>-1!==e.toString().indexOf(n),l=e=>{if(e.name&&-1!==e.name.toLowerCase().indexOf(n))return!0;if(e.gltfExtensions){let t=e.gltfExtensions,i=t.objectId&&t.objectId.Value||t.elementId&&t.elementId.Value;if(i&&-1!==i.toLowerCase().indexOf(n))return!0}return!1};if(i.length>0)for(let h=0;h<i.length;++h){let t=i[h],n=e.getObjectById(t);if(n&&n.traverse((e=>{(a(e.name)||o(e.id)||l(e.userData))&&s.push(e)})),r&&s.length>0)return[s[0]]}else if(e.traverse((e=>{(a(e.name)||o(e.id)||l(e.userData))&&s.push(e)})),r&&s.length>0)return[s[0]];return s}static find(e,t,i=[],r=!1){return this.findInner(e,t,i,r)}static findFirst(e,t,i=[],r=!1){let n=this.findInner(e,t,i,r);if(n.length>0)return n[0]}static getFloorsFromString(e){let t=[],i=new RegExp(/(?:-?(?:\d+(?:\.5)?)F)(?=\W|$)/,"g").exec(e);return i&&i.length>0&&i.forEach((e=>{if(e){let i=e.replace("F",""),r=Number(i);r?t.push(r):console.log(`[OU] invalid floor: ${e}`)}})),t}static matchFloor(e,t){return-1!==this.getFloorsFromString(e).findIndex((e=>e===t))}static matchFloors(e,t){return-1!==this.getFloorsFromString(e).findIndex((e=>-1!==t.findIndex((t=>t===e))))}static distinctFloors(e,t){let i=[],r=e=>{this.getFloorsFromString(e).forEach((e=>{i[e]=!0}))};return t.forEach((t=>{let i=e.getObjectById(t);i&&i.traverse((e=>{if(r(e.name),e.userData.gltfExtensions){let t=e.userData.gltfExtensions;t.level&&t.level.Value&&r(t.level.Value)}}))})),Object.keys(i).sort()}static traverseObjectByFloors(e,t,i,r,n){let s=e.getObjectById(t);if(!s)return[];s.traverse((e=>{let t=this.matchFloors(e.name,i);if(!t&&e.userData&&e.userData.gltfExtensions){let r=e.userData.gltfExtensions;r.level&&r.level.Value&&(t=this.matchFloors(r.level.Value,i))}t&&r&&r(e),!t&&n&&n(e)}))}static setVisibleForFloors(e,t,i,r=!0){this.traverseObjectByFloors(e,t,i,(e=>{let t=e;for(;t;)t.visible=!0,t=t.parent||void 0}),(e=>{r&&(e.visible=!1)}))}static revertVisibleForFloors(e){e.traverse((e=>{e.visible=!0}))}static revertVisibleForFloorsById(e,t){let i=this.getObjectById(e,t);this.revertVisibleForFloors(i)}static getObjectById(e,t){let i=e.getObjectById(t);if(!i)throw new Error(`Failed to find object by id: ${t}`);return i}static createOutlines(e,t={visibleOnly:!0,meshOnly:!0,replaceOriginalObject:!1}){if(!e)return[];if(0===e.children.length&&(t.visibleOnly&&!e.visible||t.meshOnly&&!(e instanceof Je)))return[];let i=[],r=e;for(let n=r.children.length-1;n>=0;--n){let e=r.children[n],s=this.createOutlines(e,t);i.push(...s)}if(!r.geometry)return i;if(r instanceof sn)for(let n=0;n<r.count;++n){let e=new Be;r.getMatrixAt(n,e);let s=this.createOutline(r.geometry);if(t.replaceOriginalObject&&r.parent){let t=r.parent;s.applyMatrix4(e.premultiply(r.matrix)),t.add(s)}else s.applyMatrix4(e),r.add(s);s.updateWorldMatrix(!0,!1),i.push(s)}else if(r instanceof Je){let e=this.createOutline(r.geometry);if(t.replaceOriginalObject&&r.parent){let t=r.parent;e.userData=Object.assign(e.userData,r.userData),r.removeFromParent(),r.geometry.dispose(),e.applyMatrix4(r.matrix),t.add(e)}else r.add(e);e.updateWorldMatrix(!0,!1),i.push(e)}return i}static addOutlines(e,t={visibleOnly:!0,meshOnly:!0,replaceOriginalObject:!1}){let i=this.createOutlines(e,t);return tl||(tl=new tI),tl.loadedGeometries.clear(),i}static removeOutlines(e){if(e&&Array.isArray(e.children))for(let t=e.children.length-1;t>=0;--t){let i=e.children[t];i.children.length>0&&this.removeOutlines(i),i.userData.isOutline&&e.remove(i)}}static hasOutline(e){let t=!1;for(let i=0;i<e.children.length;++i){let r=e.children[i];if(r.userData.isOutline){t=!0;break}if(r.children.length>0&&(t=this.hasOutline(r),t))break}return t}static setOutlinesVisibility(e,t){e.traverse((e=>{e.userData.isOutline&&(e.visible=t)}))}static createOutline(e,t=this.OUTLINE_MATERIAL){let i=new Jo,r=new Kr(i,t);if(r.layers.enableAll(),Yl.disableLayerChannels(r,[12]),r.userData.isOutline=!0,r.matrixAutoUpdate=!1,r.visible=!1,r.updateMatrix(),tl||(tl=new tI),tl.loadedGeometries.has(e.id.toString())){let t=tl.loadedGeometries.get(e.id.toString());return i.parameters={geometry:e,thresholdAngle:5},i.setAttribute("position",new dt(t,3)),r.geometry=i,r.visible=!0,r}if(tl.get(e.id.toString())||tl.add(e.id.toString(),[]),!tl.loadedGeometries.has(e.id.toString())){tl.add(e.id.toString(),tl.get(e.id.toString()).concat([{geometry:e,geom:i,line:r}]));let t=e.getAttribute("position");tl.postMessage({id:e.id,position:t.toJSON(),index:e.getIndex(),thresholdAngle:5})}return r}static createOutlineSync(e,t,i=this.OUTLINE_MATERIAL){let r=new Jo(e,5),n=new Kr(r,i);return n.layers.enableAll(),Yl.disableLayerChannels(n,[12]),n.userData.isOutline=!0,n.matrixAutoUpdate=!1,n.applyMatrix4(t),n}static cloneObject(e,t=!0){let i=e.clone();return t&&i.traverse((e=>{(e instanceof Je||e instanceof Sr)&&(e.material=ss.cloneMaterial(e.material))})),i}static createBox(e,t,i,r=Yl.BOX_FACE_MATERIAL,n=!0){let s=[],a=(e,t,i)=>{s.push(new D(e,t,i))};a(0,0,0),a(e,0,0),a(e,t,0),a(0,t,0),a(0,0,i),a(e,0,i),a(e,t,i),a(0,t,i);let o=new ot;o.setFromPoints(s);let l=[0,3,2,0,2,1,4,6,7,4,5,6,0,7,3,0,4,7,3,6,2,3,7,6,1,6,5,1,2,6];return n&&l.push(0,5,4,0,1,5),o.setIndex(l),o.computeVertexNormals(),new Je(o,r)}static rebaseObjectOnRTC(e){let t=e;if(!((t.isMesh||t.isLine||t.isPoints)&&t.geometry&&t.geometry instanceof ot))return e;let i=t.geometry;if(!i.hasAttribute("position"))return e;let r=i.getAttribute("position");if(0===r.count)return e;let n=r.itemSize,s=r.array,a=[];for(let h=0;h<n;h++)a.push(s[h]);for(let h=0;h<r.count;h++)for(let e=0;e<n;e++)s[h*n+e]-=a[e];e.updateMatrix();let o=e.matrix.clone();e.matrix.makeTranslation(a[0],a[1],a.length>2?a[2]:0);let l=e.matrixAutoUpdate;return e.matrixAutoUpdate=!1,e.applyMatrix4(o),e.matrixAutoUpdate=l,e}static isEmptyObject(e){if(0===e.children.length){let t=e.geometry;if(!t||!t.hasAttribute("position")||0===t.getAttribute("position").count)return!0}return!1}static removeEmptyObjects(e){for(let t=0;t<e.children.length;)this.removeEmptyObjects(e.children[t])||++t;return!!this.isEmptyObject(e)&&(e.removeFromParent(),!0)}static removeEmptyObjectsFromRemovingObjects(e,t){0!==e.length&&(e.forEach((e=>{e.removeFromParent()})),this.removeEmptyObjects(t))}static setSharedVariablesOfObject(e){e.uuid="",e.up=w1t}static isLeafObject(e){return(e instanceof Je||e instanceof Sr||e instanceof Bi)&&!!e.geometry}static enableLayerChannels(e,t,i=!0){for(let r=0,n=t.length;r<n;r++)e.layers.enable(t[r]);if(i){let i=e.children;for(let e=0,r=i.length;e<r;e++)Yl.enableLayerChannels(i[e],t,!0)}}static disableLayerChannels(e,t,i=!0){for(let r=0,n=t.length;r<n;r++)e.layers.disable(t[r]);if(i){let i=e.children;for(let e=0,r=i.length;e<r;e++)Yl.disableLayerChannels(i[e],t,!0)}}static setLayerChannels(e,t,i=!0){e.layers.disableAll();for(let r=0,n=t.length;r<n;r++)e.layers.enable(t[r]);if(i){let i=e.children;for(let e=0,r=i.length;e<r;e++)Yl.setLayerChannels(i[e],t,!0)}}},kr=Yl;kr.OUTLINE_MATERIAL=new br({name:"outline",color:0,transparent:!0,opacity:.2}),kr.BOX_FACE_MATERIAL=new Ws({color:11648971,transparent:!0,opacity:.3,side:Xi});var aA=new Be,R1t=new Be,oA=class{static resetMergeInfo(){this.mergeInfo.removedObjects=0,this.mergeInfo.mergedMeshes=0,this.mergeInfo.mergedLines=0,this.mergeInfo.mergedPoints=0,this.mergeInfo.mergedUnknownTypeObjects=0,this.mergeInfo.elapsedTime=0}static merge(e,t=!0){let i=Date.now();this.mergeInner(e,t),this.mergeInfo.elapsedTime+=Date.now()-i}static mergeInner(e,t=!0){if(!e.children||e.children.length<1)return;let i=e.children.length,r={},n=[];for(let h=0;h<i;++h){let i=e.children[h];if(i.children.length>0){this.mergeInner(i,t);continue}if(i.userData.relativeToCenter||i.isInstancedMesh||!i.geometry||!(i.geometry instanceof ot))continue;let s=!1,a=Object.values(r);for(let t=a.length-1;t>=0;--t){let i=a[t].indexes[0];if(s=this.tryHandleMergeableObjects(e,h,i,r,n),s)break}for(let t=n.length-1;!s&&t>=0;--t){let i=n[t];if(s=this.tryHandleMergeableObjects(e,h,i,r,n),s)break}s||n.push(h)}if(Object.keys(r).length<=0)return;let s=[],a=[],o=[],l=[];Object.values(r).forEach((i=>{let r,n=i.indexes,h=e.children[n[0]],u=[],c=0,p=0,d=0,f=[];if(n.forEach((i=>{var r,n,s;let a=e.children[i],o=a.geometry.clone();if(o.applyMatrix4(a.matrix),kt.tryConvertInterleavedBufferAttributes(o),o.userData.isLineSegments=!0===a.isLineSegments,u.push(o),t){let e=null==(n=null==(r=o.attributes)?void 0:r.position)?void 0:n.count,t=(null==(s=o.index)?void 0:s.count)||0;f.push({batchId:c,positionStart:p,positionCount:e,indexStart:d,indexCount:t}),p+=e,d+=t,c++}})),0!==u.length){if(h.isMesh){let e=bo(u);if(!e)return;e.userData={},r=new Je(e,h.material),s.push(r)}else if(h.isLine){let e=this.mergeLineGeometries(u,t,h.material instanceof kg||h.material instanceof Zt,f);if(!e)return;r=new Kr(e,h.material),a.push(r)}else if(h.isPoints){let e=bo(u);if(!e)return;e.userData={},r=new Bi(e,h.material),o.push(r)}r&&(t?r.userData.batches=f:(r.userData=h.userData,r.userData.batches=void 0),r.userData.layerName=h.userData.layerName,r.name=`[Merged] ${h.name}`,r.matrixAutoUpdate=!1,r.renderOrder=h.renderOrder,r.layers.mask=h.layers.mask,r.visible=h.visible,l.push(...n)),u.forEach((e=>{kt.releaseGeometryManually(e)})),u=[]}})),l.sort(((e,t)=>t-e)),l.forEach((t=>{let i=e.children[t];e.remove(i)})),[...s,...a,...o].forEach((t=>{e.add(t)})),e.updateMatrix(),this.mergeInfo.removedObjects+=l.length,this.mergeInfo.mergedMeshes+=s.length,this.mergeInfo.mergedLines+=a.length,this.mergeInfo.mergedPoints+=o.length}static tryHandleMergeableObjects(e,t,i,r,n){let s=!1,a=Array.isArray(e),o=a?e.length:e.children.length;if(t===i||t>=o||i>=o)return s;let l=a?e[t]:e.children[t],h=a?e[i]:e.children[i];return this.areObjectsMergeable(l,h)&&this.areGeometriesMergeable(l.geometry,h.geometry)&&ss.materialsEquals(l.material,h.material)&&(r[i]||(r[i]={indexes:[i]},this.removeFromArray(n,i)),r[i].indexes.push(t),s=!0),s}static isFilteredByOtherFactors(e,t){let i=e;if(i.isMesh&&i.material.isShaderMaterial)return!0;let r=!1,n=e;for(;n&&n!==t;){let e=n.userData;if(e.relativeToCenter||e.spatialFilterHandle){r=!0;break}n=n.parent}return r}static deepMerge(e,t=void 0,i=!0,r=!0,n=!0){let s={added:[],removed:[]};if(e.length<=1)return s;let a=Date.now(),o={},l=[];for(let m=0;m<e.length;++m){let i=e[m];if(i.isInstancedMesh||!i.geometry||!(i.geometry instanceof ot)||this.isFilteredByOtherFactors(e[m],t))continue;let r=!1,n=Object.values(o);for(let t=n.length-1;t>=0;--t){let i=n[t].indexes[0];if(r=this.tryHandleMergeableObjects(e,m,i,o,l),r)break}for(let t=l.length-1;!r&&t>=0;--t){let i=l[t];if(r=this.tryHandleMergeableObjects(e,m,i,o,l),r)break}r||l.push(m)}if(Object.keys(o).length<=0)return s;re.debug(`[Merge] Built merged indexes for ${e.length} objects in ${(Date.now()-a)/1e3}s`),a=Date.now();let h=[],u=[],c=[],p=[];Object.values(o).forEach((i=>{let r=i.indexes;if(r.length<2)return;let s,a=e[r[0]],o=[],l=0,d=0,f=0,m=[];if(r.forEach((i=>{var r,s,h;let u=e[i],c=u.geometry.clone();if(a.material instanceof br&&c.deleteAttribute("lineDistance"),this.applyMatrix(c,u,t),c.userData.isLineSegments=!0===u.isLineSegments,o.push(c),n){let e,t=null==(s=null==(r=c.attributes)?void 0:r.position)?void 0:s.count,i=(null==(h=c.index)?void 0:h.count)||0;a.isLine&&(c.boundingSphere||c.computeBoundingSphere(),e=c.boundingSphere.clone()),m.push({batchId:l,positionStart:d,positionCount:t,indexStart:f,indexCount:i,boundingSphere:e}),d+=t,f+=i,l++}})),0!==o.length){if(a.isMesh){let e=bo(o);if(!e)return;e.userData={},s=new Je(e,a.material),h.push(s)}else if(a.isLine){let e=this.mergeLineGeometries(o,n,a.material instanceof kg||a.material instanceof Zt,m);if(!e)return;s=new Kr(e,a.material),u.push(s)}else if(a.isPoints){let e=bo(o);if(!e)return;e.userData={},s=new Bi(e,a.material),c.push(s)}s&&(n?s.userData.batches=m:(s.userData=a.userData,s.userData.batches=void 0),s.userData.layerName=a.userData.layerName,s.name=`[Merged] ${a.name}`,s.matrixAutoUpdate=!1,s.renderOrder=a.renderOrder,s.layers.mask=a.layers.mask,s.visible=a.visible,r.forEach((e=>p.push(e)))),o.forEach((e=>{kt.releaseGeometryManually(e)})),o=[]}})),re.debug(`[Merge] Ran deepMerge() in ${(Date.now()-a)/1e3}s`);let d=s.removed;p.forEach((t=>{let r=e[t];d.push(r),i&&r.removeFromParent()}));let f=s.added;return[...h,...u,...c].forEach((e=>{f.push(e),i&&t&&(t.add(e),e.updateWorldMatrix(!1,!1))})),this.mergeInfo.removedObjects+=p.length,this.mergeInfo.mergedMeshes+=h.length,this.mergeInfo.mergedLines+=u.length,this.mergeInfo.mergedPoints+=c.length,r&&t&&kr.removeEmptyObjects(t),s}static applyMatrix(e,t,i){let r=t;for(aA.identity();r&&r!==i&&(aA.premultiply(r.matrix),r.parent);)r=r.parent;return aA.equals(R1t)?e:e.applyMatrix4(aA)}static mergeLineGeometries(e,t,i,r){let n;if(i)n=oA.mergeBufferGeometriesWithLinesToLineSegments(e,t,r);else{if(n=bo(e),!n)return;n.userData={};let i=[],s=0;e.forEach(((e,n)=>{let a=e.attributes.position;if(!a)return;let o=e.index,l=!0===e.userData.isLineSegments,h=i.length;if(o)for(let t=0;t<o.count;t++){let e=o.array[t];l?i.push(s+e):t>0&&i.push(s+o.array[t-1],s+e)}else for(let t=0;t<a.count;t++)t>0&&(l?t%2==1&&i.push(s+t-1,s+t):i.push(s+t-1,s+t));s+=a.count,t&&r&&(r[n].indexStart=h,r[n].indexCount=i.length-h)})),n.setIndex(i)}return n}static mergeBufferGeometriesWithLinesToLineSegments(e,t,i){let r=new Set(Object.keys(e[0].attributes)),n={},s=new ot,a=[],o=0;for(let l=0;l<e.length;++l){let s=e[l],h=!0===s.userData.isLineSegments;a.push(h),s.index&&(re.debug(`[Merge] Geometry '${l}' contains index buffer, going to convert it to non-indexed.`),s=kt.convertGeometryWithIndexedToNonIndexed(s));let u=0;for(let e in s.attributes){if(!r.has(e))return void re.error(`[Merge] mergeBufferGeometries() failed with geometry at index ${l}. All geometries must have compatible attributes; make sure ${e} attribute exists among all geometries, or in none of them`);n[e]||(n[e]=[]),n[e].push(s.attributes[e]),u++}if(u!==r.size)return void re.error(`[Merge] mergeBufferGeometries() failed with geometry at index ${l}. Make sure all geometries have the same number of attributes.`);if(t&&i){let e=s.attributes.position;i[l].indexStart=0,i[l].indexCount=0;let t=h?e.count:2*e.count-2;i[l].positionStart=o,i[l].positionCount=t,o+=t}}for(let l in n){let e=oA.mergeBufferAttributesWithLinesToLineSegments(n[l],a);if(!e)return void re.error(`[Merge] mergeBufferGeometries() failed while trying to merge the ${l} attribute.`);s.setAttribute(l,e)}return s}static mergeBufferAttributesWithLinesToLineSegments(e,t){let i,r,n,s=0;for(let l=0;l<e.length;++l){let a=e[l];if(void 0===i&&(i=a.array.constructor),i!==a.array.constructor)return void re.error("[Merge] mergeBufferAttributes() failed. THREE.BufferAttribute.array must be of consistent array types across matching attributes.");if(void 0===r&&(r=a.itemSize),r!==a.itemSize)return void re.error("[Merge] mergeBufferAttributes() failed. THREE.BufferAttribute.itemSize must be consistent across matching attributes.");if(void 0===n&&(n=a.normalized),n!==a.normalized)return void re.error("[Merge] mergeBufferAttributes() failed. THREE.BufferAttribute.normalized must be consistent across matching attributes.");let o=t[l]?0:a.count-2;s+=(a.count+o)*r}let a=new i(s),o=0;for(let l=0;l<e.length;++l){let r=t[l],n=e[l],s=r?0:n.count-2,h=n.count+s,u=n.itemSize,c=new i(h*u),p=0;for(let e=0;e<n.count;e++){let t=e*u,i=0!==e&&e!==n.count-1&&!r;for(let e=0;e<u;e++)c[p+e]=n.array[t+e],i&&(c[p+u+e]=n.array[t+e]);p+=i?2*u:u}a.set(c,o),o+=h*u}return new Wt(a,r,n)}static removeFromArray(e,t){for(let i=e.length-1;i>=0;--i)if(e[i]===t)return void e.splice(i,1)}static removeObjectFromArray(e,t){for(let i=e.length-1;i>=0;--i)if(e[i]===t)return void e.splice(i,1)}static areGeometriesMergeable(e,t){if(!e||!t||"InstancedBufferGeometry"===e.type||"InstancedBufferGeometry"===t.type||!!e.index!=!!t.index)return!1;let i=Object.keys(e.attributes);if(i.length!==Object.keys(t.attributes).length)return!1;for(let r of i)if(!t.attributes[r])return!1;return!0}static areObjectsMergeable(e,t){if(e.layers.mask!==t.layers.mask||e.renderOrder!==t.renderOrder||e.visible!==t.visible||e.userData.layerName!==t.userData.layerName)return!1;if(e.type===t.type)return!0;let i=e,r=t;return i.isMesh&&r.isMesh||i.isLine&&r.isLine||i.isPoints&&r.isPoints}static isMergedMesh(e){return!(!e||!e.userData.batches)}static isFaceIndexInBatch(e,t,i){if(e.boundsTree){let r=e.index.getX(3*i);if(r>=t.positionStart&&r<t.positionStart+t.positionCount)return!0}else if(e.index){let e=t.indexStart/3,r=(t.indexStart+t.indexCount)/3-1;if(i>=e&&i<=r)return!0}else{let e=3*i;if(e>=t.positionStart&&e<t.positionStart+t.positionCount)return!0}return!1}static getBatchByFaceIndex(e,t){if(t<0)return void re.error(`[Merge]: Invalid faceIndex: ${t}`);let i=e&&e.geometry&&e.userData.batches;if(i)for(let r=0;r<i.length;++r){let n=i[r];if(this.isFaceIndexInBatch(e.geometry,n,t))return n}}static getBatchIdByFaceIndex(e,t){let i=this.getBatchByFaceIndex(e,t);return i?i.batchId:-1}static getBatchByBatchId(e,t){let i=e&&e.geometry&&e.userData.batches;if(i)for(let r=0;r<i.length;++r){let e=i[r];if(e.batchId===t)return e}}static cloneGeometryForBatch(e,t){var i;let r=e&&e.geometry;if(!r)return;let n=r.attributes.position,s=null==n?void 0:n.array,a=null==(i=r.index)?void 0:i.array;if(!s||!a)return void re.warn(`[Merge]: Unexpected position: ${s}, or index: ${a}!`);let o=new ot,l=t.positionStart,h=t.positionStart+t.positionCount,u=r.attributes;for(let m in u){let e=u[m],t=e.itemSize,i=e.array.slice(l*t,h*t);o.setAttribute(m,new Wt(i,t,e.normalized))}if(r.boundsTree&&(a=r.userData.originalIndex,!a))return void re.warn("[Merge] After building bvh, the original index data is not preserved !");let c=t.indexStart,p=t.indexStart+t.indexCount,d=[],f=0;for(let m=c;m<p&&m<a.length;++m)d[f++]=a[m]-t.positionStart;return o.setIndex(d),r.boundingBox&&o.computeBoundingBox(),r.boundingSphere&&o.computeBoundingSphere(),o}},Zi=oA;Zi.mergeInfo={removedObjects:0,mergedMeshes:0,mergedLines:0,mergedPoints:0,mergedUnknownTypeObjects:0,elapsedTime:0};var yfe=ps(pfe(),1),ffe={triangulate:function(e,t,i=2){let r,n,s,a,o,l,h,u=t&&t.length,c=u?t[0]*i:e.length,p=mfe(e,0,c,i,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=lbt(e,t,p,i)),e.length>80*i){r=s=e[0],n=a=e[1];for(let t=i;t<c;t+=i)o=e[t],l=e[t+1],o<r&&(r=o),l<n&&(n=l),o>s&&(s=o),l>a&&(a=l);h=Math.max(s-r,a-n),h=0!==h?32767/h:0}return aI(p,d,i,r,n,h,0),d}};function mfe(e,t,i,r,n){let s,a;if(n===Ebt(e,t,i,r)>0)for(s=t;s<i;s+=r)a=dfe(s,e[s],e[s+1],a);else for(s=i-r;s>=t;s-=r)a=dfe(s,e[s],e[s+1],a);return a&&gA(a,a.next)&&(lI(a),a=a.next),a}function Kg(e,t){if(!e)return e;t||(t=e);let i,r=e;do{if(i=!1,r.steiner||!gA(r,r.next)&&0!==kn(r.prev,r,r.next))r=r.next;else{if(lI(r),r=t=r.prev,r===r.next)break;i=!0}}while(i||r!==t);return t}function aI(e,t,i,r,n,s,a){if(!e)return;!a&&s&&dbt(e,r,n,s);let o,l,h=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?sbt(e,r,n,s):nbt(e))t.push(o.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),lI(e),e=l.next,h=l.next;else if((e=l)===h){a?1===a?aI(e=abt(Kg(e),t,i),t,i,r,n,s,2):2===a&&obt(e,t,i,r,n,s):aI(Kg(e),t,i,r,n,s,1);break}}function nbt(e){let t=e.prev,i=e,r=e.next;if(kn(t,i,r)>=0)return!1;let n=t.x,s=i.x,a=r.x,o=t.y,l=i.y,h=r.y,u=n<s?n<a?n:a:s<a?s:a,c=o<l?o<h?o:h:l<h?l:h,p=n>s?n>a?n:a:s>a?s:a,d=o>l?o>h?o:h:l>h?l:h,f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=c&&f.y<=d&&bE(n,o,s,l,a,h,f.x,f.y)&&kn(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function sbt(e,t,i,r){let n=e.prev,s=e,a=e.next;if(kn(n,s,a)>=0)return!1;let o=n.x,l=s.x,h=a.x,u=n.y,c=s.y,p=a.y,d=o<l?o<h?o:h:l<h?l:h,f=u<c?u<p?u:p:c<p?c:p,m=o>l?o>h?o:h:l>h?l:h,g=u>c?u>p?u:p:c>p?c:p,y=Rk(d,f,t,i,r),v=Rk(m,g,t,i,r),T=e.prevZ,x=e.nextZ;for(;T&&T.z>=y&&x&&x.z<=v;){if(T.x>=d&&T.x<=m&&T.y>=f&&T.y<=g&&T!==n&&T!==a&&bE(o,u,l,c,h,p,T.x,T.y)&&kn(T.prev,T,T.next)>=0||(T=T.prevZ,x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&bE(o,u,l,c,h,p,x.x,x.y)&&kn(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;T&&T.z>=y;){if(T.x>=d&&T.x<=m&&T.y>=f&&T.y<=g&&T!==n&&T!==a&&bE(o,u,l,c,h,p,T.x,T.y)&&kn(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;x&&x.z<=v;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&bE(o,u,l,c,h,p,x.x,x.y)&&kn(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function abt(e,t,i){let r=e;do{let n=r.prev,s=r.next.next;!gA(n,s)&&gfe(n,r,r.next,s)&&oI(n,s)&&oI(s,n)&&(t.push(n.i/i|0),t.push(r.i/i|0),t.push(s.i/i|0),lI(r),lI(r.next),r=e=s),r=r.next}while(r!==e);return Kg(r)}function obt(e,t,i,r,n,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&gbt(a,e)){let o=vfe(a,e);return a=Kg(a,a.next),o=Kg(o,o.next),aI(a,t,i,r,n,s,0),void aI(o,t,i,r,n,s,0)}e=e.next}a=a.next}while(a!==e)}function lbt(e,t,i,r){let n,s,a,o,l,h=[];for(n=0,s=t.length;n<s;n++)a=t[n]*r,o=n<s-1?t[n+1]*r:e.length,l=mfe(e,a,o,r,!1),l===l.next&&(l.steiner=!0),h.push(mbt(l));for(h.sort(cbt),n=0;n<h.length;n++)i=ubt(h[n],i);return i}function cbt(e,t){return e.x-t.x}function ubt(e,t){let i=hbt(e,t);if(!i)return t;let r=vfe(i,e);return Kg(r,r.next),Kg(i,i.next)}function hbt(e,t){let i,r=t,n=-1/0,s=e.x,a=e.y;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){let e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>n&&(n=e,i=r.x<r.next.x?r:r.next,e===s))return i}r=r.next}while(r!==t);if(!i)return null;let o,l=i,h=i.x,u=i.y,c=1/0;r=i;do{s>=r.x&&r.x>=h&&s!==r.x&&bE(a<u?s:n,a,h,u,a<u?n:s,a,r.x,r.y)&&(o=Math.abs(a-r.y)/(s-r.x),oI(r,e)&&(o<c||o===c&&(r.x>i.x||r.x===i.x&&pbt(i,r)))&&(i=r,c=o)),r=r.next}while(r!==l);return i}function pbt(e,t){return kn(e.prev,e,t.prev)<0&&kn(t.next,e,e.next)<0}function dbt(e,t,i,r){let n=e;do{0===n.z&&(n.z=Rk(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,fbt(n)}function fbt(e){let t,i,r,n,s,a,o,l,h=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,r=i,o=0,t=0;t<h&&(o++,r=r.nextZ,r);t++);for(l=h;o>0||l>0&&r;)0!==o&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,o--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,h*=2}while(a>1);return e}function Rk(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function mbt(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function bE(e,t,i,r,n,s,a,o){return(n-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(i-a)*(t-o)&&(i-a)*(s-o)>=(n-a)*(r-o)}function gbt(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!vbt(e,t)&&(oI(e,t)&&oI(t,e)&&ybt(e,t)&&(kn(e.prev,e,t.prev)||kn(e,t.prev,t))||gA(e,t)&&kn(e.prev,e,e.next)>0&&kn(t.prev,t,t.next)>0)}function kn(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function gA(e,t){return e.x===t.x&&e.y===t.y}function gfe(e,t,i,r){let n=mA(kn(e,t,i)),s=mA(kn(e,t,r)),a=mA(kn(i,r,e)),o=mA(kn(i,r,t));return!!(n!==s&&a!==o||0===n&&fA(e,i,t)||0===s&&fA(e,r,t)||0===a&&fA(i,e,r)||0===o&&fA(i,t,r))}function fA(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function mA(e){return e>0?1:e<0?-1:0}function vbt(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&gfe(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function oI(e,t){return kn(e.prev,e,e.next)<0?kn(e,t,e.next)>=0&&kn(e,e.prev,t)>=0:kn(e,t,e.prev)<0||kn(e,e.next,t)<0}function ybt(e,t){let i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}function vfe(e,t){let i=new Mk(e.i,e.x,e.y),r=new Mk(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function dfe(e,t,i,r){let n=new Mk(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function lI(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 Mk(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ebt(e,t,i,r){let n=0;for(let s=t,a=i-r;s<i;s+=r)n+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return n}var Tbt=.01,Ff=class{static getFaces(e){let t=e.map((e=>e.toArray())).reduce(((e,t)=>(e.push(...t),e)),[]),i=[];return ffe.triangulate(t,[],3).forEach((e=>i.push(e))),i}static arePointsCoplanar(e){if(e.length<4)return!0;let t=e[1].clone().sub(e[0]),i=e[2].clone().sub(e[0]).cross(t).normalize();for(let r=3;r<e.length;r++)if(e[r].clone().sub(e[0]).projectOnVector(i).length()>Tbt)return!1;return!0}static isSelfIntersecting(e){let t=e.map((e=>e.toArray().slice(0,-1)));return(0,yfe.default)(t).length>0}},Dk=class{constructor(e,t,i=void 0,r=Dk.DEFAULT_SCALE){this.isExplodeUp=!1,this.scene=e,this.objectId=t,t||console.log(`[EXP] Invalid objectId: ${t}`),this.scale=r,r<=0&&console.log(`[EXP] Invalid scale: ${r}`),i?this.position=i:(this.position=new D,this.getObjectCenter(this.position))}explode(){if(!this.objectId||!this.position||!this.scale)return void console.log(`[EXP] Invalid objectId: ${this.objectId}, or position: ${this.position}, or this.power: ${this.scale}`);let e=this.scene.getObjectById(this.objectId);e&&e.children?(console.log(`[EXP] Exploding ${e.name} at: ${this.position.x}, ${this.position.y}, ${this.position.z}`),this.explodeObject(e)):console.log("[EXP] No children to explode!")}explodeObject(e){e.geometry?this.explodeLeafObject(e):e.children.length>0?e.children.forEach((e=>this.explodeObject(e))):this.explodeLeafObject(e)}explodeLeafObject(e){if(e.geometry){if(e.userData.originalPosition=e.position.clone(),e instanceof sn){let t=new Be,i=new D,r=new Br,n=new D;for(let s=0;s<e.count;++s){if(e.getMatrixAt(s,t),t.decompose(i,r,n),this.isExplodeUp){let e=(i.z-this.position.z)*this.scale;i.setZ(i.z+e)}else{let e=i.clone().sub(this.position);i.addScaledVector(e,this.scale)}t.setPosition(i),e.setMatrixAt(s,t)}e.matrixWorldNeedsUpdate=!0,e.instanceMatrix.needsUpdate=!0}else{let t=e.position.clone();if(e instanceof Je&&e.geometry&&e.geometry.boundingBox?e.geometry.boundingBox.getCenter(t):console.warn(`[EXP] Failed to get center for ${e.type} '${e.name||e.id}', will use its position as center`),this.isExplodeUp){let i=(t.z-this.position.z)*this.scale;e.position.setZ(t.z+i)}else{let i=t.sub(this.position);e.position.addScaledVector(i,this.scale)}}e.updateMatrix()}}unexplode(){let e=this.scene.getObjectById(this.objectId);e&&e.children?(console.log(`[EXP] Unexploding ${e.name} at: ${this.position.x}, ${this.position.y}, ${this.position.z}`),this.unexplodeObject(e)):console.log("[EXP] No children to explode!")}unexplodeObject(e){e.geometry?this.unexplodeLeafObject(e):e.children.length>0?e.children.forEach((e=>this.unexplodeObject(e))):this.unexplodeLeafObject(e)}unexplodeLeafObject(e){let t=e.userData.originalPosition;t&&(e.position.set(t.x,t.y,t.z),e.updateMatrix(),delete e.userData.originalPosition)}setOnlyExplodeUp(e){this.isExplodeUp=e}getObjectCenter(e){let t=new Rt;if(!this.objectId)return void console.log(`[EXP] Invalid objectId: ${this.objectId}`);let i=this.scene.getObjectById(this.objectId);i&&i.children?(i.traverse((e=>{t.expandByObject(e)})),t.getCenter(e)):console.log("[EXP] No children to explode!")}},cI=Dk;cI.DEFAULT_SCALE=1;var Tn=class{static getVisibleObjectBoundingBox(e){let t=new Rt;return e.traverseVisible((e=>{e instanceof Je&&!1!==e.userData.selectable&&t.expandByObject(e)})),t}static getObjectsBoundingBox(e,t,i){let r=new Rt;return t.forEach((t=>{let n=e.getObjectById(t);if(n){let e=Tn.getBoundingBox(n,i);e.isEmpty()||r.union(e)}})),r}static getBoundingBox(e,t=!0){let i=new Rt;if(e instanceof sn)return Tn.getInstancedMeshBoundingBox(e);if(0===e.children.length)return i.expandByObject(e),i;let r=e.children.length,n=1;r>20&&(n=3),r>100&&(n=5),r>200&&(n=10),r>1e3&&(n=100),e.updateMatrixWorld(!1);for(let s=0;s<r;++s){let r=e.children[s];if(!t||s%n==0)if(r.updateMatrix(),r instanceof sn){let e=Tn.getInstancedMeshBoundingBox(r);e.isEmpty()||i.union(e)}else if(Tt.isMatrixValid(r.matrixWorld)){let e=Tn.getBoundingBox(r);e.isEmpty()||i.union(e)}else console.warn(`[SceneUtils] Found object(${r.type}) with invalid matrix: ${r.matrixWorld.elements}`)}return e.geometry&&i.expandByObject(e),i}static getInstancedMeshBoundingBox(e){let t=new Rt,i=new Be;for(let r=0;r<e.count;++r){e.getMatrixAt(r,i);let n=e.geometry.clone();if(n.boundingBox){let e=n.boundingBox.applyMatrix4(i);!e.isEmpty()&&Tt.isBoxValid(e)&&t.union(e)}}return t.applyMatrix4(e.matrixWorld),t}static explodeObject(e,t,i,r=!1){i[e.id]&&i[e.id].unexplode();let n=new D;Tn.getObjectCenter(e,n);let s=new cI(t,e.id,n);s.setOnlyExplodeUp(r),s.explode(),i[e.id]=s}static explodeObjects(e,t,i,r=!1){return e.traverse((n=>{i.find((e=>e===n.id))&&(n.children&&1===n.children.length?Tn.explodeObject(n.children[0],e,t,r):Tn.explodeObject(n,e,t,r))})),t}static unexplodeObjects(e,t){e.traverse((e=>{let i=t[e.id];i&&(i.unexplode(),delete t[e.id])}))}static getObjectCenter(e,t){let i=Tn.getBoundingBox(e);i.getCenter(t),t.y=i.min.y}},lh=class{static setMaterialSection(e,t,i=!1,r=!1){let n=i&&e.clippingPlanes?e.clippingPlanes:[];n.push(...t),e.clippingPlanes=n,e.clipIntersection=r}static removeSection(e){e&&e.traverse((e=>{let t=e.material;Array.isArray(t)?t.forEach((e=>{e.clippingPlanes=void 0})):t&&(t.clippingPlanes=void 0)}))}static addSection(e,t,i=!1,r=!1){e&&e.traverse((e=>{let n=e.material;Array.isArray(n)?n.forEach((e=>{lh.setMaterialSection(e,t,i,r)})):n&&lh.setMaterialSection(n,t,i,r)}))}static generateSectionPlanesByBox(e){let t=e.min,i=e.max;return[new Ri(new D(0,-1,0),i.y),new Ri(new D(0,1,0),-t.y),new Ri(new D(1,0,0),-t.x),new Ri(new D(-1,0,0),i.x)]}static generateSectionPlanesByPoints(e,t=!0){let i=e.length;if(i<2)return;let r=[];for(let n=0;n<i-1;n++){let s=e[n],a=e[(n+1)%i],o=new Ri;o.setFromCoplanarPoints(new D(s.x,s.y,-1),new D(s.x,s.y,0),new D(a.x,a.y,0)),t||o.negate(),r.push(o)}return r}},Ck=new D,Efe=new D,vA=class{modify(e,t){let i=(e=e.clone()).attributes;for(let c in i)"position"!==c&&e.deleteAttribute(c);let r=[],n=[],s=(e=qde(e)).getAttribute("position");for(let c=0;c<s.count;c++){let e=(new D).fromBufferAttribute(s,c),t=new Ak(e);r.push(t)}let a=e.getIndex();if(null!==a)for(let c=0;c<a.count;c+=3){let e=a.getX(c),t=a.getX(c+1),i=a.getX(c+2),s=new yA(r[e],r[t],r[i],e,t,i);n.push(s)}else for(let c=0;c<s.count;c+=3){let e=c,t=c+1,i=c+2,s=new yA(r[e],r[t],r[i],e,t,i);n.push(s)}for(let c=0,p=r.length;c<p;c++)bfe(r[c]);let o,l=t;for(;l--;){if(o=Sbt(r),!o){console.log("THREE.SimplifyModifier: No next vertex");break}_bt(r,n,o,o.collapseNeighbor)}let h=new ot,u=[];a=[];for(let c=0;c<r.length;c++){let e=r[c].position;u.push(e.x,e.y,e.z),r[c].id=c}for(let c=0;c<n.length;c++){let e=n[c];a.push(e.v1.id,e.v2.id,e.v3.id)}return h.setAttribute("position",new dt(u,3)),h.setIndex(a),h}};function bbt(e,t){-1===e.indexOf(t)&&e.push(t)}function Jg(e,t){let i=e.indexOf(t);i>-1&&e.splice(i,1)}function xbt(e,t){let i=t.position.distanceTo(e.position),r=0,n=[];for(let s=0,a=e.faces.length;s<a;s++){let i=e.faces[s];i.hasVertex(t)&&n.push(i)}for(let s=0,a=e.faces.length;s<a;s++){let t=1,i=e.faces[s];for(let e=0;e<n.length;e++){let r=n[e],s=i.normal.dot(r.normal);t=Math.min(t,(1.001-s)/2)}r=Math.max(r,t)}return n.length<2&&(r=1),i*r+0}function bfe(e){if(0===e.neighbors.length)return e.collapseNeighbor=null,void(e.collapseCost=-.01);e.collapseCost=1e5,e.collapseNeighbor=null;for(let t=0;t<e.neighbors.length;t++){let i=xbt(e,e.neighbors[t]);e.collapseNeighbor||(e.collapseNeighbor=e.neighbors[t],e.collapseCost=i,e.minCost=i,e.totalCost=0,e.costCount=0),e.costCount++,e.totalCost+=i,i<e.minCost&&(e.collapseNeighbor=e.neighbors[t],e.minCost=i)}e.collapseCost=e.totalCost/e.costCount}function Tfe(e,t){for(console.assert(0===e.faces.length);e.neighbors.length;)Jg(e.neighbors.pop().neighbors,e);Jg(t,e)}function Ibt(e,t){Jg(t,e),e.v1&&Jg(e.v1.faces,e),e.v2&&Jg(e.v2.faces,e),e.v3&&Jg(e.v3.faces,e);let i=[e.v1,e.v2,e.v3];for(let r=0;r<3;r++){let e=i[r],t=i[(r+1)%3];!e||!t||(e.removeIfNonNeighbor(t),t.removeIfNonNeighbor(e))}}function _bt(e,t,i,r){if(!r)return void Tfe(i,e);let n=[];for(let s=0;s<i.neighbors.length;s++)n.push(i.neighbors[s]);for(let s=i.faces.length-1;s>=0;s--)i.faces[s]&&i.faces[s].hasVertex(r)&&Ibt(i.faces[s],t);for(let s=i.faces.length-1;s>=0;s--)i.faces[s].replaceVertex(i,r);Tfe(i,e);for(let s=0;s<n.length;s++)bfe(n[s])}function Sbt(e){let t=e[0];for(let i=0;i<e.length;i++)e[i].collapseCost<t.collapseCost&&(t=e[i]);return t}var yA=class{constructor(e,t,i,r,n,s){this.a=r,this.b=n,this.c=s,this.v1=e,this.v2=t,this.v3=i,this.normal=new D,this.computeNormal(),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(i),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(i),i.faces.push(this),i.addUniqueNeighbor(e),i.addUniqueNeighbor(t)}computeNormal(){let e=this.v1.position,t=this.v2.position,i=this.v3.position;Ck.subVectors(i,t),Efe.subVectors(e,t),Ck.cross(Efe).normalize(),this.normal.copy(Ck)}hasVertex(e){return e===this.v1||e===this.v2||e===this.v3}replaceVertex(e,t){e===this.v1?this.v1=t:e===this.v2?this.v2=t:e===this.v3&&(this.v3=t),Jg(e.faces,this),t.faces.push(this),e.removeIfNonNeighbor(this.v1),this.v1.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v2),this.v2.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v3),this.v3.removeIfNonNeighbor(e),this.v1.addUniqueNeighbor(this.v2),this.v1.addUniqueNeighbor(this.v3),this.v2.addUniqueNeighbor(this.v1),this.v2.addUniqueNeighbor(this.v3),this.v3.addUniqueNeighbor(this.v1),this.v3.addUniqueNeighbor(this.v2),this.computeNormal()}},Ak=class{constructor(e){this.position=e,this.id=-1,this.faces=[],this.neighbors=[],this.collapseCost=0,this.collapseNeighbor=null}addUniqueNeighbor(e){bbt(this.neighbors,e)}removeIfNonNeighbor(e){let t=this.neighbors,i=this.faces,r=t.indexOf(e);if(-1!==r){for(let t=0;t<i.length;t++)if(i[t].hasVertex(e))return;t.splice(r,1)}}},xfe=class{static simplifyGeometry(e,t){let i=this.getNumberOfVerticesToRemove(e,t);return i>0?(new vA).modify(e,i):e}static getNumberOfVerticesToRemove(e,t){let i=0;e instanceof ot&&e.index&&(i=e.attributes.position.count);let r=Math.floor(i*t);return i<20?0:r}},Qg=class{static createSkyOfGradientRamp(e=4e3,t=32,i=15,r=new D,n=new D(0,.7,.5)){let s=this.COLOR_TEMPLATES.default,a={topColor:{value:new Ve(s[0])},skylineColor:{value:new Ve(s[1])},bottomColor:{value:new Ve(s[2])},offset:{value:400},exponent:{value:.9},skyCenter:{value:r||new D},sunDirection:{value:n.normalize()}},o=new po(e,t,i),l=new Zt({uniforms:a,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader,side:$n}),h=new Je(o,l);return h.matrixAutoUpdate=!1,h.name=this.NAME,h.userData.selectable=!1,h}static createSkyOfGradientRampByBoundingBox(e){let t=2*(e.max.x-e.min.x+(e.max.y-e.min.y)+(e.max.z-e.min.z));t<Qg.MIN_SKY_RADIUS?t=Qg.MIN_SKY_RADIUS:t>Qg.MAX_SKY_RADIUS&&(t=Qg.MAX_SKY_RADIUS);let i=new D;e.getCenter(i);let r=Qg.createSkyOfGradientRamp(t,void 0,void 0,i);return r.position.set(i.x,0,i.z),r}static createSkyFromTextures(e){return ct(this,null,(function*(){let t=new Mx;return new Promise((i=>{t.load(e,(e=>i(e)))}))}))}},il=Qg;il.NAME="SKYBOX",il.MIN_SKY_RADIUS=4e3,il.MAX_SKY_RADIUS=2e4,il.vertexShader="\n varying vec3 vWorldPosition;\n void main() {\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",il.fragmentShader="\n uniform vec3 topColor;\n uniform vec3 skylineColor;\n uniform vec3 bottomColor;\n uniform float offset;\n uniform float exponent;\n uniform vec3 skyCenter;\n uniform vec3 sunDirection;\n varying vec3 vWorldPosition;\n // Used to find the position to draw the sun. Sun size is bigger when this value is smaller\n const float sunDirectionDotThreshold = 0.98;\n\n void main() {\n vec3 position = vec3(vWorldPosition.x - skyCenter.x, vWorldPosition.y - skyCenter.y, vWorldPosition.z - skyCenter.z);\n vec3 normalizedPosition = normalize( position + offset );\n float h = normalizedPosition.y;\n vec3 color;\n if (h > 0.0) {\n color = mix( skylineColor, topColor, pow( h, exponent ) );\n\n // draw the sun\n float dotResult = dot(sunDirection, normalizedPosition);\n if (dotResult > sunDirectionDotThreshold) {\n const float sunSize = 1.0 - sunDirectionDotThreshold; // maximum sun size\n const vec3 sunColor = vec3(1.0, 1.0, 1.0);\n color = mix(color, sunColor, pow((dotResult + sunSize - 1.0) / sunSize, 3.0));\n }\n } else {\n color = mix( skylineColor, bottomColor, pow( -h, exponent ) );\n }\n gl_FragColor = vec4(color , 1.0);\n }",il.COLOR_TEMPLATES={default:[8828661,16777215,10066329],blueSky:[11189247,16777215,6974058],boardwalk:[14413823,16777215,15459804]};var EA=class extends qt{constructor(e){super(),this.isSVGObject=!0,this.node=e}},_Kt=10,_fe=(e=>(e.Dot="Dot",e.Square="Square",e.Triangle="Triangle",e.CircleWithCross="CircleWithCross",e.Cross="Cross",e.Perpendicular="Perpendicular",e))(_fe||{}),Ife=class{static createSVGObject(e){return new EA(e)}},TA=class extends zg{constructor(e){super(e),this.type=$o}parse(e){let t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},i=function(e,t,i){t=t||1024;let r=e.pos,n=-1,s=0,a="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(n=o.indexOf("\n"))&&s<t&&r<e.byteLength;)a+=o,s+=o.length,r+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<n&&(!1!==i&&(e.pos+=s+n+1),a+o.slice(0,n))},r=function(e,t,i,r){let n=e[t+3],s=Math.pow(2,n-128)/255;i[r+0]=e[t+0]*s,i[r+1]=e[t+1]*s,i[r+2]=e[t+2]*s,i[r+3]=1},n=function(e,t,i,r){let n=e[t+3],s=Math.pow(2,n-128)/255;i[r+0]=tE.toHalfFloat(Math.min(e[t+0]*s,65504)),i[r+1]=tE.toHalfFloat(Math.min(e[t+1]*s,65504)),i[r+2]=tE.toHalfFloat(Math.min(e[t+2]*s,65504)),i[r+3]=tE.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;let a=function(e){let r,n,s=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,l=/^\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};if(e.pos>=e.byteLength||!(r=i(e)))return t(1,"no header found");if(!(n=r.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(h.valid|=1,h.programtype=n[1],h.string+=r+"\n";r=i(e),!1!==r;)if(h.string+=r+"\n","#"!==r.charAt(0)){if((n=r.match(s))&&(h.gamma=parseFloat(n[1])),(n=r.match(a))&&(h.exposure=parseFloat(n[1])),(n=r.match(o))&&(h.valid|=2,h.format=n[1]),(n=r.match(l))&&(h.valid|=4,h.height=parseInt(n[1],10),h.width=parseInt(n[2],10)),2&h.valid&&4&h.valid)break}else h.comments+=r+"\n";return 2&h.valid?4&h.valid?h:t(3,"missing image size specifier"):t(3,"missing format specifier")}(s);if(-1!==a){let e=a.width,i=a.height,o=function(e,i,r){let n=i;if(n<8||n>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(n!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");let s=new Uint8Array(4*i*r);if(!s.length)return t(4,"unable to allocate buffer space");let a=0,o=0,l=4*n,h=new Uint8Array(4),u=new Uint8Array(l),c=r;for(;c>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(h[0]=e[o++],h[1]=e[o++],h[2]=e[o++],h[3]=e[o++],2!=h[0]||2!=h[1]||(h[2]<<8|h[3])!=n)return t(3,"bad rgbe scanline format");let i,r=0;for(;r<l&&o<e.byteLength;){i=e[o++];let n=i>128;if(n&&(i-=128),0===i||r+i>l)return t(3,"bad scanline data");if(n){let t=e[o++];for(let e=0;e<i;e++)u[r++]=t}else u.set(e.subarray(o,o+i),r),r+=i,o+=i}let p=n;for(let e=0;e<p;e++){let t=0;s[a]=u[e+t],t+=n,s[a+1]=u[e+t],t+=n,s[a+2]=u[e+t],t+=n,s[a+3]=u[e+t],a+=4}c--}return s}(s.subarray(s.pos),e,i);if(-1!==o){let t,s,l;switch(this.type){case La:l=o.length/4;let e=new Float32Array(4*l);for(let t=0;t<l;t++)r(o,4*t,e,4*t);t=e,s=La;break;case $o:l=o.length/4;let i=new Uint16Array(4*l);for(let t=0;t<l;t++)n(o,4*t,i,4*t);t=i,s=$o;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:e,height:i,data:t,header:a.string,gamma:a.gamma,exposure:a.exposure,type:s}}}return null}setDataType(e){return this.type=e,this}load(e,t,i,r){return super.load(e,(function(e,i){switch(e.type){case La:case $o:e.encoding=Nl,e.minFilter=hi,e.magFilter=hi,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,i)}),i,r)}},qc=class{static createEnvTexture(e,t){return ct(this,null,(function*(){let i=new TA;return new Promise((r=>{i.load(t,(t=>{if(e){let i=e.fromEquirectangular(t).texture;e.dispose(),r(i)}}))}))}))}static createEnvTextureFromDataArray(e){return ct(this,arguments,(function*(e,t=this.HDR_CITY_STREET_64x32,i=64,r=32){if(e){let n=new Pl(t,i,r);n.flipY=!0,n.magFilter=hi,n.minFilter=hi,n.type=$o,n.version=1;let s=e.fromEquirectangular(n).texture;return e.dispose(),Promise.resolve(s)}return Promise.reject("Invalid pmremGenerator!")}))}};function wbt(){if(xr.isBrowser){let e=document.createElement("div");return e.setAttribute("style","height: 1in; visibility: hidden; position: absolute; margin: 0; padding: 0;"),document.body.appendChild(e),.0254/e.clientHeight}return.0254/96}qc.HDR_CITY_STREET_64x32=Uint16Array.from([11910,12340,12797,15360,11926,12348,12806,15360,11958,12364,12814,15360,11974,12380,12830,15360,11958,12364,12822,15360,11926,12348,12797,15360,11878,12324,12773,15360,11830,12308,12749,15360,11798,12292,12733,15360,11782,12279,12725,15360,11765,12263,12709,15360,11749,12247,12701,15360,11733,12231,12701,15360,11701,12215,12693,15360,11685,12199,12685,15360,11685,12199,12685,15360,11701,12215,12693,15360,11717,12231,12701,15360,11733,12247,12709,15360,11749,12263,12717,15360,11749,12279,12717,15360,11765,12279,12725,15360,11765,12279,12725,15360,11765,12292,12725,15360,11798,12300,12733,15360,11830,12316,12749,15360,11846,12324,12757,15360,11894,12340,12781,15360,11926,12356,12797,15360,11942,12356,12797,15360,11926,12348,12789,15360,11926,12348,12789,15360,11942,12356,12797,15360,11942,12356,12797,15360,11942,12348,12806,15360,11942,12356,12806,15360,11942,12356,12814,15360,11958,12372,12830,15360,11974,12372,12830,15360,11974,12372,12838,15360,11990,12388,12854,15360,12055,12420,12886,15360,12119,12452,12918,15360,12167,12476,12950,15360,12231,12500,12982,15360,12263,12516,12998,15360,12231,12500,12974,15360,12199,12484,12958,15360,12199,12484,12958,15360,12199,12492,12966,15360,12247,12508,12982,15360,12247,12508,12990,15360,12231,12500,12982,15360,12199,12484,12966,15360,12167,12468,12942,15360,12119,12444,12918,15360,12087,12436,12902,15360,12055,12420,12886,15360,12055,12412,12878,15360,12039,12412,12878,15360,12022,12396,12862,15360,12006,12388,12846,15360,11958,12364,12830,15360,11910,12340,12806,15360,12119,12508,13103,15360,12087,12484,13071,15360,12055,12468,13046,15360,12006,12436,13006,15360,11926,12396,12958,15360,11878,12364,12926,15360,11846,12348,12894,15360,11782,12308,12854,15360,11749,12292,12830,15360,11717,12263,12814,15360,11685,12247,12806,15360,11669,12215,12789,15360,11685,12231,12789,15360,11701,12247,12797,15360,11701,12247,12806,15360,11717,12263,12814,15360,11749,12292,12822,15360,11782,12308,12838,15360,11798,12316,12846,15360,11814,12332,12862,15360,11846,12340,12870,15360,11862,12348,12878,15360,11846,12340,12870,15360,11846,12340,12862,15360,11878,12356,12886,15360,11910,12372,12910,15360,11942,12396,12934,15360,11958,12412,12958,15360,12039,12452,12998,15360,12071,12468,13022,15360,12039,12452,12998,15360,12039,12452,12998,15360,12006,12444,13006,15360,11974,12436,12998,15360,11942,12412,12982,15360,11926,12396,12974,15360,11926,12404,12974,15360,11958,12420,12998,15360,12006,12452,13038,15360,12055,12476,13071,15360,12039,12476,13079,15360,12087,12508,13127,15360,12247,12597,13231,15360,12388,12693,13332,15360,12420,12741,13364,15360,12436,12757,13372,15360,12468,12773,13380,15360,12500,12806,13388,15360,12516,12822,13404,15360,12629,12934,13452,15360,12741,13046,13508,15360,12806,13095,13532,15360,12757,13046,13516,15360,12645,12950,13460,15360,12565,12870,13428,15360,12532,12838,13412,15360,12549,12854,13412,15360,12516,12838,13396,15360,12452,12757,13356,15360,12420,12725,13340,15360,12404,12709,13332,15360,12372,12677,13316,15360,12279,12589,13207,15360,12135,12516,13119,15360,12388,12709,13348,15360,12247,12581,13223,15360,12055,12476,13087,15360,11910,12388,12982,15360,11733,12308,12886,15360,11669,12247,12846,15360,11621,12199,12814,15360,11541,12103,12765,15360,11492,12055,12733,15360,11508,12055,12733,15360,11476,12022,12717,15360,11525,12055,12725,15360,11589,12135,12757,15360,11669,12199,12765,15360,11765,12292,12814,15360,11862,12348,12886,15360,11910,12372,12910,15360,12006,12420,12966,15360,12071,12452,12998,15360,12119,12476,13022,15360,12167,12492,13046,15360,12183,12500,13063,15360,12199,12524,13079,15360,12308,12589,13151,15360,12300,12581,13151,15360,12167,12516,13087,15360,12087,12468,13030,15360,12022,12444,13014,15360,11990,12420,12990,15360,11974,12420,12990,15360,11974,12420,12990,15360,11990,12436,13014,15360,11990,12444,13030,15360,12103,12500,13103,15360,12087,12508,13111,15360,12039,12484,13103,15360,12039,12476,13103,15360,11942,12436,13054,15360,11974,12452,13087,15360,12039,12492,13135,15360,12103,12532,13199,15360,12183,12581,13263,15360,12308,12661,13340,15360,12484,12822,13436,15360,12613,12918,13484,15360,12725,13046,13540,15360,13046,13332,13677,15360,13143,13380,13717,15360,13223,13420,13741,15360,13396,13540,13862,15360,13436,13589,13902,15360,13484,13629,13942,15360,13468,13621,13934,15360,13412,13564,13878,15360,13372,13524,13846,15360,13287,13452,13781,15360,13223,13428,13749,15360,13340,13492,13805,15360,13239,13428,13749,15360,13095,13364,13685,15360,12918,13223,13597,15360,12822,13111,13556,15360,12613,12934,13468,15360,12532,12854,13428,15360,12565,12870,13444,15360,12468,12789,13396,15360,12372,12693,13340,15360,12087,12492,13111,15360,11846,12364,12958,15360,11717,12300,12878,15360,11557,12135,12781,15360,11476,12055,12741,15360,11460,12022,12725,15360,11476,12022,12725,15360,11476,12022,12709,15360,11476,11958,12605,15360,11364,11733,12332,15360,11111,11412,11661,15360,11223,11476,11773,15360,11388,11669,12095,15360,11765,12119,12492,15360,12388,12613,13079,15360,12661,12902,13356,15360,12998,13255,13564,15360,13372,13508,13797,15360,13412,13548,13846,15360,13287,13436,13725,15360,13271,13428,13709,15360,13287,13428,13717,15360,13014,13287,13597,15360,12709,12998,13460,15360,12452,12741,13332,15360,12364,12653,13271,15360,12404,12693,13316,15360,12420,12709,13316,15360,12420,12709,13332,15360,12263,12589,13231,15360,12332,12661,13312,15360,12300,12629,13295,15360,12263,12605,13287,15360,12231,12597,13279,15360,12247,12613,13303,15360,12231,12597,13295,15360,12231,12605,13312,15360,12199,12597,13324,15360,12231,12613,13340,15360,12516,12870,13468,15360,12725,13063,13564,15360,12741,13079,13573,15360,12854,13175,13613,15360,12902,13223,13629,15360,13046,13348,13693,15360,13356,13516,13846,15360,13605,13765,14078,15360,13717,13870,14191,15360,13765,13918,14255,15360,13765,13910,14247,15360,13701,13854,14191,15360,13573,13733,14070,15360,13508,13677,14006,15360,13380,13548,13886,15360,13111,13380,13741,15360,13063,13348,13709,15360,12886,13207,13629,15360,12725,13046,13548,15360,12645,12966,13508,15360,12677,12982,13508,15360,12629,12950,13492,15360,12452,12789,13412,15360,12324,12661,13332,15360,12356,12677,13340,15360,12388,12693,13348,15360,12279,12597,13247,15360,11894,12396,12998,15360,11637,12231,12846,15360,11573,12135,12789,15360,11589,12151,12797,15360,11621,12167,12797,15360,11637,12119,12677,15360,11079,11404,11693,15360,10517,10701,10653,15360,10252,10348,10007,15360,9902,9999,9428,15360,9846,9886,9047,15360,10135,10260,9685,15360,10412,10533,10412,15360,11268,11436,11549,15360,12364,12605,13087,15360,12444,12709,13255,15360,12549,12822,13348,15360,12613,12886,13396,15360,12597,12886,13412,15360,12581,12870,13404,15360,12661,12950,13460,15360,12725,13014,13492,15360,13079,13332,13645,15360,12757,13046,13500,15360,12677,12982,13476,15360,12854,13143,13556,15360,12693,12982,13492,15360,12581,12886,13452,15360,12709,13030,13508,15360,12372,12709,13364,15360,12324,12661,13348,15360,12292,12645,13340,15360,12292,12645,13348,15360,12468,12806,13436,15360,12532,12854,13460,15360,12500,12854,13468,15360,12500,12854,13484,15360,12725,13063,13589,15360,12982,13324,13701,15360,13111,13388,13741,15360,13014,13340,13709,15360,13014,13332,13717,15360,13287,13476,13862,15360,13436,13621,13974,15360,13532,13717,14095,15360,13725,13902,14295,15360,13942,14103,14420,15360,13974,14135,14436,15360,13862,14022,14388,15360,13725,13894,14295,15360,13789,13958,14336,15360,13830,13990,14348,15360,13372,13548,13942,15360,13014,13332,13733,15360,12886,13239,13661,15360,12854,13207,13637,15360,12757,13095,13589,15360,12757,13079,13573,15360,12645,12982,13516,15360,12629,12966,13532,15360,12549,12870,13468,15360,12356,12693,13372,15360,12151,12549,13231,15360,12215,12573,13247,15360,12199,12565,13231,15360,12071,12492,13135,15360,12055,12468,13087,15360,11878,12372,12958,15360,11685,12199,12781,15360,10774,11159,11412,15360,9533,9621,8870,15360,9308,9340,8071,15360,9276,9300,7878,15360,9324,9332,8420,15360,9191,9216,7991,15360,8950,8983,7766,15360,9493,9525,8677,15360,10252,10332,10007,15360,10661,10846,10894,15360,10701,10926,10998,15360,10950,11276,11428,15360,11364,11637,12063,15360,11958,12388,12926,15360,12183,12540,13175,15360,12340,12645,13295,15360,12420,12693,13316,15360,12757,13030,13460,15360,13046,13324,13645,15360,13095,13348,13677,15360,13303,13460,13781,15360,13207,13404,13741,15360,13127,13372,13717,15360,13372,13524,13862,15360,12693,13030,13540,15360,12725,13046,13548,15360,12468,12822,13436,15360,12263,12629,13348,15360,12436,12773,13428,15360,12693,12998,13524,15360,12725,13046,13564,15360,12645,12982,13556,15360,12613,12966,13556,15360,12886,13255,13685,15360,13436,13629,14022,15360,13637,13813,14231,15360,13621,13789,14215,15360,13878,14038,14412,15360,14022,14183,14468,15360,13926,14119,14452,15360,14054,14231,14508,15360,14135,14311,14540,15360,14348,14436,14669,15360,14460,14540,14749,15360,14404,14484,14709,15360,14420,14500,14709,15360,14653,14717,14894,15360,14119,14279,14508,15360,13484,13669,14078,15360,13063,13380,13773,15360,12677,13079,13613,15360,12484,12886,13516,15360,12436,12822,13476,15360,12468,12838,13476,15360,12039,12532,13316,15360,12231,12613,13340,15360,12468,12789,13436,15360,12388,12725,13396,15360,12135,12557,13287,15360,12151,12557,13271,15360,12039,12484,13175,15360,11878,12396,13038,15360,11814,12348,12950,15360,11492,11894,12460,15360,9950,10103,9621,15360,8830,8838,7220,15360,8565,8533,7015,15360,8541,8501,6919,15360,8332,8300,6822,15360,8412,8372,7220,15360,8710,8701,7686,15360,9372,9404,8549,15360,9533,9621,9079,15360,9268,9292,8196,15360,9452,9460,8167,15360,9533,9581,8533,15360,9742,9870,9316,15360,11460,11814,12348,15360,11942,12388,12902,15360,11749,12167,12573,15360,11300,11492,11621,15360,11974,12332,12669,15360,12436,12741,13364,15360,12597,12886,13460,15360,12966,13271,13653,15360,12998,13303,13669,15360,13476,13629,13974,15360,13733,13886,14239,15360,13364,13524,13894,15360,13063,13356,13725,15360,12982,13287,13669,15360,12484,12806,13444,15360,12565,12902,13500,15360,12950,13287,13693,15360,12934,13271,13677,15360,12693,13046,13589,15360,12661,13030,13605,15360,12870,13271,13717,15360,13348,13548,13966,15360,13621,13813,14271,15360,13797,13974,14412,15360,13942,14119,14484,15360,14263,14388,14629,15360,14420,14508,14733,15360,14460,14548,14773,15360,14982,15046,15231,15360,15564,15580,15669,15360,15974,15982,16078,15360,15805,15821,15926,15360,15460,15476,15572,15360,15436,15460,15556,15360,14781,14862,15127,15360,13621,13813,14348,15360,12789,13207,13757,15360,12452,12886,13581,15360,12263,12709,13476,15360,12039,12597,13396,15360,11942,12516,13340,15360,11846,12468,13271,15360,11733,12380,13127,15360,11926,12460,13191,15360,12055,12524,13263,15360,11878,12428,13159,15360,11605,12231,12886,15360,11412,11990,12709,15360,11508,12103,12789,15360,11637,12231,12854,15360,10661,11079,11380,15360,9541,9685,9252,15360,8573,8605,7493,15360,8404,8388,7348,15360,8830,8822,8212,15360,9308,9324,9095,15360,9324,9364,9220,15360,9047,9119,8653,15360,9023,9055,8404,15360,9055,9063,8167,15360,8870,8846,7541,15360,8862,8806,7380,15360,8950,8910,7252,15360,9268,9284,7557,15360,10316,10468,10380,15360,11239,11476,11677,15360,10653,10942,11047,15360,9661,9814,9324,15360,10693,10958,11047,15360,11396,11653,11990,15360,11878,12292,12597,15360,12468,12789,13396,15360,12773,13095,13589,15360,13364,13516,13894,15360,13894,14054,14380,15360,13717,13870,14247,15360,13420,13589,13958,15360,13255,13452,13830,15360,12806,13143,13637,15360,13159,13412,13830,15360,13629,13813,14215,15360,13303,13500,13910,15360,13079,13396,13805,15360,13191,13452,13878,15360,13412,13621,14062,15360,14103,14279,14540,15360,14773,14854,15086,15360,14717,14805,15046,15360,14295,14420,14685,15360,14380,14476,14733,15360,14572,14661,14902,15360,15596,15612,15701,15360,16351,16335,16384,15360,16484,16476,16492,15360,16516,16500,16516,15360,16388,16375,16404,15360,16054,16054,16118,15360,15918,15926,16006,15360,15556,15572,15669,15360,14653,14725,14982,15360,13637,13838,14319,15360,13412,13613,14054,15360,12870,13287,13789,15360,12404,12838,13524,15360,12199,12677,13428,15360,12324,12741,13452,15360,11942,12516,13324,15360,11765,12380,13111,15360,11428,11942,12589,15360,10886,11388,11902,15360,10372,10717,11006,15360,9846,10240,10191,15360,10252,10549,10766,15360,10613,11079,11484,15360,10581,10998,11388,15360,9613,9846,9629,15360,8525,8557,7541,15360,8605,8613,7814,15360,9292,9324,9079,15360,9388,9396,9220,15360,10709,10846,11031,15360,9894,9966,9854,15360,9252,9236,8774,15360,8822,8790,8183,15360,8292,8260,6533,15360,8111,8007,6324,15360,8228,8183,6405,15360,8501,8501,6565,15360,8814,8878,7172,15360,9260,9364,8244,15360,8902,9095,8252,15360,9444,9581,9047,15360,9509,9637,8790,15360,9477,9613,8806,15360,10725,11063,11079,15360,11508,11910,12356,15360,12484,12789,13380,15360,12838,13159,13629,15360,13428,13589,13974,15360,14135,14279,14484,15360,13942,14087,14396,15360,13677,13846,14247,15360,13436,13613,14006,15360,13597,13781,14183,15360,14183,14340,14540,15360,14022,14215,14484,15360,13637,13838,14271,15360,14038,14231,14508,15360,14380,14476,14701,15360,14757,14854,15078,15360,15030,15111,15343,15360,15420,15452,15556,15360,15476,15500,15588,15360,15351,15388,15492,15360,15572,15596,15677,15360,15653,15669,15717,15360,15821,15821,15853,15360,15845,15845,15869,15360,15998,15990,16022,15360,15926,15926,15974,15360,15653,15669,15733,15360,15661,15677,15749,15360,15612,15629,15717,15360,15271,15335,15452,15360,14484,14572,14821,15360,14215,14372,14588,15360,13468,13677,14167,15360,12773,13175,13653,15360,12725,13143,13637,15360,12452,12886,13532,15360,12263,12709,13444,15360,11894,12436,13103,15360,10252,10533,10661,15360,8613,8693,7445,15360,8742,8782,7047,15360,8420,8412,6565,15360,7926,7910,6405,15360,8806,8854,7300,15360,9127,9228,8007,15360,8685,8750,7300,15360,8348,8356,6758,15360,8380,8340,7300,15360,8991,8918,8388,15360,9838,9790,9549,15360,10055,10127,10047,15360,9501,9493,9268,15360,9332,9292,8902,15360,9079,9007,8509,15360,8300,8260,7252,15360,8693,8701,8196,15360,8228,8212,7111,15360,8469,8501,7380,15360,8420,8501,6919,15360,8549,8645,6983,15360,8581,8661,6951,15360,9268,9332,7718,15360,9063,9207,7445,15360,9284,9380,7718,15360,9412,9557,8693,15360,10276,10517,10103,15360,11830,12279,12589,15360,12725,13079,13589,15360,13127,13396,13773,15360,14087,14231,14460,15360,13974,14119,14412,15360,13677,13854,14247,15360,14119,14279,14500,15360,13990,14167,14460,15360,14364,14452,14653,15360,14564,14653,14837,15360,14404,14492,14701,15360,14870,14942,15135,15360,15388,15420,15500,15360,15207,15287,15420,15360,14797,14894,15127,15360,15271,15335,15452,15360,15926,15942,15990,15360,16207,16207,16231,15360,16118,16110,16126,15360,15741,15733,15741,15360,16239,16207,16175,15360,16444,16460,16484,15360,16046,16022,16006,15360,15942,15950,15966,15360,15773,15789,15829,15360,15789,15797,15845,15360,15693,15709,15757,15360,15540,15564,15653,15360,15303,15364,15468,15360,14733,14813,15014,15360,13862,14054,14420,15360,12838,13255,13725,15360,12789,13207,13693,15360,12468,12918,13564,15360,12404,12838,13500,15360,11428,11862,12412,15360,9143,9276,8388,15360,8541,8533,6726,15360,8444,8428,6629,15360,8212,8183,6597,15360,8388,8380,7015,15360,8726,8710,6758,15360,8332,8316,6437,15360,8453,8428,6565,15360,8597,8605,7814,15360,8701,8661,8151,15360,9452,9396,9015,15360,10581,10557,10380,15360,10950,10974,10846,15360,10380,10356,10252,15360,10749,10741,10685,15360,9870,9854,9693,15360,9023,9039,8669,15360,8790,8854,8509,15360,8196,8167,7332,15360,7975,8015,7079,15360,8589,8750,7445,15360,9095,9260,7111,15360,8983,9135,7188,15360,8902,8991,7252,15360,8862,9007,7015,15360,8967,9111,7300,15360,8742,8878,7493,15360,9557,9999,9549,15360,11292,11613,11862,15360,12135,12468,12982,15360,12215,12460,12878,15360,13356,13468,13685,15360,13821,13934,14199,15360,13548,13701,14022,15360,14103,14263,14468,15360,14279,14388,14572,15360,14364,14452,14645,15360,14709,14789,14950,15360,15143,15199,15327,15360,15388,15412,15468,15360,15476,15500,15548,15360,15420,15444,15492,15360,15436,15460,15516,15360,15612,15637,15685,15360,16086,16086,16110,15360,16396,16388,16396,15360,16094,16094,16110,15360,15869,15861,15861,15360,16135,16110,16070,15360,16428,16420,16404,15360,15588,15556,15524,15360,15484,15500,15508,15360,15335,15364,15396,15360,15677,15685,15717,15360,15604,15621,15661,15360,15420,15444,15500,15360,15303,15372,15452,15360,14717,14805,14998,15360,14412,14508,14701,15360,13548,13765,14199,15360,13271,13508,13942,15360,12661,13159,13709,15360,12468,12854,13436,15360,10260,10484,10509,15360,8613,8669,6951,15360,8151,8143,6469,15360,8653,8629,7814,15360,8469,8444,7541,15360,8718,8693,7814,15360,8372,8332,6597,15360,8356,8308,7111,15360,9047,8983,8396,15360,8822,8798,8308,15360,9372,9348,8967,15360,10364,10364,10183,15360,10268,10260,9894,15360,10541,10533,10468,15360,10380,10364,10276,15360,10621,10613,10549,15360,9910,9942,9758,15360,8364,8380,7621,15360,8581,8637,8135,15360,8252,8300,7573,15360,8119,8175,7300,15360,8372,8453,7493,15360,8420,8501,6983,15360,8742,8822,7573,15360,8782,8854,8151,15360,8581,8661,7079,15360,9220,9268,8340,15360,9549,9645,8854,15360,11717,11950,12127,15360,12468,12741,13207,15360,12709,12966,13388,15360,12300,12508,12886,15360,12492,12709,13063,15360,13239,13372,13548,15360,12476,12597,12814,15360,13581,13685,13878,15360,14476,14548,14685,15360,14556,14629,14773,15360,14765,14829,14966,15360,15159,15207,15303,15360,15372,15396,15444,15360,15516,15532,15572,15360,15653,15661,15693,15360,15829,15837,15853,15360,16022,16014,16022,15360,16311,16295,16279,15360,16343,16319,16303,15360,16412,16388,16359,15360,15813,15797,15773,15360,13063,13151,13183,15360,11484,11701,11798,15360,12300,12412,12468,15360,14613,14637,14653,15360,11974,12215,12316,15360,14135,14215,14303,15360,15604,15629,15677,15360,15524,15548,15596,15360,15351,15380,15428,15360,14797,14894,15054,15360,13990,14231,14500,15360,13492,13709,14070,15360,12886,13316,13701,15360,12613,13207,13749,15360,11525,11974,12428,15360,9284,9412,8629,15360,8597,8653,6951,15360,7806,7790,6292,15360,7589,7541,6437,15360,7485,7437,6597,15360,7453,7404,6180,15360,7774,7686,6565,15360,8300,8260,7332,15360,9918,9942,9862,15360,10348,10372,10231,15360,9725,9709,9228,15360,10613,10621,10509,15360,10199,10175,9838,15360,10380,10388,10340,15360,11207,11255,11284,15360,10661,10717,10725,15360,10103,10135,9950,15360,8444,8436,7669,15360,8469,8501,7445,15360,8950,9111,8854,15360,9485,9798,10071,15360,8364,8501,8039,15360,7959,7951,6806,15360,8597,8605,8039,15360,8501,8533,7557,15360,8758,8830,7509,15360,10758,10830,10693,15360,11508,11605,11621,15360,13524,13669,13886,15360,13830,14022,14327,15360,13926,14103,14364,15360,13460,13621,13886,15360,12854,13191,13420,15360,13597,13733,13926,15360,13846,13990,14223,15360,13773,13942,14199,15360,13910,14087,14356,15360,13813,14022,14319,15360,14247,14396,14540,15360,14693,14765,14878,15360,15223,15279,15343,15360,15508,15524,15540,15360,15540,15548,15564,15360,15327,15335,15319,15360,15303,15311,15303,15360,15918,15910,15886,15360,16247,16207,16151,15360,16175,16143,16086,15360,14436,14452,14436,15360,12263,12380,12404,15360,11476,11701,11773,15360,12380,12492,12532,15360,14797,14797,14757,15360,11372,11589,11677,15360,12597,12934,13356,15360,13990,14364,14725,15360,14183,14444,14773,15360,14231,14444,14717,15360,14412,14532,14709,15360,14054,14199,14380,15360,12372,12500,12605,15360,12199,12565,13006,15360,12581,13175,13653,15360,10055,10380,10324,15360,8557,8573,6726,15360,8167,8196,6533,15360,7517,7485,6119,15360,7244,7172,5798,15360,7071,6959,5718,15360,7669,7581,6260,15360,8661,8605,7975,15360,10942,11079,11151,15360,12573,12741,13014,15360,11902,12030,12191,15360,10308,10332,10135,15360,11255,11300,11284,15360,11276,11348,11396,15360,10055,10215,10292,15360,12183,12332,12468,15360,9918,9966,9798,15360,8734,8742,8196,15360,8967,8950,8469,15360,10260,10276,10039,15360,9734,9758,9605,15360,9388,9404,9308,15360,7943,7878,7095,15360,7726,7637,6645,15360,8047,7983,7204,15360,9284,9236,8693,15360,9621,9565,9143,15360,11255,11268,11047,15360,13175,13332,13420,15360,13773,13934,14175,15360,13854,14022,14271,15360,13870,14038,14279,15360,13388,13516,13677,15360,12279,12629,12966,15360,13348,13452,13564,15360,13821,13918,14054,15360,13701,13846,14022,15360,13460,13605,13781,15360,13492,13637,13821,15360,13709,13821,13950,15360,14372,14428,14476,15360,14516,14572,14613,15360,14741,14789,14813,15360,14725,14749,14749,15360,13452,13484,13468,15360,13476,13500,13492,15360,14990,15022,15022,15360,14556,14572,14564,15360,15094,15111,15094,15360,13231,13287,13215,15360,11255,11380,11175,15360,10677,10886,10492,15360,11846,12006,11934,15360,14327,14340,14279,15360,10766,11039,10862,15360,12918,13255,13452,15360,14231,14548,14886,15360,13878,14380,14765,15360,13444,13862,14412,15360,12151,12404,12621,15360,12637,12902,13215,15360,11549,11749,11870,15360,12279,12653,13119,15360,13223,13404,13516,15360,9228,9260,8276,15360,8087,7991,6308,15360,7918,7814,6919,15360,7469,7364,6148,15360,7485,7380,6212,15360,8228,7991,7204,15360,9276,8967,8212,15360,9806,9573,8742,15360,10135,10087,9621,15360,11452,11452,11452,15360,10629,10637,10509,15360,10693,10733,10637,15360,11095,11111,10982,15360,11292,11348,11372,15360,10199,10244,10167,15360,10814,10926,10846,15360,8669,8774,7493,15360,7870,7910,6244,15360,8204,8183,6919,15360,9806,9758,9159,15360,9460,9436,8629,15360,9159,9087,8260,15360,7637,7509,6790,15360,7758,7629,6838,15360,7967,7918,6774,15360,10854,10749,10501,15360,11508,11412,11316,15360,12372,12300,12151,15360,12030,12119,12063,15360,12781,12910,12982,15360,13476,13581,13661,15360,13484,13589,13677,15360,12404,12428,12380,15360,11605,11765,11798,15360,11492,11533,11452,15360,11838,11886,11798,15360,12263,12372,12380,15360,12151,12231,12175,15360,11492,11508,11412,15360,11119,11111,10838,15360,12508,12581,12573,15360,12621,12693,12677,15360,12573,12629,12589,15360,12292,12324,12231,15360,12476,12565,12573,15360,11998,12159,12215,15360,12950,13071,13159,15360,12263,12372,12428,15360,12380,12428,12444,15360,11300,11308,11143,15360,10199,10244,9734,15360,9709,9701,9252,15360,10492,10581,10404,15360,11476,11516,11388,15360,9477,9517,8790,15360,11717,11854,11838,15360,14247,14420,14524,15360,14054,14311,14436,15360,13597,13805,13982,15360,11364,11533,11597,15360,12263,12428,12549,15360,11436,11605,11653,15360,13079,13324,13444,15360,12516,12613,12605,15360,10039,10015,9605,15360,8693,8621,7878,15360,7951,7862,6902,15360,8196,8204,7015,15360,8677,8589,7637,15360,9284,9031,8340,15360,9814,9605,8902,15360,10685,10428,9910,15360,10492,10260,9685,15360,9404,9252,7943,15360,8830,8766,7220,15360,9220,9047,7943,15360,9693,9669,9015,15360,11412,11468,11372,15360,11135,11159,11023,15360,10087,10055,9428,15360,9910,10007,9621,15360,9236,9300,8934,15360,9597,9557,8902,15360,10669,10549,9782,15360,9926,9870,9127,15360,9894,9918,9047,15360,8685,8742,7910,15360,9958,10167,10284,15360,10215,10332,10396,15360,11396,11428,11452,15360,11223,11255,11300,15360,11814,11862,11958,15360,10685,10846,10870,15360,10340,10380,10007,15360,11175,11207,10894,15360,12103,12207,12215,15360,11143,11103,10902,15360,9910,9966,9613,15360,10015,10079,9493,15360,10806,10846,10517,15360,10862,10934,10637,15360,10838,10942,10661,15360,10958,11087,10878,15360,10709,10838,10701,15360,10669,10741,10589,15360,10581,10669,10525,15360,10252,10348,9974,15360,11396,11500,11525,15360,11207,11255,11264,15360,10878,10910,10934,15360,11031,11063,11159,15360,11292,11324,11396,15360,11223,11255,11300,15360,10693,10685,10645,15360,10428,10420,10324,15360,10300,10252,9991,15360,10838,10846,10798,15360,10428,10428,10364,15360,9669,9605,9380,15360,10167,10244,10087,15360,11709,11854,11910,15360,11223,11284,11268,15360,10231,10244,9878,15360,10199,10244,9862,15360,10183,10260,9942,15360,10525,10653,10541,15360,12500,12597,12621,15360,11814,11741,11597,15360,11533,11460,11175,15360,11103,11006,10557,15360,10444,10396,9846,15360,10007,10023,9228,15360,9653,9790,8469,15360,9316,9372,8039,15360,9557,9830,8071,15360,9621,9918,8071,15360,9677,10015,8167,15360,9991,10284,8420,15360,10215,10436,8581,15360,10260,10484,8645,15360,10292,10476,8902,15360,10324,10468,9252,15360,9910,9894,8886,15360,10525,10573,9701,15360,9782,10039,8581,15360,9565,9814,8167,15360,9950,10039,8934,15360,10749,10758,10199,15360,10669,10685,10244,15360,10838,10838,10460,15360,11215,10910,10087,15360,11492,11364,10806,15360,11095,11159,11055,15360,11364,11388,11356,15360,11023,11039,10990,15360,11653,11653,11613,15360,11798,11725,11557,15360,11974,11862,11637,15360,12039,11942,11765,15360,12119,12047,11934,15360,12151,12071,11950,15360,12087,12006,11886,15360,12047,11966,11838,15360,11990,11926,11790,15360,11974,11910,11798,15360,11998,11934,11814,15360,12111,12039,11886,15360,12231,12143,11998,15360,12292,12199,12039,15360,12039,11974,11846,15360,11822,11782,11653,15360,11862,11838,11765,15360,11798,11765,11701,15360,11782,11733,11669,15360,11798,11749,11685,15360,11838,11790,11725,15360,11870,11822,11749,15360,11741,11701,11621,15360,11565,11541,11452,15360,11533,11500,11412,15360,11621,11581,11484,15360,11605,11557,11460,15360,11516,11468,11372,15360,11565,11533,11444,15360,11677,11637,11541,15360,11725,11661,11557,15360,11725,11661,11557,15360,11733,11669,11573,15360,11838,11773,11677,15360,11998,11926,11814,15360,12014,11926,11798,15360,11460,11404,11332,15360,11637,11557,11428,15360,12014,11894,11693,15360,12167,12022,11765,15360,12119,11982,11709,15360,11926,11806,11516,15360,11685,11589,11300,15360,11476,11404,10886,15360,11239,11151,10468,15360,10766,10733,9894,15360,10565,10565,9589,15360,10436,10444,9332,15360,10308,10308,9031,15360,10308,10316,8999,15360,10199,10244,8774,15360,9725,9645,8549,15360,10244,10276,8967,15360,10878,10838,10183,15360,11055,10966,10348,15360,11119,11006,10404,15360,11264,11135,10565,15360,11404,11316,10822,15360,11492,11388,10982,15360,11798,11613,11223,15360,12047,11830,11412,15360,12039,11894,11597,15360,12127,11990,11693,15360,12127,11990,11725,15360,12191,12055,11806,15360,12191,12055,11830,15360,11870,11773,11613,15360,11573,11516,11428,15360,11533,11484,11412,15360,11541,11492,11420,15360,11565,11516,11452,15360,11589,11541,11476,15360,11605,11557,11500,15360,11637,11589,11533,15360,11669,11621,11557,15360,11701,11645,11573,15360,11733,11669,11589,15360,11798,11717,11605,15360,11838,11749,11621,15360,11878,11782,11661,15360,11894,11798,11661,15360,11926,11806,11653,15360,11958,11822,11661,15360,11982,11846,11677,15360,12006,11870,11685,15360,12095,11950,11765,15360,12047,11910,11741,15360,11886,11765,11605,15360,11838,11733,11589,15360,11814,11717,11589,15360,11814,11709,11573,15360,11790,11693,11565,15360,11741,11677,11589,15360,11733,11677,11613,15360,11733,11685,11629,15360,11717,11669,11621,15360,11685,11645,11589,15360,11629,11589,11533,15360,11573,11525,11468,15360,11492,11444,11380,15360,11316,11255,11111,15360,11348,11292,11143,15360,11516,11436,11316,15360,11854,11749,11589,15360,12127,11990,11765,15360,12199,12055,11782,15360,12340,12231,11910,15360,12372,12292,11958,15360,12380,12300,11974,15360,12348,12247,11910,15360,12324,12215,11878,15360,12247,12103,11773,15360,12095,11958,11637,15360,12055,11926,11613,15360,11974,11854,11541,15360,11870,11765,11468,15360,11966,11854,11541,15360,12300,12151,11846,15360,12396,12316,12006,15360,12388,12308,11990,15360,12388,12308,12006,15360,12396,12316,12022,15360,12396,12308,12022,15360,12396,12308,12022,15360,12364,12279,11974,15360,12340,12247,11942,15360,12340,12231,11926,15360,12215,12071,11806,15360,12095,11966,11749,15360,11741,11645,11500,15360,11420,11356,11255,15360,11364,11308,11207,15360,11356,11300,11175,15360,11348,11292,11191,15360,11372,11324,11255,15360,11412,11364,11308,15360,11420,11372,11316,15360,11428,11380,11324,15360,11444,11388,11332,15360,11484,11428,11364,15360,11508,11460,11396,15360,11557,11500,11436,15360,11589,11533,11460,15360,11613,11557,11484,15360,11621,11557,11492,15360,11613,11557,11500,15360,11621,11557,11500,15360,11629,11573,11508,15360,11629,11573,11508,15360,11605,11557,11484,15360,11589,11533,11468,15360,11557,11508,11436,15360,11549,11500,11428,15360,11557,11500,11436,15360,11549,11492,11436,15360,11533,11484,11428,15360,11525,11476,11428,15360,11516,11476,11428,15360,11525,11484,11444,15360,11516,11476,11428,15360,11468,11428,11380,15360,11428,11388,11332,15360,11356,11308,11239,15360,11308,11255,11127,15360,11167,11071,10926,15360,11223,11119,10966,15360,11276,11175,10998,15360,11404,11332,11191,15360,11773,11693,11557,15360,11926,11798,11613,15360,12207,12039,11773,15360,12348,12231,11894,15360,12308,12151,11846,15360,12332,12215,11894,15360,12364,12279,11958,15360,12380,12292,11974,15360,12396,12316,12022,15360,12404,12316,12039,15360,12412,12332,12087,15360,12412,12332,12103,15360,12436,12356,12135,15360,12372,12292,12039,15360,12420,12332,12087,15360,12396,12316,12055,15360,12356,12263,11990,15360,12340,12231,11942,15360,12271,12127,11854,15360,12215,12071,11814,15360,12292,12135,11878,15360,12288,12135,11870,15360,12111,11982,11765,15360,11990,11886,11717,15360,11637,11557,11428,15360,11364,11300,11143,15360,11316,11239,11079,15360,11300,11207,11047,15360,11268,11159,11015,15360,11268,11159,11015,15360,11268,11159,11031,15360,11300,11223,11095,15360,11340,11292,11191,15360,11348,11300,11223,15360,11372,11324,11255,15360,11380,11332,11255,15360,11372,11316,11239,15360,11396,11340,11268,15360,11468,11404,11300,15360,11460,11404,11324,15360,11484,11428,11356,15360,11492,11436,11372,15360,11500,11444,11388,15360,11508,11460,11404,15360,11500,11452,11396,15360,11492,11436,11380,15360,11468,11412,11356,15360,11444,11388,11324,15360,11444,11388,11324,15360,11428,11380,11316,15360,11412,11356,11300,15360,11404,11348,11300,15360,11404,11356,11308,15360,11396,11356,11308,15360,11388,11348,11308,15360,11372,11340,11292,15360,11348,11308,11255,15360,11284,11223,11111,15360,11231,11143,11023,15360,11199,11111,10974,15360,11047,10958,10814,15360,11127,11023,10870,15360,11119,11006,10846,15360,11175,11055,10886,15360,11292,11191,10998,15360,11525,11404,11284,15360,11822,11637,11476,15360,11878,11733,11549,15360,11918,11790,11573,15360,12063,11918,11653,15360,12223,12063,11765,15360,12300,12151,11846,15360,12255,12103,11814,15360,12271,12127,11846,15360,12271,12127,11862,15360,12271,12127,11886,15360,12308,12183,11942,15360,12175,12039,11814,15360,12063,11934,11709,15360,12159,12014,11765,15360,12215,12063,11798,15360,12143,11998,11757,15360,12071,11934,11693,15360,11998,11870,11661,15360,11974,11870,11685,15360,11998,11910,11757,15360,11846,11765,11629,15360,11468,11396,11284,15360,11308,11223,11031,15360,11215,11103,10934,15360,11207,11095,10942,15360,11215,11103,10950,15360,11191,11087,10942,15360,11175,11079,10942,15360,11167,11063,10934,15360,11143,11031,10902,15360,11247,11143,11015,15360,11284,11191,11079,15360,11300,11223,11095,15360,11316,11268,11127,15360,11340,11284,11143,15360,11340,11284,11159,15360,11356,11300,11191,15360,11372,11316,11239,15360,11380,11324,11255,15360,11372,11316,11255,15360,11380,11324,11276,15360,11380,11324,11268,15360,11372,11316,11255,15360,11364,11316,11255,15360,11364,11308,11239,15360,11348,11292,11207,15360,11340,11284,11191,15360,11348,11292,11191,15360,11348,11292,11207,15360,11340,11292,11207,15360,11340,11292,11207,15360,11324,11276,11207,15360,11308,11255,11175,15360,11264,11175,11079,15360,11119,11039,10934,15360,11103,11015,10902,15360,11095,11006,10878,15360,11031,10942,10806,15360,10990,10902,10766,15360,11047,10942,10814,15360,11031,10926,10790,15360,11055,10942,10806,15360,11119,10998,10846,15360,11151,11015,10830,15360,11268,11095,10886,15360,11484,11396,11268,15360,11790,11701,11549,15360,11886,11790,11637,15360,11838,11741,11581,15360,11838,11725,11541,15360,11902,11782,11581,15360,11966,11838,11629,15360,11974,11846,11629,15360,11958,11838,11629,15360,11950,11838,11637,15360,11814,11701,11525,15360,11581,11492,11332,15360,11645,11541,11380,15360,11806,11701,11533,15360,11902,11806,11637,15360,11950,11862,11717,15360,12014,11934,11790,15360,11942,11862,11725,15360,11565,11492,11388,15360,11292,11191,11015,15360,11231,11111,10950,15360,11159,11047,10894,15360,11119,11006,10854,15360,11127,11023,10878,15360,11159,11055,10902,15360,11135,11031,10894,15360,11111,11006,10878,15360,11095,10990,10870,15360,11095,10998,10886,15360,11071,10966,10846,15360,11111,11006,10902,15360,11191,11095,10974,15360,11268,11159,11031,15360,11284,11191,11063,15360,11292,11207,11063,15360,11300,11223,11079,15360,11332,11268,11143,15360,11316,11255,11127,15360,11316,11255,11143,15360,11308,11239,11127,15360,11316,11255,11159,15360,11300,11223,11127,15360,11292,11207,11095,15360,11300,11223,11111,15360,11300,11223,11095,15360,11300,11223,11095,15360,11308,11239,11111,15360,11300,11223,11111,15360,11292,11207,11111,15360,11264,11167,11071,15360,11215,11127,11047,15360,11135,11055,10966,15360,11015,10934,10846,15360,10918,10838,10733,15360,10982,10894,10782,15360,10974,10886,10766,15360,10982,10894,10766,15360,10958,10862,10749,15360,10982,10886,10774,15360,10958,10862,10758,15360,10958,10862,10749,15360,11015,10910,10790,15360,11023,10910,10774,15360,11079,10958,10806,15360,11103,10974,10798,15360,11191,11047,10846,15360,11468,11388,11276,15360,11846,11765,11637,15360,12006,11918,11782,15360,11998,11910,11782,15360,11902,11822,11693,15360,11838,11749,11637,15360,11782,11709,11605,15360,11806,11741,11645,15360,11782,11717,11629,15360,11773,11717,11621,15360,11870,11806,11701,15360,11942,11862,11757,15360,12183,12103,11974,15360,11974,11894,11765,15360,11476,11404,11308,15360,11268,11143,10966,15360,11183,11063,10902,15360,11111,10998,10854,15360,11055,10942,10806,15360,11023,10910,10766,15360,11047,10934,10782,15360,11039,10926,10782,15360,11079,10966,10830,15360,11031,10918,10782,15360,11031,10926,10806,15360,10990,10894,10782,15360,10974,10886,10790,15360,10966,10870,10774,15360,11006,10902,10806,15360,11039,10942,10838,15360,11127,11023,10910,15360,11175,11079,10958,15360,11191,11087,10958,15360,11207,11095,10958,15360,11268,11143,11015,15360,11276,11175,11047,15360,11284,11191,11079,15360,11292,11191,11079,15360,11276,11175,11079,15360,11239,11135,11031,15360,11268,11159,11047,15360,11215,11111,11006,15360,11239,11127,11015,15360,11255,11143,11031,15360,11223,11119,11015,15360,11199,11103,10998,15360,11175,11087,10982,15360,11143,11047,10958,15360,11031,10942,10854,15360,10958,10878,10790,15360,10910,10830,10741,15360,10942,10862,10758,15360,10926,10838,10733,15360,10854,10758,10637,15360,10918,10830,10709,15360,10910,10822,10717,15360,10942,10846,10749,15360,10942,10854,10741,15360,10942,10854,10749,15360,10966,10870,10758,15360,10966,10870,10758,15360,10958,10854,10733,15360,10998,10886,10741,15360,10942,10830,10677,15360,11039,10918,10749,15360,11095,10974,10806,15360,11308,11223,11031,15360,11468,11396,11292,15360,11605,11533,11428,15360,11701,11621,11525,15360,11693,11629,11541,15360,11685,11621,11549,15360,11685,11629,11549,15360,11629,11565,11484,15360,11589,11533,11444,15360,11364,11308,11191,15360,11191,11087,10958,15360,11135,11031,10902,15360,11135,11031,10894,15360,11055,10950,10830,15360,11015,10910,10782,15360,10958,10854,10733,15360,10942,10838,10717,15360,10974,10870,10733,15360,10982,10878,10749,15360,10990,10886,10758,15360,11015,10910,10798,15360,10966,10862,10758,15360,10950,10854,10758,15360,10910,10822,10733,15360,10894,10798,10709,15360,10902,10814,10725,15360,10934,10846,10758,15360,10910,10822,10733,15360,10950,10854,10749,15360,10974,10878,10766,15360,11047,10942,10830,15360,11095,10990,10878,15360,11167,11055,10942,15360,11199,11103,10990,15360,11191,11087,10982,15360,11151,11047,10950,15360,11135,11031,10934,15360,11095,10998,10902,15360,11143,11047,10950,15360,11079,10990,10894,15360,11079,10990,10902,15360,11103,11006,10910,15360,11079,10982,10886,15360,11023,10926,10822,15360,10982,10894,10798,15360,10958,10870,10782,15360,10910,10814,10725,15360,10926,10838,10741,15360,10934,10838,10733,15360,10950,10854,10749,15360,10886,10798,10709,15360,10910,10814,10709,15360,10926,10830,10725,15360,10910,10814,10701,15360,10862,10774,10677,15360,10950,10854,10733,15360,10926,10830,10717,15360,10926,10838,10725,15360,10926,10830,10725,15360,10894,10798,10685,15360,10926,10830,10701,15360,10958,10854,10717,15360,10934,10830,10685,15360,10950,10846,10709,15360,10974,10862,10717,15360,10942,10830,10685,15360,10958,10846,10701,15360,11006,10894,10749,15360,10950,10846,10725,15360,10958,10862,10741,15360,10894,10806,10701,15360,10854,10774,10669,15360,10886,10806,10701,15360,10862,10790,10693,15360,10878,10806,10717,15360,10982,10902,10798,15360,10990,10902,10798,15360,10950,10862,10758,15360,10942,10846,10733,15360,10870,10774,10669,15360,10894,10798,10693,15360,10918,10830,10725,15360,10894,10806,10701,15360,10926,10830,10733,15360,10902,10830,10725,15360,10870,10790,10693,15360,10886,10814,10725,15360,10814,10741,10661,15360,10838,10766,10677,15360,10822,10741,10661,15360,10822,10741,10669,15360,10862,10790,10709,15360,10846,10758,10669,15360,10894,10798,10693,15360,10974,10878,10766,15360,10966,10870,10766,15360,11023,10926,10814,15360,11079,10974,10862,15360,11006,10910,10814,15360,10950,10862,10766,15360,10982,10894,10798,15360,10958,10862,10774,15360,10958,10870,10782,15360,10910,10830,10741,15360,10950,10862,10766,15360,10982,10886,10790,15360,10918,10822,10725,15360,10886,10798,10701,15360,10854,10766,10669,15360,10894,10806,10709,15360,10926,10830,10725,15360,10926,10830,10725,15360,10958,10862,10749,15360,10958,10862,10749,15360,10894,10806,10717,15360,10902,10814,10717,15360,10878,10790,10677,15360,10942,10838,10717,15360,10918,10814,10701,15360,10886,10790,10661,15360,10942,10838,10717,15360,10950,10854,10725,15360,10950,10854,10725,15360,10910,10814,10693,15360,10910,10814,10685,15360,10942,10838,10709,15360,10894,10790,10661,15360,10910,10806,10669,15360,10822,10725,10597,15360,10749,10661,10541,15360,10830,10733,10613,15360,10838,10741,10629,15360,10806,10709,10597,15360,10854,10766,10653,15360,10862,10774,10669,15360,10798,10725,10629,15360,10822,10749,10653,15360,10854,10782,10693,15360,10806,10741,10661,15360,10862,10790,10701,15360,10870,10790,10685,15360,10870,10790,10693,15360,10878,10790,10677,15360,10862,10782,10677,15360,10870,10790,10693,15360,10870,10782,10685,15360,10894,10814,10709,15360,10886,10814,10709,15360,10846,10782,10685,15360,10741,10669,10573,15360,10766,10693,10589,15360,10709,10637,10541,15360,10741,10669,10589,15360,10741,10677,10589,15360,10709,10637,10557,15360,10774,10701,10613,15360,10862,10774,10677,15360,11006,10918,10806,15360,11006,10902,10782,15360,10974,10870,10749,15360,10958,10854,10733,15360,10934,10838,10725,15360,10934,10838,10733,15360,10934,10838,10725,15360,10886,10790,10685,15360,10854,10766,10661,15360,10886,10798,10701,15360,10838,10749,10645,15360,10878,10782,10661,15360,10822,10725,10613,15360,10822,10717,10605,15360,10846,10749,10629,15360,10854,10749,10637,15360,10950,10854,10733,15360,10958,10854,10741,15360,10910,10806,10693,15360,10926,10822,10693,15360,10934,10838,10725,15360,10910,10822,10709,15360,10910,10822,10709,15360,10886,10782,10661,15360,10910,10814,10677,15360,10910,10806,10677,15360,10926,10822,10685,15360,10958,10854,10717,15360,10974,10870,10725,15360,10926,10830,10693,15360,10926,10830,10693,15360,10918,10822,10693,15360,10934,10838,10701,15360,10918,10814,10685,15360,10878,10782,10653,15360,10870,10774,10645,15360,10838,10749,10629,15360,10806,10717,10605,15360,10822,10733,10621,15360,10822,10733,10621,15360,10846,10758,10653,15360,10846,10766,10653,15360,10822,10741,10629,15360,10806,10733,10629,15360,10806,10725,10621,15360,10790,10709,10605,15360,10766,10693,10589,15360,10814,10741,10629,15360,10846,10766,10653,15360,10838,10758,10653,15360,10878,10790,10677,15360,10894,10798,10685,15360,10830,10741,10629,15360,10830,10758,10653,15360,10798,10725,10629,15360,10806,10733,10629,15360,10717,10637,10525,15360,10661,10581,10476,15360,10701,10621,10517,15360,10733,10661,10565,15360,10782,10685,10557,15360,10862,10758,10613,15360,10974,10862,10725,15360,10958,10846,10709,15360,11006,10902,10766,15360,11006,10902,10774,15360,11039,10934,10814,15360,11006,10902,10790,15360,11006,10910,10790,15360,10950,10854,10741,15360,10934,10830,10709,15360,10918,10814,10701,15360,10854,10758,10653,15360,10918,10814,10701,15360,10870,10766,10645,15360,10830,10733,10621,15360,10934,10830,10709,15360,10990,10886,10758,15360,10950,10838,10717,15360,10910,10814,10701,15360,10926,10822,10693,15360,10934,10830,10709,15360,10878,10774,10653,15360,10934,10830,10701,15360,10926,10822,10693,15360,10878,10782,10661,15360,10878,10782,10661,15360,10862,10766,10621,15360,10886,10782,10645,15360,10886,10782,10653,15360,10926,10822,10701,15360,10902,10806,10685,15360,10926,10822,10701,15360,10918,10814,10685,15360,10878,10782,10645,15360,10910,10806,10669,15360,10854,10758,10621,15360,10886,10790,10645,15360,10854,10758,10629,15360,10830,10741,10613,15360,10918,10814,10685,15360,10862,10766,10645,15360,10830,10741,10613,15360,10806,10717,10597,15360,10741,10661,10557,15360,10774,10693,10581,15360,10749,10669,10557,15360,10774,10693,10581,15360,10766,10685,10573,15360,10790,10709,10597,15360,10782,10701,10589,15360,10790,10709,10597,15360,10838,10749,10621,15360,10870,10774,10645,15360,10894,10790,10661,15360,10878,10782,10653,15360,10846,10741,10613,15360,10790,10693,10557,15360,10814,10717,10597,15360,10790,10701,10581,15360,10741,10645,10525,15360,10717,10629,10509,15360,10774,10685,10573,15360,10725,10637,10525,15360,10854,10749,10621,15360,10950,10846,10701,15360,10966,10854,10709,15360,10934,10814,10677,15360,10926,10822,10701,15360,10982,10878,10766,15360,10998,10894,10782,15360,10990,10878,10766,15360,10998,10894,10782,15360,10998,10886,10774,15360,10998,10886,10758,15360,11006,10894,10774,15360,10942,10838,10733,15360,10958,10854,10741,15360,10958,10854,10749,15360,11006,10902,10790,15360,11015,10902,10798,15360,10982,10870,10758,15360,10998,10894,10782,15360,10974,10870,10758,15360,11006,10902,10790,15360,10998,10894,10774,15360,10974,10870,10758,15360,10950,10854,10741,15360,10878,10790,10693,15360,10902,10814,10701,15360,10918,10822,10709,15360,10838,10733,10613,15360,10878,10782,10661,15360,10934,10838,10717,15360,10902,10806,10693,15360,10918,10822,10709,15360,10926,10830,10709,15360,10838,10733,10605,15360,10910,10806,10661,15360,10942,10838,10693,15360,10886,10782,10645,15360,10886,10782,10637,15360,10854,10749,10621,15360,10926,10830,10709,15360,10966,10862,10741,15360,10846,10749,10629,15360,10830,10733,10605,15360,10854,10758,10637,15360,10822,10725,10605,15360,10886,10790,10661,15360,10902,10806,10669,15360,10918,10814,10677,15360,10830,10733,10605,15360,10806,10717,10589,15360,10870,10774,10645,15360,10934,10838,10709,15360,10958,10862,10733,15360,10886,10790,10661,15360,10894,10798,10661,15360,10958,10854,10709,15360,10934,10830,10709,15360,10814,10717,10581,15360,10862,10758,10613,15360,10854,10741,10589,15360,10814,10717,10573,15360,10886,10782,10645,15360,10814,10725,10597,15360,10862,10766,10637,15360,10910,10806,10669,15360,10942,10838,10709,15360,10966,10862,10733,15360,10974,10870,10741,15360,10974,10870,10749,15360,10958,10862,10749,15360,11031,10934,10822,15360,10998,10894,10782,15360,10974,10870,10766,15360,11023,10918,10814,15360,11039,10926,10822,15360,10958,10846,10741,15360,10918,10814,10693,15360,10966,10870,10741,15360,10982,10886,10766,15360,10982,10878,10766,15360,10942,10846,10733,15360,10958,10862,10758,15360,10950,10854,10758,15360,10934,10830,10717,15360,10966,10862,10733,15360,10942,10846,10725,15360,10934,10846,10733,15360,10934,10846,10733,15360,10878,10798,10693,15360,10886,10798,10693,15360,10910,10814,10709,15360,10942,10846,10733,15360,10838,10733,10597,15360,10878,10774,10645,15360,10918,10822,10701,15360,10878,10782,10653,15360,10894,10790,10661,15360,10934,10838,10725,15360,10958,10854,10725,15360,10966,10862,10733,15360,10910,10806,10685,15360,10982,10878,10758,15360,10942,10854,10749,15360,10934,10838,10733,15360,10918,10814,10701,15360,10894,10798,10669,15360,10894,10798,10669,15360,10814,10725,10605,15360,10902,10798,10669,15360,10814,10725,10605,15360,10894,10798,10685,15360,10958,10862,10749,15360,10910,10814,10701,15360,10910,10806,10685,15360,10918,10814,10693,15360,10926,10822,10709,15360,10894,10790,10661,15360,10902,10806,10677,15360,10902,10806,10685,15360,10934,10838,10717,15360,10934,10838,10701,15360,10934,10838,10717,15360,10950,10854,10725,15360,10894,10798,10661,15360,10862,10749,10597,15360,10894,10798,10677,15360,10878,10782,10661,15360,10926,10838,10717,15360,10926,10838,10717,15360,10918,10822,10709,15360,10934,10838,10733,15360,10926,10838,10733,15360,10958,10870,10766,15360,10942,10854,10749,15360,10958,10870,10774,15360,10974,10878,10774,15360,10958,10854,10741,15360,10950,10846,10741,15360,10950,10854,10758,15360,10934,10838,10733,15360,10942,10846,10725,15360,10966,10862,10741,15360,10926,10838,10733,15360,10958,10862,10749,15360,10910,10822,10709,15360,10942,10854,10758,15360,10926,10838,10733,15360,10910,10822,10717,15360,10934,10838,10733,15360,10934,10846,10733,15360,10902,10814,10709,15360,10926,10830,10717,15360,10918,10822,10709,15360,10838,10749,10637,15360,10878,10790,10677,15360,10942,10846,10733,15360,10926,10822,10701,15360,10958,10862,10749,15360,10886,10790,10685,15360,10918,10814,10693,15360,10910,10814,10693,15360,10902,10806,10701,15360,10878,10774,10637,15360,10798,10693,10565,15360,10822,10725,10597,15360,10934,10838,10709,15360,10958,10854,10725,15360,10886,10790,10669,15360,10910,10806,10677,15360,10886,10782,10645,15360,10830,10725,10597,15360,10822,10717,10581,15360,10862,10758,10637,15360,10878,10782,10669,15360,10926,10822,10709,15360,10974,10878,10774,15360,10966,10870,10758,15360,10918,10822,10709,15360,10846,10749,10645,15360,10894,10798,10693,15360,10918,10822,10709,15360,10974,10878,10774,15360,10918,10822,10717,15360,10982,10886,10774,15360,10974,10878,10758,15360,10950,10854,10741,15360,10958,10854,10725,15360,10982,10886,10766,15360,10918,10822,10701,15360,10878,10782,10669,15360,10886,10790,10669,15360,10934,10838,10717,15360,10950,10854,10741,15360,10934,10838,10733,15360,10982,10886,10782,15360,10886,10798,10701,15360,10870,10782,10685,15360,10894,10814,10717,15360,10910,10822,10725,15360,10934,10838,10733,15360,10950,10846,10741,15360,10934,10838,10725,15360,10934,10846,10749,15360,10902,10814,10717,15360,10878,10790,10677,15360,10878,10782,10669,15360,10854,10766,10645,15360,10838,10749,10629,15360,10902,10814,10701,15360,10910,10814,10693,15360,10902,10798,10669,15360,10910,10806,10677,15360,10886,10782,10653,15360,10854,10749,10629,15360,10870,10774,10653,15360,10974,10870,10758,15360,10990,10878,10758,15360,10918,10822,10709,15360,10926,10838,10725,15360,10958,10854,10733,15360,10894,10790,10653,15360,10822,10725,10605,15360,10878,10782,10661,15360,10974,10870,10749,15360,10902,10806,10677,15360,10934,10838,10725,15360,10870,10774,10653,15360,10798,10701,10581,15360,10854,10749,10621,15360,10894,10798,10669,15360,10934,10822,10685,15360,10942,10830,10701,15360,10910,10806,10669,15360,10870,10758,10629,15360,10886,10774,10645,15360,10950,10838,10701,15360,10966,10870,10749,15360,10886,10790,10685,15360,10870,10782,10677,15360,10934,10838,10733,15360,10934,10838,10725,15360,10822,10725,10621,15360,10878,10790,10677,15360,10894,10798,10693,15360,10822,10733,10629,15360,10894,10798,10685,15360,10998,10902,10790,15360,11015,10918,10806,15360,10950,10854,10741,15360,10950,10846,10741,15360,10934,10838,10733,15360,10942,10846,10749,15360,10910,10822,10725,15360,10846,10758,10653,15360,10878,10790,10685,15360,10894,10798,10701,15360,10862,10774,10669,15360,10814,10725,10621,15360,10846,10758,10645,15360,10870,10774,10661,15360,10870,10774,10677,15360,10878,10790,10693,15360,10878,10782,10677,15360,10830,10741,10637,15360,10870,10782,10677,15360,10966,10870,10766,15360,11015,10918,10814,15360,10910,10814,10701,15360,10942,10846,10725,15360,10950,10846,10725,15360,10942,10838,10725,15360,10934,10830,10701,15360,10910,10798,10677,15360,10886,10782,10653,15360,10838,10733,10597,15360,10902,10806,10669,15360,10830,10733,10613,15360,10838,10741,10621,15360,10838,10741,10621,15360,10894,10798,10669,15360,10934,10830,10685,15360,10886,10790,10669,15360,10902,10806,10685,15360,10854,10749,10637,15360]);var Sfe={file:1,m:1,mm:.001,cm:.01,ft:.3048,in:.0254,pt:wbt()},Rbt={file:"m",m:"m",mm:"mm",cm:"cm",ft:"ft",in:"in",pt:"pt"},wfe=e=>2===e?"\xb2":3===e?"\xb3":"",uI=(e,t=1)=>Rbt[e]+wfe(t),OKt=(e,t,i,r=1)=>(null==i&&(i=t),i===t?{value:e,unit:uI(i)}:{value:e*Math.pow(Sfe[t]/Sfe[i],r),unit:uI(i)+wfe(r)}),Ok=(e=>(e.Top="Top",e.Bottom="Bottom",e.Front="Front",e.Back="Back",e.Left="Left",e.Right="Right",e))(Ok||{}),Va=class{static getCameraPositionByBboxAndView(e,t,i,r,n){let s=Va.getCameraDirectionByView(t);return this.getCameraPositionByBboxAndDirection(e,i,r,n,s)}static getCameraPositionByBboxAndDirection(e,t,i,r,n){if(e.isEmpty()||!r)return;let s=new D,a=new D,o=new D(0,1,0);e.getSize(a),e.getCenter(s);let l,h,u=(a.x+a.y+a.z)/3*1.5;if(!n||null!=n&&n.equals(new D))l=new D(s.x+u,s.y+u/1.5,s.z+u),h=l.clone().sub(s);else{let e=new D(u,u/1.5,u).length();h=new D(-n.x,-n.y,-n.z).normalize().multiplyScalar(e),l=h.clone().add(s)}u=h.length(),h=h.normalize();let c=new Be;c.lookAt(l,s,o);let p=new Be;p.makeTranslation(-l.x,-l.y,-l.z);let d=e.clone().applyMatrix4(p).applyMatrix4(c.invert()).applyMatrix4(r),f=Math.max(Math.abs(d.max.x),Math.abs(d.min.x)),m=Math.max(Math.abs(d.max.y),Math.abs(d.min.y));u*=1.1*Math.sqrt(Math.pow(f,2)+Math.pow(m,2)),l=h.multiplyScalar(u).add(s),i.set(s.x,s.y,s.z),t.set(l.x,l.y,l.z)}static getCameraDirectionByView(e){let t=new D(1,0,0);return"Top"===e?t.set(0,-1,0):"Bottom"===e?t.set(0,1,0):"Front"===e?t.set(0,0,-1):"Back"===e?t.set(0,0,1):"Left"===e?t.set(1,0,0):"Right"===e&&t.set(-1,0,0),t}},Mbt=!1,Ys=class extends Ls{constructor(e){super(),this.DEFAULT_LINE_WIDTH=1,this.DEFAULT_STROKE_STYLE="#000000",this.DEFAULT_FILL_STYLE="#000000",this.lineWidth=this.DEFAULT_LINE_WIDTH,this.lineColor=this.DEFAULT_STROKE_STYLE,this.fillColor=this.DEFAULT_FILL_STYLE,this.x=0,this.y=0,this.points=[],this.userData={},this.width=0,this.height=0,this.tolerance=1,this.visible=!0,this.selected=!1,this.renderOrder=1,this.needsFrustumCulled=!0,this.editPointSize=3,this.editPointColor="#ffffff",this.matrix=new Be,this.id=e||Tt.guid()}setTolerance(e){this.tolerance=e}render(e,t){this.ctx=e,this.draw(e,t),this.selected&&this.drawSelect(e,t),Mbt&&(this.drawBounds(e,t),this.drawCenter(e,t))}getData(){return{id:this.id,points:this.points.map((e=>[e.x,e.y])),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,type:this.getClassType()}}setData(e){this.id=e.id,this.setLineWidth(e.lineWidth),this.setLineColor(e.lineColor),this.setFillColor(e.fillColor)}getVertexs(){return[new D(this.x,this.y,0),new D(this.x+this.width,this.y,0),new D(this.x+this.width,this.y+this.height,0),new D(this.x,this.y+this.height,0)]}setLineWidth(e){this.lineWidth=e||this.DEFAULT_LINE_WIDTH}setLineColor(e){this.lineColor=e||this.DEFAULT_STROKE_STYLE}setFillColor(e){this.fillColor=e||this.DEFAULT_FILL_STYLE}isSelected(){return this.selected}getCenter(){return this.getBounds().getCenter(new D)}transToScreenCoord(e,t){return this.ctx?xi.worldPosition2ScreenPoint(e,t,this.ctx.canvas):new ce}drawBounds(e,t){let{min:i,max:r}=this.getBounds(),n=[],s=(e,t,i)=>n.push(new D(e,t,i));s(r.x,r.y,r.z),s(i.x,r.y,r.z),s(i.x,i.y,r.z),s(r.x,i.y,r.z),s(r.x,r.y,i.z),s(i.x,r.y,i.z),s(i.x,i.y,i.z),s(r.x,i.y,i.z),s(i.x,r.y,r.z),s(i.x,i.y,r.z),s(r.x,r.y,r.z),s(r.x,i.y,r.z),s(r.x,r.y,i.z),s(r.x,i.y,i.z),s(i.x,r.y,i.z),s(i.x,i.y,i.z),s(i.x,r.y,r.z),s(i.x,r.y,i.z),s(r.x,r.y,r.z),s(r.x,r.y,i.z),s(i.x,i.y,r.z),s(i.x,i.y,i.z),s(r.x,i.y,r.z),s(r.x,i.y,i.z),e.save(),e.strokeStyle="yellow",e.beginPath(),n.forEach(((i,r)=>{let n=this.transToScreenCoord(i,t);r%2==0?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore()}drawCenter(e,t){let i=this.transToScreenCoord(this.getCenter(),t);e.save(),e.fillStyle="yellow",e.beginPath(),e.arc(i.x,i.y,5,0,2*Math.PI),e.closePath(),e.fill(),e.restore()}getBounds(){let e=this.getVertexs();return(new Rt).setFromPoints(e)}},Yc=(e=>(e.MouseClicked="MouseClicked",e.LayoutChanged="LayoutChanged",e.ModelLoaded="ModelLoaded",e.AfterRender="AfterRender",e.CameraChanged="CameraChanged",e.BoxSelectActivated="BoxSelectActivated",e.BoxSelectDeactivated="BoxSelectDeactivated",e.MarkupActivated="MarkupActivated",e.MarkupDeactivated="MarkupDeactivated",e.MarkupAdded="MarkupAdded",e.MarkupUpdated="MarkupUpdated",e.MarkupRemoved="MarkupRemoved",e.BeforeRemoveMarkup="BeforeRemoveMarkup",e.MeasurementActivated="MeasurementActivated",e.MeasurementDeactivated="MeasurementDeactivated",e.MeasurementAdded="MeasurementAdded",e.MeasurementRemoved="MeasurementRemoved",e))(Yc||{}),Rfe={},Rr=class extends Ls{constructor(e){super(),this.drawableLists=[],this.frustum=new na,this.projScreenMatrix=new Be,this.viewer=e,this.init()}static _registerDrawableClass(e){Rfe[e.prototype.getClassType()]=e}static createDrawable(e){let t=Rfe[e.type];if(!t)throw new Error(`Invalid drawable type: ${t}`);let i=e.points.map((e=>new D(e[0],e[1],e[2]||0))),r=new t(e.id,i);return r.setData(e),r}get container(){return this.viewer.viewerContainer}get camera(){return this.viewer.camera}get raycaster(){return this.viewer.getRaycaster()}init(){this.initCanvas(),this.viewer.addEventListener("AfterRender",(()=>{this.projScreenMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(this.projScreenMatrix),this.render()}))}initCanvas(){let e=this.viewer.getViewConfig();if(xr.isBrowser&&!e.context2d){let e=this.canvas=document.createElement("canvas"),t=this.viewer.viewerContainer;t.appendChild(e),e.classList.add("overlay-renderer"),e.style.pointerEvents="none",e.style.position="absolute",e.style.left="0px",e.style.top="0px",e.style.userSelect="none",this.context=e.getContext("2d",{willReadFrequently:!0});let{clientWidth:i,clientHeight:r}=t;this.setSize(i,r)}else e.context2d&&(this.context=e.context2d,this.canvas=xr.creatReactNativeCanvas(this.context),this.context.canvas||(this.context.canvas=this.canvas))}toHighDpr(e,t,i){let r=Math.max(window.devicePixelRatio||1,1),n=this.canvas;return n.width=t*r,n.height=i*r,e.scale(r,r),n.style.width=`${t}px`,n.style.height=`${i}px`,e}clearCanvas(){var e,t,i;null==(i=this.context)||i.clearRect(0,0,null==(e=this.canvas)?void 0:e.width,null==(t=this.canvas)?void 0:t.height)}addDrawableList(e){this.drawableLists.push(e)}render(){if(!this.canvas||!this.context)return;this.clearCanvas();let e=this.getSortedDrawables(),t=new $i;for(let i=0;i<e.length;i++){let r=e[i];r.setTolerance(this.viewer.getPixelSizeInWorldCoord()),r.visible&&(r.getBounds().getBoundingSphere(t),!r.needsFrustumCulled||this.frustum.intersectsSphere(t))&&r.render(this.context,this.camera)}}setSize(e,t){let i=this.canvas;i.width=e,i.height=t,i.style.width=`${e}px`,i.style.height=`${t}px`,this.toHighDpr(this.context,e,t)}getSortedDrawables(){let e=[];return this.drawableLists.forEach((t=>{e.push(...Array.from(t.getDrawables().values()))})),e.sort(((e,t)=>e.renderOrder===t.renderOrder?t.getCenter().distanceTo(this.camera.position)-e.getCenter().distanceTo(this.camera.position):e.renderOrder-t.renderOrder)),e}getDrawablesByPosition(e,t){let i=this.getSortedDrawables().reverse(),r=[];for(let n=0;n<i.length;n++){let s=i[n];s.isPointInPath(e,t)&&r.push(s)}return r}getDrawableById(e){return this.getSortedDrawables().find((t=>t.id===e))}measureTextLength(e,t){let i=this.context,r=e.split("\n"),n=0;for(let s=0;s<r.length;s++){let e=r[s];i.save(),i.font=t;let a=i.measureText(e).width;i.restore(),n=Math.max(n,a)}return n}screenshot(){return ct(this,arguments,(function*(e={type:"image/png",quality:.8}){var t,i,r;if(!this.canvas)return;let n=yield Tt.canvasToImage(this.canvas),s=yield Tt.canvasToImage(null==(t=this.viewer.renderer)?void 0:t.domElement);return this.clearCanvas(),null==(i=this.context)||i.drawImage(s,0,0,s.width/window.devicePixelRatio,s.height/window.devicePixelRatio),null==(r=this.context)||r.drawImage(n,0,0,n.width/window.devicePixelRatio,n.height/window.devicePixelRatio),this.canvas.toDataURL(e.type,e.quality)}))}getImage(e){this.clearCanvas();let t=this.getSortedDrawables();for(let i=0;i<t.length;i++){let r=t[i];e(r)&&r.render(this.context,this.camera)}return Tt.canvasToImage(this.canvas)}getCanvas(){return this.canvas}destroy(){var e;this.drawableLists.forEach((e=>e.clear())),this.drawableLists=[],this.canvas&&(null==(e=this.viewer.viewerContainer)||e.removeChild(this.canvas),this.canvas=void 0)}},Xc=class extends Ls{constructor(e){super(),this.drawableMap=new Map,this.category=e}addDrawable(e){this.drawableMap.set(e.id,e),this.dispatchEvent("addDrawable",e.getData())}updateDrawable(e,t){e.setData(t),this.dispatchEvent("updateDrawable",e.getData())}removeDrawable(e){this.drawableMap.delete(e.id),this.dispatchEvent("removeDrawable",e.getData())}getDrawableById(e){return this.drawableMap.get(e)}clear(){this.drawableMap.forEach((e=>this.removeDrawable(e)))}getDrawables(){return this.drawableMap}getDrawableDatas(){return Array.from(this.drawableMap).map((([e,t])=>t.getData()))}setDrawableDatas(e){for(let t=0;t<e.length;t++){let i=e[t],r=Rr.createDrawable(i);this.addDrawable(r)}}getDrawableByPosition(e,t){let i;for(let[r,n]of this.drawableMap)if(n.visible&&n.isPointInPath(e,t)){i=n;break}return i}},bn=class extends Ys{constructor(e){super(e),this.editPointSize=3,this.editPointColor="#ffffff",this.id=e||Tt.guid()}isSelected(){return this.selected}drawSelect(e,t){let i=this.getVertexs();this.drawPoints(e,t,i)}drawPoints(e,t,i){e.save(),e.fillStyle=this.editPointColor,e.beginPath(),i.forEach((i=>{let r=this.transToScreenCoord(i,t);e.moveTo(r.x,r.y),e.arc(r.x,r.y,this.editPointSize,0,2*Math.PI)})),e.closePath(),e.fill(),e.restore()}setEditPointSize(e){this.editPointSize=e}setEditPointColor(e){this.editPointColor=e}getCenter(){return this.getBounds().getCenter(new D)}isPointInPath(e){let t=this.getVertexs().map((e=>new ce(e.x,e.y)));return kt.isPointInPolygon(new ce(e.x,e.y),t,!0)}setData(e){super.setData(e),this.update(e.points.map((e=>new D(e[0],e[1],0))))}translate(e,t){let i=new D(e,t,0);return this.points.forEach((e=>e.add(i))),this.update(this.points),this}rotate(){return this}scale(){return this}},nl=(e=>(e.Arrow="ArrowMarkup",e.Circle="CircleMarkup",e.CloudLine="CloudLineMarkup",e.CloudLineRectangle="CloudRectMarkup",e.Dot="DotMarkup",e.Ellipse="EllipseMarkup",e.PolyLine="PolylineMarkup",e.Rectangle="RectMarkup",e.Text="TextMarkup",e.X="XMarkup",e))(nl||{}),Pk=class extends bn{constructor(e,t){super(e),this.type="ArrowMarkup",this.update(t)}draw(e,t){let i=this.points.map((e=>this.transToScreenCoord(e,t))),[r,n]=this.points,s=(new D).subVectors(r,n).length()/10/this.tolerance;this.drawArrowLine(e,i,s),this.drawArrowHead(e,i[0],i[1],10,s)}drawArrowLine(e,t,i){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor;let[r,n]=t,s=(new ce).subVectors(n,r).normalize();e.beginPath(),e.moveTo(r.x,r.y);let a=n.clone().sub(s.multiplyScalar(i));e.lineTo(a.x,a.y),e.closePath(),e.stroke(),e.restore()}drawArrowHead(e,t,i,r,n){let s=180*Math.atan2(t.y-i.y,t.x-i.x)/Math.PI,a=(s+r)*Math.PI/180,o=(s-r)*Math.PI/180,l=n*Math.cos(a),h=n*Math.sin(a),u=n*Math.cos(o),c=n*Math.sin(o),p=new ce(i.x+l,i.y+h),d=new ce(i.x+u,i.y+c);e.save(),e.fillStyle=this.lineColor,e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(p.x,p.y),e.lineTo(d.x,d.y),e.closePath(),e.fill(),e.restore()}getVertexs(){return this.points}update(e){let[t,i]=e;return this.points=e,this.x=Math.min(t.x,i.x),this.y=Math.min(t.y,i.y),this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this}isPointInPath(e){return kt.isPointOnLineSegments(e,this.points,this.tolerance)}getClassType(){return"ArrowMarkup"}};Rr._registerDrawableClass(Pk);var Nk=class extends bn{constructor(e,t){super(e),this.radius=1,this.type="CircleMarkup",this.update(t)}draw(e,t){let[i,r]=this.points.map((e=>this.transToScreenCoord(e,t)));this.radius=(new ce).subVectors(r,i).length(),e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.arc(i.x,i.y,this.radius,0,2*Math.PI),e.closePath(),e.stroke(),e.restore()}update(e){let[t,i]=e,r=(new D).subVectors(i,t).length();return this.width=2*r,this.height=2*r,this.x=t.x-this.width/2,this.y=t.y-this.height/2,this.points=e,this}isPointInPath(e){let[t,i]=this.points,r=(new D).subVectors(t,i).length();return Math.abs(e.distanceTo(t)-r)<=2*this.tolerance}getClassType(){return"CircleMarkup"}};Rr._registerDrawableClass(Nk);var Dbt=new Rt,Zp=class extends bn{constructor(e,t){super(e),this.type="CloudLineMarkup",this.update(t)}draw(e,t){let i=this.points,r=[];e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath();for(let n=0;n<i.length-1;n++){let s=this.transToScreenCoord(i[n],t),a=this.transToScreenCoord(i[n+1],t),o=Zp.getControlPointByTwoPoints(s,a);0===n&&e.moveTo(s.x,s.y),e.quadraticCurveTo(o.x,o.y,a.x,a.y),r.push(i[n],i[n+1])}e.stroke(),e.restore(),this.calculateWidthAndHeight(r)}static getControlPointByTwoPoints(e,t){let i=(new ce).subVectors(t,e),r=i.angle(),n=i.length(),s=fr.degToRad(45),a=n/2/Math.cos(s);return new ce(e.x+a*Math.cos(s-r),e.y-a*Math.sin(s-r))}calculateWidthAndHeight(e){let t=new Rt;for(let n=0;n<e.length-1;n++){let i=e[n],r=e[n+1],s=(new D).lerpVectors(i,r,.5),a=(new D).subVectors(r,i).length(),o=(new Rt).setFromCenterAndSize(s,new D(a,a,0));t.union(o)}let{min:i,max:r}=t;this.width=Math.abs(r.x-i.x),this.height=Math.abs(r.y-i.y),this.x=i.x,this.y=i.y}update(e){let{min:t,max:i}=Dbt.setFromPoints(e);return this.x=t.x,this.y=t.y,this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this.points=e,this}getClassType(){return"CloudLineMarkup"}};Rr._registerDrawableClass(Zp);var Lk=class extends bn{constructor(e,t){super(e),this.type="CloudRectMarkup",this.update(t)}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath();let i=this.getVertexs();i.push(i[0]);let r,n=[];for(let s=0;s<i.length-1;s++){let e=this.transToScreenCoord(i[s],t),a=this.transToScreenCoord(i[s+1],t),o=(new ce).subVectors(a,e);r||(r=o.length()/10);let l=o.length(),h=o.normalize(),u=Math.round(l/r);for(let t=0;t<u;t++)n.push(e.clone().add(h.clone().multiplyScalar(r*t)))}n.push(n[0]);for(let s=0;s<n.length-1;s++){let t=n[s],i=n[s+1],r=Zp.getControlPointByTwoPoints(i,t);0===s&&e.moveTo(t.x,t.y),e.quadraticCurveTo(r.x,r.y,i.x,i.y)}e.closePath(),e.stroke(),e.restore()}update(e){let[t,i]=e;return this.points=e,this.x=Math.min(t.x,i.x),this.y=Math.min(t.y,i.y),this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this}isPointInPath(e){let t=this.getVertexs(),i=[];for(let r=0;r<t.length;r++){let e=t[r],n=t[r+1]||t[0];i.push(e,n)}return kt.isPointOnLineSegments(e,i,3*this.tolerance)}getClassType(){return"CloudRectMarkup"}};Rr._registerDrawableClass(Lk);var Fk=class extends bn{constructor(e,t){super(e),this.radius=8,this.update(t)}draw(e,t){let i=this.transToScreenCoord(this.points[0],t);this.width=2*this.radius*this.tolerance,this.height=2*this.radius*this.tolerance,this.x=this.points[0].x-this.radius*this.tolerance,this.y=this.points[0].y-this.radius*this.tolerance,e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.arc(i.x,i.y,this.radius,0,2*Math.PI),e.closePath(),e.fill(),e.stroke(),e.restore()}update(e){let t=e[0];return this.width=2*this.radius*this.tolerance,this.height=2*this.radius*this.tolerance,this.x=t.x-this.radius*this.tolerance,this.y=t.y-this.radius*this.tolerance,this.points=e,this}getClassType(){return"DotMarkup"}};Rr._registerDrawableClass(Fk);var Hk=class extends bn{constructor(e,t){super(e),this.radiusX=1,this.radiusY=1,this.type="EllipseMarkup",this.update(t)}draw(e,t){let[i,r]=this.points.map((e=>this.transToScreenCoord(e,t))),n=(new ce).lerpVectors(i,r,.5);this.radiusX=Math.abs(r.x-i.x)/2,this.radiusY=Math.abs(r.y-i.y)/2,e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.ellipse(n.x,n.y,this.radiusX,this.radiusY,0,0,2*Math.PI),e.closePath(),e.stroke(),e.restore()}update(e){let[t,i]=e;return this.x=Math.min(t.x,i.x),this.y=Math.min(t.y,i.y),this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this.points=e,this}isPointInPath(e){let[t,i]=this.points,r=(new D).lerpVectors(t,i,.5),n=Math.abs(i.x-t.x)/2,s=Math.abs(i.y-t.y)/2,a=Math.pow(e.x-r.x,2)/(n*n),o=Math.pow(e.y-r.y,2)/(s*s);return Math.abs(a+o-1)<=.3}getClassType(){return"EllipseMarkup"}};Rr._registerDrawableClass(Hk);var Uk=class extends bn{constructor(e,t){super(e),this.type="PolylineMarkup",this.update(t)}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor;let i=this.points;e.beginPath(),i.forEach(((i,r)=>{let n=this.transToScreenCoord(i,t);0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.stroke(),e.restore()}isPointInPath(e){let t=this.points,i=[];for(let r=0;r<t.length-1;r++)i.push(t[r],t[r+1]);return kt.isPointOnLineSegments(e,i,1*this.tolerance)}getVertexs(){return this.points}update(e){let{min:t,max:i}=(new Rt).setFromPoints(e);return this.x=t.x,this.y=t.y,this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this.points=e,this}getClassType(){return"PolylineMarkup"}};Rr._registerDrawableClass(Uk);var Bk=class extends bn{constructor(e,t){super(e),this.type="RectMarkup",this.update(t)}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),this.getVertexs().forEach(((i,r)=>{let n=this.transToScreenCoord(i,t);0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore()}update(e){let[t,i]=e;return this.x=Math.min(t.x,i.x),this.y=Math.min(t.y,i.y),this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this.points=e,this}isPointInPath(e){let t=this.getVertexs(),i=[];for(let r=0;r<t.length;r++){let e=t[r],n=t[r+1]||t[0];i.push(e,n)}return kt.isPointOnLineSegments(e,i,2*this.tolerance)}getClassType(){return"RectMarkup"}};Rr._registerDrawableClass(Bk);var kk=class extends bn{constructor(e,t,i){super(e),this.text="",this.fontSize=12,this.textWidth=0,this.textRow=1,this.type="TextMarkup",this.update(t),this.text=i}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.lineColor,e.font=this.fontSize/this.tolerance+"px Arial";let i=this.formatText(e,this.text),r=this.transToScreenCoord(new D(this.x,this.y,0),t);this.drawText(e,i,r.x,r.y),e.restore()}drawText(e,t,i,r){for(let n=0;n<t.length;n++){let s=t[n];if(s.lineWidth<this.textWidth+2){let t=s.lineText;e.fillText(t,i,r-n*this.fontSize/this.tolerance-4)}}this.width||(this.width=this.textWidth*this.tolerance),this.height||(this.height=t.length*this.fontSize),this.textRow=t.length}formatText(e,t){let i=t.split("\n"),r=[];for(let n=0;n<i.length;n++){let t=i[n],s=e.measureText(t).width;s>this.textWidth&&(this.textWidth=s),r.push({lineWidth:s,lineText:t})}return this.textRow!==r.length&&(this.y-=(r.length-1)*this.fontSize),r.reverse()}setFontSize(e){this.fontSize=e}update(e){let t=e[0];return this.x=t.x,this.y=t.y,this.points=[t],this.textRow=1,this}setData(e){super.setData(e),this.text=e.text,this.setFontSize(e.fontSize)}updateText(e){this.text=e}getData(){return{id:this.id,points:this.points.map((e=>[e.x,e.y])),text:this.text,lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,fontSize:this.fontSize,type:this.getClassType()}}getClassType(){return"TextMarkup"}};Rr._registerDrawableClass(kk);var Gk=class extends bn{constructor(e,t){super(e),this.type="XMarkup",this.update(t)}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.beginPath();let[i,r,n,s]=this.getVertexs().map((e=>this.transToScreenCoord(e,t)));e.moveTo(i.x,i.y),e.lineTo(n.x,n.y),e.moveTo(r.x,r.y),e.lineTo(s.x,s.y),e.closePath(),e.stroke(),e.restore()}isPointInPath(e){let[t,i,r,n]=this.getVertexs();return kt.isPointOnLineSegments(e,[t,r,i,n],.1)}update(e){let[t,i]=e;return this.points=e,this.x=Math.min(t.x,i.x),this.y=Math.min(t.y,i.y),this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this}getClassType(){return"XMarkup"}};Rr._registerDrawableClass(Gk);var Or={LEFT:1,RIGHT:2,MIDDLE:4},et=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768});function Hf(e){return e.isPerspectiveCamera}function ch(e){return e.isOrthographicCamera}var Cbt=(e=>(e[e.NONE=-1]="NONE",e[e.ROTATE=0]="ROTATE",e[e.DOLLY=1]="DOLLY",e[e.PAN=2]="PAN",e[e.TOUCH_ROTATE=3]="TOUCH_ROTATE",e[e.TOUCH_DOLLY=4]="TOUCH_DOLLY",e))(Cbt||{}),Abt=(e=>(e.LEFT="ArrowLeft",e.UP="ArrowUp",e.RIGHT="ArrowRight",e.BOTTOM="ArrowDown",e))(Abt||{});function xE(e){return{type:e}}var uh={movable:!1,startDistBetweenFingers:0,scale:1},IE=2*Math.PI,Mfe=1e-6,bA=class extends Zo{constructor(e,t,i=!1){super(),this.enabled=!0,this.target=new D,this.enableZoom=!1,this.enablePan=!1,this.enableRotate=!0,this.state=-1,this.rotateSpeed=1,this.zoomSpeed=1,this.panSpeed=1,this.scale=1,this.minZoom=0,this.maxZoom=1/0,this.screenSpacePanning=!0,this.autoRotate=!0,this.autoRotateSpeed=2,this.enableDamping=!1,this.dampingFactor=.05,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minDistance=0,this.maxDistance=1/0,this.keyPanSpeed=7,this.minFov=50,this.maxFov=95,this.zoomChanged=!1,this.panOffset=new D,this.pointerPositions={},this.rotateStart=new ce,this.rotateEnd=new ce,this.rotateDelta=new ce,this.dollyStart=new ce,this.dollyEnd=new ce,this.dollyDelta=new ce,this.panStart=new ce,this.panEnd=new ce,this.panDelta=new ce,this.pointers=[],this.spherical=new xf,this.sphericalDelta=new xf,this.update=function(e){let t=new D,i=new D,r=new Br;return function(){let n=e.quat,s=n.clone().invert(),a=e.object.position;t.copy(a).sub(e.target),t.applyQuaternion(n),e.spherical.setFromVector3(t),e.autoRotate&&-1===e.state&&(e.isVRMode?e.sphericalDelta.theta+=IE/60/60*e.autoRotateSpeed:e.sphericalDelta.theta-=IE/60/60*e.autoRotateSpeed),e.enableDamping?(e.spherical.theta+=e.sphericalDelta.theta*e.dampingFactor,e.spherical.phi+=e.sphericalDelta.phi*e.dampingFactor):(e.spherical.theta+=e.sphericalDelta.theta,e.spherical.phi+=e.sphericalDelta.phi);let o=e.minAzimuthAngle,l=e.maxAzimuthAngle;return isFinite(o)&&isFinite(l)&&(o<-Math.PI?o+=IE:o>Math.PI&&(o-=IE),l<-Math.PI?l+=IE:l>Math.PI&&(l-=IE),e.spherical.theta=o<=l?Math.max(o,Math.min(l,e.spherical.theta)):e.spherical.theta>(o+l)/2?Math.max(o,e.spherical.theta):Math.min(l,e.spherical.theta)),e.spherical.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,e.spherical.phi)),e.spherical.makeSafe(),e.spherical.radius*=e.scale,e.spherical.radius=Math.max(e.minDistance,Math.min(e.maxDistance,e.spherical.radius)),!0===e.enableDamping?e.target.addScaledVector(e.panOffset,e.dampingFactor):e.target.add(e.panOffset),t.setFromSpherical(e.spherical),t.applyQuaternion(s),a.copy(e.target).add(t),e.object.lookAt(e.target),!0===e.enableDamping?(e.sphericalDelta.theta*=1-e.dampingFactor,e.sphericalDelta.phi*=1-e.dampingFactor,e.panOffset.multiplyScalar(1-e.dampingFactor)):(e.sphericalDelta.set(0,0,0),e.panOffset.set(0,0,0)),e.scale=1,!!(e.zoomChanged||i.distanceToSquared(e.object.position)>Mfe||8*(1-r.dot(e.object.quaternion))>Mfe)&&(e.dispatchEvent(xE("change")),i.copy(e.object.position),r.copy(e.object.quaternion),e.zoomChanged=!1,!0)}}(this),this.onContextMenu=function(e){return t=>{!1!==e.enabled&&t.preventDefault()}}(this),this.onPointerDown=function(e){return t=>{!1!==e.enabled&&(0===e.pointers.length&&(e.domElement.setPointerCapture(t.pointerId),e.domElement.addEventListener("pointermove",e.onPointerMove),e.domElement.addEventListener("pointerup",e.onPointerUp)),e.addPointer(t),"touch"===t.pointerType?e.onTouchStart(t):e.onMouseDown(t))}}(this),this.onPointerMove=function(e){return t=>{!1!==e.enabled&&("touch"===t.pointerType?e.onTouchMove(t):e.onMouseMove(t))}}(this),this.onPointerUp=function(e){return t=>{e.removePointer(t),0===e.pointers.length&&(e.domElement.releasePointerCapture(t.pointerId),e.domElement.removeEventListener("pointermove",e.onPointerMove),e.domElement.removeEventListener("pointerup",e.onPointerUp)),"touch"===t.pointerType&&e.handlerTouchEnd(t),e.dispatchEvent(xE("end")),e.state=-1}}(this),this.onPointerCancel=function(e){return t=>{e.removePointer(t),e.handlerTouchEnd(t)}}(this),this.onMouseWheel=function(e){return t=>{!1===e.enabled||!1===e.enableZoom||-1!==e.state||(t.preventDefault(),t.stopPropagation(),e.dispatchEvent(xE("start")),e.handleMouseWheel(t),e.dispatchEvent(xE("end")))}}(this),this.pan=function(e){let t=new D;return function(i,r){let n=e.domElement;if(e.object instanceof Vr){let s=e.object.position;t.copy(s).sub(e.target);let a=t.length();a*=Math.tan(e.object.fov/2*Math.PI/180),e.panLeft(2*i*a/n.clientHeight,e.object.matrix),e.panUp(2*r*a/n.clientHeight,e.object.matrix)}else console.warn("WARNING: VRControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1}}(this),this.panLeft=function(e){let t=new D;return function(i,r){t.setFromMatrixColumn(r,0),t.multiplyScalar(-i),e.panOffset.add(t)}}(this),this.panUp=function(e){let t=new D;return function(i,r){!0===e.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(e.object.up,t)),t.multiplyScalar(i),e.panOffset.add(t)}}(this),this.onKeyDown=e=>{!1===this.enabled||!1===this.enablePan||this.handleKeyDown(e)},this.object=e,this.domElement=t,this.isVRMode=i,this.quat=(new Br).setFromUnitVectors(this.object.up,new D(0,1,0)),this.domElement&&this.domElement.style&&(this.domElement.style.touchAction="none"),this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerCancel),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this.domElementKeyEvents&&this.domElementKeyEvents.removeEventListener("keydown",this.onKeyDown)}addPointer(e){this.pointers.push(e)}removePointer(e){delete this.pointerPositions[e.pointerId];for(let t=0;t<this.pointers.length;t++)if(this.pointers[t].pointerId==e.pointerId)return void this.pointers.splice(t,1)}getDist(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}trackPointer(e){let t=this.pointerPositions[e.pointerId];void 0===t&&(t=new ce,this.pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}onTouchStart(e){switch(this.trackPointer(e),this.pointers.length){case 1:if(!1===this.enableRotate)return;this.handleTouchStartRotate(),this.state=3;break;case 2:this.handleTouchStartDolly(this.pointers),this.state=4;break;default:this.state=-1}-1!==this.state&&this.dispatchEvent(xE("start"))}onMouseDown(e){switch(e.button){case 0:if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=0;break;case 1:if(!1===this.enableZoom)return;this.handleMouseDownDolly(e),this.state=1;break;case 2:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=2}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=0}break;default:this.state=-1}-1!==this.state&&this.dispatchEvent(xE("start"))}onTouchMove(e){switch(this.trackPointer(e),this.state){case 3:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(e);break;case 4:this.handleTouchMoveDolly(e)}}onMouseMove(e){if(!1!==this.enabled)switch(this.state){case 0:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(e);break;case 1:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(e);break;case 2:if(!1===this.enablePan)return;this.handleMouseMovePan(e)}}handlerTouchEnd(e){uh.movable=!1,uh.scale=1}handleMouseWheel(e){let t=Math.pow(.95,this.zoomSpeed);e.deltaY<0?this.dollyIn(t):e.deltaY>0&&this.dollyOut(t),this.update()}handleMouseDownRotate(e){this.rotateStart.set(e.clientX,e.clientY)}handleMouseDownDolly(e){this.dollyStart.set(e.clientX,e.clientY)}handleMouseDownPan(e){this.panStart.set(e.clientX,e.clientY)}handleTouchStartRotate(){if(1===this.pointers.length)this.rotateStart.set(this.pointers[0].pageX,this.pointers[0].pageY);else{let e=.5*(this.pointers[0].pageX+this.pointers[1].pageX),t=.5*(this.pointers[0].pageY+this.pointers[1].pageY);this.rotateStart.set(e,t)}}handleTouchStartDolly(e){if(e.length<2)return;let t=e[0],i=e[1];uh.startDistBetweenFingers=this.getDist([t.pageX,t.pageY],[i.pageX,i.pageY]),uh.movable=!0,uh.scale=1}updateRotate(){let e=this.isVRMode,t=this.sphericalDelta;this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);let i=this.domElement;e?(t.theta+=2*Math.PI*this.rotateDelta.x/i.clientHeight,t.phi+=2*Math.PI*this.rotateDelta.y/i.clientHeight):(t.theta-=2*Math.PI*this.rotateDelta.x/i.clientHeight,t.phi-=2*Math.PI*this.rotateDelta.y/i.clientHeight),this.rotateStart.copy(this.rotateEnd)}handleMouseMoveRotate(e){this.rotateEnd.set(e.clientX,e.clientY),this.updateRotate()}dollyOut(e){this.object instanceof Vr?this.scale/=e:(console.warn("WARNING: VRControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}dollyIn(e){this.object instanceof Vr?this.scale*=e:(console.warn("WARNING: VRControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}handleMouseMoveDolly(e){this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart);let t=Math.pow(.95,this.zoomSpeed);this.dollyDelta.y>0?this.dollyOut(t):this.dollyIn(t),this.dollyStart.copy(this.dollyEnd)}handleMouseMovePan(e){this.panEnd.set(e.clientX,e.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}getSecondPointerPosition(e){let t=e.pointerId===this.pointers[0].pointerId?this.pointers[1]:this.pointers[0];return this.pointerPositions[t.pointerId]}handleTouchMoveRotate(e){if(1==this.pointers.length)this.rotateEnd.set(e.pageX,e.pageY);else{let t=this.getSecondPointerPosition(e),i=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this.rotateEnd.set(i,r)}this.updateRotate()}updateFov(e){var t;let i=this.object;if(!(i&&i instanceof Vr))return void console.warn("WARNING: VRControls.js encountered an unknown camera type - updateFov disabled.");let r=this.minFov,n=this.maxFov,s=e=>{let t=i.fov+e;t=Math.min(t,n),t=Math.max(t,r),i.fov!==t&&(i.fov=t,i.updateProjectionMatrix(),this.dispatchEvent({type:"change"}))},a=e/20;for(let o=0;o<20;++o)setTimeout((()=>s(a)),5*o);this.autoRotate&&(null==(t=this.controlsHelper)||t.delayAutoRotate())}handleTouchMoveDolly(e){if(!uh.movable||this.pointers.length<2)return;let t=this.getSecondPointerPosition(e),i=[e.pageX,e.pageY],r=[t.x,t.y],n=uh.startDistBetweenFingers,s=this.getDist(i,r);if(!n||!s||Math.abs(n-s)<10)return;let a=s/n;console.log(a),a=Math.min(a,3),a=Math.max(a,1/3);let o=a-uh.scale;if(Math.abs(o)<.05)return;let l=0;l=o>0?10*-o:10*(uh.scale/a-1),this.updateFov(l),uh.scale=a}handleKeyDown(e){let t=!1;switch(e.code){case"ArrowUp":this.pan(0,this.keyPanSpeed),t=!0;break;case"ArrowDown":this.pan(0,-this.keyPanSpeed),t=!0;break;case"ArrowLeft":this.pan(this.keyPanSpeed,0),t=!0;break;case"ArrowRight":this.pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}listenToKeyEvents(e){e.addEventListener("keydown",this.onKeyDown),this.domElementKeyEvents=e}},e0=class extends Ls{constructor(e){super(),this.enable=!0,this.mouseDownPositionX=0,this.mouseDownPositionY=0,this.downClickTime=0,this.upClickTime=0,this.pointers=[],this.handleClick=e=>{if(!this.enable)return;this.stop(e);let t=this.getBaseEvent(e);this.dispatchEvent("click",t)},this.handlePointerDown=e=>{if(!this.enable)return;this.stop(e);let t,i=this.getBaseEvent(e);this.mouseDownPositionX=i.x,this.mouseDownPositionY=i.y,this.downClickTime=i.timestamp,0===i.button&&this.downClickTime-this.upClickTime<300&&(t&&clearTimeout(t),t=setTimeout((()=>{this.dispatchEvent("dblclick",i)}),300)),this.dispatchEvent("pointerdown",i),"touch"===e.pointerType?(this.pointers.push(i),i.pointers=this.pointers,this.dispatchEvent("touchstart",i)):this.dispatchEvent("mousedown",i)},this.handlePointerMove=e=>{if(!this.enable)return;this.stop(e);let t=this.getBaseEvent(e);(Math.abs(t.x-this.mouseDownPositionX)>5||Math.abs(t.y-this.mouseDownPositionY)>5)&&(this.dispatchEvent("pointermove",t),"touch"===e.pointerType?(this.updatePointers(t),t.pointers=this.pointers,this.dispatchEvent("touchmove",t)):this.dispatchEvent("mousemove",t))},this.handlePointerUp=e=>{if(!this.enable)return;this.stop(e);let t=this.getBaseEvent(e);0===t.button&&(this.upClickTime=t.timestamp),this.dispatchEvent("pointerup",t),"touch"===e.pointerType?(this.removePointers(t),t.pointers=this.pointers,this.dispatchEvent("touchend",t)):this.dispatchEvent("mouseup",t),this.mouseDownPositionX=-1,this.mouseDownPositionY=-1},this.handlePointerCancel=e=>{this.enable&&(this.stop(e),this.dispatchEvent("pointercancel",this.getBaseEvent(e)))},this.handleMouseWheel=e=>{this.enable&&(this.stop(e),this.dispatchEvent("wheel",this.getBaseEvent(e)))},this.handleContextMenu=e=>{if(this.enable)return this.stop(e),this.dispatchEvent("contextmenu",this.getBaseEvent(e)),!1},this.handlePointerEnter=e=>{this.enable&&(this.stop(e),this.dispatchEvent("pointerenter",this.getBaseEvent(e)))},this.handlePointerLeave=e=>{this.enable&&(this.stop(e),this.dispatchEvent("pointerleave",this.getBaseEvent(e)))},this.handleResize=e=>{this.enable&&(this.stop(e),this.dispatchEvent("resize",this.getBaseEvent(e)))},this.handleKeydown=e=>{this.enable&&this.dispatchEvent("keydown",this.getBaseEvent(e))},this.handleKeyup=e=>{this.enable&&this.dispatchEvent("keyup",this.getBaseEvent(e))},this.style={},this.element=e,this.bindEvents()}setEnable(e){this.enable=e}setCursor(e){this.element.style&&(this.element.style.cursor=e||"default")}bindEvents(){this.element.style.touchAction="none",this.element.style.userSelect="none",this.element.style.webkitUserSelect="none",this.element.addEventListener("click",this.handleClick),this.element.addEventListener("pointerdown",this.handlePointerDown),this.element.addEventListener("pointermove",this.handlePointerMove),this.element.addEventListener("pointerup",this.handlePointerUp),this.element.addEventListener("pointercancel",this.handlePointerCancel),this.element.addEventListener("pointerenter",this.handlePointerEnter),this.element.addEventListener("pointerleave",this.handlePointerLeave),this.element.addEventListener("contextmenu",this.handleContextMenu),this.element.addEventListener("wheel",this.handleMouseWheel),window.addEventListener("resize",this.handleResize),window.addEventListener("keydown",this.handleKeydown),window.addEventListener("keyup",this.handleKeyup)}unBindEvents(){this.element.removeEventListener("pointerdown",this.handlePointerDown),this.element.removeEventListener("pointermove",this.handlePointerMove),this.element.removeEventListener("pointerup",this.handlePointerUp),this.element.removeEventListener("pointerenter",this.handlePointerEnter),this.element.removeEventListener("pointerleave",this.handlePointerLeave),this.element.removeEventListener("contextmenu",this.handleContextMenu),this.element.removeEventListener("wheel",this.handleMouseWheel),window.removeEventListener("resize",this.handleResize),window.removeEventListener("keydown",this.handleKeydown),window.removeEventListener("keyup",this.handleKeyup),this.element.style.touchAction="",this.element.style.userSelect="",this.element.style.webkitUserSelect=""}getBaseEvent(e){let t={x:0,y:0,pageX:0,pageY:0,clientX:0,clientY:0,deltaX:0,deltaY:0,movementX:0,movementY:0,deltaMode:0,pointerId:0,timestamp:0,buttons:0,pointerType:"mouse",altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1};if(t.timestamp=e.timeStamp,xA(e,"clientX"))if(t.altKey=e.altKey,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.clientX=e.clientX,t.clientY=e.clientY,t.button=e.button,xA(e,"pointerId")){t.pointerType=e.pointerType,t.buttons=e.buttons,t.pageX=e.pageX,t.pageY=e.pageY,t.pointerId=e.pointerId;let i=xi.getScreenPointByEvent(e,this.element);t.x=i.x,t.y=i.y,t.movementX=e.movementX,t.movementY=e.movementY}else xA(e,"deltaX")&&(t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY);else xA(e,"code")&&(t.altKey=e.altKey,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.code=e.code);return t}stop(e){e.preventDefault()}updatePointers(e){for(let t=0;t<this.pointers.length;t++)if(e.pointerId==this.pointers[t].pointerId){this.pointers[t]=e;break}}removePointers(e){for(let t=0;t<this.pointers.length;t++)if(this.pointers[t].pointerId==e.pointerId){this.pointers.splice(t,1);break}}getBoundingClientRect(){return this.element.getBoundingClientRect()}};function xA(e,t){return void 0!==e[t]}var t0=2*Math.PI,Vk=Math.PI/2,_E=Math.PI/180;function r0(e,t,i){return Math.max(t,Math.min(i,e))}function Dn(e,t=1e-5){return Math.abs(e)<t}function Cn(e,t,i=1e-5){return Dn(e-t,i)}function zk(e,t){return Math.round(e/t)*t}function SE(e){return isFinite(e)?e:e<0?-Number.MAX_VALUE:Number.MAX_VALUE}function wE(e){return Math.abs(e)<Number.MAX_VALUE?e:e*(1/0)}function hI(e,t,i,r,n=1/0,s){let a=2/(r=Math.max(1e-4,r)),o=a*s,l=1/(1+o+.48*o*o+.235*o*o*o),h=e-t,u=t,c=n*r;h=r0(h,-c,c),t=e-h;let p=(i.value+a*h)*s;i.value=(i.value-a*p)*l;let d=t+(h+p)*l;return u-e>0==d>u&&(d=u,i.value=(d-u)/s),d}function jk(e,t,i,r,n=1/0,s,a){let o=2/(r=Math.max(1e-4,r)),l=o*s,h=1/(1+l+.48*l*l+.235*l*l*l),u=t.x,c=t.y,p=t.z,d=e.x-u,f=e.y-c,m=e.z-p,g=u,y=c,v=p,T=n*r,x=d*d+f*f+m*m;if(x>T*T){let e=Math.sqrt(x);d=d/e*T,f=f/e*T,m=m/e*T}u=e.x-d,c=e.y-f,p=e.z-m;let b=(i.x+o*d)*s,E=(i.y+o*f)*s,_=(i.z+o*m)*s;i.x=(i.x-o*b)*h,i.y=(i.y-o*E)*h,i.z=(i.z-o*_)*h,a.x=u+(d+b)*h,a.y=c+(f+E)*h,a.z=p+(m+_)*h;let w=g-e.x,S=y-e.y,M=v-e.z;return w*(a.x-g)+S*(a.y-y)+M*(a.z-v)>0&&(a.x=g,a.y=y,a.z=v,i.x=(a.x-g)/s,i.y=(a.y-y)/s,i.z=(a.z-v)/s),a}function IA(e,t){t.set(0,0),e.forEach((e=>{t.x+=e.clientX,t.y+=e.clientY})),t.x/=e.length,t.y/=e.length}function _A(e,t){return!!ch(e)&&(console.warn(`${t} is not supported in OrthographicCamera`),!0)}var Pr,Dfe,RA,Wk,xo,Lr,ln,RE,hh,ph,i0,Cfe,Afe,$c,pI,ME,Ofe,qk,Pfe,Yk,Xk,MA,SA=class{constructor(){this._listeners={}}addEventListener(e,t){let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}removeAllEventListeners(e){e?Array.isArray(this._listeners[e])&&(this._listeners[e].length=0):this._listeners={}}dispatchEvent(e){let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,r=i.length;t<r;t++)i[t].call(this,e)}}},wA=1/8,Obt=xr.isBrowser&&/Mac/.test(navigator.platform),Pbt=!(xr.isBrowser&&"PointerEvent"in window),Uf=class extends SA{constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=0,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=et.NONE,this._viewport=null,this._dollyControlAmount=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=xr.isBrowser?new DOMRect:{x:0,y:0,width:0,height:0,left:0,right:0,top:0,bottom:0},this._activePointers=[],this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new Pr.Vector3,this._focalOffsetVelocity=new Pr.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,i)=>{if(Hf(this._camera)){let r=Lr.copy(this._camera.position).sub(this._target),n=this._camera.getEffectiveFOV()*_E,s=r.length()*Math.tan(.5*n),a=this.truckSpeed*e*s/this._elementRect.height,o=this.truckSpeed*t*s/this._elementRect.height;this.verticalDragToForward?(i?this.setFocalOffset(this._focalOffsetEnd.x+a,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(a,0,!0),this.forward(-o,!0)):i?this.setFocalOffset(this._focalOffsetEnd.x+a,this._focalOffsetEnd.y+o,this._focalOffsetEnd.z,!0):this.truck(a,o,!0)}else if(ch(this._camera)){let r=this._camera,n=e*(r.right-r.left)/r.zoom/this._elementRect.width,s=t*(r.top-r.bottom)/r.zoom/this._elementRect.height;i?this.setFocalOffset(this._focalOffsetEnd.x+n,this._focalOffsetEnd.y+s,this._focalOffsetEnd.z,!0):this.truck(n,s,!0)}},this._rotateInternal=(e,t)=>{let i=t0*this.azimuthRotateSpeed*e/this._elementRect.height,r=t0*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(i,r,!0)},this._dollyInternal=(e,t,i)=>{let r=Math.pow(.95,-e*this.dollySpeed),n=this._sphericalEnd.radius*r,s=this._sphericalEnd.radius,a=s*(e>=0?-1:1);this.dollyTo(n),this.infinityDolly&&(n<this.minDistance||this.maxDistance===this.minDistance)&&(this._camera.getWorldDirection(Lr),this._targetEnd.add(Lr.normalize().multiplyScalar(a)),this._target.add(Lr.normalize().multiplyScalar(a))),this.dollyToCursor&&(this._dollyControlAmount+=this._sphericalEnd.radius-s,this.infinityDolly&&(n<this.minDistance||this.maxDistance===this.minDistance)&&(this._dollyControlAmount-=a),this._dollyControlCoord.set(t,i))},this._zoomInternal=(e,t,i)=>{let r=Math.pow(.95,e*this.dollySpeed),n=this._zoomEnd;this.zoomTo(this._zoom*r),this.dollyToCursor&&(this._dollyControlAmount+=this._zoomEnd-n,this._dollyControlCoord.set(t,i))},void 0===Pr&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=(new Pr.Quaternion).setFromUnitVectors(this._camera.up,RA),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=et.NONE,this._target=new Pr.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new Pr.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=(new Pr.Spherical).setFromVector3(Lr.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._nearPlaneCorners=[new Pr.Vector3,new Pr.Vector3,new Pr.Vector3,new Pr.Vector3],this._updateNearPlaneCorners(),this._boundary=new Pr.Box3(new Pr.Vector3(-1/0,-1/0,-1/0),new Pr.Vector3(1/0,1/0,1/0)),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlAmount=0,this._dollyControlCoord=new Pr.Vector2,this.mouseButtons={left:et.ROTATE,middle:et.DOLLY,right:et.TRUCK,wheel:Hf(this._camera)?et.DOLLY:ch(this._camera)?et.ZOOM:et.NONE},this.touches={one:et.TOUCH_ROTATE,two:Hf(this._camera)?et.TOUCH_DOLLY_TRUCK:ch(this._camera)?et.TOUCH_ZOOM_TRUCK:et.NONE,three:et.TOUCH_TRUCK};let i=new Pr.Vector2,r=new Pr.Vector2,n=new Pr.Vector2,s=e=>{if(!this._enabled||!this._domElement)return;let t="mouse"!==e.pointerType?null:(e.buttons&Or.LEFT)===Or.LEFT?Or.LEFT:(e.buttons&Or.MIDDLE)===Or.MIDDLE?Or.MIDDLE:(e.buttons&Or.RIGHT)===Or.RIGHT?Or.RIGHT:null;if(null!==t){let e=this._findPointerByMouseButton(t);e&&this._activePointers.splice(this._activePointers.indexOf(e),1)}let i={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(i),this._domElement.removeEventListener("pointermove",o),this._domElement.removeEventListener("pointerup",h),this._domElement.addEventListener("pointermove",o),this._domElement.addEventListener("pointerup",h),f(e)},a=e=>{if(!this._enabled||!this._domElement)return;let t=(e.buttons&Or.LEFT)===Or.LEFT?Or.LEFT:(e.buttons&Or.MIDDLE)===Or.MIDDLE?Or.MIDDLE:(e.buttons&Or.RIGHT)===Or.RIGHT?Or.RIGHT:null;if(null!==t){let e=this._findPointerByMouseButton(t);e&&this._activePointers.splice(this._activePointers.indexOf(e),1)}let i={pointerId:0,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:(e.buttons&Or.LEFT)===Or.LEFT?Or.LEFT:(e.buttons&Or.MIDDLE)===Or.LEFT?Or.MIDDLE:(e.buttons&Or.RIGHT)===Or.LEFT?Or.RIGHT:null};this._activePointers.push(i),this._domElement.removeEventListener("mousemove",l),this._domElement.removeEventListener("mouseup",u),this._domElement.addEventListener("mousemove",l),this._domElement.addEventListener("mouseup",u),f(e)},o=e=>{let t=e.pointerId,i=this._findPointerById(t);if(i){if(i.clientX=e.clientX,i.clientY=e.clientY,i.deltaX=e.movementX,i.deltaY=e.movementY,"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=0,(e.buttons&Or.LEFT)===Or.LEFT&&(this._state=this._state|this.mouseButtons.left),(e.buttons&Or.MIDDLE)===Or.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&Or.RIGHT)===Or.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=e=>{let t=this._findPointerById(0);t&&(t.clientX=e.clientX,t.clientY=e.clientY,t.deltaX=e.movementX,t.deltaY=e.movementY,this._state=0,(e.buttons&Or.LEFT)===Or.LEFT&&(this._state=this._state|this.mouseButtons.left),(e.buttons&Or.MIDDLE)===Or.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&Or.RIGHT)===Or.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},h=e=>{let t=e.pointerId,i=this._findPointerById(t);if(i&&this._activePointers.splice(this._activePointers.indexOf(i),1),"touch"===e.pointerType)switch(this._activePointers.length){case 0:this._state=et.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=et.NONE;g()},u=()=>{let e=this._findPointerById(0);e&&this._activePointers.splice(this._activePointers.indexOf(e),1),this._state=et.NONE,g()},c=-1,p=e=>{if(!this._enabled||this.mouseButtons.wheel===et.NONE)return;if(this.dollyToCursor||this.mouseButtons.wheel===et.ROTATE||this.mouseButtons.wheel===et.TRUCK){let e=performance.now();c-e<1e3&&this._getClientRect(this._elementRect),c=e}let t=Obt?-1:-3,i=1===e.deltaMode?e.deltaY/t:e.deltaY/(10*t),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,n=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case et.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case et.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case et.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case et.DOLLY:this._dollyInternal(-i,r,n),this._isUserControllingDolly=!0;break;case et.ZOOM:this._zoomInternal(-i,r,n),this._isUserControllingZoom=!0}this.dispatchEvent({type:"control"})},d=e=>{if(this._domElement&&this._enabled&&this.mouseButtons.right===Uf.ACTION.NONE){let t=e instanceof PointerEvent?e.pointerId:(MouseEvent,0),i=this._findPointerById(t);return i&&this._activePointers.splice(this._activePointers.indexOf(i),1),this._domElement.removeEventListener("pointermove",o),this._domElement.removeEventListener("pointerup",h),this._domElement.removeEventListener("mousemove",l),void this._domElement.removeEventListener("mouseup",u)}},f=e=>{if(this._enabled){if(IA(this._activePointers,xo),this._getClientRect(this._elementRect),i.copy(xo),r.copy(xo),this._activePointers.length>=2){let e=xo.x-this._activePointers[1].clientX,t=xo.y-this._activePointers[1].clientY,i=Math.sqrt(e*e+t*t);n.set(0,i);let s=.5*(this._activePointers[0].clientX+this._activePointers[1].clientX),a=.5*(this._activePointers[0].clientY+this._activePointers[1].clientY);r.set(s,a)}if("pointerType"in e&&"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=0,(e.buttons&Or.LEFT)===Or.LEFT&&(this._state=this._state|this.mouseButtons.left),(e.buttons&Or.MIDDLE)===Or.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&Or.RIGHT)===Or.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&et.ROTATE)===et.ROTATE||(this._state&et.TOUCH_ROTATE)===et.TOUCH_ROTATE||(this._state&et.TOUCH_DOLLY_ROTATE)===et.TOUCH_DOLLY_ROTATE||(this._state&et.TOUCH_ZOOM_ROTATE)===et.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&et.TRUCK)===et.TRUCK||(this._state&et.TOUCH_TRUCK)===et.TOUCH_TRUCK||(this._state&et.TOUCH_DOLLY_TRUCK)===et.TOUCH_DOLLY_TRUCK||(this._state&et.TOUCH_ZOOM_TRUCK)===et.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&et.DOLLY)===et.DOLLY||(this._state&et.TOUCH_DOLLY)===et.TOUCH_DOLLY||(this._state&et.TOUCH_DOLLY_TRUCK)===et.TOUCH_DOLLY_TRUCK||(this._state&et.TOUCH_DOLLY_OFFSET)===et.TOUCH_DOLLY_OFFSET||(this._state&et.TOUCH_DOLLY_ROTATE)===et.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&et.ZOOM)===et.ZOOM||(this._state&et.TOUCH_ZOOM)===et.TOUCH_ZOOM||(this._state&et.TOUCH_ZOOM_TRUCK)===et.TOUCH_ZOOM_TRUCK||(this._state&et.TOUCH_ZOOM_OFFSET)===et.TOUCH_ZOOM_OFFSET||(this._state&et.TOUCH_ZOOM_ROTATE)===et.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&et.OFFSET)===et.OFFSET||(this._state&et.TOUCH_OFFSET)===et.TOUCH_OFFSET||(this._state&et.TOUCH_DOLLY_OFFSET)===et.TOUCH_DOLLY_OFFSET||(this._state&et.TOUCH_ZOOM_OFFSET)===et.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})}},m=()=>{if(!this._enabled)return;IA(this._activePointers,xo);let e=!!xr.isBrowser&&this._domElement&&document.pointerLockElement===this._domElement,t=e?-this._activePointers[0].deltaX:r.x-xo.x,s=e?-this._activePointers[0].deltaY:r.y-xo.y;if(r.copy(xo),((this._state&et.ROTATE)===et.ROTATE||(this._state&et.TOUCH_ROTATE)===et.TOUCH_ROTATE||(this._state&et.TOUCH_DOLLY_ROTATE)===et.TOUCH_DOLLY_ROTATE||(this._state&et.TOUCH_ZOOM_ROTATE)===et.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(t,s),this._isUserControllingRotate=!0),(this._state&et.DOLLY)===et.DOLLY||(this._state&et.ZOOM)===et.ZOOM){let e=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&et.DOLLY)===et.DOLLY?(this._dollyInternal(s*wA,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(s*wA,e,t),this._isUserControllingZoom=!0)}if((this._state&et.TOUCH_DOLLY)===et.TOUCH_DOLLY||(this._state&et.TOUCH_ZOOM)===et.TOUCH_ZOOM||(this._state&et.TOUCH_DOLLY_TRUCK)===et.TOUCH_DOLLY_TRUCK||(this._state&et.TOUCH_ZOOM_TRUCK)===et.TOUCH_ZOOM_TRUCK||(this._state&et.TOUCH_DOLLY_OFFSET)===et.TOUCH_DOLLY_OFFSET||(this._state&et.TOUCH_ZOOM_OFFSET)===et.TOUCH_ZOOM_OFFSET||(this._state&et.TOUCH_DOLLY_ROTATE)===et.TOUCH_DOLLY_ROTATE||(this._state&et.TOUCH_ZOOM_ROTATE)===et.TOUCH_ZOOM_ROTATE){let e=xo.x-this._activePointers[1].clientX,t=xo.y-this._activePointers[1].clientY,i=Math.sqrt(e*e+t*t),s=n.y-i;n.set(0,i);let a=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,o=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&et.TOUCH_DOLLY)===et.TOUCH_DOLLY||(this._state&et.TOUCH_DOLLY_ROTATE)===et.TOUCH_DOLLY_ROTATE||(this._state&et.TOUCH_DOLLY_TRUCK)===et.TOUCH_DOLLY_TRUCK||(this._state&et.TOUCH_DOLLY_OFFSET)===et.TOUCH_DOLLY_OFFSET?(this._dollyInternal(s*wA,a,o),this._isUserControllingDolly=!0):(this._zoomInternal(s*wA,a,o),this._isUserControllingZoom=!0)}((this._state&et.TRUCK)===et.TRUCK||(this._state&et.TOUCH_TRUCK)===et.TOUCH_TRUCK||(this._state&et.TOUCH_DOLLY_TRUCK)===et.TOUCH_DOLLY_TRUCK||(this._state&et.TOUCH_ZOOM_TRUCK)===et.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(t,s,!1),this._isUserControllingTruck=!0),((this._state&et.OFFSET)===et.OFFSET||(this._state&et.TOUCH_OFFSET)===et.TOUCH_OFFSET||(this._state&et.TOUCH_DOLLY_OFFSET)===et.TOUCH_DOLLY_OFFSET||(this._state&et.TOUCH_ZOOM_OFFSET)===et.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(t,s,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},g=()=>{IA(this._activePointers,xo),r.copy(xo),0===this._activePointers.length&&this._domElement&&(this._domElement.removeEventListener("pointermove",o),this._domElement.removeEventListener("mousemove",l),this._domElement.removeEventListener("pointerup",h),this._domElement.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",s),Pbt&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",p),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",s),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",p),this._domElement.removeEventListener("contextmenu",d),this._domElement.removeEventListener("pointermove",o),this._domElement.removeEventListener("mousemove",l),this._domElement.removeEventListener("pointerup",h),this._domElement.removeEventListener("mouseup",u))},this.cancel=()=>{this._state!==et.NONE&&(this._state=et.NONE,this._activePointers.length=0,g())},t&&this.connect(t),this.update(0)}static install(e){Pr=e.THREE,Dfe=Object.freeze(new Pr.Vector3(0,0,0)),RA=Object.freeze(new Pr.Vector3(0,1,0)),Wk=Object.freeze(new Pr.Vector3(0,0,1)),xo=new Pr.Vector2,Lr=new Pr.Vector3,ln=new Pr.Vector3,RE=new Pr.Vector3,hh=new Pr.Vector3,ph=new Pr.Vector3,i0=new Pr.Vector3,Cfe=new Pr.Vector3,Afe=new Pr.Vector3,$c=new Pr.Spherical,pI=new Pr.Spherical,ME=new Pr.Box3,Ofe=new Pr.Box3,qk=new Pr.Sphere,Pfe=new Pr.Quaternion,Yk=new Pr.Quaternion,Xk=new Pr.Matrix4,MA=new Pr.Raycaster}static get ACTION(){return et}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;let r=r0(e,this.minAzimuthAngle,this.maxAzimuthAngle),n=r0(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);let s=!i||Cn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Cn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(s)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){this._isUserControllingDolly=!1;let i=this._sphericalEnd.radius,r=r0(e,this.minDistance,this.maxDistance);if(this.colliderMeshes.length>=1){let e=this._collisionTest(),t=Cn(e,this._spherical.radius);if(!(i>r)&&t)return Promise.resolve();this._sphericalEnd.radius=Math.min(r,e)}else this._sphericalEnd.radius=r;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);let n=!t||Cn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=r0(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);let i=!t||Cn(this._zoom,this._zoomEnd,this.restThreshold);return this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),hh.setFromMatrixColumn(this._camera.matrix,0),ph.setFromMatrixColumn(this._camera.matrix,1),hh.multiplyScalar(e),ph.multiplyScalar(-t);let r=Lr.copy(hh).add(ph),n=ln.copy(this._targetEnd).add(r);return this.moveTo(n.x,n.y,n.z,i)}forward(e,t=!1){Lr.setFromMatrixColumn(this._camera.matrix,0),Lr.crossVectors(this._camera.up,Lr),Lr.multiplyScalar(e);let i=ln.copy(this._targetEnd).add(Lr);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return Lr.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+Lr.x,this._targetEnd.y+Lr.y,this._targetEnd.z+Lr.z,t)}moveTo(e,t,i,r=!1){this._isUserControllingTruck=!1;let n=Lr.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);let s=!r||Cn(this._target.x,this._targetEnd.x,this.restThreshold)&&Cn(this._target.y,this._targetEnd.y,this.restThreshold)&&Cn(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}lookInDirectionOf(e,t,i,r=!1){let n=Lr.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(n.x,n.y,n.z,r)}fitToBox(e,t,{cover:i=!1,paddingLeft:r=0,paddingRight:n=0,paddingBottom:s=0,paddingTop:a=0}={}){let o=[],l=e.isBox3?ME.copy(e):ME.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());let h=zk(this._sphericalEnd.theta,Vk),u=zk(this._sphericalEnd.phi,Vk);o.push(this.rotateTo(h,u,t));let c=Lr.setFromSpherical(this._sphericalEnd).normalize(),p=Pfe.setFromUnitVectors(c,Wk),d=Cn(Math.abs(c.y),1);d&&p.multiply(Yk.setFromAxisAngle(RA,h)),p.multiply(this._yAxisUpSpaceInverse);let f=Ofe.makeEmpty();ln.copy(l.min).applyQuaternion(p),f.expandByPoint(ln),ln.copy(l.min).setX(l.max.x).applyQuaternion(p),f.expandByPoint(ln),ln.copy(l.min).setY(l.max.y).applyQuaternion(p),f.expandByPoint(ln),ln.copy(l.max).setZ(l.min.z).applyQuaternion(p),f.expandByPoint(ln),ln.copy(l.min).setZ(l.max.z).applyQuaternion(p),f.expandByPoint(ln),ln.copy(l.max).setY(l.min.y).applyQuaternion(p),f.expandByPoint(ln),ln.copy(l.max).setX(l.min.x).applyQuaternion(p),f.expandByPoint(ln),ln.copy(l.max).applyQuaternion(p),f.expandByPoint(ln),f.min.x-=r,f.min.y-=s,f.max.x+=n,f.max.y+=a,p.setFromUnitVectors(Wk,c),d&&p.premultiply(Yk.invert()),p.premultiply(this._yAxisUpSpace);let m=f.getSize(Lr),g=f.getCenter(ln).applyQuaternion(p);if(Hf(this._camera)){let e=this.getDistanceToFitBox(m.x,m.y,m.z,i);o.push(this.moveTo(g.x,g.y,g.z,t)),o.push(this.dollyTo(e,t)),o.push(this.setFocalOffset(0,0,0,t))}else if(ch(this._camera)){let e=this._camera,r=e.right-e.left,n=e.top-e.bottom,s=i?Math.max(r/m.x,n/m.y):Math.min(r/m.x,n/m.y);o.push(this.moveTo(g.x,g.y,g.z,t)),o.push(this.zoomTo(s,t)),o.push(this.setFocalOffset(0,0,0,t))}return Promise.all(o)}fitToSphere(e,t){let i=[],r=e instanceof Pr.Sphere?qk.copy(e):Uf.createBoundingSphere(e,qk);if(i.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),Hf(this._camera)){let e=this.getDistanceToFitSphere(r.radius);i.push(this.dollyTo(e,t))}else if(ch(this._camera)){let e=this._camera.right-this._camera.left,n=this._camera.top-this._camera.bottom,s=2*r.radius,a=Math.min(e/s,n/s);i.push(this.zoomTo(a,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,r,n,s,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1;let o=ln.set(r,n,s),l=Lr.set(e,t,i);this._targetEnd.copy(o),this._sphericalEnd.setFromVector3(l.sub(o).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let h=!a||Cn(this._target.x,this._targetEnd.x,this.restThreshold)&&Cn(this._target.y,this._targetEnd.y,this.restThreshold)&&Cn(this._target.z,this._targetEnd.z,this.restThreshold)&&Cn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Cn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Cn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(e,t,i,r,n,s,a,o,l,h,u,c,p,d=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1;let f=Lr.set(r,n,s),m=ln.set(e,t,i);$c.setFromVector3(m.sub(f).applyQuaternion(this._yAxisUpSpace));let g=RE.set(h,u,c),y=ln.set(a,o,l);pI.setFromVector3(y.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(g,p));let v=pI.theta-$c.theta,T=pI.phi-$c.phi,x=pI.radius-$c.radius;this._sphericalEnd.set($c.radius+x*p,$c.phi+T*p,$c.theta+v*p),this.normalizeRotations(),this._needsUpdate=!0,d||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let b=!d||Cn(this._target.x,this._targetEnd.x,this.restThreshold)&&Cn(this._target.y,this._targetEnd.y,this.restThreshold)&&Cn(this._target.z,this._targetEnd.z,this.restThreshold)&&Cn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Cn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Cn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(b)}setPosition(e,t,i,r=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,i,r=!1){let n=this.getPosition(Lr),s=this.setLookAt(n.x,n.y,n.z,e,t,i,r);return this._sphericalEnd.phi=r0(this.polarAngle,this.minPolarAngle,this.maxPolarAngle),s}setFocalOffset(e,t,i,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);let n=!r||Cn(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&Cn(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&Cn(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),hh.setFromMatrixColumn(this._camera.matrixWorldInverse,0),ph.setFromMatrixColumn(this._camera.matrixWorldInverse,1),i0.setFromMatrixColumn(this._camera.matrixWorldInverse,2);let r=Lr.set(e,t,i),n=r.distanceTo(this._camera.position),s=r.sub(this._camera.position);hh.multiplyScalar(s.x),ph.multiplyScalar(s.y),i0.multiplyScalar(s.z),Lr.copy(hh).add(ph).add(i0),Lr.z=Lr.z+n,this.dollyTo(n,!1),this.setFocalOffset(-Lr.x,Lr.y,-Lr.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e)return this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),void(this._needsUpdate=!0);this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,r){null!==e?(this._viewport=this._viewport||new Pr.Vector4,"number"==typeof e?this._viewport.set(e,t,i,r):this._viewport.copy(e)):this._viewport=null}getDistanceToFitBox(e,t,i,r=!1){if(_A(this._camera,"getDistanceToFitBox"))return this._spherical.radius;let n=e/t,s=this._camera.getEffectiveFOV()*_E,a=this._camera.aspect;return.5*((r?n>a:n<a)?t:e/a)/Math.tan(.5*s)+.5*i}getDistanceToFitSphere(e){if(_A(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;let t=this._camera.getEffectiveFOV()*_E,i=2*Math.atan(Math.tan(.5*t)*this._camera.aspect),r=1<this._camera.aspect?t:i;return e/Math.sin(.5*r)}getTarget(e){return(e&&e.isVector3?e:new Pr.Vector3).copy(this._targetEnd)}getPosition(e){return(e&&e.isVector3?e:new Pr.Vector3).setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).add(this._targetEnd)}getFocalOffset(e){return(e&&e.isVector3?e:new Pr.Vector3).copy(this._focalOffsetEnd)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%t0,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=t0),this._spherical.theta+=t0*Math.round((this._sphericalEnd.theta-this._spherical.theta)/t0)}reset(e=!1){let t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,RA),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert}update(e){let t=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,n=Cfe.subVectors(this._targetEnd,this._target),s=Afe.subVectors(this._focalOffsetEnd,this._focalOffset),a=this._zoomEnd-this._zoom;if(Dn(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{let t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=hI(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,t,1/0,e),this._needsUpdate=!0}if(Dn(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{let t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=hI(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,t,1/0,e),this._needsUpdate=!0}if(Dn(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{let t=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=hI(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,t,this.maxSpeed,e),this._needsUpdate=!0}if(Dn(n.x)&&Dn(n.y)&&Dn(n.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{let t=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;jk(this._target,this._targetEnd,this._targetVelocity,t,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(Dn(s.x)&&Dn(s.y)&&Dn(s.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{let t=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;jk(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,t,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(0!==this._dollyControlAmount){if(Hf(this._camera)){let e=this._camera,t=Lr.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).normalize().negate(),i=ln.copy(t).cross(e.up).normalize();0===i.lengthSq()&&(i.x=1);let r=RE.crossVectors(i,t),n=this._sphericalEnd.radius*Math.tan(e.getEffectiveFOV()*_E*.5),s=(this._sphericalEnd.radius-this._dollyControlAmount-this._sphericalEnd.radius)/this._sphericalEnd.radius,a=Lr.copy(this._targetEnd).add(i.multiplyScalar(this._dollyControlCoord.x*n*e.aspect)).add(r.multiplyScalar(this._dollyControlCoord.y*n));this._targetEnd.lerp(a,s)}else if(ch(this._camera)){let e=this._camera,t=Lr.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(e.near+e.far)/(e.near-e.far)).unproject(e),i=ln.set(0,0,-1).applyQuaternion(e.quaternion),r=RE.copy(t).add(i.multiplyScalar(-t.dot(e.up))),n=-(this._zoom-this._dollyControlAmount-this._zoomEnd)/this._zoom,s=Lr.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).normalize().negate(),a=this._targetEnd.dot(s);this._targetEnd.lerp(r,n);let o=this._targetEnd.dot(s),l=s.multiplyScalar(o-a);this._targetEnd.sub(l)}this._target.copy(this._targetEnd),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._dollyControlAmount=0}if(Dn(a))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{let t=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=hI(this._zoom,this._zoomEnd,this._zoomVelocity,t,1/0,e)}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0);let o=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,o),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!Dn(this._focalOffset.x)||!Dn(this._focalOffset.y)||!Dn(this._focalOffset.z))&&(this._camera.updateMatrixWorld(),hh.setFromMatrixColumn(this._camera.matrix,0),ph.setFromMatrixColumn(this._camera.matrix,1),i0.setFromMatrixColumn(this._camera.matrix,2),hh.multiplyScalar(this._focalOffset.x),ph.multiplyScalar(-this._focalOffset.y),i0.multiplyScalar(this._focalOffset.z),Lr.copy(hh).add(ph).add(i0),this._camera.position.add(Lr)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),Lr.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);let l=this._needsUpdate;return l&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):l?(this.dispatchEvent({type:"update"}),Dn(t,this.restThreshold)&&Dn(i,this.restThreshold)&&Dn(r,this.restThreshold)&&Dn(n.x,this.restThreshold)&&Dn(n.y,this.restThreshold)&&Dn(n.z,this.restThreshold)&&Dn(s.x,this.restThreshold)&&Dn(s.y,this.restThreshold)&&Dn(s.z,this.restThreshold)&&Dn(a,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!l&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._updatedLastTime=l,this._needsUpdate=!1,l}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:SE(this.maxDistance),minZoom:this.minZoom,maxZoom:SE(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:SE(this.maxPolarAngle),minAzimuthAngle:SE(this.minAzimuthAngle),maxAzimuthAngle:SE(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:Lr.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){let i=JSON.parse(e),r=Lr.fromArray(i.position);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=wE(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=wE(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=wE(i.maxPolarAngle),this.minAzimuthAngle=wE(i.minAzimuthAngle),this.maxAzimuthAngle=wE(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this.verticalDragToForward=i.verticalDragToForward,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],t),$c.setFromVector3(r.sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo($c.theta,$c.phi,t),this.zoomTo(i.zoom,t),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],t),this._needsUpdate=!0}connect(e){this._domElement?console.warn("camera-controls is already connected."):this._addAllEventListeners(e)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_findPointerById(e){return this._activePointers.find((t=>t.pointerId===e))}_findPointerByMouseButton(e){return this._activePointers.find((t=>t.mouseButton===e))}_encloseToBoundary(e,t,i){let r=t.lengthSq();if(0===r)return e;let n=ln.copy(t).add(e),s=this._boundary.clampPoint(n,RE).sub(n),a=s.lengthSq();if(0===a)return e.add(t);if(a===r)return e;if(0===i)return e.add(t).add(s);{let r=1+i*a/t.dot(s);return e.add(ln.copy(t).multiplyScalar(r)).add(s.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Hf(this._camera)){let e=this._camera,t=e.near,i=e.getEffectiveFOV()*_E,r=Math.tan(.5*i)*t,n=r*e.aspect;this._nearPlaneCorners[0].set(-n,-r,0),this._nearPlaneCorners[1].set(n,-r,0),this._nearPlaneCorners[2].set(n,r,0),this._nearPlaneCorners[3].set(-n,r,0)}else if(ch(this._camera)){let e=this._camera,t=1/e.zoom,i=e.left*t,r=e.right*t,n=e.top*t,s=e.bottom*t;this._nearPlaneCorners[0].set(i,n,0),this._nearPlaneCorners[1].set(r,n,0),this._nearPlaneCorners[2].set(r,s,0),this._nearPlaneCorners[3].set(i,s,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||_A(this._camera,"_collisionTest"))return e;let t=Lr.setFromSpherical(this._spherical).divideScalar(this._spherical.radius);Xk.lookAt(Dfe,t,this._camera.up);for(let i=0;i<4;i++){let r=ln.copy(this._nearPlaneCorners[i]);r.applyMatrix4(Xk);let n=RE.addVectors(this._target,r);MA.set(n,t),MA.far=this._spherical.radius+1;let s=MA.intersectObjects(this.colliderMeshes);0!==s.length&&s[0].distance<e&&(e=s[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;let t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise((e=>{let t=()=>{this.removeEventListener("rest",t),e()};this.addEventListener("rest",t)})))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new Pr.Sphere){let i=t,r=i.center;ME.makeEmpty(),e.traverseVisible((e=>{e.isMesh&&ME.expandByObject(e)})),ME.getCenter(r);let n=0;return e.traverseVisible((e=>{if(!e.isMesh)return;let t=e,i=t.geometry.clone();if(i.applyMatrix4(t.matrixWorld),i.isBufferGeometry){let e=i.attributes.position;for(let t=0,i=e.count;t<i;t++)Lr.fromBufferAttribute(e,t),n=Math.max(n,r.distanceToSquared(Lr))}else{let e=i.attributes.position;for(let t=0,i=e.count;t<i;t++)Lr.fromBufferAttribute(e,t),n=Math.max(n,r.distanceToSquared(Lr))}})),i.radius=Math.sqrt(n),i}};Uf.install({THREE:Ot});var Io=class extends Uf{constructor(e,t){super(e,t),this.minZoom=0,this.draggingSmoothTime=0,this.keyTruckSpeed=7,this.keys={left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",bottom:"ArrowDown"},this.onKeyDown=e=>{if(this.enabled){switch(e.code){case this.keys.up:e.ctrlKey||e.metaKey||e.shiftKey?(this._rotateInternal(0,1),this._isUserControllingRotate=!0):(this._truckInternal(0,this.keyTruckSpeed,!1),this._isUserControllingTruck=!0);break;case this.keys.bottom:e.ctrlKey||e.metaKey||e.shiftKey?(this._rotateInternal(0,-1),this._isUserControllingRotate=!0):(this._truckInternal(0,-this.keyTruckSpeed,!1),this._isUserControllingTruck=!0);break;case this.keys.left:e.ctrlKey||e.metaKey||e.shiftKey?(this._rotateInternal(1,0),this._isUserControllingRotate=!0):(this._truckInternal(this.keyTruckSpeed,0,!1),this._isUserControllingTruck=!0);break;case this.keys.right:e.ctrlKey||e.metaKey||e.shiftKey?(this._rotateInternal(-1,0),this._isUserControllingRotate=!0):(this._truckInternal(-this.keyTruckSpeed,0,!1),this._isUserControllingTruck=!0)}this.dispatchEvent({type:"control"})}},this.onKeyUp=e=>{this.dispatchEvent({type:"controlend"})},this._getClientRect(this._elementRect),this.dollySpeedBackup=this.dollySpeed,this.azimuthRotateSpeedBackup=this.azimuthRotateSpeed,this.polarRotateSpeedBackup=this.polarRotateSpeed,this.truckSpeedBackup=this.truckSpeed}get enableZoom(){return!!this.dollySpeed}set enableZoom(e){e?this.dollySpeed=this.dollySpeedBackup:(this.dollySpeedBackup=this.dollySpeed,this.dollySpeed=0)}get enableRotate(){return!!this.azimuthRotateSpeed||!!this.polarRotateSpeed}set enableRotate(e){e?(this.azimuthRotateSpeed=this.azimuthRotateSpeedBackup,this.polarRotateSpeed=this.polarRotateSpeedBackup):(this.azimuthRotateSpeedBackup=this.azimuthRotateSpeed,this.polarRotateSpeedBackup=this.polarRotateSpeed,this.azimuthRotateSpeed=0,this.polarRotateSpeed=0)}get enableTruck(){return!!this.truckSpeed}set enableTruck(e){e?this.truckSpeed=this.truckSpeedBackup:(this.truckSpeedBackup=this.truckSpeed,this.truckSpeed=0)}listenToKeyEvents(){var e,t;null==(e=this._domElement)||e.addEventListener("keydown",this.onKeyDown),null==(t=this._domElement)||t.addEventListener("keyup",this.onKeyUp)}stopListenToKeyEvents(){var e,t;null==(e=this._domElement)||e.removeEventListener("keydown",this.onKeyDown),null==(t=this._domElement)||t.removeEventListener("keyup",this.onKeyUp)}dispose(){super.dispose(),this.stopListenToKeyEvents()}},$l=class{constructor(e){this.name=e}},DA=class{constructor(e){this.history=[],this.step=0,this.maxCount=50,this.isBatchCommand=!1,this.batchCommands=[],this.maxCount=e||this.maxCount}addCommand(e){this.isBatchCommand?this.batchCommands.push(e):(this.history.length===this.maxCount&&this.history.shift(),this.step!==this.history.length&&this.history.splice(this.step),this.history.push(e),this.step++)}startTransaction(){this.isBatchCommand=!0}endTransaction(){this.history.length===this.maxCount&&this.history.shift(),this.step!==this.history.length&&this.history.splice(this.step),this.batchCommands.length>0&&(this.history.push(this.batchCommands.slice()),this.step++),this.isBatchCommand=!1,this.batchCommands=[]}undo(){if(this.canUndo())return!1;this.step--;let e=this.history[this.step];return e&&(Array.isArray(e)?e.forEach((e=>e.undo())):e.undo()),!0}redo(){if(this.canRedo())return!1;this.step++;let e=this.history[this.step-1];return e&&(Array.isArray(e)?e.forEach((e=>e.redo())):e.redo()),!0}getCommands(){return this.history}canUndo(){return this.step<=0}canRedo(){return this.step>=this.history.length}clear(){this.history=[],this.step=0}destroy(){this.clear(),this.maxCount=0}},dI=class extends $l{constructor(e,t){super("AddMarkup"),this.manager=e,this.data=t}undo(){let e=this.manager.getMarkupById(this.data.id);return!!e&&(this.manager.removeMarkup(e),!0)}redo(){let e=this.manager.createMarkup(this.data);return!!e&&(this.manager.addMarkup(e),!0)}},CA=class extends $l{constructor(e,t,i){super("UpdateMarkup"),this.manager=e,this.oldData=t,this.newData=i}undo(){let e=this.manager.getMarkupById(this.oldData.id);return!!e&&(this.manager.updateMarkup(e,this.oldData),!0)}redo(){let e=this.manager.getMarkupById(this.newData.id);return!!e&&(this.manager.updateMarkup(e,this.newData),!0)}},n0=class extends $l{constructor(e,t){super("RemoveMarkup"),this.manager=e,this.data=t}undo(){let e=this.manager.createMarkup(this.data);return!!e&&(this.manager.addMarkup(e),!0)}redo(){let e=this.manager.getMarkupById(this.data.id);return!!e&&(this.manager.removeMarkup(e),!0)}},fI=class extends $l{constructor(e,t){super("AddMeasurement"),this.manager=e,this.data=t}undo(){let e=this.manager.getMeasurementById(this.data.id);return!!e&&(this.manager.removeMeasurement(e),!0)}redo(){let e=this.manager.createMeasurement(this.data);return!!e&&(this.manager.addMeasurement(e),!0)}},DE=class extends $l{constructor(e,t){super("RemoveMeasurement"),this.manager=e,this.data=t}undo(){let e=this.manager.createMeasurement(this.data);return!!e&&(this.manager.addMeasurement(e),!0)}redo(){let e=this.manager.getMeasurementById(this.data.id);return!!e&&(this.manager.removeMeasurement(e),!0)}},Nfe=new D,mI=class extends Ls{constructor(e,t){var i;super(),this.drawableList=new Xc("markup"),this.lineWidth=2,this.lineColor="#ff0000",this.fillColor="rgba(255, 0, 0, 0.3)",this.fontSize=20,this.mouseDown=!1,this.mouseDownPositionX=void 0,this.mouseDownPositionY=void 0,this.isDrawing=!1,this.tempPoints=[],this.actived=!1,this.mousedown=e=>{if(e.pointers&&e.pointers.length>1)return;let t=this.pickThreejsPositionByMouse(e);if(this.mouseDownPositionX=t.x,this.mouseDownPositionY=t.y,0===e.button&&(this.mouseDown=!0),2===e.button&&this.isDrawing&&this.endDraw(this.creatingShape),this.selectedShape&&(this.selectedShape.selected=!1,this.selectedShape=void 0,this.render()),!this.isDrawing){let e=this.drawableList.getDrawableByPosition(t);e&&(this.selectedShape=e,e.selected=!0,this.render(),this.textInput&&(this.textInput.style.display="none"))}if(this.isCreateTextMode()&&this.mouseDown&&!this.selectedShape&&((!this.textInitialPosition||this.textInput&&0===this.textInput.value.length)&&(this.textInitialPosition=t.clone()),this.addInput(e.clientX,e.clientY)),this.isCreateLineMode()&&this.mouseDown&&!this.selectedShape){if(this.tempPoints.length>0){let e=this.tempPoints[0];if(Nfe.subVectors(e,t).length()<5*this.viewer.getPixelSizeInWorldCoord())return t=this.tempPoints[0].clone(),this.tempPoints.push(t),void this.endDraw(this.creatingShape)}if(this.isDrawing=!0,this.tempPoints.push(t),!this.creatingShape){let e=this.creatingShape=this.drawLine([...this.tempPoints,t]);e&&this.addMarkup(e,!1)}this.creatingShape&&(this.creatingShape.update([...this.tempPoints,t]),this.render()),this.dispatchEvent("StartDraw",this.creatingShape)}if(this.isCreateDotMode()&&this.mouseDown&&!this.selectedShape){if(!this.creatingShape){let e=this.creatingShape=this.drawShape(t);e&&this.addMarkup(e,!1)}this.isDrawing=!0,this.render()}},this.mousemove=e=>{if(e.pointers&&e.pointers.length>1)return;let t=this.pickThreejsPositionByMouse(e);if(this.selectedShape){if(this.mouseDown&&void 0!==this.mouseDownPositionX&&void 0!==this.mouseDownPositionY){this.isEditing()||(this.initialDataForEditing=this.selectedShape.getData());let e=t.x-this.mouseDownPositionX,i=t.y-this.mouseDownPositionY;this.selectedShape.translate(e,i),this.render(),this.mouseDownPositionX=t.x,this.mouseDownPositionY=t.y}}else{if(this.isCreateDotMode())return;if(this.mouseDown&&this.isCreateShapeMode()&&void 0!==this.mouseDownPositionX&&void 0!==this.mouseDownPositionY){let e=new D(this.mouseDownPositionX,this.mouseDownPositionY,0);if(!this.creatingShape){let i=this.creatingShape=this.drawShape(e,t);i&&this.addMarkup(i,!1)}this.creatingShape.update([e,t]),this.isDrawing=!0,this.render()}if(this.isCreateLineMode()&&this.tempPoints.length>0&&this.isDrawing){let e=this.tempPoints[0];Nfe.subVectors(e,t).length()<5*this.viewer.getPixelSizeInWorldCoord()&&(t=this.tempPoints[0].clone()),this.creatingShape.update([...this.tempPoints,t]),this.render()}}},this.mouseup=e=>{this.mouseDown=!1,this.selectedShape&&this.isEditing()&&this.endEdit(this.selectedShape),this.isCreateShapeMode()&&this.isDrawing&&this.endDraw(this.creatingShape)},this.keydown=e=>{var t;"Delete"===e.code?this.selectedShape&&(this.viewer.hasEventListener("BeforeRemoveMarkup")?this.viewer.dispatchEvent("BeforeRemoveMarkup",this.confirmToRemove.bind(this)):(this.removeMarkup(this.selectedShape),null==(t=this.viewer.undoRedoManager)||t.addCommand(new n0(this,this.selectedShape.getData())),this.selectedShape=void 0)):"Escape"===e.code&&this.cancelDraw(this.creatingShape)},this.viewer=e,this.inputManager=t,this.overlayRender=this.viewer.overlayRender,null==(i=this.overlayRender)||i.addDrawableList(this.drawableList)}get viewerCanvas(){var e;return null==(e=this.viewer.renderer)?void 0:e.domElement}get camera(){return this.viewer.camera}get raycaster(){return this.viewer.getRaycaster()}setMarkupVisibility(e,t){let i=this.drawableList.getDrawables().get(e);return!!i&&(i.visible=t,this.viewer.enableRender(),!0)}setMarkupsVisibility(e){this.drawableList.getDrawables().forEach((t=>t.visible=e))}clearAll(){this.drawableList.clear(),this.textInput&&(this.textInput.style.display="none"),this.isDrawing&&this.reset(),this.render()}isMarkupActive(){return this.actived}createMobileExitButton(){let e=this.viewer.widgetContainer,t=document.createElement("button");return t.innerText="X",t.style.cssText="position: absolute;right: 5%; top: 5%;background-color: #000000;color: #ffffff;padding: 3px 10px;font-weight: bolder;",null==e||e.appendChild(t),this.exitButton=t,this.exitButton.style.display="none",t.addEventListener("touchstart",(()=>{this.isDrawing&&this.endDraw(this.creatingShape),this.exitButton&&(this.exitButton.style.display="none")})),this.addEventListener("StartDraw",(()=>{this.exitButton&&(this.exitButton.style.display="inline-block")})),this.addEventListener("EndDraw",(()=>{this.exitButton&&(this.exitButton.style.display="none")})),this.exitButton}activate(){this.actived=!0,xr.isMobile?(this.inputManager.addEventListener("touchstart",this.mousedown),this.inputManager.addEventListener("touchmove",this.mousemove),this.inputManager.addEventListener("touchend",this.mouseup)):(this.inputManager.addEventListener("mousedown",this.mousedown),this.inputManager.addEventListener("mousemove",this.mousemove),this.inputManager.addEventListener("mouseup",this.mouseup)),this.inputManager.addEventListener("keydown",this.keydown);let e=this.viewer.controls;this.tempKey=e.mouseButtons.left,e.mouseButtons.left=et.NONE,this.tempTouch=e.touches.one,e.touches.one=et.NONE,this.tempArrowKeys=e.keys,e.keys={},this.render()}deactivate(){this.actived=!1,xr.isMobile?(this.inputManager.removeEventListener("touchstart",this.mousedown),this.inputManager.removeEventListener("touchmove",this.mousemove),this.inputManager.removeEventListener("touchend",this.mouseup)):(this.inputManager.removeEventListener("mousedown",this.mousedown),this.inputManager.removeEventListener("mousemove",this.mousemove),this.inputManager.removeEventListener("mouseup",this.mouseup)),this.inputManager.removeEventListener("keydown",this.keydown),this.viewer.controls.mouseButtons.left=this.tempKey,this.viewer.controls.keys=this.tempArrowKeys,this.viewer.controls.touches.one=this.tempTouch,this.textInput&&(this.textInput.onkeydown=null),this.textInput&&(this.textInput.onkeyup=null),this.textInput&&(this.textInput.onblur=null),this.textInput&&this.textInput.remove(),this.textInput=void 0,this.textInitialPosition=void 0,this.mouseDown=!1,this.tempPoints=[],this.isDrawing=!1,this.creatingShape=void 0,this.selectedShape&&(this.selectedShape.selected=!1,this.selectedShape=void 0)}getActiveMarkupType(){return this.type}setDrawType(e){this.type=e,this.reset()}setLineWidth(e){this.lineWidth=e}getLineWidth(){return this.lineWidth}setLineColor(e){this.lineColor=e}getLineColor(){return this.lineColor}setFillColor(e){this.fillColor=e}getFillColor(){return this.fillColor}setFontSize(e){this.fontSize=e}getFontSize(){return this.fontSize}pickPositionByScreenPoint(e){let t=new D,i=xi.screenPoint2NdcPoint(e,this.camera,this.viewerCanvas);this.raycaster.layers.set(10),this.raycaster.setFromCamera(i,this.camera);let r=this.viewer.scene,n=this.raycaster.intersectObject(this.viewer.groundPlane||r)||[];return n.length>0&&t.copy(n[0].point),t}pickThreejsPositionByMouse(e){return this.pickPositionByScreenPoint(new ce(e.x,e.y))}confirmToRemove(e){var t;this.selectedShape&&e&&(this.removeMarkup(this.selectedShape),null==(t=this.viewer.undoRedoManager)||t.addCommand(new n0(this,this.selectedShape.getData())),this.selectedShape=void 0)}isEditing(){return!!this.initialDataForEditing}endEdit(e){var t;if(!this.initialDataForEditing)return;let i=e.getData();this.viewer.dispatchEvent("MarkupUpdated",{oldData:this.initialDataForEditing,newData:i}),this.dispatchEvent("EndEdit",e),null==(t=this.viewer.undoRedoManager)||t.addCommand(new CA(this,this.initialDataForEditing,i)),this.initialDataForEditing=void 0}endDraw(e){var t;if("PolylineMarkup"===this.type&&this.creatingShape&&(this.tempPoints.length<2?(this.removeMarkup(this.creatingShape,!1),this.creatingShape=void 0):this.creatingShape.update(this.tempPoints)),e){let i=e.getData();this.viewer.dispatchEvent("MarkupAdded",i),null==(t=this.viewer.undoRedoManager)||t.addCommand(new dI(this,i))}this.dispatchEvent("EndDraw",e),this.reset()}cancelDraw(e){e&&this.removeMarkup(e,!1),this.reset()}reset(){this.textInput&&(this.textInput.style.display="none",this.textInput.value=""),this.textInitialPosition=void 0,this.tempPoints=[],this.isDrawing=!1,this.creatingShape=void 0,this.mouseDownPositionX=void 0,this.mouseDownPositionY=void 0,this.selectedShape&&(this.selectedShape.selected=!1,this.selectedShape=void 0),this.render()}render(){var e;null==(e=this.overlayRender)||e.render()}addMarkup(e,t=!0){this.drawableList.addDrawable(e),this.render(),t&&this.viewer.dispatchEvent("MarkupAdded",e.getData())}updateMarkup(e,t,i=!0){this.drawableList.updateDrawable(e,t),this.render(),i&&this.viewer.dispatchEvent("MarkupUpdated",{oldData:e.getData(),newData:t})}removeMarkup(e,t=!0){this.drawableList.removeDrawable(e),this.render(),t&&this.viewer.dispatchEvent("MarkupRemoved",e.getData())}removeMarkupById(e){let t=this.getMarkupById(e);return!!t&&(this.drawableList.removeDrawable(t),this.render(),!0)}createMarkup(e){return Rr.createDrawable(e)}getMarkupById(e){return this.drawableList.getDrawableById(e)}getMarkupData(){return this.drawableList.getDrawableDatas()}setMarkupData(e){var t,i;null==(t=this.viewer.undoRedoManager)||t.startTransaction(),e.forEach((e=>{var t;this.addMarkup(this.createMarkup(e)),null==(t=this.viewer.undoRedoManager)||t.addCommand(new dI(this,e))})),null==(i=this.viewer.undoRedoManager)||i.endTransaction(),this.render()}isCreateLineMode(){return["PolylineMarkup","CloudLineMarkup"].includes(this.type)}isCreateDotMode(){return["DotMarkup"].includes(this.type)}isCreateTextMode(){return["TextMarkup"].includes(this.type)}isCreateShapeMode(){return["XMarkup","RectMarkup","CloudRectMarkup","CircleMarkup","EllipseMarkup","ArrowMarkup","DotMarkup"].includes(this.type)}drawShape(e,t){let i=[[e.x,e.y]];return t&&i.push([t.x,t.y]),Rr.createDrawable({id:Tt.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,type:this.type,points:i})}drawLine(e){return Rr.createDrawable({id:Tt.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,type:this.type,points:e.map((e=>[e.x,e.y]))})}drawText(e,t){return Rr.createDrawable({id:Tt.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,fontSize:this.fontSize*this.viewer.getPixelSizeInWorldCoord(),type:this.type,text:t,points:[[e.x,e.y]]})}addInput(e,t){var i;if(!this.textInput){let e,t=document.createElement("textarea");t.style.cssText=`\n position: fixed;\n border: 1px solid red;\n background: transparent;\n outline: none;\n resize: none;\n overflow: hidden;\n z-index: 1000;\n box-sizing: content-box;\n padding: 0px 2px;\n color: ${this.lineColor}`,t.setAttribute("wrap","off"),t.onkeydown=e=>{if("Enter"===e.key){let e=parseInt(t.style.height);t.style.height=`${e+this.fontSize}px`}this.isDrawing=!0},t.onkeyup=t=>{var i;let r=t.target.value,n=(null==(i=this.overlayRender)?void 0:i.measureTextLength(r,`${this.fontSize}px Arial`))||0;n>50&&(e&&clearTimeout(e),e=setTimeout((()=>{t.target.style.width=`${n+4}px`}),0))},t.onblur=e=>{let t=e.target.value;if(t.length>0&&this.textInitialPosition){let e=this.creatingShape=this.drawText(this.textInitialPosition,t);e.setTolerance(this.viewer.getPixelSizeInWorldCoord()),this.addMarkup(e,!1),this.endDraw(this.creatingShape)}},null==(i=this.viewer.viewerContainer)||i.appendChild(t),this.textInput=t}setTimeout((()=>{var e,t;null==(e=this.textInput)||e.blur(),null==(t=this.textInput)||t.focus()}),0),this.textInput.style.width="50px",this.textInput.style.height=`${this.fontSize}px`,this.textInput.style.lineHeight=`${this.fontSize}px`,this.textInput.style.fontSize=`${this.fontSize}px`,this.textInput.style.color=this.lineColor,this.textInput.style.display="inline-block",this.textInput.style.left=e+4+"px",this.textInput.style.top=t-this.fontSize+"px"}destroy(){this.deactivate(),this.clearAll()}},Lfe=new D,s0=class extends Ys{constructor(e,t){super(e),this.lineSegments=[],this.boxes=t,this.lineColor="red",this.lineWidth=2,this.calculateCloudLineSegments(t)}calculateCloudLineSegments(e){var t;for(let i=0;i<e.length;i++){let r=e[i],n=[new D(r.min.x,r.min.y),new D(r.max.x,r.min.y),new D(r.max.x,r.max.y),new D(r.min.x,r.max.y),new D(r.min.x,r.min.y)],s=Lfe.subVectors(n[0],n[2]).length()/10||1e-4,a=[];for(let e=0;e<n.length-1;e++){let t=n[e],i=n[e+1],r=Lfe.subVectors(i,t),o=r.length(),l=r.normalize(),h=Math.ceil(o/s);for(let e=0;e<h;e++)a.push(t.clone().add(l.clone().multiplyScalar(s*e)))}a.push(a[0]),null==(t=this.lineSegments)||t.push(a)}}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor;for(let i=0;i<this.lineSegments.length;i++){let r=this.lineSegments[i];this.drawBox(e,t,r)}}drawBox(e,t,i){e.beginPath();for(let r=0;r<i.length-1;r++){let n=this.transToScreenCoord(i[r],t),s=this.transToScreenCoord(i[r+1],t),a=Zp.getControlPointByTwoPoints(s,n);0===r&&e.moveTo(n.x,n.y),e.quadraticCurveTo(a.x,a.y,s.x,s.y)}e.stroke()}drawSelect(e,t){throw new Error("Method not implemented.")}isPointInPath(e){return!1}getBounds(){let e=new Rt;for(let t=0;t<this.boxes.length;t++){let i=this.boxes[t];e.union(i)}return e}getClassType(){return"CompareDrawable"}};Rr._registerDrawableClass(s0);var AA="BYLAYER",$k="BYBLOCK",Ffe=(e=>(e[e.Mesh=-1]="Mesh",e[e.MeshWithPattern=0]="MeshWithPattern",e[e.LineWithWidth=1]="LineWithWidth",e[e.Line=2]="Line",e[e.LineWithPattern=3]="LineWithPattern",e[e.Point=4]="Point",e[e.Text=5]="Text",e))(Ffe||{}),a0=["INSERT","DIMENSION"],Lar=ps(Gfe(),1),OA=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215],CE=class{constructor(){this.pointer=0,this.eof=!1}},Jk=ps(Vfe(),1),Bf=class{constructor(e,t){this.endian=t&&"big"===t?"big":"little",this.position=0,this.data=new DataView(e)}readAsciiString(e){if(this.data.byteLength<this.position+e)throw"range error";let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(this.data.getInt8(this.position+i));return this.position+=e,t}readUtf8String(e){let t=this.readBytes(e);return this.decoder||(this.decoder=new TextDecoder("utf-8")),this.decoder.decode(t)}readBytes(e=1){if(this.data.byteLength<this.position+e)throw"range error";let t=new Uint8Array(e);for(let i=0;i<e;i++)t[i]=this.data.getUint8(this.position+i);return this.position+=e,t}readUint8(){if(this.data.byteLength<this.position+1)throw"range error";let e=this.data.getUint8(this.position);return this.position+=1,e}readInt8(){if(this.data.byteLength<this.position+1)throw"range error";let e=this.data.getInt8(this.position);return this.position+=1,e}readUint16(){if(this.data.byteLength<this.position+2)throw"range error";let e=this.data.getUint16(this.position,"little"===this.endian);return this.position+=2,e}readInt16(){if(this.data.byteLength<this.position+2)throw"range error";let e=this.data.getInt16(this.position,"little"===this.endian);return this.position+=2,e}readUint32(){if(this.data.byteLength<this.position+4)throw"range error";let e=this.data.getUint32(this.position,"little"===this.endian);return this.position+=4,e}readInt32(){if(this.data.byteLength<this.position+4)throw"range error";let e=this.data.getInt32(this.position,"little"===this.endian);return this.position+=4,e}readFloat32(){if(this.data.byteLength<this.position+4)throw"range error";let e=this.data.getFloat32(this.position,"little"===this.endian);return this.position+=4,e}readFloat64(){if(this.data.byteLength<this.position+8)throw"range error";let e=this.data.getFloat64(this.position,"little"===this.endian);return this.position+=8,e}readInt64(){if(this.data.byteLength<this.position+8)throw"range error";let e=Jk.default.DataViewGetBigInt64(this.data,this.position,"little"===this.endian);return this.position+=8,e}readUint64(){if(this.data.byteLength<this.position+8)throw"range error";let e=Jk.default.DataViewGetBigUint64(this.data,this.position,"little"===this.endian);return this.position+=8,e}getPosition(){return this.position}setPosition(e){if(this.data.byteLength<e)throw"range error";this.position=e}isEnd(){return this.position===this.data.byteLength-1}},zfe=1e3,vI=class extends CE{constructor(e){super(),this.int8Array=new Int8Array(zfe),this.caches=new Map,this.reader=new Bf(e);let t=this.reader.readBytes(22),i="";for(let r=0;r<18;r++)i+=String.fromCharCode(t[r]);if("AutoCAD Binary DXF"!=i)throw new Error("Invalid DXF file")}next(){if(!this.hasNext())throw this.eof?new Error("Cannot call 'next' after EOF group has been read"):new Error("Unexpected end of input: EOF group not read before end of file.");let e={code:this.reader.readInt16()};return e.value=this.parseGroupValue(e.code),0===e.code&&"EOF"===e.value&&(this.eof=!0),this.lastReadGroup=e,e}hasNext(){return!this.eof&&!this.reader.isEnd()}isEOF(){return this.eof}parseGroupValue(e){if(e>=0&&e<=9)return this.readNullTerminatedString();if(e>=10&&e<=59)return this.reader.readFloat64();if(e>=60&&e<=79)return this.reader.readInt16();if(e>=90&&e<=99)return this.reader.readInt32();if(e>=100&&e<=109)return this.readNullTerminatedString();if(e>=110&&e<=149)return this.reader.readFloat64();if(e>=160&&e<=169)return this.reader.readInt64();if(e>=170&&e<=179)return this.reader.readInt16();if(e>=210&&e<=239)return this.reader.readFloat64();if(e>=270&&e<=289)return this.reader.readInt16();if(e>=290&&e<=299)return this.reader.readInt8()>0;if(e>=300&&e<=309)return this.readNullTerminatedString();if(e>=310&&e<=319)return jfe(this.ReadBinaryData());if(e>=320&&e<=369)return this.readNullTerminatedString();if(e>=370&&e<=389)return this.reader.readInt16();if(e>=390&&e<=399)return this.readNullTerminatedString();if(e>=400&&e<=409)return this.reader.readInt16();if(e>=410&&e<=419)return this.readNullTerminatedString();if(e>=420&&e<=429)return this.reader.readInt32();if(e>=430&&e<=439)return this.readNullTerminatedString();if(e>=440&&e<=459)return this.reader.readInt32();if(e>=460&&e<=469)return this.reader.readFloat64();if(e>=470&&e<=481)return this.readNullTerminatedString();if(999===e)throw new Error("The comment group 999, is not used in binary DXF files at byte address!");return 1004===e?jfe(this.ReadBinaryData()):e>=1e3&&e<=1009?this.readNullTerminatedString():e>=1010&&e<=1059?this.reader.readFloat64():e>=1060&&e<=1070?this.reader.readInt16():1071===e?this.reader.readInt32():void re.warn(`[DxfBinReader] Invalid code '${e}' at byte address ${this.reader.getPosition()}`)}readNullTerminatedString(){var e;this.decoder||(this.decoder=new TextDecoder("utf-8"));let t=0,i=this.reader.readInt8();for(;0!==i;)this.int8Array[t++]=i,i=this.reader.readInt8();if(0===t)return"";if(t>zfe)return re.warn(`[DxfBinReader] Failed to read string! The number of bytes is ${t} !`),"";let r=this.int8Array.subarray(0,t),n=r.toString();if(this.caches.get(n))return this.caches.get(n);let s=null==(e=this.decoder)?void 0:e.decode(r);return this.caches.set(n,s),s}ReadBinaryData(){let e=this.reader.readUint8();return this.reader.readBytes(e)}};function jfe(e){return Array.prototype.map.call(e,(e=>("00"+e.toString(16)).slice(-2))).join("")}var AE=class extends CE{constructor(e){super(),this.data=e}next(){if(!this.hasNext())throw this.eof?new Error("Cannot call 'next' after EOF group has been read"):new Error("Unexpected end of input: EOF group not read before end of file. Ended on code "+this.data[this.pointer]);let e={code:parseInt(this.data[this.pointer])};return this.pointer++,e.value=Lbt(e.code,this.data[this.pointer].trim()),this.pointer++,0===e.code&&"EOF"===e.value&&(this.eof=!0),this.lastReadGroup=e,e}hasNext(){return!(this.eof||this.pointer>this.data.length-2)}isEOF(){return this.eof}};function Lbt(e,t){return e>=0&&e<=9?t:e>=10&&e<=59?parseFloat(t):e>=60&&e<=99?parseInt(t):e>=100&&e<=109?t:e>=110&&e<=149?parseFloat(t):e>=160&&e<=179?parseInt(t):e>=210&&e<=239?parseFloat(t):e>=270&&e<=289?parseInt(t):e>=290&&e<=299?Fbt(t):e>=300&&e<=369?t:e>=370&&e<=389?parseInt(t):e>=390&&e<=399?t:e>=400&&e<=409?parseInt(t):e>=410&&e<=419?t:e>=420&&e<=429?parseInt(t):e>=430&&e<=439?t:e>=440&&e<=459?parseInt(t):e>=460&&e<=469?parseFloat(t):e>=470&&e<=481||999===e||e>=1e3&&e<=1009?t:e>=1010&&e<=1059?parseFloat(t):e>=1060&&e<=1071?parseInt(t):(re.info("WARNING: Group code does not have a defined type: %j",{code:e,value:t}),t)}function Fbt(e){if("0"===e)return!1;if("1"===e)return!0;throw TypeError("String '"+e+"' cannot be cast to Boolean type")}var Yfe=ps(Zc(),1),Hbt="OriginalHandle",Ubt="OriginalType",Bbt="Outlines",Wfe=["PROXY","REGION","INSERT","HATCH"];function o0(e){return OA[e]}function ht(e){let t={},i=e.lastReadGroup,r=i.code;if(t.x=i.value,r+=10,i=e.next(),i.code!=r)throw new Error(`Expected code for point value to be ${r} but got ${i.code}`);return t.y=i.value,r+=10,i=e.next(),i.code!=r||(t.z=i.value,e.next()),t}function qfe(e,t){let i=e.lastReadGroup,r=[];for(let n=0;n<16;n++){if(i.code!==t)throw new Error(`Expected code for matrix value to be ${t} but got ${i.code}`);r.push(i.value),i=e.next()}return r}function hr(e,t){switch(t.code){case 0:e.type=t.value;break;case 5:e.handle=t.value;break;case 6:e.lineType=t.value.toUpperCase();break;case 8:e.layer=t.value;break;case 48:e.lineTypeScale=t.value,e.lineTypeScale<=0&&(e.lineTypeScale=1);break;case 60:e.visible=0===t.value;break;case 62:e.isTrueColor||(e.colorIndex=t.value,e.colorIndex<0&&re.warn("[DxfParser] a negative value of colorIndex indicates that the layer is turned off"),e.color=o0(Math.abs(t.value)));break;case 67:e.inPaperSpace=0!==t.value;break;case 100:case 1001:break;case 330:e.ownerHandle=t.value;break;case 347:e.materialObjectHandle=t.value;break;case 370:e.lineweight=t.value;break;case 410:e.layoutName=t.value;break;case 420:e.isTrueColor=!0,e.color=t.value;break;case 1e3:if(t.value&&t.value.includes(Hbt)){let i=t.value.split(":").map((e=>e.trim()));e.extendedData||(e.extendedData={}),e.extendedData.originalHandle=i[1]}if(e.extendedData&&e.extendedData.outlines)try{e.extendedData.outlines=JSON.parse(t.value||"[]")}catch(t){e.extendedData.outlines=void 0}if(t.value&&t.value.includes(Bbt)&&(e.extendedData||(e.extendedData={}),e.extendedData.outlines=[]),t.value&&t.value.includes(Ubt)){let i=t.value.split(":").map((e=>e.trim()));e.extendedData||(e.extendedData={}),e.extendedData.originalType=i[1]}break;default:return!1}return!0}function Zl(e,t){switch(t.code){case 0:e.type=t.value;break;case 5:e.handle=t.value;break;case 330:e.ownerHandle=t.value;break;case 1e3:case 1001:break;default:return!1}return!0}var EI=class{constructor(){this.ForEntityName="3DFACE"}parseEntity(e,t){let i={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 70:if(0!==t.value){let e=Math.log2(t.value)-1;i.vertices.splice(e,1)}t=e.next();break;case 10:i.vertices=kbt(e,t),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}};function kbt(e,t){let i=[],r=!1,n=!1;for(let s=0;s<=4;s++){let s={};for(;!e.isEOF()&&0!==t.code&&!n;){switch(t.code){case 10:case 11:case 12:case 13:if(r){n=!0;continue}s.x=t.value,r=!0;break;case 20:case 21:case 22:case 23:s.y=t.value;break;case 30:case 31:case 32:case 33:s.z=t.value;break;default:return i}t=e.next()}(0,Yfe.isEmpty)(s)||i.push(s),r=!1,n=!1}return i}var TI=class{constructor(){this.ForEntityName="ARC"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.center=ht(e),t=e.lastReadGroup;break;case 40:i.radius=t.value,t=e.next();break;case 50:i.startAngle=Math.PI/180*t.value,t=e.next();break;case 51:i.endAngle=Math.PI/180*t.value,i.angleLength=i.endAngle-i.startAngle,t=e.next();break;case 210:i.extrusionDirectionX=t.value,t=e.next();break;case 220:i.extrusionDirectionY=t.value,t=e.next();break;case 230:i.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},bI=class{constructor(){this.ForEntityName="ATTDEF"}parseEntity(e,t){let i={type:t.value,xScale:1,textStyle:"STANDARD"};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 1:i.text=t.value,t=e.next();break;case 2:i.tag=t.value,t=e.next();break;case 3:i.prompt=t.value,t=e.next();break;case 7:i.textStyle=t.value,t=e.next();break;case 10:i.startPoint=ht(e),t=e.lastReadGroup;break;case 11:i.endPoint=ht(e),t=e.lastReadGroup;break;case 39:i.thickness=t.value,t=e.next();break;case 40:i.textHeight=t.value,t=e.next();break;case 41:i.xScale=t.value,t=e.next();break;case 50:i.rotation=t.value,t=e.next();break;case 51:i.obliqueAngle=t.value,t=e.next();break;case 70:i.invisible=!!(1&t.value),i.constant=!!(2&t.value),i.verificationRequired=!!(4&t.value),i.preset=!!(8&t.value),t=e.next();break;case 71:i.backwards=!!(2&t.value),i.mirrored=!!(4&t.value),t=e.next();break;case 72:i.horizontalJustification=t.value,t=e.next();break;case 73:i.fieldLength=t.value,t=e.next();break;case 74:i.verticalJustification=t.value,t=e.next();break;case 100:t=e.next();break;case 210:i.extrusionDirectionX=t.value,t=e.next();break;case 220:i.extrusionDirectionY=t.value,t=e.next();break;case 230:i.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},xI=class{constructor(){this.ForEntityName="ATTRIB"}parseEntity(e,t){let i={type:t.value,xScale:1,textStyle:"STANDARD"};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 1:i.text=t.value,t=e.next();break;case 2:i.tag=t.value,t=e.next();break;case 3:i.prompt=t.value,t=e.next();break;case 7:i.textStyle=t.value,t=e.next();break;case 10:i.startPoint=ht(e),t=e.lastReadGroup;break;case 11:i.endPoint=ht(e),t=e.lastReadGroup;break;case 39:i.thickness=t.value,t=e.next();break;case 40:i.textHeight=t.value,t=e.next();break;case 41:i.xScale=t.value,t=e.next();break;case 50:i.rotation=t.value,t=e.next();break;case 51:i.obliqueAngle=t.value,t=e.next();break;case 70:i.invisible=!!(1&t.value),i.constant=!!(2&t.value),i.verificationRequired=!!(4&t.value),i.preset=!!(8&t.value),t=e.next();break;case 71:i.backwards=!!(2&t.value),i.mirrored=!!(4&t.value),t=e.next();break;case 72:i.horizontalJustification=t.value,t=e.next();break;case 73:i.fieldLength=t.value,t=e.next();break;case 74:i.verticalJustification=t.value,t=e.next();break;case 100:t=e.next();break;case 210:i.extrusionDirectionX=t.value,t=e.next();break;case 220:i.extrusionDirectionY=t.value,t=e.next();break;case 230:i.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},II=class{constructor(){this.ForEntityName="CIRCLE"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.center=ht(e),t=e.lastReadGroup;break;case 40:i.radius=t.value,t=e.next();break;case 50:i.startAngle=Math.PI/180*t.value,t=e.next();break;case 51:let r=Math.PI/180*t.value;r<i.startAngle?i.angleLength=r+2*Math.PI-i.startAngle:i.angleLength=r-i.startAngle,i.endAngle=r,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},_I=class{constructor(){this.ForEntityName="DIMENSION"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 2:i.block=t.value,t=e.next();break;case 3:i.dimStyleName=t.value,t=e.next();break;case 10:i.anchorPoint=ht(e),t=e.lastReadGroup;break;case 11:i.middleOfText=ht(e),t=e.lastReadGroup;break;case 12:i.insertionPoint=ht(e),t=e.lastReadGroup;break;case 13:i.linearOrAngularPoint1=ht(e),t=e.lastReadGroup;break;case 14:i.linearOrAngularPoint2=ht(e),t=e.lastReadGroup;break;case 15:i.diameterOrRadiusPoint=ht(e),t=e.lastReadGroup;break;case 16:i.arcPoint=ht(e),t=e.lastReadGroup;break;case 70:i.dimensionType=t.value,t=e.next();break;case 71:i.attachmentPoint=t.value,t=e.next();break;case 42:i.actualMeasurement=t.value,t=e.next();break;case 1:i.text=t.value,t=e.next();break;case 50:i.angle=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},SI=class{constructor(){this.ForEntityName="ELLIPSE"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.center=ht(e),t=e.lastReadGroup;break;case 11:i.majorAxisEndPoint=ht(e),t=e.lastReadGroup;break;case 40:i.axisRatio=t.value,t=e.next();break;case 41:i.startAngle=t.value,t=e.next();break;case 42:i.endAngle=t.value,t=e.next();break;case 210:i.extrusionDirection=ht(e),t=e.lastReadGroup;break;case 2:i.name=t.value,t=e.next();break;default:hr(i,t),t=e.next()}return i}},l0=class{constructor(e){this.type=e}},Qk=class extends l0{constructor(){super(0),this.points=[],this.isClosed=!0}},eG=class extends l0{constructor(){super(1),this.startPoint={x:0,y:0,z:0},this.endPoint={x:0,y:0,z:0}}},tG=class extends l0{constructor(){super(2),this.center={x:0,y:0,z:0},this.radius=0,this.startAngle=0,this.endAngle=0,this.bCounterclockwise=!1}},rG=class extends l0{constructor(){super(3),this.center={x:0,y:0,z:0},this.majorAxisEndPoint={x:0,y:0,z:0},this.minorRatio=0,this.startAngle=0,this.endAngle=0,this.bCounterclockwise=!1}},iG=class extends l0{constructor(){super(4),this.controlPoints=[],this.numControlPoints=0,this.knotValues=[],this.numKnots=0,this.bPeriodic=!1,this.bRational=!1,this.degreeOfSplineCurve=0}},wI=class{constructor(){this.ForEntityName="HATCH"}parseEntity(e,t){let i={type:t.value,boundaryPaths:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 2:i.patternName=t.value,t=e.next();break;case 10:i.elevationX=t.value,t=e.next();break;case 20:i.elevationY=t.value,t=e.next();break;case 30:i.elevationZ=t.value,t=e.next();break;case 41:i.patternScale=t.value,t=e.next();break;case 47:i.pixelSize=t.value,t=e.next();break;case 52:i.patternAngle=t.value,t=e.next();break;case 63:i.patternFillColor=t.value,t=e.next();break;case 70:i.solidFill=0!=(1&t.value),t=e.next();break;case 71:i.associativity=0!=(1&t.value),t=e.next();break;case 73:i.annotatedBoundary=0!=(1&t.value),t=e.next();break;case 75:i.style=t.value,t=e.next();break;case 76:i.patternType=t.value,t=e.next();break;case 78:i.patternLines=jbt(t.value,e),t=e.lastReadGroup;break;case 91:i.boundaryPathsCount=t.value,i.boundaryPaths=zbt(i.boundaryPathsCount,e),t=e.lastReadGroup;break;case 98:i.seedPointsCount=t.value,t=e.next();break;case 210:i.extrusionDirectionX=t.value,t=e.next();break;case 220:i.extrusionDirectionY=t.value,t=e.next();break;case 230:i.extrusionDirectionZ=t.value,t=e.next();break;case 450:i.isGradientColor=1===t.value,t=e.next();break;case 451:case 452:case 460:case 461:case 462:case 463:case 470:t=e.next();break;case 453:i.gradientColorCount=t.value,i.gradientColors=Wbt(i.gradientColorCount,e),t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}};function Gbt(e){let t=new Qk,i=e.next(),r=0!==i.value;i=e.next(),t.isClosed=0!==i.value,i=e.next();let n=i.value;i=e.next();for(let a=0;a<n;a++){let n=ht(e);i=e.lastReadGroup,r&&(n.bulge=i.value,i=e.next()),t.points.push(n)}i=e.lastReadGroup,console.assert(97===i.code,"The reference count code 97 was expected.");let s=i.value;i=e.next();for(let a=0;a<s;a++)console.assert(330===i.code,"The reference handle code 330 was expected."),i=e.next();return{edges:[t],pathTypeFlag:-1}}function Vbt(e,t){let i=[],r=t.next();for(;i.length<e;)if(72===r.code)switch(r.value){case 1:{r=t.next();let e=new eG;e.startPoint=ht(t),e.endPoint=ht(t),r=t.lastReadGroup,i.push(e);break}case 2:{r=t.next();let e=new tG;e.center=ht(t),r=t.lastReadGroup,e.radius=r.value,r=t.next(),e.startAngle=r.value,r=t.next(),e.endAngle=r.value,r=t.next(),e.bCounterclockwise=0!==r.value,r=t.next(),i.push(e);break}case 3:{r=t.next();let e=new rG;e.center=ht(t),e.majorAxisEndPoint=ht(t),r=t.lastReadGroup,e.minorRatio=r.value,r=t.next(),e.startAngle=r.value,r=t.next(),e.endAngle=r.value,r=t.next(),e.bCounterclockwise=0!==r.value,r=t.next(),i.push(e);break}case 4:{r=t.next();let e=new iG;e.degreeOfSplineCurve=r.value,r=t.next(),e.bRational=0!==r.value,r=t.next(),e.bPeriodic=0!==r.value,r=t.next(),e.numKnots=r.value,r=t.next(),e.numControlPoints=r.value,r=t.next();for(let i=0;i<e.numKnots;i++)e.knotValues.push(r.value),r=t.next();for(let i=0;i<e.numControlPoints;i++){let i=r.value;r=t.next();let n=r.value,s=1;r=t.next(),42===r.code&&(s=r.value,r=t.next()),e.controlPoints.push({x:i,y:n,z:s})}i.push(e);break}default:r=t.next()}else r=t.next();r=t.lastReadGroup,console.assert(97===r.code,"The reference count code 97 was expected.");let n=r.value;r=t.next();for(let s=0;s<n;s++)console.assert(330===r.code,"The reference handle code 330 was expected."),r=t.next();return{edges:i,pathTypeFlag:-1}}function zbt(e,t){let i=[],r=-1,n=t.next();for(;i.length<e;){let e;switch(n.code){case 92:if(r=n.value,2&r){if(e=Gbt(t),!e)throw new Error("[Hatch] Failed to parse hatch polyline boundary path !");e.pathTypeFlag=r,i.push(e),n=t.lastReadGroup}else n=t.next();break;case 93:e=Vbt(n.value,t),e.pathTypeFlag=r,i.push(e),n=t.lastReadGroup;break;default:n=t.next()}}return i}function jbt(e,t){if(e<=0)return;let i=[],r=t.next();for(let n=0;n<e;n++){let e=0,n={x:0,y:0},s={x:0,y:0},a=-1,o=[];for(;!t.isEOF()&&0!==r.code;){let i=!1;switch(r.code){case 53:e=r.value;break;case 43:n.x=r.value;break;case 44:n.y=r.value;break;case 45:s.x=r.value;break;case 46:s.y=r.value;break;case 79:a=r.value;break;case 49:o.push(r.value);break;default:i=!0}if(r=t.next(),i||o.length===a)break}a>=0&&i.push({angle:e,origin:n,delta:s,dashPattern:o})}return i}function Wbt(e,t){let i=[],r=t.next();for(;i.length<e;)switch(r.code){case 63:default:r=t.next();break;case 421:i.push(r.value),r=t.next()}return i}var RI=class{constructor(){this.ForEntityName="IMAGE"}parseEntity(e,t){let i={type:t.value,clippingBoundaryPath:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.position=ht(e),t=e.lastReadGroup;break;case 11:i.uPixel=ht(e),t=e.lastReadGroup;break;case 12:i.vPixel=ht(e),t=e.lastReadGroup;break;case 13:i.imageSize=ht(e),t=e.lastReadGroup;break;case 340:i.imageDefHandle=t.value,t=e.next();break;case 70:i.flags=t.value,t=e.next();break;case 280:i.clipping=t.value,t=e.next();break;case 281:i.brightness=t.value,t=e.next();break;case 282:i.contrast=t.value,t=e.next();break;case 283:i.fade=t.value,t=e.next();break;case 360:i.imageDefReactorHandle=t.value,t=e.next();break;case 71:i.clippingBoundaryType=t.value,t=e.next();break;case 91:i.countBoundaryPoints=t.value,t=e.next();break;case 14:i.clippingBoundaryPath.push(ht(e)),t=e.lastReadGroup;break;case 290:i.clipMode=t.value,t=e.next();default:hr(i,t),t=e.next()}return i}},MI=class{constructor(){this.ForEntityName="INSERT"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 2:i.block=t.value,t=e.next();break;case 66:i.attributesFollow=0!=t.value,t=e.next();break;case 41:i.xScale=t.value,t=e.next();break;case 42:i.yScale=t.value,t=e.next();break;case 43:i.zScale=t.value,t=e.next();break;case 10:i.position=ht(e),t=e.lastReadGroup;break;case 50:i.rotation=t.value,t=e.next();break;case 70:i.columnCount=t.value,t=e.next();break;case 71:i.rowCount=t.value,t=e.next();break;case 44:i.columnSpacing=t.value,t=e.next();break;case 45:i.rowSpacing=t.value,t=e.next();break;case 210:i.extrusionDirection=ht(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},DI=class{constructor(){this.ForEntityName="LEADER"}parseEntity(e,t){let i={type:t.value,arrowFlag:1,vertices:[]};t=e.next();let r=!1;for(;!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.vertices.push(ht(e)),t=e.lastReadGroup;break;case 3:i.dimensionStyle=t.value,t=e.next();break;case 40:i.textHeight=t.value,t=e.next();break;case 41:i.textWidth=t.value,t=e.next();break;case 71:i.arrowFlag=t.value,t=e.next();break;case 72:i.pathType=t.value,t=e.next();break;case 73:i.creationFlag=t.value,t=e.next();break;case 74:i.direction=t.value,t=e.next();break;case 75:i.hasHookline=1===t.value,t=e.next();break;case 1001:r="ACAD"===t.value,t=e.next();break;case 1070:if(r){let r=qbt(t.value);r&&(1005==(t=e.next()).code||1040==t.code||1070==t.code)&&("DIMLDRBLK"===r&&(i.arrowHeadBlockHandle=t.value),"DIMASZ"===r&&(i.arrowHeight=t.value),"DIMSCALE"===r&&(i.arrowHeadScale=t.value),"DIMCLRD"===r&&t.value>0&&(i.colorIndex=t.value,i.color=o0(Math.abs(t.value))))}t=e.next();break;default:hr(i,t),t=e.next()}return i}};function qbt(e){switch(e){case 40:return"DIMSCALE";case 41:return"DIMASZ";case 42:return"DIMEXO";case 44:return"DIMEXE";case 75:return"DIMSE1";case 76:return"DIMSE2";case 77:return"DIMTAD";case 140:return"DIMTXT";case 144:return"DIMLFAC";case 147:return"DIMGAP";case 176:return"DIMCLRD";case 178:return"DIMCLRT";case 271:return"DIMDEC";case 341:return"DIMLDRBLK";default:return null}}var CI=class{constructor(){this.ForEntityName="LINE"}parseEntity(e,t){let i={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.vertices.unshift(ht(e)),t=e.lastReadGroup;break;case 11:i.vertices.push(ht(e)),t=e.lastReadGroup;break;case 210:i.extrusionDirection=ht(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},AI=class{constructor(){this.ForEntityName="LWPOLYLINE"}parseEntity(e,t){let i={type:t.value,vertices:[]},r=0;for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 38:i.elevation=t.value,t=e.next();break;case 39:i.thickness=t.value,t=e.next();break;case 70:i.shape=1==(1&t.value),i.hasContinuousLinetypePattern=128==(128&t.value),t=e.next();break;case 90:r=t.value,t=e.next();break;case 10:i.vertices.push(...Ybt(r,e)),t=e.lastReadGroup;break;case 43:0!==t.value&&(i.constantWidth=t.value),t=e.next();break;case 210:i.extrusionDirectionX=t.value,t=e.next();break;case 220:i.extrusionDirectionY=t.value,t=e.next();break;case 230:i.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}};function Ybt(e,t){if(!e||e<=0)throw Error("n must be greater than 0 verticies");let i=[],r=!1,n=!1,s=t.lastReadGroup,a={};for(;!t.isEOF()&&0!==s.code&&!n;)switch(s.code){case 10:if(r){n=!0;continue}a.x=s.value,r=!0,s=t.next();break;case 20:a.y=s.value,s=t.next();break;case 30:a.z=s.value,s=t.next();break;case 40:a.startWidth=s.value,s=t.next();break;case 41:a.endWidth=s.value,s=t.next();break;case 42:0!=s.value&&(a.bulge=s.value),s=t.next();break;default:return r&&i.push(a),i}return i.push(a),r=!1,n=!1,i}var OI=class{constructor(){this.ForEntityName="MULTILEADER"}parseEntity(e,t){let i={type:t.value};function r(){for(;!e.isEOF();)switch(t.code){case 40:i.contextData.contentScale=t.value,t=e.next();break;case 10:i.contextData.contentBasePosition=ht(e),t=e.lastReadGroup;break;case 145:i.contextData.landingGap=t.value,t=e.next();break;case 290:i.contextData.hasMText=t.value,t=e.next();break;case 304:i.contextData.defaultTextContents=t.value,t=e.next();break;case 11:i.contextData.textNormalDirection=ht(e),t=e.lastReadGroup;break;case 12:i.contextData.textLocation=ht(e),t=e.lastReadGroup;break;case 13:i.contextData.textDirection=ht(e),t=e.lastReadGroup;break;case 140:i.contextData.arrowHeadSize=t.value,t=e.next();break;case 41:i.contextData.textHeight=t.value,t=e.next();break;case 42:i.contextData.textRotation=t.value,t=e.next();break;case 43:i.contextData.textWidth=t.value,t=e.next();break;case 44:default:t=e.next();break;case 45:i.contextData.textLineSpacingFactor=t.value,t=e.next();break;case 90:i.contextData.textColor=t.value,t=e.next();break;case 170:i.contextData.textLineSpacingStyle=t.value,t=e.next();break;case 171:i.contextData.textAttachment=t.value,t=e.next();break;case 172:i.contextData.textFlowDirection=t.value,t=e.next();break;case 141:i.contextData.textBackgroundScaleFactor=t.value,t=e.next();break;case 92:i.contextData.textBackgroundTransparency=t.value,t=e.next();break;case 291:i.contextData.textBackgroundColorOn=t.value,t=e.next();break;case 292:i.contextData.textBackgroundFillOn=t.value,t=e.next();break;case 293:i.contextData.textUseAutoHeight=t.value,t=e.next();break;case 173:i.contextData.textColumnType=t.value,t=e.next();break;case 142:i.contextData.textColumnWidth=t.value,t=e.next();break;case 143:i.contextData.textColumnGutterWidth=t.value,t=e.next();break;case 144:i.contextData.textColumnHeight=t.value,t=e.next();break;case 295:i.contextData.textUseWordBreak=t.value,t=e.next();break;case 296:i.contextData.hasBlock=t.value,t=e.next();break;case 341:i.contextData.blockContentId=t.value,t=e.next();break;case 14:i.contextData.blockContentNormalDirection=ht(e),t=e.lastReadGroup;break;case 15:i.contextData.blockContentPosition=ht(e),t=e.lastReadGroup;break;case 16:i.contextData.blockContentScale=t.value,t=e.next();break;case 46:i.contextData.blockContentRotation=t.value,t=e.next();break;case 93:i.contextData.blockContentColor=t.value,t=e.next();break;case 47:i.contextData.blockTransformationMatrix=qfe(e,47),t=e.lastReadGroup;break;case 110:i.contextData.planeOriginPoint=ht(e),t=e.lastReadGroup;break;case 111:i.contextData.planeXAxisDirection=ht(e),t=e.lastReadGroup;break;case 112:i.contextData.planeYAxisDirection=ht(e),t=e.lastReadGroup;break;case 297:i.contextData.planeNormalReversed=t.value,t=e.next();break;case 301:return;case 302:n(),t=e.lastReadGroup}}function n(){let r={leaderLines:[]};for(i.contextData.leaders.push(r);!e.isEOF();)switch(t.code){case 290:r.hasSetLastLeaderLinePoint=t.value,t=e.next();break;case 291:r.hasSetDoglegVector=t.value,t=e.next();break;case 10:r.lastLeaderLinePoint=ht(e),t=e.lastReadGroup;break;case 11:r.doglegVector=ht(e),t=e.lastReadGroup;break;case 90:r.leaderBranchIndex=t.value,t=e.next();break;case 40:r.doglegLength=t.value,t=e.next();break;case 303:return;case 304:s(),t=e.lastReadGroup;break;default:t=e.next()}}function s(){let r={vertices:[[]]};for(i.contextData.leaders[i.contextData.leaders.length-1].leaderLines.push(r);!e.isEOF();)switch(t.code){case 10:r.vertices[0].push(ht(e)),t=e.lastReadGroup;break;case 305:return;default:t=e.next()}}return i.contextData={leaders:[]},t=e.next(),function(){for(;!e.isEOF();)switch(t.code){case 0:return;case 340:i.leaderStyleId=t.value,t=e.next();break;case 170:i.leaderLineType=t.value,t=e.next();break;case 91:i.leaderLineColor=t.value,t=e.next();break;case 341:i.leaderLineTypeId=t.value,t=e.next();break;case 171:i.leaderLineWeight=t.value,t=e.next();break;case 41:i.doglegLength=t.value,t=e.next();break;case 290:i.enableLanding=t.value,t=e.next();break;case 291:i.enableDogLeg=t.value,t=e.next();break;case 342:i.arrowHeadId=t.value,t=e.next();break;case 42:i.arrowHeadSize=t.value,t=e.next();break;case 172:i.contentType=t.value,t=e.next();break;case 173:case 95:i.textLeftAttachmentType=t.value,t=e.next();break;case 174:i.textAngleType=t.value,t=e.next();break;case 175:i.textAlignmentType=t.value,t=e.next();break;case 343:i.textStyleId=t.value,t=e.next();break;case 92:i.textColor=t.value,t=e.next();break;case 292:i.enableFrameText=t.value,t=e.next();break;case 344:i.blockContentId=t.value,t=e.next();break;case 93:i.blockContentColor=t.value,t=e.next();break;case 10:i.blockContentScale=ht(e),t=e.lastReadGroup;break;case 43:i.blockContentRotation=t.value,t=e.next();break;case 176:i.blockContentConnectionType=t.value,t=e.next();break;case 293:i.enableAnotationScale=t.value,t=e.next();break;case 94:i.arrowHeadIndex=t.value,t=e.next();break;case 177:i.blockAttributeIndex=t.value,t=e.next();break;case 44:i.blockAttributeWidth=t.value,t=e.next();break;case 302:i.blockAttributeTextString=t.value,t=e.next();break;case 294:i.textDirectionNegative=t.value,t=e.next();break;case 178:i.textAlignInIPE=t.value,t=e.next();break;case 179:i.textAttachmentPoint=t.value,t=e.next();break;case 271:i.textAttachmentDirectionMText=t.value,t=e.next();break;case 272:i.textAttachmentDirectionBottom=t.value,t=e.next();break;case 273:i.textAttachmentDirectionTop=t.value,t=e.next();break;case 300:r(),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}}(),i}},PI=class{constructor(){this.ForEntityName="MTEXT"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 3:case 1:i.text?i.text+=t.value:i.text=t.value,t=e.next();break;case 10:i.position=ht(e),t=e.lastReadGroup;break;case 7:i.textStyle=t.value,t=e.next();break;case 44:i.lineSpaceFactor=t.value,t=e.next();break;case 11:i.directionVector=ht(e),t=e.lastReadGroup;break;case 40:i.height=t.value,t=e.next();break;case 41:i.width=t.value,t=e.next();break;case 50:i.rotation=t.value,t=e.next();break;case 71:i.attachmentPoint=t.value,t=e.next();break;case 72:i.drawingDirection=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},NI=class{constructor(){this.ForEntityName="OLE2FRAME"}parseEntity(e,t){let i={type:t.value,binaryData:""};for(t=e.next();"OLE"!==t.value&&0!==t.code;)switch(t.code){case 3:i.documentType=t.value,t=e.next();break;case 70:i.version=t.value,t=e.next();break;case 10:i.leftUpX=t.value,t=e.next();break;case 20:i.leftUpY=t.value,t=e.next();break;case 30:i.leftUpZ=t.value,t=e.next();break;case 11:i.rightDownX=t.value,t=e.next();break;case 21:i.rightDownY=t.value,t=e.next();break;case 31:i.rightDownZ=t.value,t=e.next();break;case 90:i.lengthOfBinaryData=t.value,t=e.next();break;case 310:i.binaryData+=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},LI=class{constructor(){this.ForEntityName="POINT"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.position=ht(e),t=e.lastReadGroup;break;case 39:i.thickness=t.value,t=e.next();break;case 210:i.extrusionDirection=ht(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},FI=class{constructor(){this.ForEntityName="VERTEX"}parseEntity(e,t){var i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.x=t.value,t=e.next();break;case 20:i.y=t.value,t=e.next();break;case 30:i.z=t.value,t=e.next();break;case 40:case 41:case 50:t=e.next();break;case 42:0!=t.value&&(i.bulge=t.value),t=e.next();break;case 70:i.curveFittingVertex=0!=(1&t.value),i.curveFitTangent=0!=(2&t.value),i.splineVertex=0!=(8&t.value),i.splineControlPoint=0!=(16&t.value),i.threeDPolylineVertex=0!=(32&t.value),i.threeDPolylineMesh=0!=(64&t.value),i.polyfaceMeshVertex=0!=(128&t.value),t=e.next();break;case 71:i.faceA=t.value,t=e.next();break;case 72:i.faceB=t.value,t=e.next();break;case 73:i.faceC=t.value,t=e.next();break;case 74:i.faceD=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},HI=class{constructor(){this.ForEntityName="POLYLINE"}parseEntity(e,t){var i={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:case 20:case 30:case 40:case 41:case 71:case 72:case 73:case 74:case 75:t=e.next();break;case 39:t=e.next(),i.thickness=t.value;break;case 70:i.shape=0!=(1&t.value),i.includesCurveFitVertices=0!=(2&t.value),i.includesSplineFitVertices=0!=(4&t.value),i.is3dPolyline=0!=(8&t.value),i.is3dPolygonMesh=0!=(16&t.value),i.is3dPolygonMeshClosed=0!=(32&t.value),i.isPolyfaceMesh=0!=(64&t.value),i.hasContinuousLinetypePattern=0!=(128&t.value),t=e.next();break;case 210:i.extrusionDirection=ht(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i.vertices=Xbt(e,t),i}};function Xbt(e,t){let i=new FI,r=[];for(;!e.isEOF();)if(0===t.code)if("VERTEX"===t.value)r.push(i.parseEntity(e,t)),t=e.lastReadGroup;else if("SEQEND"===t.value){$bt(e,t);break}return r}function $bt(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)if(101===t.code)for(;0!=t.code;)t=e.next();else hr(i,t),t=e.next();return i}var UI=class{constructor(){this.ForEntityName="RAY"}parseEntity(e,t){let i={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.vertices.unshift(ht(e)),t=e.lastReadGroup;break;case 11:i.directionVector=ht(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},BI=class{constructor(){this.ForEntityName="REGION"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 70:i.modelerVersion=t.value,t=e.next();break;case 1:i.proprietaryData=t.value,t=e.next();break;case 3:i.proprietaryData+=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},kI=class{constructor(){this.ForEntityName="SEQEND"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)-2===t.code||(hr(i,t),t=e.next());return i}},GI=class{constructor(){this.ForEntityName="SOLID"}parseEntity(e,t){let i={type:t.value,points:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.points[0]=ht(e),t=e.lastReadGroup;break;case 11:i.points[1]=ht(e),t=e.lastReadGroup;break;case 12:i.points[2]=ht(e),t=e.lastReadGroup;break;case 13:i.points[3]=ht(e),t=e.lastReadGroup;break;case 210:i.extrusionDirection=ht(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},VI=class{constructor(){this.ForEntityName="SPLINE"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.controlPoints||(i.controlPoints=[]),i.controlPoints.push(ht(e)),t=e.lastReadGroup;break;case 11:i.fitPoints||(i.fitPoints=[]),i.fitPoints.push(ht(e)),t=e.lastReadGroup;break;case 12:i.startTangent=ht(e),t=e.lastReadGroup;break;case 13:i.endTangent=ht(e),t=e.lastReadGroup;break;case 40:i.knotValues||(i.knotValues=[]),i.knotValues.push(t.value),t=e.next();break;case 70:1&t.value&&(i.closed=!0),2&t.value&&(i.periodic=!0),4&t.value&&(i.rational=!0),8&t.value&&(i.planar=!0),16&t.value&&(i.planar=!0,i.linear=!0),t=e.next();break;case 71:i.degreeOfSplineCurve=t.value,t=e.next();break;case 72:i.numberOfKnots=t.value,t=e.next();break;case 73:i.numberOfControlPoints=t.value,t=e.next();break;case 74:i.numberOfFitPoints=t.value,t=e.next();break;case 210:i.normalVector=ht(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},zI=class{constructor(){this.ForEntityName="TEXT"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.startPoint=ht(e),t=e.lastReadGroup;break;case 11:i.endPoint=ht(e),t=e.lastReadGroup;break;case 40:i.textHeight=t.value,t=e.next();break;case 41:i.xScale=t.value,t=e.next();break;case 50:i.rotation=t.value,t=e.next();break;case 1:i.text=t.value,t=e.next();break;case 72:i.halign=t.value,t=e.next();break;case 73:i.valign=t.value,t=e.next();break;case 7:i.textStyle=t.value,t=e.next();break;case 71:i.mirrored=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},jI=class{constructor(){this.ForEntityName="VIEWPORT"}parseEntity(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 68:i.viewportStatus=t.value,t=e.next();break;case 40:i.width_paperSpace=t.value,t=e.next();break;case 41:i.height_paperSpace=t.value,t=e.next();break;case 69:i.viewportId=t.value,t=e.next();break;case 10:i.centerPoint=ht(e),t=e.lastReadGroup;break;case 12:i.centerPoint_dcs=ht(e),t=e.lastReadGroup;break;case 13:i.snapBasePoint_dcs=ht(e),t=e.lastReadGroup;break;case 14:i.snapSpacing_dcs=ht(e),t=e.lastReadGroup;break;case 15:i.gridSpacing_dcs=ht(e),t=e.lastReadGroup;break;case 16:i.viewDirection=ht(e),t=e.lastReadGroup;break;case 17:i.viewTarget=ht(e),t=e.lastReadGroup;break;case 42:i.perspectiveLens=t.value,t=e.next();break;case 43:i.frontClippingPlaneZ=t.value,t=e.next();break;case 44:i.backClippingPlaneZ=t.value,t=e.next();break;case 45:i.viewHeight=t.value,t=e.next();break;case 50:i.snapAngle=t.value,t=e.next();break;case 51:i.viewTwistAngle=t.value,t=e.next();break;case 72:i.circleZoomPercent=t.value,t=e.next();break;case 331:i.frozenLayerHandles=i.frozenLayerHandles||[],i.frozenLayerHandles.push(t.value),t=e.next();break;case 90:i.viewportStatusFlags=t.value,t=e.next();break;case 340:i.viewportClippingBoundaryhandleId=t.value,t=e.next();break;case 1:i.plotStyleSheetName=t.value,t=e.next();break;case 281:i.renderMode=t.value,t=e.next();break;case 71:i.viewportFlag_ucs=t.value,t=e.next();break;case 74:i.ucsIcon=t.value,t=e.next();break;case 110:i.ucsOrigin=ht(e),t=e.lastReadGroup;break;case 111:i.ucsXAxis=ht(e),t=e.lastReadGroup;break;case 112:i.ucsYAxis=ht(e),t=e.lastReadGroup;break;case 345:i.ucsTableRecordHandle=t.value,t=e.next();break;case 346:i.baseUcsTableRecordHandle=t.value,t=e.next();break;case 79:i.orthographicType=t.value,t=e.next();break;case 146:i.elevation=t.value,t=e.next();break;case 170:i.shadePlotMode=t.value,t=e.next();break;case 61:i.frequency=t.value,t=e.next();break;case 292:i.lightingFlag=t.value,t=e.next();break;case 282:i.lightingType=t.value,t=e.next();break;case 141:i.viewBrightness=t.value,t=e.next();break;case 142:i.viewContrast=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},WI=class{constructor(){this.ForEntityName="XLINE"}parseEntity(e,t){let i={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:i.vertices.unshift(ht(e)),t=e.lastReadGroup;break;case 11:i.directionVector=ht(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:hr(i,t),t=e.next()}return i}},PA=class{constructor(){this.ForObjectName="DICTIONARY"}parseObject(e,t){let i={type:t.value},r=[],n=[];for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 280:i.isHardOwner=1===t.value,t=e.next();break;case 281:i.cloningFlag=t.value,t=e.next();break;case 3:r.push(t.value),t=e.next();break;case 350:case 360:n.push(t.value),t=e.next();break;case 100:case 102:t=e.next();break;default:Zl(i,t),t=e.next()}if(r.length!==n.length)throw new Error("The number of Dictionary entries does not match !");return i.entries={},r.forEach(((e,t)=>{i.entries[n[t]]=e})),i}},NA=class{constructor(){this.ForObjectName="IMAGEDEF"}parseObject(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 90:i.classVersion=t.value,t=e.next();break;case 1:i.filename=t.value,t=e.next();break;case 10:i.imageSize=ht(e),t=e.next();break;case 11:i.pixelSize=ht(e),t=e.next();break;case 280:i.loaded=t.value,t=e.next();break;case 281:i.resolutionUnits=t.value,t=e.next();break;default:Zl(i,t),t=e.next()}return i}},LA=class{constructor(){this.ForObjectName="LAYOUT"}parseObject(e,t){let i={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 100:t=e.next();break;case 1:i.layoutName=t.value,t=e.next();break;case 70:i.flag=t.value,t=e.next();break;case 71:i.tabOrder=t.value,t=e.next();break;case 76:i.orthographicType=t.value,t=e.next();break;case 10:i.minLimit=ht(e),t=e.lastReadGroup;break;case 11:i.maxLimit=ht(e),t=e.lastReadGroup;break;case 12:i.basePoint=ht(e),t=e.lastReadGroup;break;case 13:i.origin=ht(e),t=e.lastReadGroup;break;case 14:i.minExtent=ht(e),t=e.lastReadGroup;break;case 15:i.maxExtent=ht(e),t=e.lastReadGroup;break;case 16:i.XAxis=ht(e),t=e.lastReadGroup;break;case 17:i.YAxis=ht(e),t=e.lastReadGroup;break;case 146:i.elevation=t.value,t=e.next();break;case 331:i.viewportHandle=t.value,t=e.next();break;default:Zl(i,t),t=e.next()}return i.blockTableHandle=i.ownerHandle,i}},FA=class{constructor(){this.ForObjectName="SORTENTSTABLE"}parseObject(e,t){let i={type:t.value},r=!1;i.sortEntsObject={},i.sortEntsObject.entityHandles=[];let n=[];for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 5:r?(n.push(t.value),i.sortEntsObject.entityHandles.push(n),n=[]):i.handle=t.value,t=e.next();break;case 100:t=e.next(),r=!0;break;case 102:t=e.next();break;case 330:r?i.sortEntsObject.ownerHandle=t.value:i.ownerHandle=t.value,t=e.next();break;case 331:n.push(t.value),t=e.next();break;default:Zl(i,t),t=e.next()}return i}},HA=class{constructor(){this.ForObjectName="SPATIAL_FILTER"}parseObject(e,t){let i,r,n={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 11:n.origin=ht(e),t=e.lastReadGroup;break;case 70:n.numberOfPointsOnClipBoundary=t.value,2===n.numberOfPointsOnClipBoundary?(t=e.next(),i=ht(e),t=e.lastReadGroup,r=ht(e),t=e.lastReadGroup,n.vertices.push(i,{x:r.x,y:i.y},r,{x:i.x,y:r.y},i)):n.numberOfPointsOnClipBoundary>2?(n.vertices=Zbt(n.numberOfPointsOnClipBoundary,e),t=e.lastReadGroup):t=e.next();break;case 71:n.clipBoundaryVisible=1===t.value,t=e.next();break;case 72:n.frontClippingPlaneFlag=1===t.value,t=e.next(),n.frontClippingPlaneFlag&&40===t.code&&(n.frontClippingPlaneDistance=t.value,t=e.next());break;case 73:n.backClippingPlaneFlag=1===t.value,t=e.next(),n.backClippingPlaneFlag&&41===t.code&&(n.backClippingPlaneDistance=t.value,t=e.next());break;case 100:case 102:t=e.next();break;case 210:n.extrusionDirectionX=t.value,t=e.next();break;case 220:n.extrusionDirectionY=t.value,t=e.next();break;case 230:n.extrusionDirectionZ=t.value,t=e.next();break;case 40:n.invertBlockMatrix=Xfe(e,40),n.matrix=Xfe(e,40),t=e.lastReadGroup;break;default:Zl(n,t),t=e.next()}return n}};function Zbt(e,t){t.next();let i=[];for(;i.length<e;)i.push(ht(t));return i}function Xfe(e,t){let i=e.lastReadGroup,r=[];for(let n=0;n<12;n++){if(i.code!==t)throw new Error(`Expected code for matrix value to be ${t} but got ${i.code}`);r.push(i.value),i=e.next()}return r}var UA=class{constructor(){this.ForObjectName="XRECORD"}parseObject(e,t){let i={type:t.value,binaryData:""};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 100:case 311:t=e.next();break;case 280:i.cloningFlag=t.value,t=e.next();break;case 310:i.binaryData+=t.value,t=e.next();break;default:Zl(i,t),t=e.next()}return i}};function Kbt(e){e.registerEntityHandler(EI),e.registerEntityHandler(TI),e.registerEntityHandler(bI),e.registerEntityHandler(xI),e.registerEntityHandler(II),e.registerEntityHandler(_I),e.registerEntityHandler(OI),e.registerEntityHandler(SI),e.registerEntityHandler(wI),e.registerEntityHandler(RI),e.registerEntityHandler(MI),e.registerEntityHandler(DI),e.registerEntityHandler(CI),e.registerEntityHandler(AI),e.registerEntityHandler(PI),e.registerEntityHandler(NI),e.registerEntityHandler(LI),e.registerEntityHandler(HI),e.registerEntityHandler(BI),e.registerEntityHandler(UI),e.registerEntityHandler(kI),e.registerEntityHandler(GI),e.registerEntityHandler(VI),e.registerEntityHandler(zI),e.registerEntityHandler(jI),e.registerEntityHandler(WI)}function Jbt(e){e.registerObjectHandler(PA),e.registerObjectHandler(NA),e.registerObjectHandler(LA),e.registerObjectHandler(FA),e.registerObjectHandler(HA),e.registerObjectHandler(UA)}function Qbt(e){let t=new Bf(e).readBytes(22),i="";for(let r=0;r<18;r++)i+=String.fromCharCode(t[r]);return"AutoCAD Binary DXF"===i}var c0=class{constructor(){this._entityHandlers={},this._objectHandlers={},this._layoutBlocks={},this.unhandledSections={},this.unhandledObjects={},this.unhandledEntities={},this.unsupportedLineTypes={},Kbt(this),Jbt(this)}parse(e){if("string"==typeof e){let t=this.splitByLineSeparator(e),i=new AE(t);return this._parse(i)}{let t;if(Qbt(e))t=new vI(e);else{let i=(new TextDecoder).decode(e),r=Date.now(),n=this.splitByLineSeparator(i);re.info(`[DxfParser] string.split costed ${(Date.now()-r)/1e3}s, it is avoidable by using dxf in binary.`),t=new AE(n)}return this._parse(t)}}registerEntityHandler(e){let t=new e;this._entityHandlers[t.ForEntityName]=t}registerObjectHandler(e){let t=new e;this._objectHandlers[t.ForObjectName]=t}parseSync(e){return this.parse(e)}parseStream(e){let t="",i=this;return new Promise(((r,n)=>{e.on("data",(e=>{t+=e})),e.on("end",(()=>{try{r(i.parse(t))}catch(e){n(e)}})),e.on("error",(e=>{n(e)}))}))}_parse(e){let t={},i=0;if(!e.hasNext())throw Error("Empty file");let r,n=this;function s(){let t=null,i=null,n={};for(r=e.next();;){if(al(r,0,"ENDSEC")){t&&(n[t]=i);break}9===r.code?(t&&(n[t]=i),t=r.value):10===r.code?i={x:r.value}:20===r.code?i.y=r.value:30===r.code?i.z=r.value:i=r.value,r=e.next()}return r=e.next(),n}function a(){let t={};for(r=e.next();"EOF"!==r.value&&!al(r,0,"ENDSEC");)if(al(r,0,"BLOCK")){re.trace("block {");let e=o();re.trace("}"),m(e),e.name?t[e.name]=e:re.error(`[DxfParser] Block with handle '${e.handle}' is missing a name, ignored!`)}else Kp(r),r=e.next();return t}function o(){let t={};for(r=e.next();"EOF"!==r.value;){switch(r.code){case 1:t.xrefPath=r.value,r=e.next();break;case 2:t.name=r.value,r=e.next();break;case 3:t.name2=r.value,r=e.next();break;case 4:t.description=r.value,r=e.next();break;case 5:t.handle=r.value,r=e.next();break;case 8:t.layer=r.value,r=e.next();break;case 10:t.position=f(r),r=e.lastReadGroup;break;case 67:t.paperSpace=!(!r.value||1!==r.value),r=e.next();break;case 70:t.blockType=r.value,r=e.next();break;case 100:r=e.next();break;case 330:t.ownerHandle=r.value,r=e.next();break;case 0:if("ENDBLK"==r.value)break;t.entities=p(!0);break;default:Kp(r),r=e.next()}if(al(r,0,"ENDBLK")){r=e.next();break}}return t}function l(){let t={};for(r=e.next();"EOF"!==r.value&&!al(r,0,"ENDSEC");)al(r,0,"TABLE")?(r=e.next(),c[r.value]?(re.trace(r.value+" Table {"),t[c[r.value].tableName]=u(r),re.trace("}")):re.trace("Unhandled Table "+r.value)):r=e.next();return r=e.next(),t}let h="ENDTAB";function u(t){let i=c[t.value],n={},s=0;for(r=e.next();!al(r,0,h);)switch(r.code){case 5:n.handle=r.value,r=e.next();break;case 330:n.ownerHandle=r.value,r=e.next();break;case 100:"AcDbSymbolTable"===r.value||Kp(r),r=e.next();break;case 70:s=r.value,r=e.next();break;case 0:r.value===i.dxfSymbolName?n[i.tableRecordsProperty]=i.parseTableRecords():(Kp(r),r=e.next());break;default:Kp(r),r=e.next()}let a=n[i.tableRecordsProperty];if(a){let e=a.constructor===Array?a.length:"object"==typeof a?Object.keys(a).length:void 0;s!==e&&re.warn(`[DxfParser] Parsed ${e} ${i.dxfSymbolName}s but expected ${s}`)}return r=e.next(),n}let c={VPORT:{tableRecordsProperty:"viewports",tableName:"viewport",dxfSymbolName:"VPORT",parseTableRecords:function(){let t=[],i={};for(re.trace("Viewport {"),r=e.next();!al(r,0,h);)switch(r.code){case 2:i.name=r.value,r=e.next();break;case 10:i.lowerLeftCorner=f(r),r=e.lastReadGroup;break;case 11:i.upperRightCorner=f(r),r=e.lastReadGroup;break;case 12:i.center=f(r),r=e.lastReadGroup;break;case 13:i.snapBasePoint=f(r),r=e.lastReadGroup;break;case 14:i.snapSpacing=f(r),r=e.lastReadGroup;break;case 15:i.gridSpacing=f(r),r=e.lastReadGroup;break;case 16:i.viewDirectionFromTarget=f(r),r=e.lastReadGroup;break;case 17:i.viewTarget=f(r),r=e.lastReadGroup;break;case 40:case 45:i.viewHeight=r.value,r=e.next();break;case 41:i.aspectRatio=r.value,r=e.next();break;case 42:i.lensLength=r.value,r=e.next();break;case 43:i.frontClippingPlane=r.value,r=e.next();break;case 44:i.backClippingPlane=r.value,r=e.next();break;case 50:i.snapRotationAngle=r.value,r=e.next();break;case 51:i.viewTwistAngle=r.value,r=e.next();break;case 79:i.orthographicType=r.value,r=e.next();break;case 110:i.ucsOrigin=f(r),r=e.lastReadGroup;break;case 111:i.ucsXAxis=f(r),r=e.lastReadGroup;break;case 112:i.ucsYAxis=f(r),r=e.lastReadGroup;break;case 281:i.renderMode=r.value,r=e.next();break;case 282:i.defaultLightingType=r.value,r=e.next();break;case 292:i.defaultLightingOn=r.value,r=e.next();break;case 330:i.ownerHandle=r.value,r=e.next();break;case 63:case 421:case 431:i.ambientColor=r.value,r=e.next();break;case 0:"VPORT"===r.value&&(re.trace("}"),t.push(i),re.trace("Viewport {"),i={},r=e.next());break;default:Kp(r),r=e.next()}return re.trace("}"),t.push(i),t}},LTYPE:{tableRecordsProperty:"lineTypes",tableName:"lineType",dxfSymbolName:"LTYPE",parseTableRecords:function(){let t={},i={},s=0,a="",o=!1;for(re.trace("LType {"),r=e.next();!al(r,0,"ENDTAB");)switch(r.code){case 2:i.name=r.value.toUpperCase(),a=i.name,r=e.next();break;case 3:i.description=r.value,r=e.next();break;case 9:case 44:case 45:case 46:case 70:case 75:default:r=e.next();break;case 40:i.patternLength=r.value,r=e.next();break;case 49:let l=r.value;o&&(l=Math.abs(l),o=!1),i.pattern.push(l),r=e.next();break;case 73:s=r.value,s>0&&(i.pattern=[]),r=e.next();break;case 74:0!==r.value&&(o=!0,n.unsupportedLineTypes[i.name]?n.unsupportedLineTypes[i.name]++:n.unsupportedLineTypes[i.name]=1),r=e.next();break;case 0:re.trace("}"),s>0&&s!==i.pattern.length&&re.warn("[DxfParser] lengths do not match on LTYPE pattern"),t[a]=i,i={},re.trace("LType {"),r=e.next()}return re.trace("}"),t[a]=i,t}},LAYER:{tableRecordsProperty:"layers",tableName:"layer",dxfSymbolName:"LAYER",parseTableRecords:function(){let t,i={},n={};for(re.trace("Layer {"),r=e.next();!al(r,0,"ENDTAB");)switch(r.code){case 2:n.name=r.value,t=r.value,r=e.next();break;case 5:n.handle=r.value,r=e.next();break;case 62:n.visible=r.value>=0,n.colorIndex=Math.abs(r.value),n.color=ext(n.colorIndex),r=e.next();break;case 70:n.flag=r.value,n.frozen=(1&n.flag)>0,r=e.next();break;case 420:n.color=Math.abs(r.value),r=e.next();break;case 6:n.lineType=r.value.toUpperCase(),r=e.next();break;case 370:n.lineweight=r.value,r=e.next();break;case 0:"LAYER"===r.value&&(re.trace("}"),t&&(i[t]=n),re.trace("Layer {"),n={},t=void 0,r=e.next());break;default:Kp(r),r=e.next()}return re.trace("}"),t&&(i[t]=n),i}},BLOCK_RECORD:{tableRecordsProperty:"blockRecords",tableName:"blockRecord",dxfSymbolName:"BLOCK_RECORD",parseTableRecords:function(){let t,i={},s={};for(re.trace("BlockRecord {"),r=e.next();!al(r,0,"ENDTAB");)switch(r.code){case 5:s.handle=r.value,r=e.next();break;case 330:s.ownerHandle=r.value,r=e.next();break;case 2:s.blockName=r.value,t=s.blockName,r=e.next();break;case 340:s.layoutHandle=r.value,r=e.next();break;case 70:s.blockInsertUnits=r.value,r=e.next();break;case 280:s.blockExplodability=r.value,r=e.next();break;case 281:s.blockScalability=r.value,r=e.next();break;case 310:s.bitmap=r.value,r=e.next();break;case 0:if("BLOCK_RECORD"===r.value){re.trace("}"),t&&(i[t]=s);let a=s.layoutHandle;t&&a&&a.length>0&&"0"!==a&&(n._layoutBlocks[a]=s),re.trace("BlockRecord {"),s={},t=void 0,r=e.next()}else Kp(r),r=e.next();break;default:Kp(r),r=e.next()}re.trace("}"),t&&(i[t]=s);let a=s.layoutHandle;return t&&a&&a.length>0&&"0"!==a&&(n._layoutBlocks[a]=s),i}},STYLE:{tableRecordsProperty:"styles",tableName:"style",dxfSymbolName:"STYLE",parseTableRecords:function(){let t,i={},n={};for(re.trace("Style {"),r=e.next();!al(r,0,"ENDTAB");)switch(r.code){case 2:n.styleName=r.value,t=r.value,r=e.next();break;case 3:n.fontFile=r.value,r=e.next();break;case 4:n.bigFontFile=r.value,r=e.next();break;case 5:n.handle=r.value,r=e.next();break;case 7:n.textStyle=r.value,r=e.next();break;case 40:n.textHeight=r.value,r=e.next();break;case 41:n.xScale=r.value,r=e.next();break;case 42:n.priorTextHeight=r.value,r=e.next();break;case 50:n.rotation=r.value,r=e.next();break;case 70:default:r=e.next();break;case 71:n.mirroreType=r.value,r=e.next();break;case 330:n.ownerHandle=r.value,r=e.next();break;case 0:"STYLE"===r.value&&(re.trace("}"),t&&(i[t]=n),re.trace("Style {"),n={},t=void 0,r=e.next())}return re.trace("}"),t&&(i[t]=n),i}},DIMSTYLE:{tableRecordsProperty:"dimStyles",tableName:"dimStyle",dxfSymbolName:"DIMSTYLE",parseTableRecords:function(){let t,i={},n={};for(re.trace("DimStyle {"),r=e.next();!al(r,0,"ENDTAB");)switch(r.code){case 2:n.styleName=r.value,t=r.value,r=e.next();break;case 40:n.DIMSCALE=r.value,r=e.next();break;case 41:n.DIMASZ=r.value,r=e.next();break;case 42:n.DIMEXO=r.value,r=e.next();break;case 44:n.DIMEXE=r.value,r=e.next();break;case 75:n.DIMSE1=r.value,r=e.next();break;case 76:n.DIMSE2=r.value,r=e.next();break;case 77:n.DIMTAD=r.value,r=e.next();break;case 140:n.DIMTXT=r.value,r=e.next();break;case 144:n.DIMLFAC=r.value,r=e.next();break;case 147:n.DIMGAP=r.value,r=e.next();break;case 176:n.DIMCLRD=r.value,r=e.next();break;case 178:n.DIMCLRT=r.value,r=e.next();break;case 271:n.DIMDEC=r.value,r=e.next();break;case 341:n.DIMLDRBLK=r.value,r=e.next();break;case 70:default:r=e.next();break;case 0:"DIMSTYLE"===r.value&&(re.trace("}"),t&&(i[t]=n),re.trace("DimStyle {"),n={},t=void 0,r=e.next())}return re.trace("}"),t&&(i[t]=n),i}}};function p(t){let i=[],s=t?"ENDBLK":"ENDSEC";for(t||(r=e.next());;)if(0===r.code){if(r.value===s)break;let t=n._entityHandlers[r.value];if(null==t){let t=r.value;n.unhandledEntities[t]||(n.unhandledEntities[t]=0),n.unhandledEntities[t]++,r=e.next();continue}{re.trace(r.value+" {");let n=t.parseEntity(e,r);n&&(n.layer||(n.layer="0"),void 0===n.colorIndex&&(n.colorIndex=256),n.lineType||(n.lineType=AA)),r=e.lastReadGroup,re.trace("}"),m(n),i.push(n)}}else r=e.next();return"ENDSEC"==s&&(r=e.next()),i}function d(){let t={};for(r=e.next();"EOF"!==r.value;)if(0===r.code){if("ENDSEC"===r.value)break;let i=n._objectHandlers[r.value];if(null==i){let t=r.value;n.unhandledObjects[t]||(n.unhandledObjects[t]=0),n.unhandledObjects[t]++,r=e.next();continue}{re.trace(r.value+" {");let n=i.parseObject(e,r),s=r.value;r=e.lastReadGroup,re.trace("}"),m(n),t[s]||(t[s]=[]),t[s].push(n)}}else r=e.next();return r=e.next(),t.LAYOUT&&(Object.keys(n._layoutBlocks).length!==t.LAYOUT.length&&re.warn("[DxfParser] The number of layout and block associations does not match!"),t.LAYOUT.forEach((e=>{n._layoutBlocks[e.handle]&&(e.associatedBlockName=n._layoutBlocks[e.handle].blockName)})),t.LAYOUT.sort(((e,t)=>e.tabOrder-t.tabOrder))),t}function f(t){let i={},r=t.code;if(i.x=t.value,r+=10,(t=e.next()).code!=r)throw new Error(`Expected code for point value to be ${r} but got ${t.code}.`);return i.y=t.value,r+=10,(t=e.next()).code!=r||(i.z=t.value,t=e.next()),i}function m(e){if(!e)throw new TypeError("entity cannot be undefined or null");e.handle||(e.handle=(i++).toString())}return function(){for(r=e.next();999===r.code;)r=e.next();for(;!e.isEOF();)if(0===r.code&&"SECTION"===r.value){if(r=e.next(),2!==r.code){re.error("Unexpected code %s after 0:SECTION",$fe(r)),r=e.next();continue}if("HEADER"===r.value)re.trace("> HEADER"),t.header=s(),re.trace("<");else if("TABLES"===r.value)re.trace("> TABLES"),t.tables=l(),re.trace("<");else if("BLOCKS"===r.value)re.trace("> BLOCKS"),t.blocks=a(),re.trace("<");else if("ENTITIES"===r.value)re.trace("> ENTITIES"),t.entities=p(!1),re.trace("<");else if("OBJECTS"===r.value)re.trace("> OBJECTS"),t.objects=d(),re.trace("<");else if("EOF"===r.value)re.trace("EOF");else{let e=r.value;n.unhandledSections[e]?n.unhandledSections[e]++:n.unhandledSections[e]=1}}else r=e.next();n.unhandledSections={},n.unhandledEntities={},n.unhandledObjects={},n.unsupportedLineTypes={}}(),t}splitByLineSeparator(e){let t=[],i=0;for(let r=0,n=e.length;r<n;++r){let n=e[r];if("\r"===n||"\n"===n){let s=e.substring(i,r);t.push(s),"\r"===n&&"\n"===e[r+1]&&r++,i=r+1}}return t.push(e.substring(i,e.length)),t}};function al(e,t,i){return e.code===t&&e.value===i}function Kp(e){re.trace("unhandled group "+$fe(e))}function $fe(e){return e.code+":"+e.value}function ext(e){return OA[e]}var nG=(e=>(e.Added="Added",e.Removed="Removed",e.Modified="Modified",e.NoChange="NoChange",e))(nG||{}),Xs=1,BA=class{constructor(e,t){if(this.changes={},this.comparedBlocks=new Map,this.isComparingBlock=!1,this.isComparingDimension=!1,this.dxf1=e,this.dxf2=t,!e||!t)throw new Error("Invalid dxf data to compare!")}getLayerFrozen(e,t){var i,r,n;let s=null==(r=null==(i=e.tables)?void 0:i.layer)?void 0:r.layers;return s&&(null==(n=s[t.layer])?void 0:n.frozen)}compare(e){return ct(this,null,(function*(){this.changes={};let t=[],i=new Map;return this.dxf1.entities.forEach((e=>{if(!0!==e.inPaperSpace){let i=!0===this.getLayerFrozen(this.dxf1,e);!BA.ignoreEntityTypes.includes(e.type)&&!i&&t.push(e)}})),this.dxf2.entities.forEach((e=>{if(!0!==e.inPaperSpace){let t=!0===this.getLayerFrozen(this.dxf2,e);!BA.ignoreEntityTypes.includes(e.type)&&!t&&i.set(e.handle,e)}})),yield this.compareEntities(t,i,void 0,e),Promise.resolve(this.changes)}))}isDimensionBlock(e){return e.includes("*D")}compareInsertOrDemensionEntities(e,t,i,r){if(!e.block||!t.block)return;let n,s=e.block;if(this.isComparingBlock=!0,this.isDimensionBlock(s)){let i=this.dxf1.blocks[e.block],r=this.dxf2.blocks[t.block],a=Date.now();this.isComparingDimension=!0,n=this.compareBlock(i,r),this.isComparingDimension=!1,re.debug(`[DxfCompare] compare block: ${s} cost ${(Date.now()-a)/1e3}s`)}else{if(!this.comparedBlocks.has(s)){let e=this.dxf1.blocks[s],t=this.dxf2.blocks[s],i=Date.now(),r=this.compareBlock(e,t);this.comparedBlocks.set(s,r),re.debug(`[DxfCompare] compare block: ${s} cost ${(Date.now()-i)/1e3}s`)}n=this.comparedBlocks.get(s)}return null==n||n.forEach((t=>{if(t.parentHandles||(t.parentHandles=[]),i&&r)"Added"===t.type?t.parentHandles.push(r):"Removed"===t.type&&t.parentHandles.push(i);else{let i=[...t.parentHandles,e.handle];("Added"===t.type||"Removed"===t.type)&&(this.changes[Xs]=Ln(Mr({id:Xs},t),{parentHandles:i})),Xs++}})),!i&&!r&&(this.isComparingBlock=!1),n}compareBlock(e,t){var i,r;let n=[],s=[];null==(i=null==e?void 0:e.entities)||i.forEach((e=>{"ATTDEF"!==e.type&&!this.bIgnoreChildEntitiesOriginalType(e)&&n.push(e)})),null==(r=null==t?void 0:t.entities)||r.forEach((e=>{"ATTDEF"!==e.type&&!this.bIgnoreChildEntitiesOriginalType(e)&&s.push(e)}));let a=[],o=[];for(let l=0;l<n.length;l++){let e=n[l],t=!1;0===s.length&&(t=!0),this.isComparingDimension||(this.isComparingDimension="DIMENSION"===e.type);for(let i=0;i<s.length;i++){let r=s[i];if(this.entitiesEqual(e,r)){if("INSERT"===e.type&&"INSERT"===r.type||"DIMENSION"===e.type&&"DIMENSION"===r.type){let n=this.compareInsertOrDemensionEntities(e,r,e.handle,r.handle);n&&n.length>0&&a.push(...n),t=!1,s.splice(i--,1);break}t=!1,s.splice(i--,1);break}t=!0}t&&(a.push({type:"Removed",handle:e.handle}),o.push(e.handle))}return s.forEach((e=>{o.includes(e.handle)||a.push({type:"Added",handle:e.handle})})),a}compareEntities(e,t,i,r){return ct(this,null,(function*(){var n,s;let a=e.length,o=Math.round(Math.pow(a,.5)),l=Date.now(),h=e=>ct(this,null,(function*(){if(r&&(e%o==0||e===a-1)){r(new ProgressEvent("compareProgress",{loaded:e+1,total:a}));let t=500,i=Date.now();(i-l>t||e===a-1)&&(yield Tt.sleep(0),l=i)}}));for(let r=0;r<e.length;r++){let a=e[r].handle;if(t.has(a)){let o=e[r],l=t.get(a);if(this.entitiesEqual(o,l)){if(a0.includes(o.type)){if(this.bIgnoreChildEntitiesOriginalType(o)){t.delete(a),re.warn(`[DxfCompare] We cannot compare insert (handle '${o.handle}') yet, ignored!`);continue}this.compareInsertOrDemensionEntities(o,l)}}else{if(null!=(n=o.extendedData)&&n.originalType&&null!=(s=l.extendedData)&&s.originalType&&o.block!==l.block){t.delete(a);continue}this.changes[Xs]={id:Xs,type:"Modified",handle:a},i&&(this.changes[Xs].parentHandles=[i]),Xs++}t.delete(a)}else this.changes[Xs]={id:Xs,type:"Removed",handle:a},i&&(this.changes[Xs].parentHandles=[i]),Xs++;yield h(r)}for(let e of t){let t=e[0];this.changes[Xs]={id:Xs,type:"Added",handle:t},i&&(this.changes[Xs].parentHandles=[i]),Xs++}}))}bIgnoreChildEntitiesOriginalType(e){var t;return Wfe.includes(null==(t=e.extendedData)?void 0:t.originalType)}entitiesEqual(e,t){if(!this.baseEntitiesEqual(e,t))return!1;let i=e.type,r=!0;return"CIRCLE"===i||"ARC"===i?r=this.arcsEqual(e,t):"LWPOLYLINE"===i||"LINE"===i?r=this.linesEqual(e,t):"POLYLINE"===i?r=this.polylinesEqual(e,t):"TEXT"===i?r=this.textsEqual(e,t):"SOLID"===i?r=this.solidsEqual(e,t):"POINT"===i?r=this.pointEntitiesEqual(e,t):"INSERT"===i?r=this.insertsEqual(e,t):"SPLINE"===i?r=this.splinesEqual(e,t):"MTEXT"===i?r=this.mtextsEqual(e,t):"ELLIPSE"===i?r=this.ellipsesEqual(e,t):"DIMENSION"===i?r=this.dimensionsEqual(e,t):"REGION"===i?r=this.regionsEqual(e,t):"ATTDEF"===i?r=this.attDefsEqual(e,t):"ATTRIB"===i?r=this.attribsEqual(e,t):"HATCH"===i?r=this.hatchesEqual(e,t):"VIEWPORT"===i?r=this.viewportsEqual(e,t):"LEADER"===i?r=this.leadersEqual(e,t):"MULTILEADER"===i?r=this.mleadersEqual(e,t):"OLE2FRAME"===i&&(r=this.ole2framesEqual(e,t)),r}baseEntitiesEqual(e,t){var i,r;return!((null==(i=e.extendedData)?void 0:i.originalType)!==(null==(r=t.extendedData)?void 0:r.originalType)||!this.isComparingBlock&&!this.isComparingDimension&&e.handle!==t.handle||!this.isComparingDimension&&e.ownerHandle!==t.ownerHandle||e.type!==t.type)}arcsEqual(e,t){return!!(this.vectorsEqual(e.center,t.center)&&this.numberEqual(e.radius,t.radius)&&this.numberEqual(e.startAngle,t.startAngle)&&this.numberEqual(e.endAngle,t.endAngle))}linesEqual(e,t){return!(!this.verticesEqual(e.vertices,t.vertices)||e.shape!==t.shape)}polylinesEqual(e,t){return!(!this.vertexEntitiesEqual(e.vertices,t.vertices)||e.shape!==t.shape||e.isPolyfaceMesh!==t.isPolyfaceMesh)}textsEqual(e,t){if(e.halign!==t.halign)return!1;if(3===e.halign||5===e.halign){if(!this.pointsEqual(e.startPoint,t.startPoint))return!1}else if(!this.pointsEqual(e.endPoint,t.endPoint))return!1;return e.text===t.text}solidsEqual(e,t){return!!this.verticesEqual(e.points,t.points)}pointEntitiesEqual(e,t){return!!this.pointsEqual(e.position,t.position)}splinesEqual(e,t){return!(!this.verticesEqual(e.controlPoints,t.controlPoints)||!this.numbersEqual(e.knotValues,t.knotValues)||!this.numberEqual(e.degreeOfSplineCurve,t.degreeOfSplineCurve))}mtextsEqual(e,t){return!(!this.pointsEqual(e.position,t.position)||e.text!==t.text||!this.numberEqual(e.rotation,t.rotation))}ellipsesEqual(e,t){return!!(this.pointsEqual(e.center,t.center)&&this.pointsEqual(e.majorAxisEndPoint,t.majorAxisEndPoint)&&this.numberEqual(e.axisRatio,t.axisRatio)&&this.numberEqual(e.startAngle,t.startAngle)&&this.numberEqual(e.endAngle,t.endAngle))}attDefsEqual(e,t){return!(!this.pointsEqual(e.startPoint,t.startPoint)||!this.pointsEqual(e.endPoint,t.endPoint)||!this.numberEqual(e.xScale,t.xScale)||e.text!==t.text||e.tag!==t.tag||e.prompt!==t.prompt)}attribsEqual(e,t){return this.attDefsEqual(e,t)}hatchesEqual(e,t){let i=e,r=t;return!!(this.numberEqual(i.elevationX,r.elevationX)&&this.numberEqual(i.elevationY,r.elevationY)&&this.numberEqual(i.elevationZ,r.elevationZ)&&this.hatchBoundaryPathArraysEqual(i.boundaryPaths,r.boundaryPaths))}viewportsEqual(e,t){let i=e,r=t;return!!(this.pointsEqual(i.centerPoint,r.centerPoint)&&this.pointsEqual(i.centerPoint_dcs,r.centerPoint_dcs)&&this.pointsEqual(i.viewDirection,r.viewDirection)&&this.numberEqual(i.viewHeight,r.viewHeight)&&i.width_paperSpace===r.width_paperSpace&&i.height_paperSpace===r.height_paperSpace)}leadersEqual(e,t){return!!(this.pointsEqual(e.position,t.position)&&this.verticesEqual(e.vertices,t.vertices)&&e.arrowHeadBlockHandle===t.arrowHeadBlockHandle&&this.numberEqual(e.arrowHeadSize,t.arrowHeadSize)&&this.numberEqual(e.rotation,t.rotation)&&e.block===t.block)}mleadersEqual(e,t){return!(e.arrowHeadId!==t.arrowHeadId||!this.numberEqual(e.arrowHeadSize,t.arrowHeadSize))&&this.mleaderContextEqual(e.contextData,t.contextData)}ole2framesEqual(e,t){return!(e.leftUpX!==t.leftUpX||e.leftUpY!==t.leftUpY||e.leftUpZ!==t.leftUpZ||e.rightDownX!==t.rightDownX||e.rightDownY!==t.rightDownY||e.rightDownZ!==t.rightDownZ)}insertsEqual(e,t){var i,r,n,s;return"INSERT"===(null==(i=e.extendedData)?void 0:i.originalType)&&"INSERT"===(null==(r=t.extendedData)?void 0:r.originalType)?(re.warn(`[DxfCompare] We cannot compare insert (handle '${e.handle}') yet, ignored!`),!0):!!(this.pointsEqual(e.position,t.position)&&this.numberEqual(void 0===e.xScale?1:e.xScale,void 0===t.xScale?1:t.xScale)&&this.numberEqual(void 0===e.yScale?1:e.yScale,void 0===t.yScale?1:t.yScale)&&this.numberEqual(void 0===e.zScale?1:e.zScale,void 0===t.zScale?1:t.zScale)&&e.block===t.block&&(null==(n=e.entities)?void 0:n.length)===(null==(s=t.entities)?void 0:s.length))}dimensionsEqual(e,t){return!!this.pointsEqual(e.anchorPoint,t.anchorPoint)}regionsEqual(e,t){return re.warn("Cannot compare region yet!"),!0}vectorsEqual(e,t){return!e&&!t||!(!e||!t)&&this.numberEqual(e.x,t.x)&&this.numberEqual(e.y,t.y)&&this.numberEqual(e.z,t.z)}pointsEqual(e,t){return!e&&!t||!(!e||!t)&&this.numberEqual(e.x,t.x)&&this.numberEqual(e.y,t.y)&&this.numberEqual(e.z,t.z)&&this.numberEqual(e.bulge,t.bulge)}vertexEntityEqual(e,t){return!e&&!t||!(!e||!t)&&!(!this.pointsEqual(e,t)||e.polyfaceMeshVertex!==t.polyfaceMeshVertex||e.threeDPolylineMesh!==t.threeDPolylineMesh)}numbersEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.numberEqual(e[i],t[i]))return!1;return!0}return!1}numberEqual(e,t){return null==e&&null==t||null!=e&&null!=t&&$t.areNumbersEqual(e,t)}vectorArraysEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.vectorsEqual(e[i],t[i]))return!1;return!0}return!1}verticesEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.pointsEqual(e[i],t[i]))return!1;return!0}return!1}verticesArrayEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.verticesEqual(e[i],t[i]))return!1;return!0}return!1}vertexEntitiesEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.vertexEntityEqual(e[i],t[i]))return!1;return!0}return!1}hatchEdgesEqual(e,t){return!e&&!t||!(!e||!t)&&e.type===t.type}hatchEdgeArraysEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.hatchEdgesEqual(e[i],t[i]))return!1;return!0}return!1}hatchBoundaryPathsEqual(e,t){return!e&&!t||!(!e||!t)&&e.pathTypeFlag===t.pathTypeFlag&&this.hatchEdgeArraysEqual(e.edges,t.edges)}hatchBoundaryPathArraysEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.hatchBoundaryPathsEqual(e[i],t[i]))return!1;return!0}return!1}mleaderLineEqual(e,t){return!e&&!t||!(!e||!t)&&!(!this.verticesArrayEqual(e.vertices,t.vertices)||e.leaderLineIndex!==t.leaderLineIndex)}mleaderLinesEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.mleaderLineEqual(e[i],t[i]))return!1;return!0}return!1}mleaderLeaderEqual(e,t){return!e&&!t||!(!e||!t)&&!(!this.pointsEqual(e.lastLeaderLinePoint,t.lastLeaderLinePoint)||!this.pointsEqual(e.doglegVector,t.doglegVector)||!this.mleaderLinesEqual(e.leaderLines,t.leaderLines))}mleaderLeadersEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!this.mleaderLeaderEqual(e[i],t[i]))return!1;return!0}return!1}mleaderContextEqual(e,t){return!e&&!t||!(!e||!t)&&!(!this.pointsEqual(e.contentBasePosition,t.contentBasePosition)||!this.pointsEqual(e.blockContentPosition,t.blockContentPosition)||!this.mleaderLeadersEqual(e.leaders,t.leaders))}compareHexStrings(e,t){return parseInt(e,16)-parseInt(t,16)}},Zn=BA;Zn.ENTITY_COLOR_ADDED=65280,Zn.ENTITY_COLOR_REMOVED=16711680,Zn.ENTITY_COLOR_NO_CHANGE=10066329,Zn.ENTITY_COLOR_MARKUP=16744231,Zn.ignoreEntityTypes=["ATTRIB","SEQEND"];var hge=ps(pme(),1),yme="3.7.5",uxt=yme,hxt="function"==typeof atob,pxt="function"==typeof btoa,LE="function"==typeof Buffer,dme="function"==typeof TextDecoder?new TextDecoder:void 0,fme="function"==typeof TextEncoder?new TextEncoder:void 0,dxt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",qI=Array.prototype.slice.call(dxt),jA=(e=>{let t={};return qI.forEach(((e,i)=>t[e]=i)),t})(),fxt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,$s=String.fromCharCode.bind(String),mme="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Eme=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),Tme=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),bme=e=>{let t,i,r,n,s="",a=e.length%3;for(let o=0;o<e.length;){if((i=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(n=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");t=i<<16|r<<8|n,s+=qI[t>>18&63]+qI[t>>12&63]+qI[t>>6&63]+qI[63&t]}return a?s.slice(0,a-3)+"===".substring(a):s},mG=pxt?e=>btoa(e):LE?e=>Buffer.from(e,"binary").toString("base64"):bme,dG=LE?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,r=e.length;i<r;i+=4096)t.push($s.apply(null,e.subarray(i,i+4096)));return mG(t.join(""))},WA=(e,t=!1)=>t?Eme(dG(e)):dG(e),mxt=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?$s(192|t>>>6)+$s(128|63&t):$s(224|t>>>12&15)+$s(128|t>>>6&63)+$s(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return $s(240|t>>>18&7)+$s(128|t>>>12&63)+$s(128|t>>>6&63)+$s(128|63&t)},gxt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,xme=e=>e.replace(gxt,mxt),gme=LE?e=>Buffer.from(e,"utf8").toString("base64"):fme?e=>dG(fme.encode(e)):e=>mG(xme(e)),NE=(e,t=!1)=>t?Eme(gme(e)):gme(e),vme=e=>NE(e,!0),vxt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,yxt=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return $s(55296+(t>>>10))+$s(56320+(1023&t));case 3:return $s((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return $s((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Ime=e=>e.replace(vxt,yxt),_me=e=>{if(e=e.replace(/\s+/g,""),!fxt.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,i,r,n="";for(let s=0;s<e.length;)t=jA[e.charAt(s++)]<<18|jA[e.charAt(s++)]<<12|(i=jA[e.charAt(s++)])<<6|(r=jA[e.charAt(s++)]),n+=64===i?$s(t>>16&255):64===r?$s(t>>16&255,t>>8&255):$s(t>>16&255,t>>8&255,255&t);return n},gG=hxt?e=>atob(Tme(e)):LE?e=>Buffer.from(e,"base64").toString("binary"):_me,Sme=LE?e=>mme(Buffer.from(e,"base64")):e=>mme(gG(e).split("").map((e=>e.charCodeAt(0)))),wme=e=>Sme(Rme(e)),Ext=LE?e=>Buffer.from(e,"base64").toString("utf8"):dme?e=>dme.decode(Sme(e)):e=>Ime(gG(e)),Rme=e=>Tme(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),fG=e=>Ext(Rme(e)),Txt=e=>{if("string"!=typeof e)return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Mme=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Dme=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,Mme(t));e("fromBase64",(function(){return fG(this)})),e("toBase64",(function(e){return NE(this,e)})),e("toBase64URI",(function(){return NE(this,!0)})),e("toBase64URL",(function(){return NE(this,!0)})),e("toUint8Array",(function(){return wme(this)}))},Cme=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Mme(t));e("toBase64",(function(e){return WA(this,e)})),e("toBase64URI",(function(){return WA(this,!0)})),e("toBase64URL",(function(){return WA(this,!0)}))},bxt=()=>{Dme(),Cme()},Ame={version:yme,VERSION:uxt,atob:gG,atobPolyfill:_me,btoa:mG,btoaPolyfill:bme,fromBase64:fG,toBase64:NE,encode:NE,encodeURI:vme,encodeURL:vme,utob:xme,btou:Ime,decode:fG,isValid:Txt,fromUint8Array:WA,toUint8Array:wme,extendString:Dme,extendUint8Array:Cme,extendBuiltins:bxt},Ql=ps($me(),1),qA=class extends Vp{constructor(e,t={}){let i=t.font;if(void 0===i)super();else{let r=i.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}},kf=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=new di(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(e){let i=n.parse(JSON.parse(e));t&&t(i)}),i,r)}parse(e){return new u0(e)}},u0=class{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){let i=[],r=Oxt(e,t,this.data);for(let n=0,s=r.length;n<s;n++)i.push(...r[n].toShapes());return i}};function Oxt(e,t,i){let r=Array.from(e),n=t/i.resolution,s=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*n,a=[],o=0,l=0;for(let h=0;h<r.length;h++){let e=r[h];if("\n"===e)o=0,l-=s;else{let t=Pxt(e,n,o,l,i);o+=t.offsetX,a.push(t.path)}}return a}function Pxt(e,t,i,r,n){let s=n.glyphs[e]||n.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+n.familyName+".");let a,o,l,h,u,c,p,d,f=new Hx;if(s.o){let e=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let n=0,s=e.length;n<s;)switch(e[n++]){case"m":a=e[n++]*t+i,o=e[n++]*t+r,f.moveTo(a,o);break;case"l":a=e[n++]*t+i,o=e[n++]*t+r,f.lineTo(a,o);break;case"q":l=e[n++]*t+i,h=e[n++]*t+r,u=e[n++]*t+i,c=e[n++]*t+r,f.quadraticCurveTo(u,c,l,h);break;case"b":l=e[n++]*t+i,h=e[n++]*t+r,u=e[n++]*t+i,c=e[n++]*t+r,p=e[n++]*t+i,d=e[n++]*t+r,f.bezierCurveTo(u,c,p,d,l,h)}}return{offsetX:s.ha*t,path:f}}function Zme(e,t,i,r){let n={u_cameraZoom:i,u_patternLines:{value:e},u_patternAngle:{value:t},u_color:{value:r}},s=`\n uniform mat4 modelMatrix;\n uniform float u_cameraZoom;\n uniform vec3 u_color;\n varying vec3 v_pos;\n\n struct PatternLine {\n vec2 origin;\n vec2 delta;\n float angle;\n float pattern[MAX_PATTERN_SEGMENT_COUNT];\n float patternSum[MAX_PATTERN_SEGMENT_COUNT+1];\n float patternLength;\n };\n\n uniform PatternLine u_patternLines[${e.length}];\n uniform float u_patternAngle;\n\n #include <clipping_planes_pars_fragment>\n\n // Clamp [0..1] range\n #define saturate(a) clamp(a, 0.0, 1.0)\n\n const float EPS = 0.000001;\n\n vec2 getWorldScale() {\n return vec2(length(modelMatrix[0].xyz), length(modelMatrix[1].xyz));\n }\n\n vec2 rotate(vec2 st, float rotation) {\n const float PI = 3.1415926;\n float angle = rotation * PI/180.0;\n float sine = sin(angle), cosine = cos(angle);\n return vec2(cosine * st.x - sine * st.y, cosine * st.y + sine * st.x);\n }\n\n vec2 translate(vec2 samplePosition, vec2 offset) {\n //move samplepoint in the opposite direction that we want to move shapes in\n return samplePosition - offset;\n }\n\n vec2 scale(vec2 samplePosition, float scale) {\n return samplePosition / scale;\n }\n\n float sdfLine(vec2 st, vec2 a, vec2 b) {\n vec2 ap = st - a;\n vec2 ab = b - a;\n return abs(((ap.x * ab.y) - (ab.x * ap.y))) / length(ab);\n }\n\n float drawSpaceLine(vec2 st, float distanceBetweenLines, float thick) {\n float dist = sdfLine(st , vec2(0.0, 0.0) , vec2(1.0, 0.0));\n \n //vec2 tt = dFdy(st);\n //float scale = (abs(tt.x)+abs(tt.y))/2.0;\n //float scale = length(fwidth(st)) * 0.5;\n // close to a pixel\n //float thick = 2.0;\n //thick = (thick * 0.5 - 0.5) * scale;\n\n float lineDistance = abs(fract(dist / distanceBetweenLines + 0.5) - 0.5) * distanceBetweenLines;\n //float distanceChange = fwidth(dist) * 0.5;\n //float thresold = smoothstep(thick - distanceChange, thick + distanceChange, lineDistance);\n //float thresold = step(thick,lineDistance);\n // remove gradient\n float thresold = step(thick,lineDistance);\n\n return saturate(thresold);\n }\n\n float drawSolidLine(PatternLine patternLine, float thick) {\n vec2 origin = patternLine.origin;\n vec2 delta = patternLine.delta;\n float distanceBetweenLines = length(delta);\n\n origin = rotate(origin,u_patternAngle);\n vec2 st = rotate(v_pos.xy - origin, -(patternLine.angle + u_patternAngle));\n\n return drawSpaceLine(st, distanceBetweenLines , thick);\n }\n\n int getPatternIndex(PatternLine patternLine, float u ) {\n u = mod(u, patternLine.patternLength);\n float distance = 0.0;\n\n #pragma unroll_loop_start\n for(int i = 1; i < patternLine.patternSum.length(); i++){\n if(u < patternLine.patternSum[i]) {\n distance = u - patternLine.patternSum[i-1];\n return i - 1;\n }\n }\n #pragma unroll_loop_end\n\n return -1;\n }\n\n float drawDashedLine(PatternLine patternLine, float thick){\n float thresold = 1.0;\n vec2 origin = patternLine.origin;\n vec2 delta = patternLine.delta; \n float distanceBetweenLines = length(delta.y);\n\n origin = rotate(origin, u_patternAngle);\n vec2 st = rotate(v_pos.xy - origin, -(patternLine.angle + u_patternAngle));\n\n float offsetX = st.y * delta.x/delta.y;\n float u = st.x - offsetX;\n int index = getPatternIndex(patternLine, u);\n if(index < 0){\n return thresold;\n }\n\n float size = patternLine.pattern[index];\n if(size >= 0.0) {\n thresold = drawSpaceLine(st, distanceBetweenLines , thick);\n }\n \n return thresold;\n }\n\n float drawLine(PatternLine patternLine, float thick) {\n float t = 0.0;\n if(patternLine.patternLength > 0.0) {\n t = drawDashedLine(patternLine, thick);\n } else {\n t = drawSolidLine(patternLine, thick);\n }\n return t;\n }\n\n void main() {\n #include <clipping_planes_fragment>\n \n if(u_cameraZoom < EPS){\n gl_FragColor = vec4(u_color, 1.0);\n return;\n }\n\n vec2 worldScale = getWorldScale();\n float averageScale = (abs(worldScale.x) + abs(worldScale.y))/2.0;\n float thick = (0.7 / averageScale) / u_cameraZoom;\n\n float total = 0.0;\n\n#if ${e.length} > 1\n #pragma unroll_loop_start\n for (int i = 0; i < u_patternLines.length(); i++) {\n PatternLine pl = u_patternLines[i];\n float t = drawLine(pl, thick);\n total += (1.0 - t);\n }\n #pragma unroll_loop_end\n#else\n float t = drawLine(u_patternLines[0], thick);\n total += (1.0 - t);\n#endif\n\n total = saturate(total);\n if (total < 0.01) {\n discard;\n }\n\n gl_FragColor = vec4(u_color * total, 1.0);\n }\n `;return new Zt({uniforms:n,vertexShader:"\n varying vec3 v_pos;\n\n #include <clipping_planes_pars_vertex>\n void main() {\n //vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n v_pos = position;\n\n #include <begin_vertex>\n #include <project_vertex>\n #include <clipping_planes_vertex>\n }",fragmentShader:s,clipping:!0})}var YA=class{static createLineShaderMaterial(e,t,i,r,n){let s=0,a=[];for(let h=0;h<e.length;h++)a[h]=e[h],0===a[h]&&(a[h]=.5),a[h]*=i,s+=Math.abs(a[h]);let o=dn.merge([At.common,{pattern:{type:"fv1",value:a},patternLength:{type:"f",value:s},u_color:{value:new Ve(t)}}]);o.u_viewportScale=r,o.u_cameraZoom=n;let l=`\n uniform mat4 modelMatrix;\n uniform vec3 diffuse;\n uniform vec3 u_color;\n uniform float opacity;\n uniform float pattern[${e.length}];\n uniform float patternLength;\n uniform float u_viewportScale;\n uniform float u_cameraZoom;\n varying float vLineDistance;\n\n #include <clipping_planes_pars_fragment>\n\n vec2 getWorldScale() {\n return vec2(length(modelMatrix[0].xyz), length(modelMatrix[1].xyz));\n }\n\n void main() {\n\n #include <clipping_planes_fragment>\n\n // vec2 worldScale = getWorldScale();\n // float averageScale = (abs(worldScale.x) + abs(worldScale.y))/2.0;\n // When zoomed out to a certain extent, it is displayed as a solid line.\n if(patternLength * u_viewportScale * u_cameraZoom/1.5 < 1.0){\n gl_FragColor = vec4(u_color, opacity);\n return;\n }\n\n float pos = mod(vLineDistance, patternLength * u_viewportScale);\n\n for ( int i = 0; i < ${e.length}; i++ ) {\n pos = pos - abs(pattern[i] * u_viewportScale);\n if ( pos < 0.0 ) {\n if ( pattern[i] > 0.0 ) {\n gl_FragColor = vec4(u_color, opacity);\n break;\n }\n discard;\n }\n }\n }`;return new Zt({uniforms:o,vertexShader:"\n attribute float lineDistance;\n varying float vLineDistance;\n\n #include <clipping_planes_pars_vertex>\n\n void main() {\n vLineDistance = lineDistance;\n\n #include <begin_vertex>\n #include <project_vertex>\n #include <clipping_planes_vertex>\n }",fragmentShader:l,clipping:!0})}},TG={};fw(TG,{default:()=>EG});var yG={};fw(yG,{default:()=>vG});var vG=(e,t)=>void 0===t||0==+t?Math.round(e):(e=+e,t=+t,isNaN(e)||"number"!=typeof t||t%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math.round(+(e[0]+"e"+(e[1]?+e[1]-t:-t)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+t:t)))),EG=(e,t,i,r,n)=>{let s=i.length,a=i[0].length;if(e<0||e>1)throw new Error("t out of bounds [0,1]: "+e);if(t<1)throw new Error("degree must be at least 1 (linear)");if(t>s-1)throw new Error("degree must be less than or equal to point count - 1");if(r){if(r.length!==s+t+1)throw new Error("bad knot vector length")}else{r=[];for(let e=0;e<s+t+1;e++)r[e]=e}let o,l=[t,r.length-1-t],h=r[l[0]],u=r[l[1]];for(e=e*(u-h)+h,e=Math.max(e,h),e=Math.min(e,u),o=l[0];o<l[1]&&!(e>=r[o]&&e<=r[o+1]);o++);let c,p=[];for(let f=0;f<s;f++){p[f]=[];let e=n?n[f]:1;for(let t=0;t<a;t++)p[f][t]=i[f][t]*e;p[f][a]=e}for(let f=1;f<=t+1;f++)for(let i=o;i>o-t-1+f;i--){c=(e-r[i])/(r[i+t+1-f]-r[i]);for(let e=0;e<a+1;e++)p[i][e]=(1-c)*p[i-1][e]+c*p[i][e]}let d=[];for(let f=0;f<a;f++)d[f]=vG(p[o][f]/p[o][a],-9);return d},Nxt={d:"\xb0",c:"\u2300",p:"\xb1"},XA=(e,t)=>{if(!e)return[];e=e.replace(/%%(.)/g,((e,t)=>Nxt[t]||t));let i,r=null==t?void 0:t.encoding,n=r instanceof TextDecoder?r:void 0,s="",a=[],o=e=>{s&&(a.push(s),s=""),a.push(e)};for(let l=0;l<e.length;l++)switch(i=e[l]){default:s+=i,";"===i&&o(s);break;case"\\":switch(i=e[++l]){default:s+=i;break;case"P":s+="\n";break;case"f":case"F":{let t="";for(;i=e[++l];){if(";"===i){o({f:t});break}if("|"===i){let i={f:t},r=e.indexOf(";",++l);for(let t of e.slice(l,r).split("|"))i[t[0]]=+t.slice(1);l=r,o(i);break}t+="\\"===i?e[++l]:i}break}case"S":{let t,r="",n="";for(;i=e[++l];){if(";"===i){t&&o({S:[r,t,n]});break}"\\"===i?t?n+=e[++l]:r+=e[++l]:t?n+=i:"^"===i||"/"===i||"#"===i?t=i:r+=i}break}case"H":case"W":let t=++l,[,a,h]=e.slice(t,l=e.indexOf(";",l)).match(/^(\d*(?:\.\d+)?)(\D*)$/);o({[i]:[+a,h]});break;case"Q":case"A":case"C":case"c":case"T":{let t=++l;o({[i]:+e.slice(t,l=e.indexOf(";",l))});break}case"L":case"O":case"K":o({[i]:1});break;case"l":case"o":case"k":o({[i.toUpperCase()]:0});break;case"U":case"u":"+"===e[l+1]?(s+=String.fromCodePoint(parseInt(e.substr(l+2,4),16)),l+=5):s+=i;break;case"M":case"m":r?"+"!==e[l+1]||"0"!==e[l+2]&&"1"!==e[l+2]?s+=i:(s+=(n=n||new TextDecoder(r)).decode(new Uint8Array([parseInt(e.substr(l+3,2),16),parseInt(e.substr(l+5,2),16)])),l+=6):s+="\\"+i}break;case"{":{let t=1,r=l;for(;i=e[++l];)if("{"===i)t++;else if("}"===i){if(0==--t){o(XA(e.slice(r+1,l)));break}}else"\\"===i&&l++;break}}return s&&a.push(s),a},Lxt={d:"\xb0",c:"\u2300",p:"\xb1"},Fxt=(e,t)=>(e=Hxt(e),t?Uxt(e,t):e),Hxt=e=>e.replace(/\\[uU]\+([0-9a-fA-F]{4})/g,((e,t)=>String.fromCodePoint(parseInt(t,16)))),Uxt=(e,t)=>{let i=t instanceof TextDecoder?t:new TextDecoder(t);return e.replace(/\\[mM]\+[0|1]([0-9a-fA-F]{2})([0-9a-fA-F]{2})/g,((e,r,n)=>(i=i||new TextDecoder(t)).decode(new Uint8Array([parseInt(r,16),parseInt(n,16)]))))},$A=(e,t)=>{let i=0,r={text:""},n=[r],s=(e=Fxt(e,null==t?void 0:t.encoding)).matchAll(/%%(\d\d\d|.)/g);for(let a of s){r.text+=e.slice(i,a.index);let t=a[1].toLowerCase(),s=Lxt[t];s?r.text+=s:3===t.length?r.text+=String.fromCodePoint(+t):"k"===t||"o"===t||"u"===t?(r=Ln(Mr({},r),{text:""}),r[t]?delete r[t]:r[t]=1,n.push(r)):r.text+=t,i=a.index+a[0].length}return r.text+=e.slice(i),n.filter((e=>e.text))},bG=(e=>(e.Unitless="Unitless",e.Inches="Inches",e.Feet="Feet",e.Millimeters="Millimeters",e.Centimeters="Centimeters",e.Meters="Meters",e))(bG||{}),Kme=e=>"Unitless"===e?1:"Inches"===e?.0254:"Feet"===e?.3048:"Millimeters"===e?.001:"Centimeters"===e?.01:("Meters"===e||console.warn(`[Units] Unsupported unit '${e}', will return 1 for unit scale.`),1),xG=(e,t)=>Kme(e)/Kme(t),JI="0.2.43",Jme="VERSION",Bxt=()=>window.localStorage.getItem(Jme),kxt=()=>{window.localStorage.setItem(Jme,JI)},Qme=()=>Bxt()!==JI&&(kxt(),!0),FE=class{constructor(){this.DATABASE_NAME="gemini_viewer_db",this.TABLES=[{name:"viewpoint",options:{keyPath:"id",autoIncrement:!0},indexArray:[]},{name:"annotation",options:{keyPath:"id",autoIncrement:!0},indexArray:[]},{name:"dxfdata",options:{keyPath:"dxfDataId",autoIncrement:!1},indexArray:[]},{name:"fontdata",options:{keyPath:"url",autoIncrement:!0},indexArray:[]}],this.db=void 0}static instance(){return FE._instance||(FE._instance=new FE),FE._instance}getDatabase(){return ct(this,null,(function*(){let e=yield this.getDB(this.DATABASE_NAME);return this.db||(e.close(),Qme()&&(yield this.deleteDataBase(this.DATABASE_NAME)),e=yield this.getUpgradedDB(e)),e.onclose=()=>{this.db=void 0,re.debug(`[DB] Db ${e.name} is closed.`)},e.onerror=t=>{this.db=void 0,re.debug(`[DB] Db ${e.name} encountered error.`,t)},e.onabort=t=>{this.db=void 0,re.debug(`[DB] Db ${e.name} aborted.`,t)},e.onversionchange=e=>{re.debug("onversionchange",e)},this.db=e,Promise.resolve(this.db)}))}closeDatabase(){this.db&&this.db.close()}deleteDataBase(e){return new Promise(((t,i)=>{let r=window.indexedDB.deleteDatabase(e);r.onerror=e=>{re.debug(e),i(e)},r.onsuccess=i=>{let r=i.target;re.debug(`[DB] Db ${e} delete old version ${i.oldVersion}.`),t(r)}}))}getDB(e){return ct(this,null,(function*(){return new Promise(((t,i)=>{let r=window.indexedDB.open(e);r.onerror=i,r.onsuccess=e=>{let i=e.target.result;re.debug(`[DB] Db ${i.name} opened (version ${i.version}).`),t(i)}}))}))}getUpgradedDB(e){return ct(this,null,(function*(){return new Promise(((t,i)=>{re.debug(`[DB] Upgrading db ${e.name} (version ${e.version})`);let r=window.indexedDB.open(e.name,e.version+1);r.onerror=i,r.onblocked=e=>{re.debug("onblocked",e)},r.onupgradeneeded=e=>{e.target.transaction.oncomplete=()=>{re.debug(`[DB] Upgrade is done (new version: ${t.version}).`)};let t=e.target.result,i=[];for(let r=0;r<this.TABLES.length;++r){let e=this.TABLES[r];if(!t.objectStoreNames.contains(e.name)){re.debug(`[DB] Creating table ${e.name}...`);let r=this.createTable(t,e.name,e.options,e.indexArray);i.push(r)}}i.length>0&&Promise.all(i).then((()=>{re.debug(`[DB] All(${i.length}) tables created.`)}))},r.onsuccess=e=>{let i=e.target.result;re.debug(`[DB] Db ${i.name} opened (version ${i.version}).`),t(i)}}))}))}createTable(e,t,i,r){return ct(this,null,(function*(){return new Promise((n=>{let s=e.createObjectStore(t,i);r&&r.forEach((e=>{s.createIndex(e.name,e.fields,{unique:e.unique})})),re.debug(`[DB] Table ${t} created.`),n(e)}))}))}},as=FE;as._instance=void 0;var dh=class{constructor(){if(this.db=void 0,this.isCreatingTable=!1,-1===as.instance().TABLES.findIndex((e=>e.name===this.tableName())))throw new Error(`Make sure to add table '${this.tableName()}' to IndexedDbManager.TABLES!`)}tableName(){throw new Error("Derived class have to override 'tableName', and set a proper table name!")}add(e,t,i){let r=this.tableName();as.instance().getDatabase().then((n=>{let s=n.transaction([r],"readwrite").objectStore(r).add(e);s.onsuccess=t,s.onerror=i})).finally((()=>{as.instance().closeDatabase()})).catch((e=>{i&&i(e)}))}save(e,t,i){let r=this.tableName();as.instance().getDatabase().then((n=>{let s=n.transaction([r],"readwrite").objectStore(r).put(e);s.onsuccess=t,s.onerror=i})).finally((()=>{as.instance().closeDatabase()}))}delete(e,t,i){let r=this.tableName();as.instance().getDatabase().then((n=>{let s=n.transaction([r],"readwrite").objectStore(r).delete(e);s.onsuccess=t,s.onerror=i})).finally((()=>{as.instance().closeDatabase()}))}update(){as.instance().getDatabase().then((()=>{}))}query(e,t){let i=this.tableName();as.instance().getDatabase().then((r=>{let n=r.transaction([i],"readonly").objectStore(i).openCursor();n.onsuccess=t=>{let i=t.target.result;i&&i.continue(),e&&e(i)},n.onerror=t})).finally((()=>{as.instance().closeDatabase()}))}queryAll(e,t){let i=this.tableName();as.instance().getDatabase().then((r=>{let n=r.transaction([i],"readonly").objectStore(i).getAll();n.onsuccess=t=>{e&&e(n.result)},n.onerror=t})).finally((()=>{as.instance().closeDatabase()}))}clearAll(e,t){let i=this.tableName();as.instance().getDatabase().then((r=>{let n=r.transaction([i],"readwrite").objectStore(i).clear();n.onsuccess=t=>{e&&e(t)},n.onerror=e=>{t&&t(e)}})).finally((()=>{as.instance().closeDatabase()}))}},HE=class extends dh{tableName(){return"annotation"}static instance(){return HE._instance||(HE._instance=new HE),HE._instance}query(e,t,i){let r=[];super.query((i=>{i?!i.value||i.value.projectId!==e||r.push(i.value):t&&t(r)}),(e=>{console.log(e)}))}},IG=HE;IG._instance=void 0;var UE=class extends dh{tableName(){return"viewpoint"}static instance(){return UE._instance||(UE._instance=new UE),UE._instance}query(e,t,i){let r=[];super.query((i=>{i?!i.value||i.value.projectId!==e||r.push(i.value):t&&t(r)}),(e=>{i&&i(),console.log(e)}))}},_G=UE;_G._instance=void 0;var BE=class extends dh{tableName(){return"dxfdata"}static instance(){return BE._instance||(BE._instance=new BE),BE._instance}query(e,t,i){let r=[],n=this.tableName();as.instance().getDatabase().then((s=>{let a=s.transaction([n],"readonly").objectStore(n).get(e);a.onerror=e=>{i&&i(e),re.info("[DxfDataTable] Failed to query !",e)},a.onsuccess=()=>{a.result&&r.push(a.result),t&&t(r)}})).finally((()=>{as.instance().closeDatabase()}))}},kE=BE;kE._instance=void 0;var h0=class extends dh{tableName(){return"fontdata"}static instance(){return h0._instance||(h0._instance=new h0),h0._instance}query(e,t,i){let r;super.query((i=>{i?!i.value||i.value.url!==e||(r=i.value):t&&t(r)}),(e=>{i&&i(),console.log(e)}))}queryAll(){return ct(this,null,(function*(){return new Promise(((e,t)=>{w9(h0.prototype,this,"queryAll").call(this,(t=>{e(t)}),(e=>{t(e)}))}))}))}},fh=h0;fh._instance=void 0;var KA,ege=(e=>(e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.All=2]="All",e))(ege||{}),p0=(e=>(e[e.Shapes=0]="Shapes",e[e.Bigfont=1]="Bigfont",e[e.Unifont=2]="Unifont",e))(p0||{}),ZA=12,Jp=class extends Fa{constructor(e,t){super(),this.width=0,this.lastPoint=e,this.polylines=t,this.width=this.calcWidth(t)}offset(e){let t=[];for(let i=0;i<this.polylines.length;i++){let r=this.polylines[i],n=[];for(let t=0;t<r.length;t++){let i=r[t];n.push(i.clone().add(e))}t.push(n)}return new Jp(this.lastPoint,t)}transform(e){let t=[];for(let i=0;i<this.polylines.length;i++){let r=this.polylines[i],n=[];for(let t=0;t<r.length;t++){let i=r[t];n.push(i.clone().applyMatrix3(e))}t.push(n)}return new Jp(this.lastPoint.clone().applyMatrix3(e),t)}calcWidth(e){let t=new ns(new ce,new ce);for(let r=0;r<e.length;r++){let i=e[r];for(let e=0;e<i.length;e++){let r=i[e];t.expandByPoint(r)}}let i=t.min.x||0;return(t.max.x||0)-i}toThreeGeometry(){let e=this.polylines,t=[],i=[],r=0,n=new ot;for(let s=0;s<e.length;s++){let n=e[s];for(let e=0;e<n.length;e++){let s=n[e];t.push(s.x,s.y,0),e===n.length-1||i.push(r,r+1),r++}}return n.setAttribute("position",new dt(t,3)),n.setIndex(i),n}};function Gxt(){let e=[[161,169,161,254],[176,247,161,254],[129,160,64,254],[170,254,64,160],[168,169,64,160],[170,175,161,254],[248,254,161,254],[161,167,64,160]],t=new Uint16Array(23940),i=0;for(let[n,s,a,o]of e)for(let e=a;e<=o;e++)if(127!==e)for(let r=n;r<=s;r++)t[i++]=e<<8|r;let r=new TextDecoder("gbk").decode(t);for(KA=new Uint16Array(65536),i=0;i<r.length;i++)KA[r.charCodeAt(i)]=t[i]}function tge(e){KA||Gxt();let t=new Uint8Array(2*e.length),i=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n<128)t[i++]=n;else{let e=KA[n];t[i++]=255&e,t[i++]=e>>8}}return t.subarray(0,i)}var Vxt="\u554a\u963f\u57c3\u6328\u54ce\u5509\u54c0\u7691\u764c\u853c\u77ee\u827e\u788d\u7231\u9698\u978d\u6c28\u5b89\u4ffa\u6309\u6697\u5cb8\u80fa\u6848\u80ae\u6602\u76ce\u51f9\u6556\u71ac\u7ff1\u8884\u50b2\u5965\u61ca\u6fb3\u82ad\u634c\u6252\u53ed\u5427\u7b06\u516b\u75a4\u5df4\u62d4\u8dcb\u9776\u628a\u8019\u575d\u9738\u7f62\u7238\u767d\u67cf\u767e\u6446\u4f70\u8d25\u62dc\u7a17\u6591\u73ed\u642c\u6273\u822c\u9881\u677f\u7248\u626e\u62cc\u4f34\u74e3\u534a\u529e\u7eca\u90a6\u5e2e\u6886\u699c\u8180\u7ed1\u68d2\u78c5\u868c\u9551\u508d\u8c24\u82de\u80de\u5305\u8912\u5265\u8584\u96f9\u4fdd\u5821\u9971\u5b9d\u62b1\u62a5\u66b4\u8c79\u9c8d\u7206\u676f\u7891\u60b2\u5351\u5317\u8f88\u80cc\u8d1d\u94a1\u500d\u72c8\u5907\u60eb\u7119\u88ab\u5954\u82ef\u672c\u7b28\u5d29\u7ef7\u752d\u6cf5\u8e66\u8ff8\u903c\u9f3b\u6bd4\u9119\u7b14\u5f7c\u78a7\u84d6\u853d\u6bd5\u6bd9\u6bd6\u5e01\u5e87\u75f9\u95ed\u655d\u5f0a\u5fc5\u8f9f\u58c1\u81c2\u907f\u965b\u97ad\u8fb9\u7f16\u8d2c\u6241\u4fbf\u53d8\u535e\u8fa8\u8fa9\u8fab\u904d\u6807\u5f6a\u8198\u8868\u9cd6\u618b\u522b\u762a\u5f6c\u658c\u6fd2\u6ee8\u5bbe\u6448\u5175\u51b0\u67c4\u4e19\u79c9\u997c\u70b3\u75c5\u5e76\u73bb\u83e0\u64ad\u62e8\u94b5\u6ce2\u535a\u52c3\u640f\u94c2\u7b94\u4f2f\u5e1b\u8236\u8116\u818a\u6e24\u6cca\u9a73\u6355\u535c\u54fa\u8865\u57e0\u4e0d\u5e03\u6b65\u7c3f\u90e8\u6016\u64e6\u731c\u88c1\u6750\u624d\u8d22\u776c\u8e29\u91c7\u5f69\u83dc\u8521\u9910\u53c2\u8695\u6b8b\u60ed\u60e8\u707f\u82cd\u8231\u4ed3\u6ca7\u85cf\u64cd\u7cd9\u69fd\u66f9\u8349\u5395\u7b56\u4fa7\u518c\u6d4b\u5c42\u8e6d\u63d2\u53c9\u832c\u8336\u67e5\u78b4\u643d\u5bdf\u5c94\u5dee\u8be7\u62c6\u67f4\u8c7a\u6400\u63ba\u8749\u998b\u8c17\u7f20\u94f2\u4ea7\u9610\u98a4\u660c\u7316\u573a\u5c1d\u5e38\u957f\u507f\u80a0\u5382\u655e\u7545\u5531\u5021\u8d85\u6284\u949e\u671d\u5632\u6f6e\u5de2\u5435\u7092\u8f66\u626f\u64a4\u63a3\u5f7b\u6f88\u90f4\u81e3\u8fb0\u5c18\u6668\u5ff1\u6c89\u9648\u8d81\u886c\u6491\u79f0\u57ce\u6a59\u6210\u5448\u4e58\u7a0b\u60e9\u6f84\u8bda\u627f\u901e\u9a8b\u79e4\u5403\u75f4\u6301\u5319\u6c60\u8fdf\u5f1b\u9a70\u803b\u9f7f\u4f88\u5c3a\u8d64\u7fc5\u65a5\u70bd\u5145\u51b2\u866b\u5d07\u5ba0\u62bd\u916c\u7574\u8e0c\u7a20\u6101\u7b79\u4ec7\u7ef8\u7785\u4e11\u81ed\u521d\u51fa\u6a71\u53a8\u8e87\u9504\u96cf\u6ec1\u9664\u695a\u7840\u50a8\u77d7\u6410\u89e6\u5904\u63e3\u5ddd\u7a7f\u693d\u4f20\u8239\u5598\u4e32\u75ae\u7a97\u5e62\u5e8a\u95ef\u521b\u5439\u708a\u6376\u9524\u5782\u6625\u693f\u9187\u5507\u6df3\u7eaf\u8822\u6233\u7ef0\u75b5\u8328\u78c1\u96cc\u8f9e\u6148\u74f7\u8bcd\u6b64\u523a\u8d50\u6b21\u806a\u8471\u56f1\u5306\u4ece\u4e1b\u51d1\u7c97\u918b\u7c07\u4fc3\u8e7f\u7be1\u7a9c\u6467\u5d14\u50ac\u8106\u7601\u7cb9\u6dec\u7fe0\u6751\u5b58\u5bf8\u78cb\u64ae\u6413\u63aa\u632b\u9519\u642d\u8fbe\u7b54\u7629\u6253\u5927\u5446\u6b79\u50a3\u6234\u5e26\u6b86\u4ee3\u8d37\u888b\u5f85\u902e\u6020\u803d\u62c5\u4e39\u5355\u90f8\u63b8\u80c6\u65e6\u6c2e\u4f46\u60ee\u6de1\u8bde\u5f39\u86cb\u5f53\u6321\u515a\u8361\u6863\u5200\u6363\u8e48\u5012\u5c9b\u7977\u5bfc\u5230\u7a3b\u60bc\u9053\u76d7\u5fb7\u5f97\u7684\u8e6c\u706f\u767b\u7b49\u77aa\u51f3\u9093\u5824\u4f4e\u6ef4\u8fea\u654c\u7b1b\u72c4\u6da4\u7fdf\u5ae1\u62b5\u5e95\u5730\u8482\u7b2c\u5e1d\u5f1f\u9012\u7f14\u98a0\u6382\u6ec7\u7898\u70b9\u5178\u975b\u57ab\u7535\u4f43\u7538\u5e97\u60e6\u5960\u6dc0\u6bbf\u7889\u53fc\u96d5\u51cb\u5201\u6389\u540a\u9493\u8c03\u8dcc\u7239\u789f\u8776\u8fed\u8c0d\u53e0\u4e01\u76ef\u53ee\u9489\u9876\u9f0e\u952d\u5b9a\u8ba2\u4e22\u4e1c\u51ac\u8463\u61c2\u52a8\u680b\u4f97\u606b\u51bb\u6d1e\u515c\u6296\u6597\u9661\u8c46\u9017\u75d8\u90fd\u7763\u6bd2\u728a\u72ec\u8bfb\u5835\u7779\u8d4c\u675c\u9540\u809a\u5ea6\u6e21\u5992\u7aef\u77ed\u953b\u6bb5\u65ad\u7f0e\u5806\u5151\u961f\u5bf9\u58a9\u5428\u8e72\u6566\u987f\u56e4\u949d\u76fe\u9041\u6387\u54c6\u591a\u593a\u579b\u8eb2\u6735\u8dfa\u8235\u5241\u60f0\u5815\u86fe\u5ce8\u9e45\u4fc4\u989d\u8bb9\u5a25\u6076\u5384\u627c\u904f\u9102\u997f\u6069\u800c\u513f\u8033\u5c14\u9975\u6d31\u4e8c\u8d30\u53d1\u7f5a\u7b4f\u4f10\u4e4f\u9600\u6cd5\u73d0\u85e9\u5e06\u756a\u7ffb\u6a0a\u77fe\u9492\u7e41\u51e1\u70e6\u53cd\u8fd4\u8303\u8d29\u72af\u996d\u6cdb\u574a\u82b3\u65b9\u80aa\u623f\u9632\u59a8\u4eff\u8bbf\u7eba\u653e\u83f2\u975e\u5561\u98de\u80a5\u532a\u8bfd\u5420\u80ba\u5e9f\u6cb8\u8d39\u82ac\u915a\u5429\u6c1b\u5206\u7eb7\u575f\u711a\u6c7e\u7c89\u594b\u4efd\u5fff\u6124\u7caa\u4e30\u5c01\u67ab\u8702\u5cf0\u950b\u98ce\u75af\u70fd\u9022\u51af\u7f1d\u8bbd\u5949\u51e4\u4f5b\u5426\u592b\u6577\u80a4\u5b75\u6276\u62c2\u8f90\u5e45\u6c1f\u7b26\u4f0f\u4fd8\u670d\u6d6e\u6daa\u798f\u88b1\u5f17\u752b\u629a\u8f85\u4fef\u91dc\u65a7\u812f\u8151\u5e9c\u8150\u8d74\u526f\u8986\u8d4b\u590d\u5085\u4ed8\u961c\u7236\u8179\u8d1f\u5bcc\u8ba3\u9644\u5987\u7f1a\u5490\u5676\u560e\u8be5\u6539\u6982\u9499\u76d6\u6e89\u5e72\u7518\u6746\u67d1\u7aff\u809d\u8d76\u611f\u79c6\u6562\u8d63\u5188\u521a\u94a2\u7f38\u809b\u7eb2\u5c97\u6e2f\u6760\u7bd9\u768b\u9ad8\u818f\u7f94\u7cd5\u641e\u9550\u7a3f\u544a\u54e5\u6b4c\u6401\u6208\u9e3d\u80f3\u7599\u5272\u9769\u845b\u683c\u86e4\u9601\u9694\u94ec\u4e2a\u5404\u7ed9\u6839\u8ddf\u8015\u66f4\u5e9a\u7fb9\u57c2\u803f\u6897\u5de5\u653b\u529f\u606d\u9f9a\u4f9b\u8eac\u516c\u5bab\u5f13\u5de9\u6c5e\u62f1\u8d21\u5171\u94a9\u52fe\u6c9f\u82df\u72d7\u57a2\u6784\u8d2d\u591f\u8f9c\u83c7\u5495\u7b8d\u4f30\u6cbd\u5b64\u59d1\u9f13\u53e4\u86ca\u9aa8\u8c37\u80a1\u6545\u987e\u56fa\u96c7\u522e\u74dc\u5250\u5be1\u6302\u8902\u4e56\u62d0\u602a\u68fa\u5173\u5b98\u51a0\u89c2\u7ba1\u9986\u7f50\u60ef\u704c\u8d2f\u5149\u5e7f\u901b\u7470\u89c4\u572d\u7845\u5f52\u9f9f\u95fa\u8f68\u9b3c\u8be1\u7678\u6842\u67dc\u8dea\u8d35\u523d\u8f8a\u6eda\u68cd\u9505\u90ed\u56fd\u679c\u88f9\u8fc7\u54c8\u9ab8\u5b69\u6d77\u6c26\u4ea5\u5bb3\u9a87\u9163\u61a8\u90af\u97e9\u542b\u6db5\u5bd2\u51fd\u558a\u7f55\u7ff0\u64bc\u634d\u65f1\u61be\u608d\u710a\u6c57\u6c49\u592f\u676d\u822a\u58d5\u568e\u8c6a\u6beb\u90dd\u597d\u8017\u53f7\u6d69\u5475\u559d\u8377\u83cf\u6838\u79be\u548c\u4f55\u5408\u76d2\u8c89\u9602\u6cb3\u6db8\u8d6b\u8910\u9e64\u8d3a\u563f\u9ed1\u75d5\u5f88\u72e0\u6068\u54fc\u4ea8\u6a2a\u8861\u6052\u8f70\u54c4\u70d8\u8679\u9e3f\u6d2a\u5b8f\u5f18\u7ea2\u5589\u4faf\u7334\u543c\u539a\u5019\u540e\u547c\u4e4e\u5ffd\u745a\u58f6\u846b\u80e1\u8774\u72d0\u7cca\u6e56\u5f27\u864e\u552c\u62a4\u4e92\u6caa\u6237\u82b1\u54d7\u534e\u733e\u6ed1\u753b\u5212\u5316\u8bdd\u69d0\u5f8a\u6000\u6dee\u574f\u6b22\u73af\u6853\u8fd8\u7f13\u6362\u60a3\u5524\u75ea\u8c62\u7115\u6da3\u5ba6\u5e7b\u8352\u614c\u9ec4\u78fa\u8757\u7c27\u7687\u51f0\u60f6\u714c\u6643\u5e4c\u604d\u8c0e\u7070\u6325\u8f89\u5fbd\u6062\u86d4\u56de\u6bc1\u6094\u6167\u5349\u60e0\u6666\u8d3f\u79fd\u4f1a\u70e9\u6c47\u8bb3\u8bf2\u7ed8\u8364\u660f\u5a5a\u9b42\u6d51\u6df7\u8c41\u6d3b\u4f19\u706b\u83b7\u6216\u60d1\u970d\u8d27\u7978\u51fb\u573e\u57fa\u673a\u7578\u7a3d\u79ef\u7b95\u808c\u9965\u8ff9\u6fc0\u8ba5\u9e21\u59ec\u7ee9\u7f09\u5409\u6781\u68d8\u8f91\u7c4d\u96c6\u53ca\u6025\u75be\u6c72\u5373\u5ac9\u7ea7\u6324\u51e0\u810a\u5df1\u84df\u6280\u5180\u5b63\u4f0e\u796d\u5242\u60b8\u6d4e\u5bc4\u5bc2\u8ba1\u8bb0\u65e2\u5fcc\u9645\u7ee7\u7eaa\u5609\u67b7\u5939\u4f73\u5bb6\u52a0\u835a\u988a\u8d3e\u7532\u94be\u5047\u7a3c\u4ef7\u67b6\u9a7e\u5ac1\u6b7c\u76d1\u575a\u5c16\u7b3a\u95f4\u714e\u517c\u80a9\u8270\u5978\u7f04\u8327\u68c0\u67ec\u78b1\u7877\u62e3\u6361\u7b80\u4fed\u526a\u51cf\u8350\u69db\u9274\u8df5\u8d31\u89c1\u952e\u7bad\u4ef6\u5065\u8230\u5251\u996f\u6e10\u6e85\u6da7\u5efa\u50f5\u59dc\u5c06\u6d46\u6c5f\u7586\u848b\u6868\u5956\u8bb2\u5320\u9171\u964d\u8549\u6912\u7901\u7126\u80f6\u4ea4\u90ca\u6d47\u9a84\u5a07\u56bc\u6405\u94f0\u77eb\u4fa5\u811a\u72e1\u89d2\u997a\u7f34\u7ede\u527f\u6559\u9175\u8f7f\u8f83\u53eb\u7a96\u63ed\u63a5\u7686\u79f8\u8857\u9636\u622a\u52ab\u8282\u830e\u775b\u6676\u9cb8\u4eac\u60ca\u7cbe\u7cb3\u7ecf\u4e95\u8b66\u666f\u9888\u9759\u5883\u656c\u955c\u5f84\u75c9\u9756\u7adf\u7ade\u51c0\u70af\u7a98\u63ea\u7a76\u7ea0\u7396\u97ed\u4e45\u7078\u4e5d\u9152\u53a9\u6551\u65e7\u81fc\u8205\u548e\u5c31\u759a\u97a0\u62d8\u72d9\u75bd\u5c45\u9a79\u83ca\u5c40\u5480\u77e9\u4e3e\u6cae\u805a\u62d2\u636e\u5de8\u5177\u8ddd\u8e1e\u952f\u4ff1\u53e5\u60e7\u70ac\u5267\u6350\u9e43\u5a1f\u5026\u7737\u5377\u7ee2\u6485\u652b\u6289\u6398\u5014\u7235\u6854\u6770\u6377\u776b\u7aed\u6d01\u7ed3\u89e3\u59d0\u6212\u85c9\u82a5\u754c\u501f\u4ecb\u75a5\u8beb\u5c4a\u5dfe\u7b4b\u65a4\u91d1\u4eca\u6d25\u895f\u7d27\u9526\u4ec5\u8c28\u8fdb\u9773\u664b\u7981\u8fd1\u70ec\u6d78\u5c3d\u52b2\u8346\u5162\u89c9\u51b3\u8bc0\u7edd\u5747\u83cc\u94a7\u519b\u541b\u5cfb\u4fca\u7ae3\u6d5a\u90e1\u9a8f\u5580\u5496\u5361\u54af\u5f00\u63e9\u6977\u51ef\u6168\u520a\u582a\u52d8\u574e\u780d\u770b\u5eb7\u6177\u7ce0\u625b\u6297\u4ea2\u7095\u8003\u62f7\u70e4\u9760\u5777\u82db\u67ef\u68f5\u78d5\u9897\u79d1\u58f3\u54b3\u53ef\u6e34\u514b\u523b\u5ba2\u8bfe\u80af\u5543\u57a6\u6073\u5751\u542d\u7a7a\u6050\u5b54\u63a7\u62a0\u53e3\u6263\u5bc7\u67af\u54ed\u7a9f\u82e6\u9177\u5e93\u88e4\u5938\u57ae\u630e\u8de8\u80ef\u5757\u7b77\u4fa9\u5feb\u5bbd\u6b3e\u5321\u7b50\u72c2\u6846\u77ff\u7736\u65f7\u51b5\u4e8f\u76d4\u5cbf\u7aa5\u8475\u594e\u9b41\u5080\u9988\u6127\u6e83\u5764\u6606\u6346\u56f0\u62ec\u6269\u5ed3\u9614\u5783\u62c9\u5587\u8721\u814a\u8fa3\u5566\u83b1\u6765\u8d56\u84dd\u5a6a\u680f\u62e6\u7bee\u9611\u5170\u6f9c\u8c30\u63fd\u89c8\u61d2\u7f06\u70c2\u6ee5\u7405\u6994\u72fc\u5eca\u90ce\u6717\u6d6a\u635e\u52b3\u7262\u8001\u4f6c\u59e5\u916a\u70d9\u6d9d\u52d2\u4e50\u96f7\u956d\u857e\u78ca\u7d2f\u5121\u5792\u64c2\u808b\u7c7b\u6cea\u68f1\u695e\u51b7\u5398\u68a8\u7281\u9ece\u7bf1\u72f8\u79bb\u6f13\u7406\u674e\u91cc\u9ca4\u793c\u8389\u8354\u540f\u6817\u4e3d\u5389\u52b1\u783e\u5386\u5229\u5088\u4f8b\u4fd0\u75e2\u7acb\u7c92\u6ca5\u96b6\u529b\u7483\u54e9\u4fe9\u8054\u83b2\u8fde\u9570\u5ec9\u601c\u6d9f\u5e18\u655b\u8138\u94fe\u604b\u70bc\u7ec3\u7cae\u51c9\u6881\u7cb1\u826f\u4e24\u8f86\u91cf\u667e\u4eae\u8c05\u64a9\u804a\u50da\u7597\u71ce\u5be5\u8fbd\u6f66\u4e86\u6482\u9563\u5ed6\u6599\u5217\u88c2\u70c8\u52a3\u730e\u7433\u6797\u78f7\u9716\u4e34\u90bb\u9cde\u6dcb\u51db\u8d41\u541d\u62ce\u73b2\u83f1\u96f6\u9f84\u94c3\u4f36\u7f9a\u51cc\u7075\u9675\u5cad\u9886\u53e6\u4ee4\u6e9c\u7409\u69b4\u786b\u998f\u7559\u5218\u7624\u6d41\u67f3\u516d\u9f99\u804b\u5499\u7b3c\u7abf\u9686\u5784\u62e2\u9647\u697c\u5a04\u6402\u7bd3\u6f0f\u964b\u82a6\u5362\u9885\u5e90\u7089\u63b3\u5364\u864f\u9c81\u9e93\u788c\u9732\u8def\u8d42\u9e7f\u6f5e\u7984\u5f55\u9646\u622e\u9a74\u5415\u94dd\u4fa3\u65c5\u5c65\u5c61\u7f15\u8651\u6c2f\u5f8b\u7387\u6ee4\u7eff\u5ce6\u631b\u5b6a\u6ee6\u5375\u4e71\u63a0\u7565\u62a1\u8f6e\u4f26\u4ed1\u6ca6\u7eb6\u8bba\u841d\u87ba\u7f57\u903b\u9523\u7ba9\u9aa1\u88f8\u843d\u6d1b\u9a86\u7edc\u5988\u9ebb\u739b\u7801\u8682\u9a6c\u9a82\u561b\u5417\u57cb\u4e70\u9ea6\u5356\u8fc8\u8109\u7792\u9992\u86ee\u6ee1\u8513\u66fc\u6162\u6f2b\u8c29\u8292\u832b\u76f2\u6c13\u5fd9\u83bd\u732b\u8305\u951a\u6bdb\u77db\u94c6\u536f\u8302\u5192\u5e3d\u8c8c\u8d38\u4e48\u73ab\u679a\u6885\u9176\u9709\u7164\u6ca1\u7709\u5a92\u9541\u6bcf\u7f8e\u6627\u5bd0\u59b9\u5a9a\u95e8\u95f7\u4eec\u840c\u8499\u6aac\u76df\u9530\u731b\u68a6\u5b5f\u772f\u919a\u9761\u7cdc\u8ff7\u8c1c\u5f25\u7c73\u79d8\u89c5\u6ccc\u871c\u5bc6\u5e42\u68c9\u7720\u7ef5\u5195\u514d\u52c9\u5a29\u7f05\u9762\u82d7\u63cf\u7784\u85d0\u79d2\u6e3a\u5e99\u5999\u8511\u706d\u6c11\u62bf\u76bf\u654f\u60af\u95fd\u660e\u879f\u9e23\u94ed\u540d\u547d\u8c2c\u6478\u6479\u8611\u6a21\u819c\u78e8\u6469\u9b54\u62b9\u672b\u83ab\u58a8\u9ed8\u6cab\u6f20\u5bde\u964c\u8c0b\u725f\u67d0\u62c7\u7261\u4ea9\u59c6\u6bcd\u5893\u66ae\u5e55\u52df\u6155\u6728\u76ee\u7766\u7267\u7a46\u62ff\u54ea\u5450\u94a0\u90a3\u5a1c\u7eb3\u6c16\u4e43\u5976\u8010\u5948\u5357\u7537\u96be\u56ca\u6320\u8111\u607c\u95f9\u6dd6\u5462\u9981\u5185\u5ae9\u80fd\u59ae\u9713\u502a\u6ce5\u5c3c\u62df\u4f60\u533f\u817b\u9006\u6eba\u852b\u62c8\u5e74\u78be\u64b5\u637b\u5ff5\u5a18\u917f\u9e1f\u5c3f\u634f\u8042\u5b7d\u556e\u954a\u954d\u6d85\u60a8\u67e0\u72de\u51dd\u5b81\u62e7\u6cde\u725b\u626d\u94ae\u7ebd\u8113\u6d53\u519c\u5f04\u5974\u52aa\u6012\u5973\u6696\u8650\u759f\u632a\u61e6\u7cef\u8bfa\u54e6\u6b27\u9e25\u6bb4\u85d5\u5455\u5076\u6ca4\u556a\u8db4\u722c\u5e15\u6015\u7436\u62cd\u6392\u724c\u5f98\u6e43\u6d3e\u6500\u6f58\u76d8\u78d0\u76fc\u7554\u5224\u53db\u4e53\u5e9e\u65c1\u802a\u80d6\u629b\u5486\u5228\u70ae\u888d\u8dd1\u6ce1\u5478\u80da\u57f9\u88f4\u8d54\u966a\u914d\u4f69\u6c9b\u55b7\u76c6\u7830\u62a8\u70f9\u6f8e\u5f6d\u84ec\u68da\u787c\u7bf7\u81a8\u670b\u9e4f\u6367\u78b0\u576f\u7812\u9739\u6279\u62ab\u5288\u7435\u6bd7\u5564\u813e\u75b2\u76ae\u5339\u75de\u50fb\u5c41\u8b6c\u7bc7\u504f\u7247\u9a97\u98d8\u6f02\u74e2\u7968\u6487\u77a5\u62fc\u9891\u8d2b\u54c1\u8058\u4e52\u576a\u82f9\u840d\u5e73\u51ed\u74f6\u8bc4\u5c4f\u5761\u6cfc\u9887\u5a46\u7834\u9b44\u8feb\u7c95\u5256\u6251\u94fa\u4ec6\u8386\u8461\u83e9\u84b2\u57d4\u6734\u5703\u666e\u6d66\u8c31\u66dd\u7011\u671f\u6b3a\u6816\u621a\u59bb\u4e03\u51c4\u6f06\u67d2\u6c8f\u5176\u68cb\u5947\u6b67\u7566\u5d0e\u8110\u9f50\u65d7\u7948\u7941\u9a91\u8d77\u5c82\u4e5e\u4f01\u542f\u5951\u780c\u5668\u6c14\u8fc4\u5f03\u6c7d\u6ce3\u8bab\u6390\u6d3d\u7275\u6266\u948e\u94c5\u5343\u8fc1\u7b7e\u4edf\u8c26\u4e7e\u9ed4\u94b1\u94b3\u524d\u6f5c\u9063\u6d45\u8c34\u5811\u5d4c\u6b20\u6b49\u67aa\u545b\u8154\u7f8c\u5899\u8537\u5f3a\u62a2\u6a47\u9539\u6572\u6084\u6865\u77a7\u4e54\u4fa8\u5de7\u9798\u64ac\u7fd8\u5ced\u4fcf\u7a8d\u5207\u8304\u4e14\u602f\u7a83\u94a6\u4fb5\u4eb2\u79e6\u7434\u52e4\u82b9\u64d2\u79bd\u5bdd\u6c81\u9752\u8f7b\u6c22\u503e\u537f\u6e05\u64ce\u6674\u6c30\u60c5\u9877\u8bf7\u5e86\u743c\u7a77\u79cb\u4e18\u90b1\u7403\u6c42\u56da\u914b\u6cc5\u8d8b\u533a\u86c6\u66f2\u8eaf\u5c48\u9a71\u6e20\u53d6\u5a36\u9f8b\u8da3\u53bb\u5708\u98a7\u6743\u919b\u6cc9\u5168\u75ca\u62f3\u72ac\u5238\u529d\u7f3a\u7094\u7638\u5374\u9e4a\u69b7\u786e\u96c0\u88d9\u7fa4\u7136\u71c3\u5189\u67d3\u74e4\u58e4\u6518\u56b7\u8ba9\u9976\u6270\u7ed5\u60f9\u70ed\u58ec\u4ec1\u4eba\u5fcd\u97e7\u4efb\u8ba4\u5203\u598a\u7eab\u6254\u4ecd\u65e5\u620e\u8338\u84c9\u8363\u878d\u7194\u6eb6\u5bb9\u7ed2\u5197\u63c9\u67d4\u8089\u8339\u8815\u5112\u5b7a\u5982\u8fb1\u4e73\u6c5d\u5165\u8925\u8f6f\u962e\u854a\u745e\u9510\u95f0\u6da6\u82e5\u5f31\u6492\u6d12\u8428\u816e\u9cc3\u585e\u8d5b\u4e09\u53c1\u4f1e\u6563\u6851\u55d3\u4e27\u6414\u9a9a\u626b\u5ac2\u745f\u8272\u6da9\u68ee\u50e7\u838e\u7802\u6740\u5239\u6c99\u7eb1\u50bb\u5565\u715e\u7b5b\u6652\u73ca\u82eb\u6749\u5c71\u5220\u717d\u886b\u95ea\u9655\u64c5\u8d61\u81b3\u5584\u6c55\u6247\u7f2e\u5892\u4f24\u5546\u8d4f\u664c\u4e0a\u5c1a\u88f3\u68a2\u634e\u7a0d\u70e7\u828d\u52fa\u97f6\u5c11\u54e8\u90b5\u7ecd\u5962\u8d4a\u86c7\u820c\u820d\u8d66\u6444\u5c04\u6151\u6d89\u793e\u8bbe\u7837\u7533\u547b\u4f38\u8eab\u6df1\u5a20\u7ec5\u795e\u6c88\u5ba1\u5a76\u751a\u80be\u614e\u6e17\u58f0\u751f\u7525\u7272\u5347\u7ef3\u7701\u76db\u5269\u80dc\u5723\u5e08\u5931\u72ee\u65bd\u6e7f\u8bd7\u5c38\u8671\u5341\u77f3\u62fe\u65f6\u4ec0\u98df\u8680\u5b9e\u8bc6\u53f2\u77e2\u4f7f\u5c4e\u9a76\u59cb\u5f0f\u793a\u58eb\u4e16\u67ff\u4e8b\u62ed\u8a93\u901d\u52bf\u662f\u55dc\u566c\u9002\u4ed5\u4f8d\u91ca\u9970\u6c0f\u5e02\u6043\u5ba4\u89c6\u8bd5\u6536\u624b\u9996\u5b88\u5bff\u6388\u552e\u53d7\u7626\u517d\u852c\u67a2\u68b3\u6b8a\u6292\u8f93\u53d4\u8212\u6dd1\u758f\u4e66\u8d4e\u5b70\u719f\u85af\u6691\u66d9\u7f72\u8700\u9ecd\u9f20\u5c5e\u672f\u8ff0\u6811\u675f\u620d\u7ad6\u5885\u5eb6\u6570\u6f31\u6055\u5237\u800d\u6454\u8870\u7529\u5e05\u6813\u62f4\u971c\u53cc\u723d\u8c01\u6c34\u7761\u7a0e\u542e\u77ac\u987a\u821c\u8bf4\u7855\u6714\u70c1\u65af\u6495\u5636\u601d\u79c1\u53f8\u4e1d\u6b7b\u8086\u5bfa\u55e3\u56db\u4f3a\u4f3c\u9972\u5df3\u677e\u8038\u6002\u9882\u9001\u5b8b\u8bbc\u8bf5\u641c\u8258\u64de\u55fd\u82cf\u9165\u4fd7\u7d20\u901f\u7c9f\u50f3\u5851\u6eaf\u5bbf\u8bc9\u8083\u9178\u849c\u7b97\u867d\u968b\u968f\u7ee5\u9ad3\u788e\u5c81\u7a57\u9042\u96a7\u795f\u5b59\u635f\u7b0b\u84d1\u68ad\u5506\u7f29\u7410\u7d22\u9501\u6240\u584c\u4ed6\u5b83\u5979\u5854\u736d\u631e\u8e4b\u8e0f\u80ce\u82d4\u62ac\u53f0\u6cf0\u915e\u592a\u6001\u6c70\u574d\u644a\u8d2a\u762b\u6ee9\u575b\u6a80\u75f0\u6f6d\u8c2d\u8c08\u5766\u6bef\u8892\u78b3\u63a2\u53f9\u70ad\u6c64\u5858\u642a\u5802\u68e0\u819b\u5510\u7cd6\u5018\u8eba\u6dcc\u8d9f\u70eb\u638f\u6d9b\u6ed4\u7ee6\u8404\u6843\u9003\u6dd8\u9676\u8ba8\u5957\u7279\u85e4\u817e\u75bc\u8a8a\u68af\u5254\u8e22\u9511\u63d0\u9898\u8e44\u557c\u4f53\u66ff\u568f\u60d5\u6d95\u5243\u5c49\u5929\u6dfb\u586b\u7530\u751c\u606c\u8214\u8146\u6311\u6761\u8fe2\u773a\u8df3\u8d34\u94c1\u5e16\u5385\u542c\u70c3\u6c40\u5ef7\u505c\u4ead\u5ead\u633a\u8247\u901a\u6850\u916e\u77b3\u540c\u94dc\u5f64\u7ae5\u6876\u6345\u7b52\u7edf\u75db\u5077\u6295\u5934\u900f\u51f8\u79c3\u7a81\u56fe\u5f92\u9014\u6d82\u5c60\u571f\u5410\u5154\u6e4d\u56e2\u63a8\u9893\u817f\u8715\u892a\u9000\u541e\u5c6f\u81c0\u62d6\u6258\u8131\u9e35\u9640\u9a6e\u9a7c\u692d\u59a5\u62d3\u553e\u6316\u54c7\u86d9\u6d3c\u5a03\u74e6\u889c\u6b6a\u5916\u8c4c\u5f2f\u6e7e\u73a9\u987d\u4e38\u70f7\u5b8c\u7897\u633d\u665a\u7696\u60cb\u5b9b\u5a49\u4e07\u8155\u6c6a\u738b\u4ea1\u6789\u7f51\u5f80\u65fa\u671b\u5fd8\u5984\u5a01\u5dcd\u5fae\u5371\u97e6\u8fdd\u6845\u56f4\u552f\u60df\u4e3a\u6f4d\u7ef4\u82c7\u840e\u59d4\u4f1f\u4f2a\u5c3e\u7eac\u672a\u851a\u5473\u754f\u80c3\u5582\u9b4f\u4f4d\u6e2d\u8c13\u5c09\u6170\u536b\u761f\u6e29\u868a\u6587\u95fb\u7eb9\u543b\u7a33\u7d0a\u95ee\u55e1\u7fc1\u74ee\u631d\u8717\u6da1\u7a9d\u6211\u65a1\u5367\u63e1\u6c83\u5deb\u545c\u94a8\u4e4c\u6c61\u8bec\u5c4b\u65e0\u829c\u68a7\u543e\u5434\u6bcb\u6b66\u4e94\u6342\u5348\u821e\u4f0d\u4fae\u575e\u620a\u96fe\u6664\u7269\u52ff\u52a1\u609f\u8bef\u6614\u7199\u6790\u897f\u7852\u77fd\u6670\u563b\u5438\u9521\u727a\u7a00\u606f\u5e0c\u6089\u819d\u5915\u60dc\u7184\u70ef\u6eaa\u6c50\u7280\u6a84\u88ad\u5e2d\u4e60\u5ab3\u559c\u94e3\u6d17\u7cfb\u9699\u620f\u7ec6\u778e\u867e\u5323\u971e\u8f96\u6687\u5ce1\u4fa0\u72ed\u4e0b\u53a6\u590f\u5413\u6380\u9528\u5148\u4ed9\u9c9c\u7ea4\u54b8\u8d24\u8854\u8237\u95f2\u6d8e\u5f26\u5acc\u663e\u9669\u73b0\u732e\u53bf\u817a\u9985\u7fa1\u5baa\u9677\u9650\u7ebf\u76f8\u53a2\u9576\u9999\u7bb1\u8944\u6e58\u4e61\u7fd4\u7965\u8be6\u60f3\u54cd\u4eab\u9879\u5df7\u6a61\u50cf\u5411\u8c61\u8427\u785d\u9704\u524a\u54ee\u56a3\u9500\u6d88\u5bb5\u6dc6\u6653\u5c0f\u5b5d\u6821\u8096\u5578\u7b11\u6548\u6954\u4e9b\u6b47\u874e\u978b\u534f\u631f\u643a\u90aa\u659c\u80c1\u8c10\u5199\u68b0\u5378\u87f9\u61c8\u6cc4\u6cfb\u8c22\u5c51\u85aa\u82af\u950c\u6b23\u8f9b\u65b0\u5ffb\u5fc3\u4fe1\u8845\u661f\u8165\u7329\u60fa\u5174\u5211\u578b\u5f62\u90a2\u884c\u9192\u5e78\u674f\u6027\u59d3\u5144\u51f6\u80f8\u5308\u6c79\u96c4\u718a\u4f11\u4fee\u7f9e\u673d\u55c5\u9508\u79c0\u8896\u7ee3\u589f\u620c\u9700\u865a\u5618\u987b\u5f90\u8bb8\u84c4\u9157\u53d9\u65ed\u5e8f\u755c\u6064\u7d6e\u5a7f\u7eea\u7eed\u8f69\u55a7\u5ba3\u60ac\u65cb\u7384\u9009\u7663\u7729\u7eda\u9774\u859b\u5b66\u7a74\u96ea\u8840\u52cb\u718f\u5faa\u65ec\u8be2\u5bfb\u9a6f\u5de1\u6b89\u6c5b\u8bad\u8baf\u900a\u8fc5\u538b\u62bc\u9e26\u9e2d\u5440\u4e2b\u82bd\u7259\u869c\u5d16\u8859\u6daf\u96c5\u54d1\u4e9a\u8bb6\u7109\u54bd\u9609\u70df\u6df9\u76d0\u4e25\u7814\u8712\u5ca9\u5ef6\u8a00\u989c\u960e\u708e\u6cbf\u5944\u63a9\u773c\u884d\u6f14\u8273\u5830\u71d5\u538c\u781a\u96c1\u5501\u5f66\u7130\u5bb4\u8c1a\u9a8c\u6b83\u592e\u9e2f\u79e7\u6768\u626c\u4f6f\u75a1\u7f8a\u6d0b\u9633\u6c27\u4ef0\u75d2\u517b\u6837\u6f3e\u9080\u8170\u5996\u7476\u6447\u5c27\u9065\u7a91\u8c23\u59da\u54ac\u8200\u836f\u8981\u8000\u6930\u564e\u8036\u7237\u91ce\u51b6\u4e5f\u9875\u6396\u4e1a\u53f6\u66f3\u814b\u591c\u6db2\u4e00\u58f9\u533b\u63d6\u94f1\u4f9d\u4f0a\u8863\u9890\u5937\u9057\u79fb\u4eea\u80f0\u7591\u6c82\u5b9c\u59e8\u5f5d\u6905\u8681\u501a\u5df2\u4e59\u77e3\u4ee5\u827a\u6291\u6613\u9091\u5c79\u4ebf\u5f79\u81c6\u9038\u8084\u75ab\u4ea6\u88d4\u610f\u6bc5\u5fc6\u4e49\u76ca\u6ea2\u8be3\u8bae\u8c0a\u8bd1\u5f02\u7ffc\u7fcc\u7ece\u8335\u836b\u56e0\u6bb7\u97f3\u9634\u59fb\u541f\u94f6\u6deb\u5bc5\u996e\u5c39\u5f15\u9690\u5370\u82f1\u6a31\u5a74\u9e70\u5e94\u7f28\u83b9\u8424\u8425\u8367\u8747\u8fce\u8d62\u76c8\u5f71\u9896\u786c\u6620\u54df\u62e5\u4f63\u81c3\u75c8\u5eb8\u96cd\u8e0a\u86f9\u548f\u6cf3\u6d8c\u6c38\u607f\u52c7\u7528\u5e7d\u4f18\u60a0\u5fe7\u5c24\u7531\u90ae\u94c0\u72b9\u6cb9\u6e38\u9149\u6709\u53cb\u53f3\u4f51\u91c9\u8bf1\u53c8\u5e7c\u8fc2\u6de4\u4e8e\u76c2\u6986\u865e\u611a\u8206\u4f59\u4fde\u903e\u9c7c\u6109\u6e1d\u6e14\u9685\u4e88\u5a31\u96e8\u4e0e\u5c7f\u79b9\u5b87\u8bed\u7fbd\u7389\u57df\u828b\u90c1\u5401\u9047\u55bb\u5cea\u5fa1\u6108\u6b32\u72f1\u80b2\u8a89\u6d74\u5bd3\u88d5\u9884\u8c6b\u9a6d\u9e33\u6e0a\u51a4\u5143\u57a3\u8881\u539f\u63f4\u8f95\u56ed\u5458\u5706\u733f\u6e90\u7f18\u8fdc\u82d1\u613f\u6028\u9662\u66f0\u7ea6\u8d8a\u8dc3\u94a5\u5cb3\u7ca4\u6708\u60a6\u9605\u8018\u4e91\u90e7\u5300\u9668\u5141\u8fd0\u8574\u915d\u6655\u97f5\u5b55\u531d\u7838\u6742\u683d\u54c9\u707e\u5bb0\u8f7d\u518d\u5728\u54b1\u6512\u6682\u8d5e\u8d43\u810f\u846c\u906d\u7cdf\u51ff\u85fb\u67a3\u65e9\u6fa1\u86a4\u8e81\u566a\u9020\u7682\u7076\u71e5\u8d23\u62e9\u5219\u6cfd\u8d3c\u600e\u589e\u618e\u66fe\u8d60\u624e\u55b3\u6e23\u672d\u8f67\u94e1\u95f8\u7728\u6805\u69a8\u548b\u4e4d\u70b8\u8bc8\u6458\u658b\u5b85\u7a84\u503a\u5be8\u77bb\u6be1\u8a79\u7c98\u6cbe\u76cf\u65a9\u8f97\u5d2d\u5c55\u8638\u6808\u5360\u6218\u7ad9\u6e5b\u7efd\u6a1f\u7ae0\u5f70\u6f33\u5f20\u638c\u6da8\u6756\u4e08\u5e10\u8d26\u4ed7\u80c0\u7634\u969c\u62db\u662d\u627e\u6cbc\u8d75\u7167\u7f69\u5146\u8087\u53ec\u906e\u6298\u54f2\u86f0\u8f99\u8005\u9517\u8517\u8fd9\u6d59\u73cd\u659f\u771f\u7504\u7827\u81fb\u8d1e\u9488\u4fa6\u6795\u75b9\u8bca\u9707\u632f\u9547\u9635\u84b8\u6323\u7741\u5f81\u72f0\u4e89\u6014\u6574\u62ef\u6b63\u653f\u5e27\u75c7\u90d1\u8bc1\u829d\u679d\u652f\u5431\u8718\u77e5\u80a2\u8102\u6c41\u4e4b\u7ec7\u804c\u76f4\u690d\u6b96\u6267\u503c\u4f84\u5740\u6307\u6b62\u8dbe\u53ea\u65e8\u7eb8\u5fd7\u631a\u63b7\u81f3\u81f4\u7f6e\u5e1c\u5cd9\u5236\u667a\u79e9\u7a1a\u8d28\u7099\u75d4\u6ede\u6cbb\u7a92\u4e2d\u76c5\u5fe0\u949f\u8877\u7ec8\u79cd\u80bf\u91cd\u4ef2\u4f17\u821f\u5468\u5dde\u6d32\u8bcc\u7ca5\u8f74\u8098\u5e1a\u5492\u76b1\u5b99\u663c\u9aa4\u73e0\u682a\u86db\u6731\u732a\u8bf8\u8bdb\u9010\u7af9\u70db\u716e\u62c4\u77a9\u5631\u4e3b\u8457\u67f1\u52a9\u86c0\u8d2e\u94f8\u7b51\u4f4f\u6ce8\u795d\u9a7b\u6293\u722a\u62fd\u4e13\u7816\u8f6c\u64b0\u8d5a\u7bc6\u6869\u5e84\u88c5\u5986\u649e\u58ee\u72b6\u690e\u9525\u8ffd\u8d58\u5760\u7f00\u8c06\u51c6\u6349\u62d9\u5353\u684c\u7422\u8301\u914c\u5544\u7740\u707c\u6d4a\u5179\u54a8\u8d44\u59ff\u6ecb\u6dc4\u5b5c\u7d2b\u4ed4\u7c7d\u6ed3\u5b50\u81ea\u6e0d\u5b57\u9b03\u68d5\u8e2a\u5b97\u7efc\u603b\u7eb5\u90b9\u8d70\u594f\u63cd\u79df\u8db3\u5352\u65cf\u7956\u8bc5\u963b\u7ec4\u94bb\u7e82\u5634\u9189\u6700\u7f6a\u5c0a\u9075\u6628\u5de6\u4f50\u67de\u505a\u4f5c\u5750\u5ea7\u9515\u55f3\u5ad2\u7477\u66a7\u972d\u8c19\u94f5\u9e4c\u5aaa\u9a9c\u9ccc\u94af\u5457\u94a3\u9e28\u9f85\u9e4e\u8d32\u951b\u835c\u54d4\u6ed7\u94cb\u7b5a\u8df8\u82c4\u7f0f\u7b3e\u9aa0\u98d1\u98d9\u9556\u9573\u9cd4\u50a7\u7f24\u69df\u6ba1\u8191\u9554\u9acc\u9b13\u7980\u997d\u94b9\u9e41\u94b8\u9a96\u9eea\u607b\u9538\u4faa\u9497\u5181\u8c04\u8c36\u8487\u5fcf\u5a75\u9aa3\u89c7\u7985\u9561\u4f25\u82cc\u6005\u960a\u9cb3\u7817\u4f27\u8c0c\u6987\u789c\u9f80\u67a8\u67fd\u94d6\u94db\u996c\u9e31\u94f3\u4fe6\u5e31\u96e0\u520d\u7ecc\u8e70\u948f\u6006\u7f0d\u9e51\u8f8d\u9f8a\u9e5a\u82c1\u9aa2\u679e\u8f8f\u64ba\u9509\u9e7e\u54d2\u9791\u9a80\u7ed0\u6b9a\u8d55\u7605\u7baa\u8c20\u7800\u88c6\u7118\u956b\u7c74\u8bcb\u8c1b\u7ee8\u89cc\u955d\u5dc5\u94bf\u766b\u94eb\u9cb7\u9cbd\u94e4\u94e5\u5cbd\u9e2b\u7aa6\u6e0e\u691f\u724d\u7b03\u9ee9\u7c16\u603c\u9566\u7096\u8db8\u94ce\u8c14\u57a9\u960f\u8f6d\u9507\u9537\u9e57\u989a\u989b\u9cc4\u8bf6\u8fe9\u94d2\u9e38\u9c95\u94ab\u9c82\u7eef\u9544\u9cb1\u507e\u6ca3\u51eb\u9a78\u7ec2\u7ecb\u8d59\u9eb8\u9c8b\u9cc6\u9486\u8d45\u5c34\u64c0\u7ec0\u6206\u777e\u8bf0\u7f1f\u9506\u7ea5\u9549\u988d\u4e98\u8d53\u7ee0\u9ca0\u8bdf\u7f11\u89cf\u8bc2\u6bc2\u94b4\u9522\u9e2a\u9e44\u9e58\u9e39\u63b4\u8bd6\u63bc\u9e73\u9ccf\u72b7\u5326\u523f\u59ab\u6867\u9c91\u9cdc\u886e\u7ef2\u9ca7\u57da\u5459\u5e3c\u6901\u8748\u94ea\u961a\u7ed7\u9889\u704f\u98a2\u8bc3\u9616\u86ce\u9ec9\u8ba7\u836d\u95f3\u9c8e\u6d52\u9e55\u9a85\u6866\u94e7\u5942\u7f33\u953e\u9ca9\u9cc7\u8bd9\u835f\u54d5\u6d4d\u7f0b\u73f2\u6656\u8be8\u9984\u960d\u94ac\u956c\u8ba6\u8bd8\u8360\u53fd\u54dc\u9aa5\u7391\u89ca\u9f51\u77f6\u7f81\u867f\u8dfb\u9701\u9c9a\u9cab\u90cf\u6d43\u94d7\u9553\u86f2\u8c0f\u7f23\u620b\u622c\u7751\u9e63\u7b15\u9ca3\u97af\u7edb\u7f30\u6322\u5ce4\u9e6a\u9c9b\u7596\u988c\u9c92\u537a\u8369\u9991\u7f19\u8d46\u89d0\u522d\u6cfe\u8ff3\u5f2a\u80eb\u9753\u9604\u9e20\u9e6b\u8bb5\u5c66\u6989\u98d3\u949c\u9514\u7aad\u9f83\u9529\u954c\u96bd\u8c32\u73cf\u76b2\u5240\u57b2\u5ffe\u607a\u94e0\u9534\u9f9b\u95f6\u94aa\u94d0\u9a92\u7f02\u8f72\u94b6\u951e\u9894\u9f88\u94ff\u55be\u90d0\u54d9\u810d\u72ef\u9acb\u8bd3\u8bf3\u909d\u5739\u7ea9\u8d36\u532e\u8489\u6126\u8069\u7bd1\u9603\u951f\u9cb2\u86f4\u5d03\u5f95\u6d9e\u6fd1\u8d49\u7750\u94fc\u765e\u7c41\u5c9a\u6984\u6593\u9567\u8934\u9606\u9512\u5520\u5d02\u94d1\u94f9\u75e8\u9cd3\u8bd4\u7f27\u4fea\u90e6\u575c\u82c8\u8385\u84e0\u5456\u9026\u9a8a\u7f21\u67a5\u680e\u8f79\u783a\u9502\u9e42\u75a0\u7c9d\u8dde\u96f3\u9ca1\u9ce2\u8539\u5941\u6f4b\u740f\u6b93\u88e2\u88e3\u9ca2\u9b49\u7f2d\u948c\u9e69\u853a\u5eea\u6aa9\u8f9a\u8e8f\u7eeb\u68c2\u86cf\u9cae\u6d4f\u9a9d\u7efa\u954f\u9e68\u830f\u6cf7\u73d1\u680a\u80e7\u783b\u507b\u848c\u55bd\u5d5d\u9542\u7618\u8027\u877c\u9ac5\u5786\u64b8\u565c\u95fe\u6cf8\u6e0c\u680c\u6a79\u8f73\u8f82\u8f98\u6c07\u80ea\u9e2c\u9e6d\u823b\u9c88\u8114\u5a08\u683e\u9e3e\u92ae\u56f5\u8366\u7321\u6cfa\u6924\u8136\u9559\u6988\u891b\u950a\u5452\u551b\u5b37\u6769\u52a2\u7f26\u9558\u98a1\u9cd7\u9ebd\u626a\u7116\u61d1\u9494\u8288\u8c27\u7315\u7962\u6e11\u817c\u9efe\u7f08\u7f2a\u95f5\u7f17\u8c1f\u84e6\u998d\u6b81\u9546\u94bc\u94d9\u8bb7\u94cc\u9cb5\u8f87\u9cb6\u8311\u8885\u9667\u8616\u55eb\u989f\u8e51\u82ce\u549b\u804d\u4fac\u54dd\u9a7d\u9495\u50a9\u8bb4\u6004\u74ef\u8e52\u75b1\u8f94\u7eb0\u7f74\u94cd\u8c1d\u9a88\u7f25\u5ad4\u948b\u9564\u9568\u8572\u9a90\u7eee\u6864\u789b\u9880\u9883\u9ccd\u4f65\u8368\u60ad\u9a9e\u7f31\u6920\u94a4\u5af1\u6a2f\u6217\u709d\u9516\u9535\u956a\u7f9f\u8dc4\u8bee\u8c2f\u835e\u7f32\u7857\u8df7\u60ec\u9532\u7ba7\u9513\u63ff\u9cad\u8315\u86f1\u5def\u8d47\u866e\u9cc5\u8bce\u5c96\u9612\u89d1\u9e32\u8be0\u7efb\u8f81\u94e8\u9615\u9619\u60ab\u835b\u5a06\u6861\u996a\u8f6b\u5d58\u877e\u7f1b\u94f7\u98a6\u86ac\u98d2\u6bf5\u7cc1\u7f2b\u556c\u94ef\u7a51\u94e9\u9ca8\u917e\u8baa\u59d7\u9a9f\u9490\u9cdd\u57a7\u6b87\u89de\u538d\u6ee0\u7572\u8bdc\u8c02\u6e16\u8c25\u57d8\u83b3\u5f11\u8f7c\u8d33\u94c8\u9ca5\u7ef6\u6445\u7ebe\u95e9\u94c4\u53ae\u9a77\u7f0c\u9536\u9e36\u85ae\u998a\u98d5\u953c\u8c21\u7a23\u8c07\u836a\u72f2\u5522\u7743\u95fc\u94ca\u9cce\u949b\u9c90\u6619\u94bd\u952c\u9878\u50a5\u9967\u94f4\u9557\u97ec\u94fd\u7f07\u9e48\u9617\u7c9c\u9f86\u9ca6\u6078\u94ad\u948d\u629f\u9968\u7ba8\u9f0d\u5a32\u817d\u7ea8\u7efe\u8f8b\u8bff\u5e0f\u95f1\u6ca9\u6da0\u73ae\u97ea\u709c\u9c94\u960c\u83b4\u9f8c\u90ac\u5e91\u6003\u59a9\u9a9b\u9e49\u9e5c\u9969\u960b\u73ba\u89cb\u7856\u82cb\u83b6\u85d3\u5c98\u7303\u5a34\u9e47\u75eb\u869d\u7c7c\u8df9\u8297\u9977\u9aa7\u7f03\u98e8\u54d3\u6f47\u9a81\u7ee1\u67ad\u7bab\u4eb5\u64b7\u7ec1\u7f2c\u9649\u8365\u9990\u9e3a\u8be9\u987c\u8c16\u94c9\u955f\u8c11\u6cf6\u9cd5\u57d9\u6d54\u9c9f\u57ad\u5a05\u6860\u6c29\u53a3\u8d5d\u4fe8\u5156\u8c33\u6079\u95eb\u917d\u9b47\u990d\u9f39\u7080\u8f7a\u9e5e\u9cd0\u9765\u8c12\u90ba\u6654\u70e8\u8bd2\u5453\u5cc4\u9974\u603f\u9a7f\u7f22\u8f76\u8d3b\u9487\u9552\u9571\u7617\u8223\u94df\u763e\u8314\u83ba\u8426\u84e5\u6484\u5624\u6ee2\u6f46\u748e\u9e66\u763f\u988f\u7f42\u955b\u83b8\u94d5\u9c7f\u4f1b\u4fe3\u8c00\u8c15\u84e3\u5d5b\u996b\u9608\u59aa\u7ea1\u89ce\u6b24\u94b0\u9e46\u9e6c\u9f89\u6a7c\u9e22\u9f0b\u94ba\u90d3\u82b8\u607d\u6120\u7ead\u97eb\u6b92\u6c32\u74d2\u8db1\u933e\u9a75\u8d5c\u5567\u5e3b\u7ba6\u8c2e\u7f2f\u8c35\u8bcf\u948a\u8c2a\u8f84\u9e67\u6d48\u7f1c\u6862\u8f78\u8d48\u796f\u9e29\u8be4\u5ce5\u94b2\u94ee\u7b5d\u9a98\u6809\u6800\u8f75\u8f7e\u8d3d\u9e37\u86f3\u7d77\u8e2c\u8e2f\u89ef\u953a\u7ea3\u7ec9\u4f2b\u69e0\u94e2\u556d\u9994\u989e\u9a93\u7f12\u8bfc\u956f\u8c18\u7f01\u8f8e\u8d40\u7726\u9531\u9f87\u9cbb\u506c\u8bf9\u9a7a\u9cb0\u955e\u7f35\u8e9c\u9cdf\u8ba0\u8c2b\u90c4\u52d0\u51fc\u5742\u5785\u57b4\u57ef\u57dd\u82d8\u836c\u836e\u839c\u83bc\u83f0\u85c1\u63f8\u5412\u5423\u5494\u549d\u54b4\u5658\u567c\u56af\u5e5e\u5c99\u5d74\u5f77\u5fbc\u72b8\u72cd\u9980\u9987\u9993\u9995\u6123\u61b7\u61d4\u4e2c\u6e86\u6edf\u6eb7\u6f24\u6f74\u6fb9\u752f\u7e9f\u7ed4\u7ef1\u73c9\u67a7\u684a\u6849\u69d4\u6a65\u8f71\u8f77\u8d4d\u80b7\u80e8\u98da\u7173\u7145\u7198\u610d\u6dfc\u781c\u78d9\u770d\u949a\u94b7\u94d8\u94de\u9503\u950d\u950e\u950f\u9518\u951d\u952a\u952b\u953f\u9545\u954e\u9562\u9565\u9569\u9572\u7a06\u9e4b\u9e5b\u9e71\u75ac\u75b4\u75d6\u766f\u88e5\u8941\u8022\u98a5\u87a8\u9eb4\u9c85\u9c86\u9c87\u9c9e\u9cb4\u9cba\u9cbc\u9cca\u9ccb\u9cd8\u9cd9\u9792\u97b4\u9f44",rge="\u554a\u963f\u57c3\u6328\u54ce\u5509\u54c0\u769a\u764c\u85f9\u77ee\u827e\u7919\u611b\u9698\u978d\u6c28\u5b89\u4ffa\u6309\u6697\u5cb8\u80fa\u6848\u9aaf\u6602\u76ce\u51f9\u6556\u71ac\u7ffa\u8956\u50b2\u5967\u61ca\u6fb3\u82ad\u634c\u6252\u53ed\u5427\u7b06\u516b\u75a4\u5df4\u62d4\u8dcb\u9776\u628a\u8019\u58e9\u9738\u7f77\u7238\u767d\u67cf\u767e\u64fa\u4f70\u6557\u62dc\u7a17\u6591\u73ed\u642c\u6273\u822c\u9812\u677f\u7248\u626e\u62cc\u4f34\u74e3\u534a\u8fa6\u7d46\u90a6\u5e6b\u6886\u699c\u8180\u7d81\u68d2\u78c5\u868c\u938a\u508d\u8b17\u82de\u80de\u5305\u8912\u525d\u8584\u96f9\u4fdd\u5821\u98fd\u5bf6\u62b1\u5831\u66b4\u8c79\u9b91\u7206\u676f\u7891\u60b2\u5351\u5317\u8f29\u80cc\u8c9d\u92c7\u500d\u72fd\u5099\u618a\u7119\u88ab\u5954\u82ef\u672c\u7b28\u5d29\u7e43\u752d\u6cf5\u8e66\u8ff8\u903c\u9f3b\u6bd4\u9119\u7b46\u5f7c\u78a7\u84d6\u853d\u7562\u6583\u6bd6\u5e63\u5e87\u75f9\u9589\u655d\u5f0a\u5fc5\u8f9f\u58c1\u81c2\u907f\u965b\u97ad\u908a\u7de8\u8cb6\u6241\u4fbf\u8b8a\u535e\u8fa8\u8faf\u8fae\u904d\u6a19\u5f6a\u8198\u8868\u9c49\u618b\u5225\u765f\u5f6c\u658c\u7015\u6ff1\u8cd3\u64ef\u5175\u51b0\u67c4\u4e19\u79c9\u9905\u70b3\u75c5\u4e26\u73bb\u83e0\u64ad\u64a5\u7f3d\u6ce2\u535a\u52c3\u640f\u9251\u7b94\u4f2f\u5e1b\u8236\u8116\u818a\u6e24\u6cca\u99c1\u6355\u8514\u54fa\u88dc\u57e0\u4e0d\u5e03\u6b65\u7c3f\u90e8\u6016\u64e6\u731c\u88c1\u6750\u624d\u8ca1\u776c\u8e29\u91c7\u5f69\u83dc\u8521\u9910\u53c3\u8836\u6b98\u615a\u6158\u71e6\u84bc\u8259\u5009\u6ec4\u85cf\u64cd\u7cd9\u69fd\u66f9\u8349\u5ec1\u7b56\u5074\u518a\u6e2c\u5c64\u8e6d\u63d2\u53c9\u832c\u8336\u67e5\u78b4\u643d\u5bdf\u5c94\u5dee\u8a6b\u62c6\u67f4\u8c7a\u6519\u647b\u87ec\u995e\u8b92\u7e8f\u93df\u7522\u95e1\u986b\u660c\u7316\u5834\u5617\u5e38\u9577\u511f\u8178\u5ee0\u655e\u66a2\u5531\u5021\u8d85\u6284\u9214\u671d\u5632\u6f6e\u5de2\u5435\u7092\u8eca\u626f\u64a4\u63a3\u5fb9\u6f88\u90f4\u81e3\u8fb0\u5875\u6668\u5ff1\u6c88\u9673\u8d81\u896f\u6490\u7a31\u57ce\u6a59\u6210\u5448\u4e58\u7a0b\u61f2\u6f84\u8aa0\u627f\u901e\u9a01\u79e4\u5403\u7661\u6301\u5319\u6c60\u9072\u5f1b\u99b3\u6065\u9f52\u4f88\u5c3a\u8d64\u7fc5\u65a5\u71be\u5145\u6c96\u87f2\u5d07\u5bf5\u62bd\u916c\u7587\u8e8a\u7a20\u6101\u7c4c\u4ec7\u7da2\u7785\u919c\u81ed\u521d\u51fa\u6ae5\u5eda\u8e87\u92e4\u96db\u6ec1\u9664\u695a\u790e\u5132\u77d7\u6410\u89f8\u8655\u63e3\u5ddd\u7a7f\u693d\u50b3\u8239\u5598\u4e32\u7621\u7a97\u5e62\u5e8a\u95d6\u5275\u5439\u708a\u6376\u9318\u5782\u6625\u693f\u9187\u5507\u6df3\u7d14\u8822\u6233\u7dbd\u75b5\u8328\u78c1\u96cc\u8fad\u6148\u74f7\u8a5e\u6b64\u523a\u8cdc\u6b21\u8070\u8525\u56ea\u5306\u5f9e\u53e2\u6e4a\u7c97\u918b\u7c07\u4fc3\u8ea5\u7be1\u7ac4\u6467\u5d14\u50ac\u8106\u7601\u7cb9\u6dec\u7fe0\u6751\u5b58\u5bf8\u78cb\u64ae\u6413\u63aa\u632b\u932f\u642d\u9054\u7b54\u7629\u6253\u5927\u5446\u6b79\u50a3\u6234\u5e36\u6b86\u4ee3\u8cb8\u888b\u5f85\u902e\u6020\u803d\u64d4\u4e39\u55ae\u9132\u64a3\u81bd\u65e6\u6c2e\u4f46\u619a\u6de1\u8a95\u5f48\u86cb\u7576\u64cb\u9ee8\u8569\u6a94\u5200\u6417\u8e48\u5012\u5cf6\u79b1\u5c0e\u5230\u7a3b\u60bc\u9053\u76dc\u5fb7\u5f97\u7684\u8e6c\u71c8\u767b\u7b49\u77aa\u51f3\u9127\u5824\u4f4e\u6ef4\u8fea\u6575\u7b1b\u72c4\u6ecc\u7fdf\u5ae1\u62b5\u5e95\u5730\u8482\u7b2c\u5e1d\u5f1f\u905e\u7de0\u985b\u6382\u6ec7\u7898\u9ede\u5178\u975b\u588a\u96fb\u4f43\u7538\u5e97\u60e6\u5960\u6fb1\u6bbf\u7889\u53fc\u96d5\u96d5\u5201\u6389\u540a\u91e3\u8abf\u8dcc\u7239\u789f\u8776\u53e0\u8adc\u758a\u4e01\u76ef\u53ee\u91d8\u9802\u9f0e\u9320\u5b9a\u8a02\u4e1f\u6771\u51ac\u8463\u61c2\u52d5\u68df\u4f97\u606b\u51cd\u6d1e\u515c\u6296\u9b25\u9661\u8c46\u9017\u75d8\u90fd\u7763\u6bd2\u72a2\u7368\u8b80\u5835\u7779\u8ced\u675c\u934d\u809a\u5ea6\u6e21\u5992\u7aef\u77ed\u935b\u6bb5\u65b7\u7dde\u5806\u514c\u968a\u5c0d\u58a9\u5678\u8e72\u6566\u9813\u56e4\u920d\u76fe\u9041\u6387\u54c6\u591a\u596a\u579b\u8eb2\u6735\u8dfa\u8235\u5241\u60f0\u58ae\u86fe\u5ce8\u9d5d\u4fc4\u984d\u8a1b\u5a25\u60e1\u5384\u627c\u904f\u9102\u9913\u6069\u800c\u5152\u8033\u723e\u990c\u6d31\u4e8c\u8cb3\u767c\u7f70\u7b4f\u4f10\u4e4f\u95a5\u6cd5\u743a\u85e9\u5e06\u756a\u7ffb\u6a0a\u792c\u91e9\u7e41\u51e1\u7169\u53cd\u8fd4\u7bc4\u8ca9\u72af\u98ef\u6cdb\u574a\u82b3\u65b9\u80aa\u623f\u9632\u59a8\u4eff\u8a2a\u7d21\u653e\u83f2\u975e\u5561\u98db\u80a5\u532a\u8ab9\u5420\u80ba\u5ee2\u6cb8\u8cbb\u82ac\u915a\u5429\u6c1b\u5206\u7d1b\u58b3\u711a\u6c7e\u7c89\u596e\u4efd\u5fff\u61a4\u7cde\u8c50\u5c01\u6953\u8702\u5cf0\u92d2\u98a8\u760b\u70fd\u9022\u99ae\u7e2b\u8af7\u5949\u9cf3\u4f5b\u5426\u592b\u6577\u819a\u5b75\u6276\u62c2\u8f3b\u5e45\u6c1f\u7b26\u4f0f\u4fd8\u670d\u6d6e\u6daa\u798f\u88b1\u5f17\u752b\u64ab\u8f14\u4fef\u91dc\u65a7\u812f\u8151\u5e9c\u8150\u8d74\u526f\u8986\u8ce6\u5fa9\u5085\u4ed8\u961c\u7236\u8179\u8ca0\u5bcc\u8a03\u9644\u5a66\u7e1b\u5490\u5676\u560e\u8a72\u6539\u6982\u9223\u84cb\u6e89\u5e79\u7518\u687f\u67d1\u7aff\u809d\u8d95\u611f\u7a08\u6562\u8d1b\u5ca1\u525b\u92fc\u7f38\u809b\u7db1\u5d17\u6e2f\u6760\u7bd9\u81ef\u9ad8\u818f\u7f94\u7cd5\u641e\u93ac\u7a3f\u544a\u54e5\u6b4c\u64f1\u6208\u9d3f\u80f3\u7599\u5272\u9769\u845b\u683c\u86e4\u95a3\u9694\u927b\u500b\u5404\u7d66\u6839\u8ddf\u8015\u66f4\u5e9a\u7fb9\u57c2\u803f\u6897\u5de5\u653b\u529f\u606d\u9f94\u4f9b\u8eac\u516c\u5bae\u5f13\u978f\u6c5e\u62f1\u8ca2\u5171\u9264\u52fe\u6e9d\u830d\u72d7\u57a2\u69cb\u8cfc\u5920\u8f9c\u83c7\u5495\u7b8d\u4f30\u6cbd\u5b64\u59d1\u9f13\u53e4\u8831\u9aa8\u8c37\u80a1\u6545\u9867\u56fa\u96c7\u522e\u74dc\u526e\u5be1\u639b\u8902\u4e56\u62d0\u602a\u68fa\u95dc\u5b98\u51a0\u89c0\u7ba1\u9928\u7f50\u6163\u704c\u8cab\u5149\u5ee3\u901b\u7470\u898f\u572d\u77fd\u6b78\u9f9c\u95a8\u8ecc\u9b3c\u8a6d\u7678\u6842\u6ac3\u8dea\u8cb4\u528a\u8f25\u6efe\u68cd\u934b\u90ed\u570b\u679c\u88f9\u904e\u54c8\u9ab8\u5b69\u6d77\u6c26\u4ea5\u5bb3\u99ed\u9163\u61a8\u90af\u97d3\u542b\u6db5\u5bd2\u51fd\u558a\u7f55\u7ff0\u64bc\u634d\u65f1\u61be\u608d\u710a\u6c57\u6f22\u592f\u676d\u822a\u58d5\u568e\u8c6a\u6beb\u90dd\u597d\u8017\u865f\u6d69\u5475\u559d\u8377\u83cf\u6838\u79be\u548c\u4f55\u5408\u76d2\u8c89\u95a1\u6cb3\u6db8\u8d6b\u8910\u9db4\u8cc0\u563f\u9ed1\u75d5\u5f88\u72e0\u6068\u54fc\u4ea8\u6a6b\u8861\u6052\u8f5f\u54c4\u70d8\u8679\u9d3b\u6d2a\u5b8f\u5f18\u7d05\u5589\u4faf\u7334\u543c\u539a\u5019\u5f8c\u547c\u4e4e\u5ffd\u745a\u58fa\u846b\u80e1\u8774\u72d0\u7cca\u6e56\u5f27\u864e\u552c\u8b77\u4e92\u6eec\u6236\u82b1\u5629\u83ef\u733e\u6ed1\u756b\u5283\u5316\u8a71\u69d0\u5f8a\u61f7\u6dee\u58de\u6b61\u74b0\u6853\u9084\u7de9\u63db\u60a3\u559a\u7613\u8c62\u7165\u6e19\u5ba6\u5e7b\u8352\u614c\u9ec3\u78fa\u8757\u7c27\u7687\u51f0\u60f6\u714c\u6643\u5e4c\u604d\u8b0a\u7070\u63ee\u8f1d\u5fbd\u6062\u86d4\u56de\u6bc0\u6094\u6167\u5349\u60e0\u6666\u8cc4\u7a62\u6703\u71f4\u532f\u8af1\u8aa8\u7e6a\u8477\u660f\u5a5a\u9b42\u6e3e\u6df7\u8c41\u6d3b\u5925\u706b\u7372\u6216\u60d1\u970d\u8ca8\u798d\u64ca\u573e\u57fa\u6a5f\u7578\u7a3d\u7a4d\u7b95\u808c\u9951\u8de1\u6fc0\u8b4f\u96de\u59ec\u7e3e\u7ddd\u5409\u6975\u68d8\u8f2f\u7c4d\u96c6\u53ca\u6025\u75be\u6c72\u5373\u5ac9\u7d1a\u64e0\u5e7e\u810a\u5df1\u858a\u6280\u5180\u5b63\u4f0e\u796d\u5291\u60b8\u6fdf\u5bc4\u5bc2\u8a08\u8a18\u65e2\u5fcc\u969b\u7e7c\u7d00\u5609\u67b7\u593e\u4f73\u5bb6\u52a0\u83a2\u9830\u8cc8\u7532\u9240\u5047\u7a3c\u50f9\u67b6\u99d5\u5ac1\u6bb2\u76e3\u5805\u5c16\u7b8b\u9593\u714e\u517c\u80a9\u8271\u5978\u7dd8\u7e6d\u6aa2\u67ec\u583f\u9e7c\u63c0\u64bf\u7c21\u5109\u526a\u6e1b\u85a6\u6abb\u9452\u8e10\u8ce4\u898b\u9375\u7bad\u4ef6\u5065\u8266\u528d\u991e\u6f38\u6ffa\u6f97\u5efa\u50f5\u59dc\u5c07\u6f3f\u6c5f\u7586\u8523\u69f3\u734e\u8b1b\u5320\u91ac\u964d\u8549\u6912\u7901\u7126\u81a0\u4ea4\u90ca\u6f86\u9a55\u5b0c\u56bc\u652a\u9278\u77ef\u50e5\u8173\u72e1\u89d2\u9903\u7e73\u7d5e\u527f\u6559\u9175\u8f4e\u8f03\u53eb\u7a96\u63ed\u63a5\u7686\u7a2d\u8857\u968e\u622a\u52ab\u7bc0\u8396\u775b\u6676\u9be8\u4eac\u9a5a\u7cbe\u7cb3\u7d93\u4e95\u8b66\u666f\u9838\u975c\u5883\u656c\u93e1\u5f91\u75d9\u9756\u7adf\u7af6\u51c8\u70af\u7a98\u63ea\u7a76\u7cfe\u7396\u97ed\u4e45\u7078\u4e5d\u9152\u5ec4\u6551\u820a\u81fc\u8205\u548e\u5c31\u759a\u97a0\u62d8\u72d9\u75bd\u5c45\u99d2\u83ca\u5c40\u5480\u77e9\u8209\u6cae\u805a\u62d2\u64da\u5de8\u5177\u8ddd\u8e1e\u92f8\u4ff1\u53e5\u61fc\u70ac\u5287\u6350\u9d51\u5a1f\u5026\u7737\u5377\u7d79\u6485\u652b\u6289\u6398\u5014\u7235\u6854\u5091\u6377\u776b\u7aed\u6f54\u7d50\u89e3\u59d0\u6212\u85c9\u82a5\u754c\u501f\u4ecb\u75a5\u8aa1\u5c46\u5dfe\u7b4b\u65a4\u91d1\u4eca\u6d25\u895f\u7dca\u9326\u50c5\u8b39\u9032\u9773\u6649\u7981\u8fd1\u71fc\u6d78\u76e1\u52c1\u834a\u5162\u89ba\u6c7a\u8a23\u7d55\u5747\u83cc\u921e\u8ecd\u541b\u5cfb\u4fca\u7ae3\u6d5a\u90e1\u99ff\u5580\u5496\u5361\u54af\u958b\u63e9\u6977\u51f1\u6168\u520a\u582a\u52d8\u574e\u780d\u770b\u5eb7\u6177\u7ce0\u625b\u6297\u4ea2\u7095\u8003\u62f7\u70e4\u9760\u5777\u82db\u67ef\u68f5\u78d5\u9846\u79d1\u6bbc\u54b3\u53ef\u6e34\u514b\u523b\u5ba2\u8ab2\u80af\u5543\u58be\u61c7\u5751\u542d\u7a7a\u6050\u5b54\u63a7\u6473\u53e3\u6263\u5bc7\u67af\u54ed\u7a9f\u82e6\u9177\u5eab\u8932\u8a87\u57ae\u630e\u8de8\u80ef\u584a\u7b77\u5108\u5feb\u5bec\u6b3e\u5321\u7b50\u72c2\u6846\u7926\u7736\u66e0\u6cc1\u8667\u76d4\u5dcb\u7aba\u8475\u594e\u9b41\u5080\u994b\u6127\u6f70\u5764\u6606\u6346\u56f0\u62ec\u64f4\u5ed3\u95ca\u5783\u62c9\u5587\u881f\u81d8\u8fa3\u5566\u840a\u4f86\u8cf4\u85cd\u5a6a\u6b04\u6514\u7c43\u95cc\u862d\u703e\u8b95\u652c\u89bd\u61f6\u7e9c\u721b\u6feb\u746f\u6994\u72fc\u5eca\u90ce\u6717\u6d6a\u6488\u52de\u7262\u8001\u4f6c\u59e5\u916a\u70d9\u6f87\u52d2\u6a02\u96f7\u9433\u857e\u78ca\u7d2f\u5121\u58d8\u64c2\u808b\u985e\u6dda\u68f1\u695e\u51b7\u5398\u68a8\u7281\u9ece\u7c6c\u8c8d\u96e2\u6f13\u7406\u674e\u88cf\u9bc9\u79ae\u8389\u8354\u540f\u6817\u9e97\u53b2\u52f5\u792b\u6b77\u5229\u5088\u4f8b\u4fd0\u75e2\u7acb\u7c92\u701d\u96b8\u529b\u7483\u54e9\u5006\u806f\u84ee\u9023\u942e\u5ec9\u6190\u6f23\u7c3e\u6582\u81c9\u93c8\u6200\u7149\u7df4\u7ce7\u6dbc\u6881\u7cb1\u826f\u5169\u8f1b\u91cf\u667e\u4eae\u8ad2\u64a9\u804a\u50da\u7642\u71ce\u5be5\u907c\u6f66\u4e86\u6482\u9410\u5ed6\u6599\u5217\u88c2\u70c8\u52a3\u7375\u7433\u6797\u78f7\u9716\u81e8\u9130\u9c57\u6dcb\u51dc\u8cc3\u541d\u62ce\u73b2\u83f1\u96f6\u9f61\u9234\u4f36\u7f9a\u6de9\u9748\u9675\u5dba\u9818\u53e6\u4ee4\u6e9c\u7409\u69b4\u786b\u993e\u7559\u5289\u7624\u6d41\u67f3\u516d\u9f8d\u807e\u56a8\u7c60\u7abf\u9686\u58df\u650f\u96b4\u6a13\u5a41\u645f\u7c0d\u6f0f\u964b\u8606\u76e7\u9871\u5eec\u7210\u64c4\u9e75\u865c\u9b6f\u9e93\u788c\u9732\u8def\u8cc2\u9e7f\u6f5e\u797f\u9304\u9678\u622e\u9a62\u5442\u92c1\u4fb6\u65c5\u5c65\u5c62\u7e37\u616e\u6c2f\u5f8b\u7387\u6ffe\u7da0\u5dd2\u6523\u5b7f\u7064\u5375\u4e82\u63a0\u7565\u6384\u8f2a\u502b\u4f96\u6dea\u7db8\u8ad6\u863f\u87ba\u7f85\u908f\u947c\u7c6e\u9a3e\u88f8\u843d\u6d1b\u99f1\u7d61\u5abd\u9ebb\u746a\u78bc\u879e\u99ac\u7f75\u561b\u55ce\u57cb\u8cb7\u9ea5\u8ce3\u9081\u8108\u779e\u9945\u883b\u6eff\u8513\u66fc\u6162\u6f2b\u8b3e\u8292\u832b\u76f2\u6c13\u5fd9\u83bd\u8c93\u8305\u9328\u6bdb\u77db\u925a\u536f\u8302\u5192\u5e3d\u8c8c\u8cbf\u9ebd\u73ab\u679a\u6885\u9176\u9ef4\u7164\u6c92\u7709\u5a92\u9382\u6bcf\u7f8e\u6627\u5bd0\u59b9\u5a9a\u9580\u60b6\u5011\u840c\u8499\u6aac\u76df\u9333\u731b\u5922\u5b5f\u7787\u919a\u9761\u7cdc\u8ff7\u8b0e\u5f4c\u7c73\u79d8\u8993\u6ccc\u871c\u5bc6\u51aa\u68c9\u7720\u7dbf\u5195\u514d\u52c9\u5a29\u7dec\u9762\u82d7\u63cf\u7784\u85d0\u79d2\u6e3a\u5edf\u5999\u8511\u6ec5\u6c11\u62bf\u76bf\u654f\u61ab\u95a9\u660e\u879f\u9cf4\u9298\u540d\u547d\u8b2c\u6478\u6479\u8611\u6a21\u819c\u78e8\u6469\u9b54\u62b9\u672b\u83ab\u58a8\u9ed8\u6cab\u6f20\u5bde\u964c\u8b00\u725f\u67d0\u62c7\u7261\u755d\u59c6\u6bcd\u5893\u66ae\u5e55\u52df\u6155\u6728\u76ee\u7766\u7267\u7a46\u62ff\u54ea\u5436\u9209\u90a3\u5a1c\u7d0d\u6c16\u4e43\u5976\u8010\u5948\u5357\u7537\u96e3\u56ca\u6493\u8166\u60f1\u9b27\u6dd6\u5462\u9912\u5167\u5ae9\u80fd\u59ae\u9713\u502a\u6ce5\u5c3c\u64ec\u59b3\u533f\u81a9\u9006\u6eba\u852b\u62c8\u5e74\u78be\u6506\u649a\u5ff5\u5a18\u91c0\u9ce5\u5c3f\u634f\u8076\u5b7d\u5699\u9477\u93b3\u6d85\u60a8\u6ab8\u7370\u51dd\u5be7\u64f0\u6fd8\u725b\u626d\u9215\u7d10\u81bf\u6fc3\u8fb2\u5f04\u5974\u52aa\u6012\u5973\u6696\u8650\u7627\u632a\u61e6\u7cef\u8afe\u54e6\u6b50\u9dd7\u6bc6\u85d5\u5614\u5076\u6f1a\u556a\u8db4\u722c\u5e15\u6015\u7436\u62cd\u6392\u724c\u5f98\u6e43\u6d3e\u6500\u6f58\u76e4\u78d0\u76fc\u7554\u5224\u53db\u4e53\u9f90\u65c1\u802a\u80d6\u62cb\u5486\u5228\u70ae\u888d\u8dd1\u6ce1\u5478\u80da\u57f9\u88f4\u8ce0\u966a\u914d\u4f69\u6c9b\u5674\u76c6\u7830\u62a8\u70f9\u6f8e\u5f6d\u84ec\u68da\u787c\u7bf7\u81a8\u670b\u9d6c\u6367\u78b0\u576f\u7812\u9739\u6279\u62ab\u5288\u7435\u6bd7\u5564\u813e\u75b2\u76ae\u5339\u75de\u50fb\u5c41\u8b6c\u7bc7\u504f\u7247\u9a19\u98c4\u6f02\u74e2\u7968\u6487\u77a5\u62fc\u983b\u8ca7\u54c1\u8058\u4e52\u576a\u860b\u840d\u5e73\u6191\u74f6\u8a55\u5c4f\u5761\u6f51\u9817\u5a46\u7834\u9b44\u8feb\u7c95\u5256\u64b2\u92ea\u4ec6\u8386\u8461\u83e9\u84b2\u57d4\u6a38\u5703\u666e\u6d66\u8b5c\u66dd\u7011\u671f\u6b3a\u68f2\u621a\u59bb\u4e03\u6dd2\u6f06\u67d2\u6c8f\u5176\u68cb\u5947\u6b67\u7566\u5d0e\u81cd\u9f4a\u65d7\u7948\u7941\u9a0e\u8d77\u8c48\u4e5e\u4f01\u555f\u5951\u780c\u5668\u6c23\u8fc4\u68c4\u6c7d\u6ce3\u8a16\u6390\u6d3d\u727d\u6261\u91ec\u925b\u5343\u9077\u7c3d\u4edf\u8b19\u4e7e\u9ed4\u9322\u9257\u524d\u6f5b\u9063\u6dfa\u8b74\u5879\u5d4c\u6b20\u6b49\u69cd\u55c6\u8154\u7f8c\u58bb\u8594\u5f37\u6436\u6a47\u936c\u6572\u6084\u6a4b\u77a7\u55ac\u50d1\u5de7\u9798\u64ac\u7ff9\u5ced\u4fcf\u7ac5\u5207\u8304\u4e14\u602f\u7aca\u6b3d\u4fb5\u89aa\u79e6\u7434\u52e4\u82b9\u64d2\u79bd\u5be2\u6c81\u9752\u8f15\u6c2b\u50be\u537f\u6e05\u64ce\u6674\u6c30\u60c5\u9803\u8acb\u6176\u74ca\u7aae\u79cb\u4e18\u90b1\u7403\u6c42\u56da\u914b\u6cc5\u8da8\u5340\u86c6\u66f2\u8ec0\u5c48\u9a45\u6e20\u53d6\u5a36\u9f72\u8da3\u53bb\u5708\u9874\u6b0a\u919b\u6cc9\u5168\u75ca\u62f3\u72ac\u5238\u52f8\u7f3a\u7094\u7638\u537b\u9d72\u69b7\u78ba\u96c0\u88d9\u7fa4\u7136\u71c3\u5189\u67d3\u74e4\u58e4\u6518\u56b7\u8b93\u9952\u64fe\u7e5e\u60f9\u71b1\u58ec\u4ec1\u4eba\u5fcd\u97cc\u4efb\u8a8d\u5203\u598a\u7d09\u6254\u4ecd\u65e5\u620e\u8338\u84c9\u69ae\u878d\u7194\u6eb6\u5bb9\u7d68\u5197\u63c9\u67d4\u8089\u8339\u8815\u5112\u5b7a\u5982\u8fb1\u4e73\u6c5d\u5165\u8925\u8edf\u962e\u854a\u745e\u92b3\u958f\u6f64\u82e5\u5f31\u6492\u7051\u85a9\u816e\u9c13\u585e\u8cfd\u4e09\u4e09\u5098\u6563\u6851\u55d3\u55aa\u6414\u9a37\u6383\u5ac2\u745f\u8272\u6f80\u68ee\u50e7\u838e\u7802\u6bba\u524e\u6c99\u7d17\u50bb\u5565\u715e\u7be9\u66ec\u73ca\u82eb\u6749\u5c71\u522a\u717d\u886b\u9583\u965c\u64c5\u8d0d\u81b3\u5584\u6c55\u6247\u7e55\u5891\u50b7\u5546\u8cde\u664c\u4e0a\u5c1a\u88f3\u68a2\u634e\u7a0d\u71d2\u828d\u52fa\u97f6\u5c11\u54e8\u90b5\u7d39\u5962\u8cd2\u86c7\u820c\u820d\u8d66\u651d\u5c04\u61fe\u6d89\u793e\u8a2d\u7837\u7533\u547b\u4f38\u8eab\u6df1\u5a20\u7d33\u795e\u6c88\u5be9\u5b38\u751a\u814e\u614e\u6ef2\u8072\u751f\u7525\u7272\u5347\u7e69\u7701\u76db\u5269\u52dd\u8056\u5e2b\u5931\u7345\u65bd\u6fd5\u8a69\u5c4d\u8671\u5341\u77f3\u62fe\u6642\u4ec0\u98df\u8755\u5be6\u8b58\u53f2\u77e2\u4f7f\u5c4e\u99db\u59cb\u5f0f\u793a\u58eb\u4e16\u67ff\u4e8b\u62ed\u8a93\u901d\u52e2\u662f\u55dc\u566c\u9069\u4ed5\u4f8d\u91cb\u98fe\u6c0f\u5e02\u6043\u5ba4\u8996\u8a66\u6536\u624b\u9996\u5b88\u58fd\u6388\u552e\u53d7\u7626\u7378\u852c\u6a1e\u68b3\u6b8a\u6292\u8f38\u53d4\u8212\u6dd1\u758f\u66f8\u8d16\u5b70\u719f\u85af\u6691\u66d9\u7f72\u8700\u9ecd\u9f20\u5c6c\u8853\u8ff0\u6a39\u675f\u620d\u8c4e\u5885\u5eb6\u6578\u6f31\u6055\u5237\u800d\u6454\u8870\u7529\u5e25\u6813\u62f4\u971c\u96d9\u723d\u8ab0\u6c34\u7761\u7a05\u542e\u77ac\u9806\u821c\u8aaa\u78a9\u6714\u720d\u65af\u6495\u5636\u601d\u79c1\u53f8\u7d72\u6b7b\u8086\u5bfa\u55e3\u56db\u4f3a\u4f3c\u98fc\u5df3\u677e\u8073\u616b\u980c\u9001\u5b8b\u8a1f\u8aa6\u641c\u8258\u64fb\u55fd\u8607\u9165\u4fd7\u7d20\u901f\u7c9f\u50f3\u5851\u6eaf\u5bbf\u8a34\u8085\u9178\u849c\u7b97\u96d6\u968b\u96a8\u7d8f\u9ad3\u788e\u6b72\u7a57\u9042\u96a7\u795f\u5b6b\u640d\u7b4d\u84d1\u68ad\u5506\u7e2e\u7463\u7d22\u9396\u6240\u584c\u4ed6\u5b83\u5979\u5854\u737a\u64bb\u8e4b\u8e0f\u80ce\u82d4\u64e1\u81fa\u6cf0\u915e\u592a\u614b\u6c70\u574d\u6524\u8caa\u7671\u7058\u58c7\u6a80\u75f0\u6f6d\u8b5a\u8ac7\u5766\u6bef\u8892\u78b3\u63a2\u5606\u70ad\u6e6f\u5858\u642a\u5802\u68e0\u819b\u5510\u7cd6\u5018\u8eba\u6dcc\u8d9f\u71d9\u638f\u6fe4\u6ed4\u7d73\u8404\u6843\u9003\u6dd8\u9676\u8a0e\u5957\u7279\u85e4\u9a30\u75bc\u8b04\u68af\u5254\u8e22\u92bb\u63d0\u984c\u8e44\u557c\u9ad4\u66ff\u568f\u60d5\u6d95\u5243\u5c5c\u5929\u6dfb\u586b\u7530\u751c\u606c\u8214\u8146\u6311\u689d\u8fe2\u773a\u8df3\u8cbc\u9435\u5e16\u5ef3\u807d\u70f4\u6c40\u5ef7\u505c\u4ead\u5ead\u633a\u8247\u901a\u6850\u916e\u77b3\u540c\u9285\u5f64\u7ae5\u6876\u6345\u7b52\u7d71\u75db\u5077\u6295\u982d\u900f\u51f8\u79bf\u7a81\u5716\u5f92\u9014\u5857\u5c60\u571f\u5410\u5154\u6e4d\u5718\u63a8\u9839\u817f\u86fb\u892a\u9000\u541e\u5c6f\u81c0\u62d6\u6258\u812b\u9d15\u9640\u99b1\u99dd\u6a62\u59a5\u62d3\u553e\u6316\u54c7\u86d9\u7aaa\u5a03\u74e6\u896a\u6b6a\u5916\u8c4c\u5f4e\u7063\u73a9\u9811\u4e38\u70f7\u5b8c\u7897\u633d\u665a\u7696\u60cb\u5b9b\u5a49\u842c\u8155\u6c6a\u738b\u4ea1\u6789\u7db2\u5f80\u65fa\u671b\u5fd8\u5984\u5a01\u5dcd\u5fae\u5371\u97cb\u9055\u6845\u570d\u552f\u60df\u70ba\u6ff0\u7dad\u8466\u840e\u59d4\u5049\u507d\u5c3e\u7def\u672a\u851a\u5473\u754f\u80c3\u9935\u9b4f\u4f4d\u6e2d\u8b02\u5c09\u6170\u885b\u761f\u6eab\u868a\u6587\u805e\u7d0b\u543b\u7a69\u7d0a\u554f\u55e1\u7fc1\u7515\u64be\u8778\u6e26\u7aa9\u6211\u65a1\u81e5\u63e1\u6c83\u5deb\u55da\u93a2\u70cf\u6c59\u8aa3\u5c4b\u7121\u856a\u68a7\u543e\u5433\u6bcb\u6b66\u4e94\u6342\u5348\u821e\u4f0d\u4fae\u5862\u620a\u9727\u6664\u7269\u52ff\u52d9\u609f\u8aa4\u6614\u7199\u6790\u897f\u7852\u77fd\u6670\u563b\u5438\u932b\u72a7\u7a00\u606f\u5e0c\u6089\u819d\u5915\u60dc\u7184\u70ef\u6eaa\u6c50\u7280\u6a84\u8972\u5e2d\u7fd2\u5ab3\u559c\u9291\u6d17\u7cfb\u9699\u6232\u7d30\u778e\u8766\u5323\u971e\u8f44\u6687\u5cfd\u4fe0\u72f9\u4e0b\u5ec8\u590f\u5687\u6380\u9341\u5148\u4ed9\u9bae\u7e96\u9e79\u8ce2\u929c\u8237\u9591\u6d8e\u5f26\u5acc\u986f\u96aa\u73fe\u737b\u7e23\u817a\u9921\u7fa8\u61b2\u9677\u9650\u7dda\u76f8\u5ec2\u9472\u9999\u7bb1\u8944\u6e58\u9109\u7fd4\u7965\u8a73\u60f3\u97ff\u4eab\u9805\u5df7\u6a61\u50cf\u5411\u8c61\u856d\u785d\u9704\u524a\u54ee\u56c2\u92b7\u6d88\u5bb5\u6dc6\u66c9\u5c0f\u5b5d\u6821\u8096\u562f\u7b11\u6548\u6954\u4e9b\u6b47\u880d\u978b\u5354\u633e\u651c\u90aa\u659c\u8105\u8ae7\u5beb\u68b0\u5378\u87f9\u61c8\u6cc4\u7009\u8b1d\u5c51\u85aa\u82af\u92c5\u6b23\u8f9b\u65b0\u5ffb\u5fc3\u4fe1\u91c1\u661f\u8165\u7329\u60fa\u8208\u5211\u578b\u5f62\u90a2\u884c\u9192\u5e78\u674f\u6027\u59d3\u5144\u5147\u80f8\u5308\u6d36\u96c4\u718a\u4f11\u4fee\u7f9e\u673d\u55c5\u92b9\u79c0\u8896\u7e61\u589f\u620c\u9700\u865b\u5653\u9808\u5f90\u8a31\u84c4\u9157\u6558\u65ed\u5e8f\u755c\u6064\u7d6e\u5a7f\u7dd2\u7e8c\u8ed2\u55a7\u5ba3\u61f8\u65cb\u7384\u9078\u766c\u7729\u7d62\u9774\u859b\u5b78\u7a74\u96ea\u8840\u52db\u718f\u5faa\u65ec\u8a62\u5c0b\u99b4\u5de1\u6b89\u6c5b\u8a13\u8a0a\u905c\u8fc5\u58d3\u62bc\u9d09\u9d28\u5440\u4e2b\u82bd\u7259\u869c\u5d16\u8859\u6daf\u96c5\u555e\u4e9e\u8a1d\u7109\u54bd\u95b9\u7159\u6df9\u9e7d\u56b4\u7814\u8712\u5dd6\u5ef6\u8a00\u984f\u95bb\u708e\u6cbf\u5944\u63a9\u773c\u884d\u6f14\u8277\u5830\u71d5\u53ad\u786f\u96c1\u5501\u5f65\u7130\u5bb4\u8afa\u9a57\u6b83\u592e\u9d26\u79e7\u694a\u63da\u4f6f\u760d\u7f8a\u6d0b\u967d\u6c27\u4ef0\u7662\u990a\u6a23\u6f3e\u9080\u8170\u5996\u7464\u6416\u582f\u9059\u7aaf\u8b20\u59da\u54ac\u8200\u85e5\u8981\u8000\u6930\u564e\u8036\u723a\u91ce\u51b6\u4e5f\u9801\u6396\u696d\u8449\u66f3\u814b\u591c\u6db2\u58f9\u58f9\u91ab\u63d6\u92a5\u4f9d\u4f0a\u8863\u9824\u5937\u907a\u79fb\u5100\u80f0\u7591\u6c82\u5b9c\u59e8\u5f5c\u6905\u87fb\u501a\u5df2\u4e59\u77e3\u4ee5\u85dd\u6291\u6613\u9091\u5c79\u5104\u5f79\u81c6\u9038\u8084\u75ab\u4ea6\u88d4\u610f\u6bc5\u61b6\u7fa9\u76ca\u6ea2\u8a63\u8b70\u8abc\u8b6f\u7570\u7ffc\u7fcc\u7e79\u8335\u852d\u56e0\u6bb7\u97f3\u9670\u59fb\u541f\u9280\u6deb\u5bc5\u98f2\u5c39\u5f15\u96b1\u5370\u82f1\u6afb\u5b30\u9df9\u61c9\u7e93\u7469\u87a2\u71df\u7192\u8805\u8fce\u8d0f\u76c8\u5f71\u7a4e\u786c\u6620\u55b2\u64c1\u50ad\u81c3\u7670\u5eb8\u96cd\u8e34\u86f9\u8a60\u6cf3\u6e67\u6c38\u607f\u52c7\u7528\u5e7d\u512a\u60a0\u6182\u5c24\u7531\u90f5\u923e\u7336\u6cb9\u904a\u9149\u6709\u53cb\u53f3\u4f51\u91c9\u8a98\u53c8\u5e7c\u8fc2\u6de4\u65bc\u76c2\u6986\u865e\u611a\u8f3f\u4f59\u4fde\u903e\u9b5a\u6109\u6e1d\u6f01\u9685\u4e88\u5a1b\u96e8\u8207\u5dbc\u79b9\u5b87\u8a9e\u7fbd\u7389\u57df\u828b\u90c1\u7c72\u9047\u55bb\u5cea\u79a6\u6108\u6b32\u7344\u80b2\u8b7d\u6d74\u5bd3\u88d5\u9810\u8c6b\u99ad\u9d1b\u6df5\u51a4\u5143\u57a3\u8881\u539f\u63f4\u8f45\u5712\u54e1\u5713\u733f\u6e90\u7de3\u9060\u82d1\u9858\u6028\u9662\u66f0\u7d04\u8d8a\u8e8d\u9470\u5dbd\u7cb5\u6708\u6085\u95b1\u8018\u96f2\u9116\u52fb\u9695\u5141\u904b\u860a\u919e\u6688\u97fb\u5b55\u531d\u7838\u96dc\u683d\u54c9\u707d\u5bb0\u8f09\u518d\u5728\u54b1\u6522\u66ab\u8d0a\u8d13\u81df\u846c\u906d\u7cdf\u947f\u85fb\u68d7\u65e9\u6fa1\u86a4\u8e81\u566a\u9020\u7682\u7ac8\u71e5\u8cac\u64c7\u5247\u6fa4\u8cca\u600e\u589e\u618e\u66fe\u8d08\u7d2e\u55b3\u6e23\u5284\u8ecb\u9358\u9598\u7728\u67f5\u69a8\u548b\u4e4d\u70b8\u8a50\u6458\u9f4b\u5b85\u7a84\u50b5\u5be8\u77bb\u6c08\u8a79\u7c98\u6cbe\u76de\u65ac\u8f3e\u5d84\u5c55\u8638\u68e7\u5360\u6230\u7ad9\u6e5b\u7dbb\u6a1f\u7ae0\u5f70\u6f33\u5f35\u638c\u6f32\u6756\u4e08\u5e33\u8cec\u4ed7\u8139\u7634\u969c\u62db\u662d\u627e\u6cbc\u8d99\u7167\u7f69\u5146\u8087\u53ec\u906e\u6298\u54f2\u87c4\u8f4d\u8005\u937a\u8517\u9019\u6d59\u73cd\u659f\u771f\u7504\u7827\u81fb\u8c9e\u91dd\u5075\u6795\u75b9\u8a3a\u9707\u632f\u93ae\u9663\u84b8\u6399\u775c\u5f81\u7319\u722d\u6014\u6574\u62ef\u6b63\u653f\u5e40\u7665\u912d\u8b49\u829d\u679d\u652f\u5431\u8718\u77e5\u80a2\u8102\u6c41\u4e4b\u7e54\u8077\u76f4\u690d\u6b96\u57f7\u503c\u4f84\u5740\u6307\u6b62\u8dbe\u53ea\u65e8\u7d19\u8a8c\u646f\u64f2\u81f3\u81f4\u7f6e\u5e5f\u5cd9\u5236\u667a\u79e9\u7a1a\u8cea\u7099\u75d4\u6eef\u6cbb\u7a92\u4e2d\u76c5\u5fe0\u9418\u8877\u7d42\u7a2e\u816b\u91cd\u4ef2\u773e\u821f\u5468\u5dde\u6d32\u8b05\u7ca5\u8ef8\u8098\u5e1a\u5492\u76ba\u5b99\u665d\u9a5f\u73e0\u682a\u86db\u6731\u8c6c\u8af8\u8a85\u9010\u7af9\u71ed\u716e\u62c4\u77da\u56d1\u4e3b\u8457\u67f1\u52a9\u86c0\u8caf\u9444\u7bc9\u4f4f\u8a3b\u795d\u99d0\u6293\u722a\u62fd\u5c08\u78da\u8f49\u64b0\u8cfa\u7bc6\u6a01\u838a\u88dd\u599d\u649e\u58ef\u72c0\u690e\u9310\u8ffd\u8d05\u589c\u7db4\u8ac4\u6e96\u6349\u62d9\u5353\u684c\u7422\u8301\u914c\u5544\u8457\u707c\u6fc1\u8332\u54a8\u8cc7\u59ff\u6ecb\u6dc4\u5b5c\u7d2b\u4ed4\u7c7d\u6ed3\u5b50\u81ea\u6f2c\u5b57\u9b03\u68d5\u8e64\u5b97\u7d9c\u7e3d\u7e31\u9112\u8d70\u594f\u63cd\u79df\u8db3\u5352\u65cf\u7956\u8a5b\u963b\u7d44\u9246\u7e82\u5634\u9189\u6700\u7f6a\u5c0a\u9075\u6628\u5de6\u4f50\u67de\u505a\u4f5c\u5750\u5ea7\u9312\u566f\u5b21\u74a6\u66d6\u9744\u8af3\u92a8\u9d6a\u5abc\u9a41\u9c32\u9200\u5504\u9211\u9d07\u9f59\u9d6f\u8cc1\u931b\u84fd\u55f6\u6f77\u924d\u7bf3\u8e55\u8290\u7df6\u7c69\u9a43\u98ae\u98c6\u93e2\u9463\u9c3e\u5110\u7e7d\u6ab3\u6baf\u81cf\u944c\u9ad5\u9b22\u7a1f\u9911\u9238\u9d53\u923d\u9a42\u9ef2\u60fb\u9364\u5115\u91f5\u56c5\u8ac2\u8b96\u8546\u61fa\u5b0b\u9a4f\u8998\u79aa\u9414\u5000\u8407\u60b5\u95b6\u9be7\u7868\u5096\u8af6\u6aec\u78e3\u9f54\u68d6\u6a89\u92ee\u943a\u98ed\u9d1f\u9283\u5114\u5e6c\u8b8e\u82bb\u7d40\u8e95\u91e7\u6134\u7d9e\u9d89\u8f1f\u9f6a\u9dbf\u84ef\u9a44\u6a05\u8f33\u651b\u92bc\u9e7a\u5660\u97c3\u99d8\u7d3f\u6bab\u8ce7\u7649\u7c1e\u8b9c\u78ad\u8960\u71fe\u9419\u7cf4\u8a46\u8ae6\u7d88\u89bf\u93d1\u5dd4\u923f\u7672\u929a\u9bdb\u9c08\u92cc\u92a9\u5d20\u9d87\u7ac7\u7006\u6add\u7258\u7be4\u9ef7\u7c6a\u61df\u9413\u71c9\u8e89\u9438\u8ae4\u580a\u95bc\u8edb\u92e8\u9354\u9d9a\u984e\u9853\u9c77\u8a92\u9087\u927a\u9d2f\u9b9e\u9201\u9b74\u7dcb\u9428\u9be1\u50e8\u7043\u9ce7\u99d9\u7d31\u7d3c\u8cfb\u9ea9\u9b92\u9c12\u91d3\u8cc5\u5c37\u641f\u7d3a\u6207\u776a\u8aa5\u7e1e\u92ef\u7d07\u9398\u6f41\u4e99\u8ce1\u7d86\u9bc1\u8a6c\u7df1\u89af\u8a41\u8f42\u9237\u932e\u9d23\u9d60\u9dbb\u9d30\u6451\u8a7f\u645c\u9e1b\u9c25\u7377\u532d\u528c\u5aaf\u6a9c\u9bad\u9c56\u889e\u7dc4\u9bc0\u581d\u54bc\u5e57\u69e8\u87c8\u927f\u95de\u7d4e\u9821\u705d\u9865\u8a36\u95d4\u8823\u9ecc\u8a0c\u8452\u958e\u9c5f\u6ef8\u9d98\u9a4a\u6a3a\u93f5\u5950\u7e6f\u9370\u9bc7\u9c09\u8a7c\u8588\u5666\u6fae\u7e62\u743f\u6689\u8ae2\u991b\u95bd\u9225\u944a\u8a10\u8a70\u85ba\u5630\u568c\u9a65\u74a3\u89ac\u9f4f\u78ef\u7f88\u8806\u8e8b\u973d\u9c6d\u9bfd\u90df\u6d79\u92cf\u93b5\u87ef\u8aeb\u7e11\u6214\u6229\u77bc\u9dbc\u7b67\u9c39\u97c9\u7d73\u97c1\u649f\u5da0\u9de6\u9bab\u7664\u981c\u9b9a\u5df9\u85ce\u9949\u7e09\u8d10\u89b2\u5244\u6d87\u9015\u5f33\u811b\u975a\u9b2e\u9ce9\u9df2\u8a4e\u5c68\u6af8\u98b6\u9245\u92e6\u7ab6\u9f5f\u9308\u942b\u96cb\u8b4e\u73a8\u76b8\u5274\u584f\u613e\u6137\u93a7\u9347\u9f95\u958c\u9227\u92ac\u9a0d\u7dd9\u8efb\u9233\u9301\u9837\u9f66\u93d7\u56b3\u9136\u5672\u81be\u736a\u9ad6\u8a86\u8a91\u913a\u58d9\u7e8a\u8cba\u5331\u8562\u6192\u8075\u7c23\u95ab\u9315\u9be4\u8810\u5d0d\u5fa0\u6df6\u7028\u8cda\u775e\u9338\u7669\u7c5f\u5d50\u6b16\u6595\u946d\u8964\u95ac\u92c3\u562e\u5d97\u92a0\u9412\u7646\u9c33\u8a84\u7e32\u5137\u9148\u58e2\u85f6\u849e\u863a\u56a6\u9090\u9a6a\u7e2d\u6aea\u6adf\u8f62\u792a\u92f0\u9e1d\u7658\u7cf2\u8e92\u9742\u9c7a\u9c67\u861e\u5969\u7032\u7489\u6bae\u8933\u895d\u9c31\u9b4e\u7e5a\u91d5\u9def\u85fa\u5ee9\u6a81\u8f54\u8eaa\u7dbe\u6b1e\u87f6\u9bea\u700f\u9a2e\u7db9\u93a6\u9dda\u8622\u7027\u74cf\u6af3\u6727\u7931\u50c2\u851e\u560d\u5d81\u93e4\u763a\u802c\u87bb\u9acf\u58da\u64fc\u5695\u95ad\u7018\u6de5\u6ae8\u6ad3\u8f64\u8f05\u8f46\u6c0c\u81da\u9e15\u9dfa\u826b\u9c78\u81e0\u5b4c\u6b12\u9e1e\u947e\u5707\u7296\u7380\u6ffc\u6b0f\u8161\u93cd\u6ada\u8938\u92dd\u5638\u561c\u5b24\u69aa\u52f1\u7e35\u93dd\u9859\u9c3b\u9ebc\u636b\u71dc\u61e3\u9346\u7f8b\u8b10\u737c\u79b0\u6fa0\u9766\u9efd\u7df2\u7e46\u9594\u7de1\u8b28\u9a40\u9943\u6b7f\u93cc\u926c\u9403\u8a25\u922e\u9be2\u8f26\u9bf0\u8526\u88ca\u9689\u8617\u56c1\u9862\u8ea1\u82e7\u5680\u8079\u5102\u5665\u99d1\u91f9\u513a\u8b33\u616a\u750c\u8e63\u76b0\u8f61\u7d15\u7f86\u9239\u8ade\u99e2\u7e39\u5b2a\u91d9\u93f7\u9420\u8604\u9a0f\u7dba\u69bf\u78e7\u980e\u980f\u9c2d\u50c9\u8541\u6173\u9a2b\u7e7e\u69e7\u9210\u5b19\u6aa3\u6227\u7197\u9306\u93d8\u93f9\u7fa5\u8e4c\u8a9a\u8b59\u854e\u7e70\u78fd\u8e7a\u611c\u9365\u7bcb\u92df\u64b3\u9bd6\u7162\u86fa\u5df0\u8cd5\u87e3\u9c0d\u8a58\u5d87\u95c3\u89b7\u9d1d\u8a6e\u7da3\u8f07\u9293\u95cb\u95d5\u6128\u8558\u5b08\u6a48\u98ea\u8ed4\u5db8\u8811\u7e1f\u92a3\u9870\u8706\u98af\u6bff\u7cdd\u7e45\u55c7\u92ab\u7a61\u93a9\u9bca\u91c3\u8a15\u59cd\u9a38\u91e4\u9c54\u5770\u6ba4\u89f4\u5399\u7044\u756c\u8a75\u8ad7\u700b\u8b1a\u5852\u8494\u5f12\u8efe\u8cb0\u9230\u9c23\u7dac\u6504\u7d13\u9582\u9460\u5edd\u99df\u7de6\u9376\u9de5\u85ea\u993f\u98bc\u93aa\u8b16\u7a4c\u8ab6\u84c0\u733b\u55e9\u8127\u95e5\u9248\u9c28\u9226\u9b90\u66c7\u926d\u931f\u9807\u513b\u9933\u940b\u93dc\u97dc\u92f1\u7df9\u9d5c\u95d0\u7cf6\u9f60\u9c37\u615f\u9204\u91f7\u6476\u98e9\u7c5c\u9f09\u5aa7\u8183\u7d08\u7db0\u8f1e\u8ac9\u5e43\u95c8\u6e88\u6f7f\u744b\u97d9\u7152\u9baa\u95bf\u8435\u9f77\u9114\u5ee1\u61ae\u5af5\u9a16\u9d61\u9da9\u993c\u9b29\u74bd\u89a1\u7864\u83a7\u859f\u861a\u5cf4\u736b\u5afb\u9df4\u7647\u8814\u79c8\u8e9a\u858c\u9909\u9a64\u7dd7\u9957\u5635\u701f\u9a4d\u7d83\u689f\u7c2b\u893b\u64f7\u7d32\u7e88\u9658\u6ece\u9948\u9d42\u8a61\u980a\u8afc\u9249\u93c7\u8b14\u6fa9\u9c48\u5864\u6f6f\u9c58\u57e1\u5a6d\u690f\u6c2c\u53b4\u8d17\u513c\u5157\u8b9e\u61e8\u9586\u91c5\u9b58\u995c\u9f34\u716c\u8efa\u9dc2\u9c29\u9768\u8b01\u9134\u66c4\u71c1\u8a52\u56c8\u5da7\u98f4\u61cc\u9a5b\u7e0a\u8efc\u8cbd\u91d4\u93b0\u943f\u761e\u8264\u92a6\u766e\u584b\u9daf\u7e08\u93a3\u6516\u56b6\u7005\u7020\u74d4\u9e1a\u766d\u9826\u7f4c\u93de\u8555\u92aa\u9b77\u50b4\u4fc1\u8adb\u8aed\u8577\u5d33\u98eb\u95be\u5ad7\u7d06\u89a6\u6b5f\u923a\u9d52\u9df8\u9f6c\u6ade\u9cf6\u9eff\u925e\u9106\u8553\u60f2\u614d\u7d1c\u97de\u6b9e\u6c33\u74da\u8db2\u93e8\u99d4\u8cfe\u5616\u5e58\u7c00\u8b56\u7e52\u8b6b\u8a54\u91d7\u8b2b\u8f12\u9dd3\u6e5e\u7e1d\u6968\u8eeb\u8cd1\u798e\u9d06\u8acd\u5d22\u9266\u931a\u7b8f\u9a2d\u6adb\u6894\u8ef9\u8f0a\u8d04\u9dd9\u8784\u7e36\u8e93\u8e91\u89f6\u937e\u7d02\u7e10\u4f47\u6ae7\u9296\u56c0\u994c\u9873\u9a05\u7e0b\u8ad1\u9432\u8aee\u7dc7\u8f1c\u8cb2\u7725\u9319\u9f5c\u9bd4\u50af\u8acf\u9a36\u9beb\u93c3\u7e98\u8ea6\u9c52\u8a01\u8b7e\u90e4\u731b\u6c39\u962a\u58df\u5816\u57b5\u588a\u6abe\u8552\u8464\u84e7\u8493\u83c7\u69c1\u6463\u54a4\u551a\u54e2\u565d\u5645\u6485\u5288\u8b14\u8946\u5db4\u810a\u4eff\u50e5\u7341\u9e85\u9918\u9937\u994a\u9962\u695e\u6035\u61cd\u723f\u6f35\u7069\u6df7\u6feb\u7026\u6de1\u5be7\u7cf8\u7d5d\u7dd4\u7449\u6898\u68ec\u6848\u6a70\u6aeb\u8ef2\u8ee4\u8ceb\u8181\u8156\u98c8\u7cca\u7146\u6e9c\u6e63\u6e3a\u78b8\u6efe\u7798\u9208\u9255\u92e3\u92b1\u92e5\u92f6\u9426\u9427\u9369\u9340\u9343\u9307\u9384\u9387\u93bf\u941d\u9465\u9479\u9454\u7a6d\u9d93\u9da5\u9e0c\u7667\u5c59\u7602\u81d2\u8947\u7e48\u802e\u986c\u87ce\u9eaf\u9b81\u9b83\u9b8e\u9bd7\u9bdd\u9bf4\u9c5d\u9bff\u9c20\u9c35\u9c45\u97bd\u97dd\u9f47";function ige(e){return Vxt.charAt(rge.indexOf(e.charAt(0)))}var icr=new RegExp("[\u4e00-\u9fa5]+");function nge(e){return rge.includes(e)}var fi=class{static GetBytes(e){switch(typeof e){case"string":{let t=new Uint16Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return new Uint8Array(t.buffer)}case"number":return e-Math.floor(e)==0?e>4294967295?((t=new Float64Array(1))[0]=e,new Uint8Array(t.buffer)):function(t){return t[0]=e,new Uint8Array(t.buffer)}(new Int32Array(1)):function(t){return t[0]=e,new Uint8Array(t.buffer)}(new Float64Array(1));case"boolean":return function(t){return t[0]=Number(e),t}(new Uint8Array(1));default:if(e instanceof Array){let t=[];for(let s=0;s<e.length;s++)t.push(fi.GetBytes(e[s]));let i=0;for(let e=0;e<t.length;e++)i+=t[e].length;let r=new Uint8Array(i),n=0;for(let e=0;e<t.length;e++)for(let i=0;i<t[e].length;i++)r[n++]=t[e][i];return r}throw"Can't Convert To Bytes!!"}var t}static Get1Bytes(e){switch(typeof e){case"number":case"boolean":return new Uint8Array([Number(e)]);default:if(e instanceof Array){let t=[];for(let s=0;s<e.length;s++)t.push(this.Get1Bytes(e[s]));let i=0;for(let e=0;e<t.length;e++)i+=t[e].length;let r=new Uint8Array(i),n=0;for(let e=0;e<t.length;e++)for(let i=0;i<t[e].length;i++)r[n++]=t[e][i];return r}throw"Can't Convert To Bytes!!"}}static byteTosbyte(e){return(127&e)-(128&e?128:0)}static ToBoolean(e,t){return!!e[t=t||0]}static ToInt8(e,t){return 128&e[t=t||0]?-(1+(255^e[t])):e[t]}static ToUInt8(e,t){return e[t=t||0]}static ToInt16(e,t){t=t||0;let i=e.slice(t,t+2);return new Int16Array(i.buffer,0,1)[0]}static ToInt32(e,t){t=t||0;let i=e.slice(t,t+4);return new Int32Array(i.buffer,0,1)[0]}static ToUInt16(e,t){t=t||0;let i=e.slice(t,t+2);return new Uint16Array(i.buffer,0,1)[0]}static ToUInt32(e,t){t=t||0;let i=e.slice(t,t+4);return new Uint32Array(i.buffer,0,1)[0]}static ToChar(e,t){t=t||0;let i=e.slice(t,t+2);return String.fromCharCode(new Uint16Array(i.buffer,0,1)[0])}static ToAscii(e,t){return t=t||0,String.fromCharCode(e[t])}static ToAsciiString(e,t,i){t=t||0,(i=i||e.length)+t>e.length&&(i-=t);let r="";for(let n=0;n<i;n++)r+=String.fromCharCode(e[t+n]||0);return r}static ToUTF16String(e,t,i){t=t||0,(i=i||e.length)+t>e.length&&(i-=t);let r=new Uint8Array(i);for(let n=0;n<i;n++)r[n]=e[t+n]||0;return String.fromCharCode.apply(null,Array.from(new Uint16Array(r.buffer,0,i/2)))}static ToFloat32(e,t){t=t||0;let i=e.slice(t,t+4);return new Float32Array(i.buffer,0,1)[0]}static ToFloat64(e,t){t=t||0;let i=e.slice(t,t+8);return new Float64Array(i.buffer,0,1)[0]}},Gf=class{static parserHeader(e,t){let i="",r=!1,n=0;for(;;){let s=e.readInt8(),a=String.fromCharCode(s);if(r)a===t[n]?n++:(r=!1,n=0);else{if(a===t[n]){r=!0,n++;continue}i+=a}if(r&&n===t.length)break}return i}static getCode(e){let t=tge(e);return t.length<2?t[0]:t.length<4?fi.ToUInt16(t,0):fi.ToUInt32(t,0)}static parserCode(e,t,i){let r=new ce,n=[],s=[],a=[],o=!1;for(let l=0;l<t.length;l++){let h=t[l];switch(h){case 0:break;case 1:o=!0,s.push(r.clone());break;case 2:o=!1,s.length>1?(n.push(s.slice()),s=[]):r.set(0,0);break;case 3:l++,i/=t[l];break;case 4:l++,i*=t[l];break;case 5:if(4===a.length)throw"The position stack is only four locations deep";a.push(r);break;case 6:r=a.pop(),s.length>1&&(n.push(s.slice()),s=[]),o&&s.push(r.clone());break;case 7:{let a,o=0,h=i*e.baseUp,u=r.clone();switch(s.length>1&&(n.push(s.slice()),s=[]),e.type){case 0:l++,o=t[l];break;case 1:l++,o=t[l],0==o&&(l++,o=fi.ToUInt16(new Uint8Array([t[l++],t[l++]]),0),u.x=t[l++]*i,u.y=t[l++]*i,h=t[l]*i);break;case 2:l+=2,o=fi.ToUInt16(new Uint8Array([t[l-1],t[l]]),0)}0!==o&&(a=e.getGraphicDataByCodeWithOffset(o,h,u),a&&(n.push(...a.polylines.slice()),r=a.lastPoint.clone()))}break;case 8:{let e=new ce;e.x=fi.byteTosbyte(t[++l]),e.y=fi.byteTosbyte(t[++l]),r.add(e.multiplyScalar(i)),o&&s.push(r.clone())}break;case 9:for(;;){let e=new ce;if(e.x=fi.byteTosbyte(t[++l]),e.y=fi.byteTosbyte(t[++l]),0==e.x&&0==e.y)break;r.add(e.multiplyScalar(i)),o&&s.push(r.clone())}break;case 10:{let e=t[++l]*i,n=fi.byteTosbyte(t[++l]),a=(112&n)>>4,h=7&n;0==h&&(h=8);let u=Math.PI/4,c=u*h,p=Gf.CIRCLE_SPAN;n<0&&(p=-p,c=-c);let d=u*a,f=d+c,m=r.clone().sub(new ce(Math.cos(d)*e,Math.sin(d)*e));if(r=m.clone().add(new ce(Math.cos(f)*e,Math.sin(f)*e)),o){let t=d,i=!0;for(;i&&(t+=p,n>=0&&t<f||n<0&&t>f);)s.push(m.clone().add(new ce(e*Math.cos(t),e*Math.sin(t))));s.push(r.clone())}}break;case 11:{let e=t[++l],n=t[++l],a=(255*t[++l]+t[++l])*i,h=fi.byteTosbyte(t[++l]),u=(112&h)>>4,c=7&h;0==c&&(c=8),0!=n&&c--;let p=Math.PI/4,d=p*c,f=Gf.CIRCLE_SPAN,m=1;h<0&&(f=-f,d=-d,m=-1);let g=p*u,y=g+d;g+=p*e/256*m,y+=p*n/256*m;let v=r.clone().sub(new ce(a*Math.cos(g),a*Math.sin(g)));if(r=v.clone().add(new ce(a*Math.cos(y),a*Math.sin(y))),o){let e=g,t=!0;for(;t&&(e+=f,h>0&&e<y||h<0&&e>y);)s.push(v.clone().add(new ce(a*Math.cos(e),a*Math.sin(e))));s.push(r.clone())}}break;case 12:{let e=new ce;e.x=fi.byteTosbyte(t[++l])*i,e.y=fi.byteTosbyte(t[++l])*i;let n=fi.byteTosbyte(t[++l]);n<-127&&(n=-127),o&&(0==n?s.push(r.clone().add(e)):s.push(Gf.generateArcPoints(r,e,n/127))),r.add(e)}break;case 13:for(;;){let e=new ce;if(e.x=fi.byteTosbyte(t[++l])*i,e.y=fi.byteTosbyte(t[++l])*i,0==e.x&&0==e.y)break;let n=fi.byteTosbyte(t[++l]);n<-127&&(n=-127),o&&(0==n?s.push(r.clone().add(e)):s.push(Gf.generateArcPoints(r.clone(),e,n/127))),r.add(e)}break;case 14:l=Gf.skipCode(e,t,++l);break;default:if(h>15){let e=(240&h)>>4,t=15&h,n=new ce;switch(t){case 0:n.x=1;break;case 1:n.x=1,n.y=.5;break;case 2:n.x=1,n.y=1;break;case 3:n.x=.5,n.y=1;break;case 4:n.y=1;break;case 5:n.x=-.5,n.y=1;break;case 6:n.x=-1,n.y=1;break;case 7:n.x=-1,n.y=.5;break;case 8:n.x=-1;break;case 9:n.x=-1,n.y=-.5;break;case 10:n.x=-1,n.y=-1;break;case 11:n.x=-.5,n.y=-1;break;case 12:n.y=-1;break;case 13:n.x=.5,n.y=-1;break;case 14:n.x=1,n.y=-1;break;case 15:n.x=1,n.y=-.5}r.add(n.multiplyScalar(e*i)),o&&s.push(r.clone())}}}return new Jp(r,n)}static skipCode(e,t,i){switch(t[i]){case 0:case 1:case 2:case 5:case 6:case 14:default:break;case 3:case 4:i++;break;case 7:switch(e.type){case 0:i++;break;case 1:0==t[++i]&&(i+=6);break;case 2:i+=2}break;case 8:case 10:i+=2;break;case 9:for(;;){let e=t[++i],r=t[++i];if(0==e&&0==r)break}break;case 11:i+=5;break;case 12:i+=3;break;case 13:for(;;){let e=t[++i],r=t[++i];if(0==e&&0==r)break;t[++i]}}return i}static generateArcPoints(e,t,i){let r=e.clone().add(t),n=i<0;i=Math.abs(i);let s=t.length()/2,a=s*i,o=2*Math.atan(1/i),l=new ce(t.y,-t.x);l.normalize(),l.multiplyScalar(a);let h=Math.abs(s/Math.sin(o/2)),u=e.add(t.divideScalar(2));!1!==n?u.add(l):u.sub(l);let c=e.sub(u),p=r.sub(u),d=Math.atan2(c.y,c.x),f=Math.atan2(p.y,p.x),m=Gf.CIRCLE_SPAN;n?(m=-m,d<f&&(d+=2*Math.PI)):d>f&&(d-=2*Math.PI);let g=d;for(;;){if(g+=m,!n&&g<f||n&&g>f)return u.add(new ce(h*Math.cos(g),h*Math.sin(g)));break}return r}},Kc=Gf;Kc.FILE_STOP_FLAG=["\r","\n","\x1a"],Kc.CIRCLE_SPAN=Math.PI/18;var JA={130:[[[5,0],[5,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]]],131:[[[3,0],[7,0]],[[5,0],[5,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]]],132:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]]],133:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[3,9.5],[7,9.5]]],134:[[[3,0],[7,0]],[[5,0],[5,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[12,10],[9,10],[9,6]],[[9,8],[11,8]]],135:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[12,10],[9,10],[9,6]],[[9,8],[11,8]]],136:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[3,9.5],[7,9.5]],[[12,10],[9,10],[9,6]],[[9,8],[11,8]]],178:[[[1.142,9.285],[1.142,9.428],[1.285,9.714],[1.428,9.857],[1.714,10],[2.285,10],[2.571,9.857],[2.714,9.714],[2.857,9.428],[2.857,9.142],[2.714,8.857],[2.428,8.428],[1,7],[3,7]]],8960:[[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]],[[0,0],[8,8]]],20393:[[[0,0],[0,6.666]],[[0,4.761],[1.428,6.19],[2.38,6.666],[3.809,6.666],[4.761,6.19],[5.238,4.761],[5.238,0]],[[5.238,4.761],[6.666,6.19],[7.619,6.666],[9.047,6.666],[10,6.19],[10.476,4.761],[10.476,0]],[[11.142,9.285],[11.142,9.428],[11.285,9.714],[11.428,9.857],[11.714,10],[12.285,10],[12.571,9.857],[12.714,9.714],[12.857,9.428],[12.857,9.142],[12.714,8.857],[12.428,8.428],[11,7],[13,7]]],41123:[],55714:[[[2,5.9],[2.6,6.1],[3.4,7],[3.4,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],55970:[[[2.3,5.6],[2.3,5.9],[2.6,6.4],[2.9,6.7],[3.4,7],[4.6,7],[5.1,6.7],[5.4,6.4],[5.7,5.9],[5.7,5.3],[5.4,4.7],[4.9,3.9],[2,1],[6,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56226:[[[2.6,7],[5.7,7],[4,4.7],[4.9,4.7],[5.4,4.4],[5.7,4.1],[6,3.3],[6,2.7],[5.7,1.9],[5.1,1.3],[4.3,1],[3.4,1],[2.6,1.3],[2.3,1.6],[2,2.1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56482:[[[4.9,7],[2,3],[6.3,3]],[[4.9,7],[4.9,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56738:[[[5.4,7],[2.6,7],[2.3,4.4],[2.6,4.7],[3.4,5],[4.3,5],[5.1,4.7],[5.7,4.1],[6,3.3],[6,2.7],[5.7,1.9],[5.1,1.3],[4.3,1],[3.4,1],[2.6,1.3],[2.3,1.6],[2,2.1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56994:[[[5.4,6.1],[5.1,6.7],[4.3,7],[3.7,7],[2.9,6.7],[2.3,5.9],[2,4.4],[2,3],[2.3,1.9],[2.9,1.3],[3.7,1],[4,1],[4.9,1.3],[5.4,1.9],[5.7,2.7],[5.7,3],[5.4,3.9],[4.9,4.4],[4,4.7],[3.7,4.7],[2.9,4.4],[2.3,3.9],[2,3]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],57250:[[[2,7],[6,7],[3.1,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],57506:[[[3.4,7],[2.6,6.7],[2.3,6.1],[2.3,5.6],[2.6,5],[3.1,4.7],[4.3,4.4],[5.1,4.1],[5.7,3.6],[6,3],[6,2.1],[5.7,1.6],[5.4,1.3],[4.6,1],[3.4,1],[2.6,1.3],[2.3,1.6],[2,2.1],[2,3],[2.3,3.6],[2.9,4.1],[3.7,4.4],[4.9,4.7],[5.4,5],[5.7,5.6],[5.7,6.1],[5.4,6.7],[4.6,7],[3.4,7]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],57762:[[[5.7,5],[5.4,4.1],[4.9,3.6],[4,3.3],[3.7,3.3],[2.9,3.6],[2.3,4.1],[2,5],[2,5.3],[2.3,6.1],[2.9,6.7],[3.7,7],[4,7],[4.9,6.7],[5.4,6.1],[5.7,5],[5.7,3.6],[5.4,2.1],[4.9,1.3],[4,1],[3.4,1],[2.6,1.3],[2.3,1.9]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],60070:[[[0,6],[10,6],[10,4]]],60326:[[[0,7],[0,5],[10,5]]]},QA=new Ui,Vf=class{constructor(e){this.type=1,this.info="",this.orientation=0,this.baseUp=0,this.baseDown=0,this.fileHeader="",this.fileVersion="",this.codes={},this.graphicData=new Map,this.url=e}getGraphicDataByCode(e,t){if(0===e)return;let i=this.codes;if(!this.graphicData.has(e)){if(!i[e]){if(JA[e]){let i=[];for(let t=0;t<JA[e].length;t++)i.push(JA[e][t].map((e=>new ce(e[0],e[1]))));let r=new Jp(new ce,i),n=t/ZA;return QA.identity().scale(n,n),r.transform(QA)}return}{let t=i[e],r=ZA/this.baseUp,n=Kc.parserCode(this,t,r);this.graphicData.set(e,n)}}if(this.graphicData.has(e)){let i=t/ZA;return QA.identity().scale(i,i),this.graphicData.get(e).transform(QA)}}getGraphicDataByCodeWithOffset(e,t,i){var r;return null==(r=this.getGraphicDataByCode(e,t))?void 0:r.offset(i)}getFontFile(){return{url:this.url,type:this.type,codes:this.codes,info:this.info,orientation:this.orientation,baseUp:this.baseUp,baseDown:this.baseDown,fileHeader:this.fileHeader,fileVersion:this.fileVersion}}setFontFile(e){this.url=e.url,this.type=e.type,this.codes=e.codes,this.info=e.info,this.orientation=e.orientation,this.baseUp=e.baseUp,this.baseDown=e.baseDown,this.fileHeader=e.fileHeader,this.fileVersion=e.fileVersion}releaseFontData(){this.codes={},this.graphicData.clear()}setFontDataToIndexedDb(){return ct(this,null,(function*(){let e=this.getFontFile();return new Promise(((t,i)=>{fh.instance().save(e,(()=>{console.log(`[FontFile] Saved '${this.url}' (${this.fileHeader}) to indexedDb`),t()}),(e=>i(`[FontFile] Failed to save '${this.url}' (${this.fileHeader}) to indexedDb! ${e}`)))}))}))}getFontDataByIndexedDb(){return ct(this,null,(function*(){return new Promise(((e,t)=>{fh.instance().query(this.url,(t=>{e(t)}),(()=>t("[FontFile] Failed to get FontData from IndexedDB")))}))}))}},QI=class extends Vf{constructor(e){super(e),this.isExtend=!1,this.type=1}init(e){fi.ToInt16(e.readBytes(2),0);let t=fi.ToInt16(e.readBytes(2),0),i=fi.ToInt16(e.readBytes(2),0);for(let o=0;o<i;o++)e.readBytes(2),e.readBytes(2);let r=[];for(let o=0;o<t;o++){let t=e.readBytes(8),i=fi.ToUInt16(new Uint8Array([t[1],t[0]]),0),n=fi.ToUInt16(t,2),s=fi.ToUInt32(t,4);0===i&&0===n&&0===s||r.push({code:i,length:n,offset:s})}let n={};for(let o of r)e.setPosition(o.offset),n[o.code]=e.readBytes(o.length);let s=n[0],a=(this.info=zxt(s)).indexOf("\0")+1;s.length-a==4?(this.baseUp=s[a++],this.baseDown=s[a++],this.orientation=s[a++]):(this.baseUp=s[a++],a++,this.orientation=s[a++],this.baseDown=s[a++],this.isExtend=!0),this.codes=n}};function zxt(e){let t,i,r,n,s;t="";let a=e.length;for(i=0;i<a;)switch(r=e[i++],r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(r);break;case 12:case 13:n=e[i++],t+=String.fromCharCode((31&r)<<6|63&n);break;case 14:n=e[i++],s=e[i++],t+=String.fromCharCode((15&r)<<12|(63&n)<<6|(63&s)<<0)}return t}var e_=class extends Vf{constructor(e){super(e),this.type=0}init(e){e.readBytes(2),e.readBytes(2);let t=fi.ToInt16(e.readBytes(2),0),i=[];for(let a=0;a<t;a++){let t=fi.ToUInt16(e.readBytes(2),0),r=fi.ToUInt16(e.readBytes(2),0);i.push({code:t,length:r})}let r={};for(let a of i)r[a.code]=e.readBytes(a.length);let n=r[0],s=(this.info=(new TextDecoder).decode(n)).indexOf("\0");this.baseUp=n[++s],this.baseDown=n[++s],this.orientation=n[++s],this.codes=r}},t_=class extends Vf{constructor(e){super(e),this.type=2,this.isUniCode=!0,this.isEmbedded=!1}init(e){let t=fi.ToInt32(e.readBytes(4),0),i=fi.ToInt16(e.readBytes(2),0),r=e.readBytes(i),n=(this.info=(new TextDecoder).decode(r)).indexOf("\0");this.baseUp=r[++n],this.baseDown=r[++n],this.orientation=r[++n],this.isUniCode=0==r[++n],this.isEmbedded=0==r[++n];let s={};for(let a=0;a<t-1;a++){let t=fi.ToUInt16(e.readBytes(2),0),i=fi.ToUInt16(e.readBytes(2),0);s[t]=e.readBytes(i)}this.codes=s}},eO=new ce,SG=class extends u0{constructor(e){super(""),this.unsupportedChars={},this.textShapesCache=new Map,this.files=[],this.filesMap=new Map,e&&this.loadFiles(e)}loadFiles(e){return ct(this,null,(function*(){for(let t=0;t<e.length;t++){let i=e[t];this.files.push(this.loadFile(i))}xr.isBrowser&&(yield this.saveFontDataToIndexdb(),this.releaseFontData())}))}loadFile(e){let{url:t,arrayBuffer:i}=e,r=new Bf(i),n=Kc.parserHeader(r,Kc.FILE_STOP_FLAG).split(" "),s=null;switch(n[1]){case"shapes":s=new e_(t);break;case"bigfont":s=new QI(t);break;case"unifont":s=new t_(t)}return s&&(s.fileHeader=n[0],s.fileVersion=n[2],s.init(r),this.filesMap.set(t,s)),re.info(`[ShxFont] shx font loaded.The font file is ${n[0]} ${n[2]}`),s}getGraphicDataByChar(e,t){let i=Kc.getCode(e);return 0===i&&(i=e.charCodeAt(0)),this.getGraphicDataByCode(i,t)}getGraphicDataByCode(e,t){let i,r=`${e}_${t}`;if(this.textShapesCache.has(r))return this.textShapesCache.get(r);for(let n=0;n<this.files.length&&(i=this.files[n].getGraphicDataByCode(e,t),!i);n++);return i&&this.textShapesCache.set(r,i),i}getGraphicData(e,t=SG.DEFAULT_SIZE,i=0,r=0,n=0,s,a=!1){let o=[],l=e.split("\n"),h=(l.length-1)*(r+i),u=0,c=!1;for(let p=0;p<l.length;p++){let e=l[p];for(let a=0;a<e.length;a++){let l=e[a];nge(l)&&(l=ige(l));let p=this.getGraphicDataByChar(l,t);if(p||(p=this.getNotFoundTextShape(t),this.addUnsupportedChar(l)),p)if(0===p.polylines.length&&(p.width=t+n,u+=n),c||s&&u+p.width>s){c?(u+=p.width+n,c=!1):(c=!0,u=0,h-=r+i),eO.set(u,h);let e=p.offset(eO);o.push(e),!c&&(u+=p.width+n)}else{eO.set(u,h);let e=p.offset(eO);o.push(e),u+=p.width+n}else this.addUnsupportedChar(l)}c=!1,u=0,h-=r+i}return o}getNotFoundTextShape(e){let t=Kc.getCode("\uff1f");return this.getGraphicDataByCode(t,e)}addUnsupportedChar(e){this.unsupportedChars[e]||(this.unsupportedChars[e]=0),this.unsupportedChars[e]++}static checkFontsAreLoaded(e){return ct(this,null,(function*(){if(!xr.isBrowser)return!1;let t=!1,i=yield fh.instance().queryAll();if(i.length!==e.length)return!1;for(let r=0;r<i.length;r++){let n=i[r];if(n.codes instanceof Map){t=!1;break}if(0===Object.keys(n.codes).length){t=!1;break}if(!e.includes(n.url)){t=!1;break}t=!0}return t}))}saveFontDataToIndexdb(){return ct(this,null,(function*(){fh.instance().clearAll();let e=this.files.map((e=>e.setFontDataToIndexedDb()));return yield Promise.all(e).then((()=>{re.debug("[ShxFont] Saves font data to IndexDB")}))}))}getFontData(){return ct(this,null,(function*(){if(xr.isBrowser){let e=yield fh.instance().queryAll(),t=[],i=new Map;for(let r=0;r<e.length;r++){let n,s=e[r];switch(s.type){case 1:n=new QI(s.url);break;case 0:n=new e_(s.url);break;case 2:n=new t_(s.url)}n&&(n.setFontFile(s),t.push(n),i.set(s.url,n))}this.files=t,this.filesMap=i,re.debug("[ShxFont] Loaded font data from cache.")}}))}releaseFontData(){for(let e=0;e<this.files.length;e++)this.files[e].releaseFontData();this.files=[],this.filesMap.clear(),this.textShapesCache.clear()}destroy(){}},Jc=SG;Jc.DEFAULT_SIZE=12;var mh=class extends kf{constructor(e){super(e)}load(e,t,i,r){Array.isArray(e)||(e=[e]);let n=[];for(let s=0;s<e.length;s++){let t=e[s];mh.isShxFile(t)?n.push(this.loadFile(t,i)):console.warn(`[ShxFontLoader] Invalid shx file: '${t}'`)}Promise.all(n).then((e=>{let i=this.parse(e);t&&t(i)})).catch((e=>{r&&r(e)}))}loadFile(e,t){return ct(this,null,(function*(){return new Promise(((i,r)=>{let n=new di(this.manager);n.setResponseType("arraybuffer"),n.load(e,(t=>{i({url:e,arrayBuffer:t})}),t,(e=>{r(e)}))}))}))}loadAsync(e,t){return ct(this,null,(function*(){return Array.isArray(e)||(e=[e]),(yield Jc.checkFontsAreLoaded(e))?Promise.resolve(new Jc):new Promise(((i,r)=>{this.load(e,i,t,r)}))}))}parse(e){return new Jc(e)}static isShxFile(e){var t;return"shx"===(null==(t=e.split(".").pop())?void 0:t.toLowerCase())}},zf=new D(1,0,0),wG=new D(0,1,0),tO=new D(0,0,1),sge=new D(0,0,0),jf=0,jxt="CONTINUOUS",r_=new Rn({color:jf}),za=new br({color:jf}),GE=new Xt({color:jf}),age=new Be,RG=new Be,Jl=new Be,vs=new D,i_=new D,n_=new ce,oge=new Br,lge=!1,Wxt=new Rn({color:65280,size:5,depthTest:!1}),qxt=new Rn({color:65280,depthTest:!1}),Yxt=new Rn({color:65280,depthTest:!1}),Xxt=e=>void 0!==e.viewDirectionFromTarget,$xt=e=>{if(e){let t=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);if(t&&t.length>0){let i=t[1],r=e.replace("data:"+i+";","").split(",");if(r&&2===r.length&&"base64"===r[0]){let e=r[1];return Ame.decode(e)}}}return null},cge=(e,t)=>{let i=new ce(e.x,e.y),r=new ce(t.x,t.y);return r.sub(i),r.normalize(),r.y<0?-Math.acos(r.x):Math.acos(r.x)},uge=(e,t,i)=>({x:e.x+t*Math.cos(i),y:e.y+t*Math.sin(i)}),Zxt=(e,t,i,r)=>{let n=e?new ce(e.x,e.y):new ce(0,0),s=t?new ce(t.x,t.y):new ce(1,0);i=i||1;let a=4*Math.atan(i),o=n.distanceTo(s)/2/Math.sin(a/2),l=uge(e,o,cge(n,s)+(Math.PI/2-a/2));r=r||Math.max(Math.abs(Math.ceil(a/(Math.PI/18))),6);let h=cge(l,n),u=a/r,c=[];c.push(new D(n.x,n.y,0));for(let p=1;p<=r-1;p++){let e=uge(l,Math.abs(o),h+u*p);c.push(new D(e.x,e.y,0))}return c},Kxt=(e,t,i,r=2*e.length,n)=>{let s=[],a=e.map((e=>[e.x,e.y]));for(let o=0;o<1;o+=1/r){let e=EG(o,t,a,i,n);s.push(new D(e[0],e[1],0))}return s},MG=(e,t=!1)=>{let i=[],r=e.length;for(let n=0;n<r;n++){let s=e[n];if(s.bulge&&(n!==r-1||t)){let t=s.bulge,a=n+1<r?e[n+1]:i[0],o=Zxt(s,a,t);i.push(...o)}else i.push(new D(s.x,s.y,0))}return i},Jxt=e=>{let t=[];return e.faceA&&t.push(e.faceA),e.faceB&&t.push(e.faceB),e.faceC&&t.push(e.faceC),e.faceD&&t.push(e.faceD),t},Qxt=e=>{let t=[],i=[];e.forEach((e=>{e.polyfaceMeshVertex&&(e.threeDPolylineMesh?t.push(new D(e.x,e.y,e.z)):i.push(Jxt(e)))}));let r=[];for(let n=0;n<i.length;n++){let e=i[n];if(0===e.length)continue;let s=[],a=!0;for(let i=0;i<e.length;i++){let r=e[i]-1;if(r>=t.length||r<0){a=!1;break}s.push(t[r])}!a||0===s.length||(s.push(s[0]),r.push(s))}return r},Jr=class extends pi{constructor(e,t=!1,i=!0){super(e),this.timer=Date.now(),this.ignorePaperSpace=!1,this.angBase=0,this.angDir=0,this.header=void 0,this.pointsMaterials={},this.lineBasicMaterials={},this.lineShaderMaterials={},this.meshBasicMaterials={},this.meshTextureMaterials={},this.hatchShaderMaterials=[],this.entityCount=0,this.curveCount=0,this.averageCurveSize=0,this.enableRenderOrder=!1,this.enableLocalCache=!0,this.enableReleaseData=!0,this.enableMerge=!0,this.enableRTC=!0,this.enablePlineWidth=!0,this.dxfDataId=void 0,this.compareContext=void 0,this.statsInfo={unsupportedEntity:{},unsupportedEntityTypes:{},unsupportedTextStyles:{},unsupportedHatchPatterns:{},invisibleEntities:{},ignoredFrozenLayersAndEntityCount:{},ignoredInserts:{},entityTypesAndMeshCount:{},ignoredPaperSpaceEntityTypesAndCount:{},rebasedEntityCount:0},this.blockReferencesCache={},this.blockRecordsCache=void 0,this.entitiesCache=void 0,this.blocksCache=void 0,this.dictionaryOwnerHandleAndSpatialFilterHandlesCache=void 0,this.spatialFiltersCache=void 0,this.entityThreejsCache=void 0,this.entityTypesAndTimes=void 0,this.nonSnapableTypes=new Set(["ATTDEF","ATTRIB","LEADER","MTEXT","MULTILEADER","OLE2FRAME","TEXT"]),this.layoutsSnapObjectsMap={},this.entityHandlesWithRenderOrder={},this.addViewport=(e,t)=>{if("VIEWPORT"===e.type){t[e.ownerHandle]||(t[e.ownerHandle]=[]);let i=e;t[e.ownerHandle].push(i)}},Jr.abortJobs=!1,this.ignorePaperSpace=t,this.enableLocalCache=i,this.pointsMaterials[jf]=r_,this.lineBasicMaterials[jf]=za,this.meshBasicMaterials[jf]=GE}setFont(e){this.font=e}download(e,t){return ct(this,null,(function*(){let i=$xt(e);if(!i){let r=Date.now(),n=new di(this.manager);n.setResponseType("arraybuffer"),n.setPath(this.path),i=yield n.loadAsync(e,t),re.info(`[DxfLoader] ${e} dxf file downloaded in ${(Date.now()-r)/1e3}s`)}return i}))}load(e,t,i){return ct(this,null,(function*(){return this.enableLocalCache&&t&&(t=t.trim()).length>0&&(this.dxfDataId=t),this.loadAsync(e,i)}))}loadAsync(e,t){return ct(this,null,(function*(){let i=(e,i,r)=>{let n=100*e.loaded/e.total;n=n*(r-i)/100+i,t&&t(new ProgressEvent(e.type,{loaded:n,total:100}))},r=e=>i(e,10,100);if(xr.isBrowser&&this.enableLocalCache&&this.dxfDataId){let t;try{if(this.timer=Date.now(),t=yield this.getDxfDataFromIndexedDb(this.dxfDataId),t){re.info(`[DxfLoader] Loaded DxfData from indexedDb in ${(Date.now()-this.timer)/1e3}s`);let e=yield this.loadEntities(t,r);return Promise.resolve(e)}}catch(e){re.warn("[DxfLoader] Failed to parse data from indexedDb",e)}}let n=yield this.parse(e,(e=>i(e,0,50)));return yield this.loadEntities(n,(e=>i(e,50,100)))}))}parse(e,t){return ct(this,null,(function*(){let i=e=>{t&&t(new ProgressEvent("",{loaded:e,total:100}))},r=!1,n=yield this.download(e,(e=>((e,i,n)=>{let s=100*e.loaded/e.total;s=40*s/100+0,s>40&&(r||(re.warn("[DxfLoader] Invalid ProgressEvent:",e),r=!0),s=40),t&&t(new ProgressEvent(e.type,{loaded:s,total:100}))})(e)));if(!n)return Promise.reject(`[DxfLoader] Failed to download ${e}`);if(Jr.abortJobs)return Promise.reject("[DxfLoader] Job aborted");this.timer=Date.now(),re.info("[DxfLoader] Start parsing...");let s=(new c0).parseSync(n);if(i(80),re.info(`[DxfLoader] Parsed in ${(Date.now()-this.timer)/1e3}s, creating entities...`),Jr.abortJobs)return Promise.reject("[DxfLoader] Job aborted");if(s&&(s.objects.LAYOUT||(re.warn("[DxfLoader] No layout defined! Will add a default 'Model' layout!"),s.objects.LAYOUT=[{layoutName:Jr.MODEL_LAYOUT_NAME}]),xr.isBrowser&&this.enableLocalCache&&this.dxfDataId)){let t=Date.now();try{yield this.setDxfDataToIndexedDb(this.dxfDataId,s),re.info(`[DxfLoader] Saved to indexedDb in ${(Date.now()-t)/1e3}s`)}catch(e){re.warn(`[DxfLoader] Failed to save '${this.dxfDataId}' to indexedDb!`,e)}}return i(100),s}))}parseHeader(e){if(!e)return void re.error("[DxfLoader]: Invalid header!");this.header=e;let t=e.$ACADVER.toString();"AC1032"!==t&&re.warn(`[DxfLoader] Unexpected version: ${t}. But we'll try to continue.`),this.angBase=e.$ANGBASE||0,this.angDir=e.$ANGDIR||0}loadEntities(e,t){return ct(this,null,(function*(){var i;let r=Date.now();this.parseHeader(e.header),this.enableRenderOrder&&(this.initRenderOrderInfo(e),this.enableMerge=!1);let n=0,s=e.entities.length;this.entityCount=s,Object.keys(e.blocks).forEach((t=>{var i;this.entityCount+=(null==(i=e.blocks[t].entities)?void 0:i.length)||0}));let a=Math.round(Math.pow(s,.5)),o=Date.now(),l=e=>ct(this,null,(function*(){if(t&&(e%a==0||e===s-1)){t(new ProgressEvent("parseProgress",{loaded:e+1,total:s}));let i=500,r=Date.now();(r-o>i||e===s-1)&&(yield Tt.sleep(0),o=r)}})),h={};e.objects.LAYOUT.forEach((e=>{let t=e;h[t.layoutName]=t}));let u={},c=e=>{let t=e.userData.layerName,i=u[t];i||(i=[],u[t]=i),i.push(e)},p={},d={},f=new ar;kr.setSharedVariablesOfObject(f);for(let t=0;t<s&&!Jr.abortJobs;t++){let i=e.entities[t];this.addViewport(i,p);let r=this.drawEntity(i,e);if(r||(yield l(t)),!r)continue;let s=this.getLayout(e,i).layoutName,a=f.children.find((e=>e.name===s));a||(a=new ar,kr.setSharedVariablesOfObject(a),a.name=s,a.userData.isLayoutLevelObject=!0,f.add(a)),r.traverse((e=>{e.userData.isSnapObject&&(this.layoutsSnapObjectsMap[s]||(this.layoutsSnapObjectsMap[s]=[]),this.layoutsSnapObjectsMap[s].push(e))})),this.enableMerge&&Zi.merge(r,!1),n++,d[s]||(d[s]={object:a,layerObjects:{}});let o,u=d[s];if(s!==Jr.MODEL_LAYOUT_NAME){let e=h[s];e.directAssociatedLeafObjectSet||(e.directAssociatedLeafObjectSet=new Set),o=e.directAssociatedLeafObjectSet}if(this.enableMerge&&r.geometry){kr.setSharedVariablesOfObject(r);let t=r.userData.layerName;!1===this.getLayerVisible(e,t)&&(r.visible=!1),u.layerObjects[t]||(u.layerObjects[t]=[]),u.layerObjects[t].push(r)}else a.add(r),r.traverse((t=>{if(kr.setSharedVariablesOfObject(t),t.geometry){let i=t.userData.layerName;!1===this.getLayerVisible(e,i)&&(t.visible=!1),c(t),o&&o.add(t)}}));yield l(t)}e.objects.LAYOUT.forEach((t=>{let i=t,r=i.layoutName;if(this.ignorePaperSpace&&r!==Jr.MODEL_LAYOUT_NAME)return;let n=i.associatedBlockName,s=e.blocks[n];s&&this.drawLayout(s,e,i,f,u,p)})),re.debug(`[DxfLoader] Drew entities in ${(Date.now()-r)/1e3}s`);for(let e in d){let t,i=d[e],r=i.object;if(e!==Jr.MODEL_LAYOUT_NAME){let i=h[e];i.directAssociatedLeafObjectSet||(i.directAssociatedLeafObjectSet=new Set),t=i.directAssociatedLeafObjectSet}for(let e in i.layerObjects){let n=i.layerObjects[e],s=Zi.deepMerge(n,void 0,!1,!1,!0),a=s.added,o=s.removed;if(o.length!==n.length){let e=o;o.length>=100&&(e=new Set(o));let i=t=>Array.isArray(e)?e.indexOf(t)>=0:e.has(t);for(let s=0,a=n.length;s<a;s++){let e=n[s];i(e)||(r.add(e),c(e),t&&t.add(e))}}for(let e=0;e<a.length;e++){let i=a[e];kr.setSharedVariablesOfObject(i),r.add(i),c(i),t&&t.add(i)}i.layerObjects[e]=[]}}for(let e in this.entityTypesAndTimes)this.entityTypesAndTimes[e].averageTime=this.entityTypesAndTimes[e].totalTime/this.entityTypesAndTimes[e].createCount;re.debug("[DxfLoader] Entity types and cost times in ms:",this.entityTypesAndTimes),re.debug("[DxfLoader] Entity types and mesh count:",this.statsInfo.entityTypesAndMeshCount);let m=0;if(Object.values(this.statsInfo.entityTypesAndMeshCount).forEach((e=>{m+=e})),this.enableRTC&&re.debug(`[DxfLoader] Totally rebased ${this.statsInfo.rebasedEntityCount}(out of ${m}) entities`),this.enableMerge){let e=Zi.mergeInfo;re.debug(`[DxfLoader] Inner merged ${e.removedObjects} objects to ${e.mergedMeshes} meshes, ${e.mergedLines} lines, ${e.mergedPoints} points, ${e.mergedUnknownTypeObjects?e.mergedUnknownTypeObjects+" unknown type,":""} in ${e.elapsedTime/1e3}s`)}let g=(e,t,...i)=>{Object.keys(t).length};g(0,this.statsInfo.unsupportedEntityTypes),g(0,this.statsInfo.unsupportedTextStyles),g(0,this.statsInfo.unsupportedHatchPatterns),g(0,this.statsInfo.invisibleEntities),g(0,this.statsInfo.ignoredFrozenLayersAndEntityCount),g(0,this.statsInfo.ignoredInserts),this.ignorePaperSpace&&g(0,this.statsInfo.ignoredPaperSpaceEntityTypesAndCount),this.font&&this.font.unsupportedChars&&g(0,this.font.unsupportedChars);for(let e in this.layoutsSnapObjectsMap){let t=f.children.find((t=>t.name===e)),r=new ar;r.visible=lge,r.name=Jr.SNAP_GROUP_NAME,t.add(r);let n=this.layoutsSnapObjectsMap[e];for(let s=0;s<n.length;s++){let t=n[s];null==(i=h[e].directAssociatedLeafObjectSet)||i.add(t),lge&&(t.layers.enableAll(),t.material instanceof Rn?t.material=Wxt:t.material instanceof br?t.material=qxt:t.material instanceof Xt&&(t.material=Yxt));let a=t.parent,o=Jl.identity();for(;a&&!0!==a.userData.isLayoutLevelObject;)o.premultiply(a.matrix),a=a.parent;t.applyMatrix4(o),r.add(t)}}this.enableReleaseData&&(this.releaseCachedData(),this.releaseDxfData(e)),re.info(`[DxfLoader] loadEntities() done in ${(Date.now()-r)/1e3}s`);let y=Ln(Mr({},e),{threejsObject:f,layersAndThreejsObjects:u,loadedEntityCount:n,layoutViewportsMap:p});return Promise.resolve(y)}))}loadEntitiesForCompare(e,t,i,r){return ct(this,null,(function*(){let n=e.entities.length,s=t.entities.length,a=()=>ct(this,null,(function*(){var a;let o=this.compareContext,l=o.isTheFirstFile,h=l?e:t,u=new ar,c=l?n:s,p=h.entities.length;this.entityCount=p,Object.keys(h.blocks).forEach((e=>{var t;this.entityCount+=(null==(t=h.blocks[e].entities)?void 0:t.length)||0}));let d=Math.round(Math.pow(c,.5)),f=Date.now(),m=e=>ct(this,null,(function*(){if(r&&(e%d==0||e===c-1)){let t=e+1;l||(t+=n),r(new ProgressEvent("parseProgress",{loaded:t,total:n+s}));let i=500,a=Date.now();(a-f>i||e===c-1)&&(yield Tt.sleep(0),f=a)}}));this.parseHeader(h.header);let g={};for(let e=0;e<c;e++){if(Jr.abortJobs)return;let t=h.entities[e];if(this.getLayout(h,t).layoutName!==Jr.MODEL_LAYOUT_NAME){yield m(e);continue}let i=this.drawEntity(t,h);if(i||(yield m(e)),!i)continue;let r=u.children[0];r||(r=new ar,r.name=Jr.MODEL_LAYOUT_NAME,r.userData.isLayoutLevelObject=!0,u.add(r)),r.add(i),i.traverse((e=>{if(e.geometry){let t=e.userData.layerName;!1===this.getLayerVisible(h,t)&&(e.visible=!1);let i=g[t];i||(i=[],g[t]=i),i.push(e)}})),yield m(e)}let y=h;y.threejsObject=u,u.updateMatrixWorld(!0),y.layersAndThreejsObjects=g,y.layoutViewportsMap={},l&&(o.preservedHandles||(o.preservedHandles=new Set));for(let e in i){let t=i[e];l&&("Added"===t.type||"Modified"===t.type)&&(null==(a=o.preservedHandles)||a.add(t.handle),t.parentHandles&&t.parentHandles.forEach((e=>{var t;return null==(t=o.preservedHandles)?void 0:t.add(e)})));let r=this.entityThreejsCache&&this.entityThreejsCache[t.handle];t.parentHandles&&(r=this.entityThreejsCache&&this.entityThreejsCache[t.parentHandles[t.parentHandles.length-1]]),r&&(r=this.setObjectColorByChange(r,t)),"NoChange"!==t.type&&r&&("Added"===t.type?!l&&(t.box=(new Rt).setFromObject(r)):"Removed"===t.type?l&&(t.box=(new Rt).setFromObject(r)):"Modified"===t.type&&(t.box?t.box.union((new Rt).setFromObject(r)):t.box=(new Rt).setFromObject(r)))}Jr.merge(y)})),o=Date.now();this.compareContext={changes:i,isTheFirstFile:!0},Tt.printMemory("Before loading entities for first dxf"),yield a(),re.info(`[DxfLoader] loadEntities for first dxf in ${(Date.now()-o)/1e3}s`),Tt.printMemory("After loading entities for first dxf"),this.releaseCachedData(!1),this.releaseDxfData(e),Tt.printMemory("Before loading entities for second dxf"),o=Date.now(),this.compareContext.isTheFirstFile=!1,yield a(),re.info(`[DxfLoader] loadEntities for second dxf in ${(Date.now()-o)/1e3}s`);for(let e of Object.values(i))e.box||delete i[e.id];this.compareContext.preservedHandles=void 0,this.enableReleaseData&&(this.releaseCachedData(),this.releaseDxfData(t)),Tt.printMemory("After loading entities for second dxf")}))}setObjectColorByChange(e,t){let i=(e,t)=>{e.traverse((e=>{if(e.material)if(e.material instanceof br)e.material=this.getLineBasicMaterial(t);else if(e.material instanceof Xt)e.material=this.getMeshBasicMaterial(t);else if(e.material instanceof Rn)e.material=this.getPointsMaterial(t);else if(e.material instanceof Zt){let i=e.material.clone();Jr.updateMaterialUniforms(i),i.uniforms.u_color.value.set(t),e.material=i}}))},r=(e=>{var t;let i=Zn.ENTITY_COLOR_NO_CHANGE;return"Added"===e.type?i=Zn.ENTITY_COLOR_ADDED:"Removed"===e.type?i=Zn.ENTITY_COLOR_REMOVED:"Modified"===e.type&&(i=null!=(t=this.compareContext)&&t.isTheFirstFile?Zn.ENTITY_COLOR_REMOVED:Zn.ENTITY_COLOR_ADDED),i})(t);return e.traverse((n=>{t.parentHandles?n.userData&&n.userData.handle&&n.userData.handle===t.handle&&(i(n,r),e=n):i(n,r)})),e}releaseCachedData(e=!0){e&&(this.pointsMaterials={},this.lineBasicMaterials={},this.lineShaderMaterials={},this.meshBasicMaterials={},this.meshTextureMaterials={},this.hatchShaderMaterials=[]),this.header=void 0,this.blockReferencesCache={},this.blockRecordsCache=void 0,this.blocksCache=void 0,this.entitiesCache=void 0,this.dictionaryOwnerHandleAndSpatialFilterHandlesCache=void 0,this.spatialFiltersCache=void 0,this.entityThreejsCache=void 0,this.entityTypesAndTimes=void 0,this.entityHandlesWithRenderOrder={},this.layoutsSnapObjectsMap={},this.statsInfo={unsupportedEntity:{},unsupportedEntityTypes:{},unsupportedTextStyles:{},unsupportedHatchPatterns:{},invisibleEntities:{},ignoredFrozenLayersAndEntityCount:{},ignoredInserts:{},entityTypesAndMeshCount:{},ignoredPaperSpaceEntityTypesAndCount:{},rebasedEntityCount:0}}releaseEntity(e){e.vertices&&(e.vertices=void 0),e.knotValues&&(e.knotValues=void 0),e.controlPoints&&(e.controlPoints=void 0),e.binaryData&&(e.binaryData=void 0),e.text&&(e.text=void 0),e.extendedData&&(e.extendedData=void 0),e.contextData&&(e.contextData=void 0);let t=e;t.boundaryPaths&&(t.boundaryPaths=[]),t.patternLines&&(t.patternLines=void 0)}releaseDxfData(e){delete e.objects.DICTIONARY,delete e.objects.SORTENTSTABLE,delete e.objects.XRECORD,delete e.tables.dimStyle,delete e.tables.lineType,delete e.tables.style,delete e.tables.blockRecord,e.entities=[],e.blocks={}}drawEntity(e,t,i,r=!1){if(this.compareContext&&this.compareContext.preservedHandles&&this.compareContext.preservedHandles.has(e.handle)&&a0.includes(e.type)&&(r=!0),!r&&this.compareContext&&this.compareContext.preservedHandles&&!a0.includes(e.type)&&!this.compareContext.preservedHandles.has(e.handle)&&(!i||i&&!this.compareContext.preservedHandles.has(i.handle)))return;if(!0===this.getLayerFrozen(t,e)){let t=e.layer;return this.statsInfo.ignoredFrozenLayersAndEntityCount[t]||(this.statsInfo.ignoredFrozenLayersAndEntityCount[t]=0),void this.statsInfo.ignoredFrozenLayersAndEntityCount[t]++}if(!1===e.visible||e.invisible)return this.statsInfo.invisibleEntities[e.type]||(this.statsInfo.invisibleEntities[e.type]=0),void this.statsInfo.invisibleEntities[e.type]++;if(this.ignorePaperSpace&&e.inPaperSpace)return this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]||(this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]=0),void this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]++;this.entityThreejsCache||(this.entityThreejsCache={});let n,s=Date.now(),a=!1;if(!this.compareContext&&this.entityThreejsCache[e.handle])n=this.entityThreejsCache[e.handle].clone(),a=!0;else if(!this.statsInfo.unsupportedEntity[e.handle]){if("CIRCLE"===e.type||"ARC"===e.type)n=this.drawArc(e,t,i);else if("LINE"===e.type||"POLYLINE"===e.type)n=this.drawLine(e);else if("XLINE"===e.type)n=this.drawXLine(e);else if("SEQEND"!==e.type)if("RAY"===e.type)n=this.drawRay(e);else if("LWPOLYLINE"===e.type)n=this.drawLWPolyline(e,t,i);else if("3DFACE"===e.type)n=this.draw3DFace(e);else if("TEXT"===e.type)n=this.drawText(e,t,i);else if("SOLID"===e.type)n=this.drawSolid(e,t,i);else if("POINT"===e.type)n=this.drawPoint(e,t,i);else if("IMAGE"===e.type)n=this.drawImage(e,t,i);else if("INSERT"===e.type)n=this.drawInsert(e,t,r);else if("SPLINE"===e.type)n=this.drawSpline(e,i);else if("MTEXT"===e.type)n=this.drawMText(e,t,i);else if("ELLIPSE"===e.type)n=this.drawEllipse(e,t,i);else if("DIMENSION"===e.type)n=this.drawDimension(e,t);else if("REGION"!==e.type)if("ATTDEF"===e.type)n=this.drawAttDef(e,t,i);else if("ATTRIB"===e.type){if(!i)for(let r=0;r<t.entities.length;r++){let n=t.entities[r];if(e.ownerHandle===n.handle&&(i=n).attributesFollow)break}n=this.drawAttrib(e,t,i)}else"HATCH"===e.type?n=this.drawHatch(e,t,i):"VIEWPORT"===e.type?n=this.drawViewport(e,t,i):"LEADER"===e.type?n=this.drawLeader(e,t,i):"MULTILEADER"===e.type?n=this.drawMLeader(e,t,i):"OLE2FRAME"===e.type&&(n=this.drawOle2frame(e,t));n&&(this.entityThreejsCache[e.handle]=n),this.enableReleaseData&&!this.compareContext&&this.releaseEntity(e)}if(n){n.matrixAutoUpdate=!1,n.updateMatrix();let r=this.getLayerName(e,t,i),s=this.getLayerVisible(t,r);n.userData.handle=e.handle,kr.setSharedVariablesOfObject(n),"INSERT"!==e.type&&"DIMENSION"!==e.type&&n.traverse((n=>{kr.setSharedVariablesOfObject(n),n.matrixAutoUpdate=!1,n.updateMatrix(),n.geometry&&(!1===s&&(n.userData.layerVisible=!1),n.userData.layerName=r,this.setMaterial(n,e,t,i))})),a||(this.nonSnapableTypes.has(e.type)&&n.traverse((e=>{e.layers.disable(11)})),this.enableRenderOrder&&(this.entityHandlesWithRenderOrder[e.handle]?n.renderOrder=parseInt(this.entityHandlesWithRenderOrder[e.handle],16)+.1:n.renderOrder=parseInt(e.handle,16)))}return a0.includes(e.type)||(this.entityTypesAndTimes||(this.entityTypesAndTimes={}),this.entityTypesAndTimes[e.type]||(this.entityTypesAndTimes[e.type]={createCount:0,totalTime:0,averageTime:0}),this.entityTypesAndTimes[e.type].createCount++,this.entityTypesAndTimes[e.type].totalTime+=Date.now()-s),n?this.statsInfo.entityTypesAndMeshCount[e.type]?this.statsInfo.entityTypesAndMeshCount[e.type]++:this.statsInfo.entityTypesAndMeshCount[e.type]=1:(this.statsInfo.unsupportedEntityTypes[e.type]?this.statsInfo.unsupportedEntityTypes[e.type]++:this.statsInfo.unsupportedEntityTypes[e.type]=1,a0.includes(e.type)||(this.statsInfo.unsupportedEntity[e.handle]?this.statsInfo.unsupportedEntity[e.handle]++:this.statsInfo.unsupportedEntity[e.handle]=1)),n}drawEllipse(e,t,i){if(!e.majorAxisEndPoint||!e.center||void 0===e.axisRatio||void 0===e.startAngle||void 0===e.endAngle)return;let r=e.startAngle,n=e.endAngle;if(e.extrusionDirection&&e.extrusionDirection.z<0&&(r=2*Math.PI-e.endAngle,n=2*Math.PI-e.startAngle),$t.areNumbersEqual(r,n,1e-5))return void re.warn("[DxfLoader] Ellipse entity (handle '%s') contains the same start and end angle, ignored!",e.handle);let s=n-r;for(;s>2*Math.PI;)s-=2*Math.PI;Math.abs(s)<=1e-5&&(n=$t.floorNumber(r+2*Math.PI,5));let a=Math.sqrt(Math.pow(e.majorAxisEndPoint.x,2)+Math.pow(e.majorAxisEndPoint.y,2)),o=a*e.axisRatio,l=Math.atan2(e.majorAxisEndPoint.y,e.majorAxisEndPoint.x),h=new Gp(e.center.x,e.center.y,a,o,r,n,!1,l),u=1,c=i;null!=c&&c.xScale&&null!=c&&c.yScale&&(u=Math.max(Math.abs(c.xScale),Math.abs(c.yScale)));let p=this.getDivision(r,n,Math.max(a,o)*u),d=h.getPoints(p),f=[],m=d.length;for(let b=0;b<m-1;b++)$t.areVector2sEqual(d[b],d[b+1],1e-9)||f.push(d[b]);if(f.push(d[m-1]),f.length<2)return void re.warn("[DxfLoader] Ellipse entity (handle '%s') contains less than 2 points, ignored!",e.handle);let g=new D,y=!1;this.enableRTC&&(y=kt.checkAndRebasePositionsOnRTC(f,g));let v=(new ot).setFromPoints(f),T=new Sr(v,za),x=new Bi((new ot).setFromPoints([new D(e.center.x,e.center.y,e.center.z)]),r_);return x.userData.isSnapObject=!0,x.userData.type="CircleCenter",x.layers.set(11),T.add(x),y&&(this.setRTCUserData(T),T.position.x+=g.x,T.position.y+=g.y),T.layers.enableAll(),T}drawMText(e,t,i){if(!e.text)return;if(!this.font)return void re.info("[DxfLoader] Font file not set, ignoring text entity.");let r=t.tables.style.styles[e.textStyle]||this.getDefaultTextStyle(t),n=XA(e.text,{encoding:this.getTextEncoding(r)}),s=this.mtextContentAndFormattingToTextAndStyle(n,e),a=this.getMTextGroup(s.text,e,t,i,s);if(!a)return;e.position&&(a.position.x+=e.position.x,a.position.y+=e.position.y);let o=(new Rt).setFromObject(a).getSize(vs),l=o.x,h=o.y,u=0,c=0;switch(e.attachmentPoint){case 1:u=0,c=0;break;case 2:u-=l/2,c=0;break;case 3:u-=l,c=0;break;case 4:u=0,c+=h/2;break;case 5:u-=l/2,c+=h/2;break;case 6:u-=l,c+=h/2;break;case 7:u=0,c+=h;break;case 8:u-=l/2,c+=h;break;case 9:u-=l,c+=h;break;default:return}switch(s.style.horizontalAlignment){case"left":u=0;break;case"center":u=0,u-=l/2;break;case"right":u=0,u-=l}if(a.traverse((e=>{e.geometry&&e.geometry.translate(u,c,0),e.layers.enableAll()})),e.rotation&&(a.rotation.z=e.rotation*Math.PI/180),e.directionVector){let t=e.directionVector,i=new D(t.x,t.y,t.z),r=i.clone().cross(zf),n=new D(1,0,0).angleTo(i);a.rotateZ(r.z>0?-n:n)}return s.lineLength>1?a.position.y-=o.y+s.style.textHeight:a.position.y-=o.y,a}getMTextGroup(e,t,i,r,n){var s;if(0===e.length)return;let a=(n?n.style.textHeight:t.textHeight)||0;if(t.textStyle){let e=i.tables.style.styles[t.textStyle],r=e.styleName;r&&(this.statsInfo.unsupportedTextStyles[r]||(this.statsInfo.unsupportedTextStyles[r]=0),this.statsInfo.unsupportedTextStyles[r]++),a=a||e.textHeight}let o=a/1.5,l=a/2,h=new ar;for(let u=0;u<e.length;u++){let{text:a,colorIndex:c,lineNum:p}=e[u],d=this.getTextMesh(a,t,i,r,n);if(!d)continue;let f=(null==(s=a.match(new RegExp("\\n","g")))?void 0:s.length)||0;d.position.y-=(p+f)*(o+l),void 0!==c&&256!==c&&(t.color=o0(c),t.colorIndex=c);let m=this.getColor(t,i,r);d.material instanceof Xt?d.material=this.getMeshBasicMaterial(m):d.material instanceof br&&(d.material=this.getLineBasicMaterial(m)),h.add(d)}return 0!==h.children.length?(Zi.merge(h,!1),n&&h.translateY(n.lineLength*(o+l)),h):void 0}mtextContentAndFormattingToTextAndStyle(e,t){let i={horizontalAlignment:"",textHeight:t.height||t.contextData&&t.contextData.textHeight},r=1,n=[];for(let s=0;s<e.length;s++){let a=e[s];if("string"==typeof a){if(a.startsWith("\\pxq")&&a.endsWith(";"))-1!==a.indexOf("c")?i.horizontalAlignment="center":-1!==a.indexOf("l")?i.horizontalAlignment="left":-1!==a.indexOf("r")?i.horizontalAlignment="right":-1!==a.indexOf("j")&&(i.horizontalAlignment="justify");else if(!a.startsWith("pi")&&!a.startsWith("pxt")&&!a.startsWith("pt")){let e=this.getTextLineNum(a);n&&n[n.length-1]&&void 0===n[n.length-1].colorIndex?n[n.length-1].text+=a:n.push({text:a,lineNum:r}),r+=e}}else if(Array.isArray(a)){let e=this.mtextContentAndFormattingToTextAndStyle(a,t);e.text.forEach((e=>{n&&n[n.length-1]&&n[n.length-1].colorIndex===e.colorIndex?n[n.length-1].text+=e.text:n.push(e)})),r=e.lineLength}else if("object"==typeof a)if(a.S&&3===a.S.length){let e=a.S[0]+"/"+a.S[2],t=this.getTextLineNum(e);n&&n[n.length-1]&&void 0===n[n.length-1].colorIndex?n[n.length-1].text+=e:n.push({text:a.S[0]+"/"+a.S[2],lineNum:r}),r+=t}else if(void 0!==a.C&&(s++,"string"==typeof e[s])){let t=this.getTextLineNum(e[s]);n&&n[n.length-1]&&n[n.length-1].colorIndex===a.C?n[n.length-1].text+=e[s]:n.push({colorIndex:a.C,text:e[s],lineNum:r}),r+=t}}return{text:n,lineLength:r,style:i}}getTextLineNum(e){let t=e.match(new RegExp("\\n","g"));return t?t.length:0}draw3DFace(e){if(!e.vertices||0===e.vertices.length)return void re.warn("[DxfLoader] Entity is missing vertices:",e.handle);let t=e.vertices.map((e=>new D(e.x,e.y,e.z)));if(0===t.length)return;$t.areVector3sEqual(t[0],t[t.length-1])||t.push(t[0]);let i=new D,r=!1;this.enableRTC&&(r=kt.checkAndRebasePositionsOnRTC(t,i));let n=(new ot).setFromPoints(t),s=new Sr(n,za);return r&&(this.setRTCUserData(s),s.position.x+=i.x,s.position.y+=i.y),s.layers.enableAll(),s}drawSpline(e,t){if(!e.controlPoints||!e.degreeOfSplineCurve||!e.knotValues)return;let i=1/0,r=1/0,n=-1/0,s=-1/0;for(let g of e.controlPoints)g.x<i&&(i=g.x),g.y<r&&(r=g.y),g.x>n&&(n=g.x),g.y>s&&(s=g.y);let a=1,o=t;null!=o&&o.xScale&&null!=o&&o.yScale&&(a=Math.max(Math.abs(o.xScale),Math.abs(o.yScale)));let l=Math.max(n-i,s-r),h=this.getBSplineInterpolationsPerSplineSegment(e.controlPoints.length,l*a),u=Kxt(e.controlPoints,e.degreeOfSplineCurve,e.knotValues,h),c=new D,p=!1;this.enableRTC&&(p=kt.checkAndRebasePositionsOnRTC(u,c));let d=kt.getAdjacentNonRepeatPoints(u);if(d.length<2)return void re.warn("[DxfLoader] Spline entity (handle '%s') contains less than 2 points, ignored!",e.handle);let f=(new ot).setFromPoints(d),m=new Sr(f,za);return p&&(this.setRTCUserData(m),m.position.x+=c.x,m.position.y+=c.y),m.layers.enableAll(),m}drawXLine(e){if(!e.vertices||0===e.vertices.length)return void re.warn("[DxfLoader] Entity is missing vertices:",e.handle);let t=Tt.arrayOrObjectToVector3(e.directionVector),i=new D(e.vertices[0].x,e.vertices[0].y,0),r=[];if(r.push(t.clone().multiplyScalar(-1e6).add(i)),r.push(t.clone().multiplyScalar(1e6).add(i)),0===r.length)return;let n=new D,s=!1;this.enableRTC&&(s=kt.checkAndRebasePositionsOnRTC(r,n));let a=(new ot).setFromPoints(r),o=new Sr(a,za);return s&&(this.setRTCUserData(o),o.position.x+=n.x,o.position.y+=n.y),o.layers.enableAll(),o}drawRay(e){if(!e.vertices||0===e.vertices.length)return void re.warn("[DxfLoader] Entity is missing vertices:",e.handle);let t=Tt.arrayOrObjectToVector3(e.directionVector),i=e.vertices.map((e=>new D(e.x,e.y,0)));if(i.push(t.multiplyScalar(1e6).add(i[0])),0===i.length)return;let r=new D,n=!1;this.enableRTC&&(n=kt.checkAndRebasePositionsOnRTC(i,r));let s=(new ot).setFromPoints(i),a=new Sr(s,za);return n&&(this.setRTCUserData(a),a.position.x+=r.x,a.position.y+=r.y),a.layers.enableAll(),a}drawLine(e){if(!e.vertices||0===e.vertices.length)return void re.warn("[DxfLoader] Entity is missing vertices:",e.handle);let t=[];if(e.isPolyfaceMesh)t=Qxt(e.vertices);else{let i=MG(e.vertices,e.shape);e.shape&&i.length>0&&i.push(i[0]),i.length>0&&(t=[i])}if(0===t.length)return;let i=[];for(let a=0;a<t.length;){let[e,r]=t[a];$t.areVector3sEqual(e,r)?(i.push(e),t.splice(a,1)):a++}let r,n=new D,s=!1;if(t.length>0){if(this.enableRTC){let e=0;t.forEach((t=>{t.forEach((t=>{n.add(t),e++}))})),n.divideScalar(e),s=kt.shouldRebasePositionOnRTC(n)}let e=[],i=[],a=0,o=0,l=0,h=0;t.forEach((t=>{for(let r=0;r<t.length;r++)s?(o=t[r].x-n.x,l=t[r].y-n.y,h=t[r].z-n.z,e.push(new D(o,l,h))):e.push(t[r]),r>0&&i.push(a+r-1,a+r);a=t.length}));let u=(new ot).setFromPoints(e);u.setIndex(i),r=new Kr(u,za)}if(i.length>0){this.enableRTC&&(s=kt.checkAndRebasePositionsOnRTC(i,n));let e=(new ot).setFromPoints(i);r=new Bi(e,r_)}return r?(s&&(this.setRTCUserData(r),r.position.x+=n.x,r.position.y+=n.y),r.layers.enableAll(),r):void 0}drawLWPolyline(e,t,i){var r;if(!e.vertices||e.vertices.length<2)return void re.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);let n=e;if(void 0!==n.extrusionDirectionX&&void 0!==n.extrusionDirectionY&&void 0!==n.extrusionDirectionZ){vs.set(n.extrusionDirectionX,n.extrusionDirectionY,n.extrusionDirectionZ);let e=Jr.getOcsMatrix(vs).invert(),t=0;void 0!==n.elevation&&n.elevation>0&&(t=n.elevation),n.vertices.forEach((i=>{let r=vs.set(i.x,i.y,t).applyMatrix4(e);i.x=r.x,i.y=r.y}))}let s=MG(e.vertices,e.shape);if(e.shape&&s.length>0&&!$t.areVector3sEqual(s[0],s[s.length-1])&&s.push(s[0]),s.length<2)return void re.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);let a=new ar;if(null!=(r=e.extendedData)&&r.outlines){let t=e.extendedData.outlines,i=[];t.forEach((e=>{let t=new Fa;e.forEach(((e,i)=>{0===i?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])})),t.closePath(),i.push(new Qu(t))}));let r=bo(i),n=new Je(r,GE);n.layers.enableAll(),a.add(n)}let o=new D,l=!1;this.enableRTC&&(l=kt.checkAndRebasePositionsOnRTC(s,o));let h=kt.getAdjacentNonRepeatPoints(s);if(h.length<2)return void re.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);if(this.enablePlineWidth&&void 0!==n.constantWidth&&n.constantWidth>0){let r=t.tables.lineType.lineTypes[this.getLineType(e,t,i)];if(!r||!r.pattern||0===r.pattern.length){re.warn("[DxfLoader] It doesn't support line with width and lineType, lineType will be ignored!");let t=kt.convertWidthLineToMeshGeometry(h,n.constantWidth);if(t){let e=new Je(t,GE);e.layers.enableAll(),e.layers.disable(11),a.add(e);let i=kr.createOutlineSync(t,e.matrix,za);i.layers.enableAll(),i.layers.disable(11),a.add(i)}else re.warn("[DxfLoader] Failed to convert line with width to mesh geometry: %s",e.handle)}}let u=new Sr((new ot).setFromPoints(h),za);return u.layers.enableAll(),a.add(u),l&&(this.setRTCUserData(a),a.position.x+=o.x,a.position.y+=o.y,a.position.z+=o.z),a}drawMLeader(e,t,i){var r,n,s,a,o,l,h,u;let c=t.tables.dimStyle.dimStyles[e.dimensionStyle]||this.getDefaultDimensionStyle(t),p=null==(r=e.contextData)?void 0:r.defaultTextContents;if(!p)return;let d=new ar,f=XA(p),m=this.mtextContentAndFormattingToTextAndStyle(f,e),g=this.getMTextGroup(m.text,e,t,i,m);if(g){null!=(n=e.contextData)&&n.textLocation&&(g.position.x+=e.contextData.textLocation.x,g.position.y+=e.contextData.textLocation.y);let t=(null==(s=e.contextData)?void 0:s.textWidth)||1;switch(m.style.horizontalAlignment){case"left":default:break;case"center":t&&(g.position.x+=t/2);break;case"right":t&&(g.position.x+=t)}let i=(new Rt).setFromObject(g).getSize(vs),r=i.x,h=i.y,u=0,c=0;switch(null==(a=e.contextData)?void 0:a.textAttachment){case 1:u=0,c=0;break;case 2:u-=r/2,c=0;break;case 3:u-=r,c=0;break;case 4:u=0,c+=h/2;break;case 5:u-=r/2,c+=h/2;break;case 6:u-=r,c+=h/2;break;case 7:u=0,c+=h;break;case 8:u-=r/2,c+=h;break;case 9:u-=r,c+=h;break;default:return}if(g.traverse((e=>{e.geometry&&e.geometry.translate(u,c,0)})),null!=(o=e.contextData)&&o.textRotation&&(g.rotation.z=e.contextData.textRotation*Math.PI/180),null!=(l=e.contextData)&&l.textDirection){let t=e.contextData.textDirection,i=new D(t.x,t.y,t.z),r=i.clone().cross(new D(1,0,0)),n=new D(1,0,0).angleTo(i);g.rotateZ(r.z>0?-n:n)}g.renderOrder=5,d.add(g)}if(0===e.leaderLineType)return null==g||g.traverse((e=>{e.layers.enableAll()})),g;{let i=[],r=null==(h=e.contextData)?void 0:h.leaders[0];if(!r)return d;let n=r.lastLeaderLinePoint;if(e.enableDogLeg){let e=new D(n.x,n.y,n.z),t=r.doglegLength,s=new D(r.doglegVector.x,r.doglegVector.y,r.doglegVector.z).multiplyScalar(t),a=e.clone().add(s);i.push(a,e)}let s=(null==(u=e.contextData)?void 0:u.leaders[0].leaderLines)||[];for(let h=0;h<s.length;h++){let r=s[h].vertices[0].reverse().map((e=>new D(e.x,e.y,e.z))),a=new D(n.x,n.y,n.z);for(let e=0;e<r.length;e++)i.push(a,r[e]),a=r[e];let o=vs.subVectors(i[0],i[1]).length(),l=(e.arrowHeadSize||c.DIMASZ||2.5)*(e.arrowHeadScale||c.DIMSCALE||1);e.leaderLineType;let u="";if(e.arrowHeadId?u=e.arrowHeadId:c&&c.DIMLDRBLK&&(u=c.DIMLDRBLK),u){let r=this.getBlockByHandle(t.blocks,u);if(r&&r.entities)for(let n=0;n<r.entities.length;n++){let s=this.drawEntity(r.entities[n],t,e);if(s){let e=new D(i[i.length-1].x,i[i.length-1].y,i[i.length-1].z),t=new D(i[i.length-2].x,i[i.length-2].y,i[i.length-2].z),r=Math.atan2(e.y-t.y,e.x-t.x);s.position.copy(e),s.quaternion.identity(),s.scale.setScalar(l),s.rotateZ(r),s.updateMatrix(),d.add(s)}}}else this.drawDefaultLeadArrow(i[i.length-2],i[i.length-1],o/2e3,i)}let a=new D,o=!1;this.enableRTC&&(o=kt.checkAndRebasePositionsOnRTC(i,a));let l=(new ot).setFromPoints(i),p=new Kr(l,za);p.renderOrder=2,o?(this.setRTCUserData(p),p.position.x+=a.x,p.position.y+=a.y):kt.shouldRebasePositionOnRTC(p.position)&&this.setRTCUserData(p),d.add(p)}return Zi.merge(d,!1),d.traverse((e=>{e.layers.enableAll()})),d}drawLeader(e,t,i){let r=[];if(!e.vertices)return void re.warn("[DxfLoader] Entity is missing vertices:",e.handle);if(e.vertices.length<2)return void re.warn("leader's vertices number must be greater than 2");let n=t.tables.dimStyle.dimStyles[e.dimensionStyle]||this.getDefaultDimensionStyle(t),s=e.vertices;if(1===e.pathType&&(s=new Dg(e.vertices).getPoints(50)),e.textWidth){let t=e.textWidth,i=new D(s[s.length-1].x,s[s.length-1].y,s[s.length-1].z);if(0===e.direction){let e=new D(1,0,0).multiplyScalar(t);s.push(e.add(i))}else{let e=new D(-1,0,0).multiplyScalar(t);s.push(e.add(i))}}for(let d=0;d<s.length-1;d++){let e=s[d],t=s[d+1];r.push(e,t)}let a=vs.subVectors(r[0],r[1]).setZ(0).length(),o=(e.arrowHeight||n.DIMASZ||2.5)*(e.arrowHeadScale||n.DIMSCALE||1),l=new ar;if(1===e.arrowFlag){let i="";e.arrowHeadBlockHandle?i=e.arrowHeadBlockHandle:n&&n.DIMLDRBLK&&(i=n.DIMLDRBLK);let s=this.getBlockByHandle(t.blocks,i);if(s&&s.entities){n&&(e.colorIndex=n.DIMCLRD||256,e.color=o0(e.colorIndex));for(let i=0;i<s.entities.length;i++){let n=this.drawEntity(s.entities[i],t,e);if(n){let e=new D(r[0].x,r[0].y,r[0].z),t=new D(r[1].x,r[1].y,r[1].z),i=Math.atan2(e.y-t.y,e.x-t.x);n.position.copy(e),n.quaternion.identity(),n.scale.setScalar(o),n.rotateZ(i),n.updateMatrix(),l.add(n)}}}else this.drawDefaultLeadArrow(r[1],r[0],o/a/2,r)}if(0===r.length)return;let h=new D,u=!1;this.enableRTC&&(u=kt.checkAndRebasePositionsOnRTC(r,h));let c=(new ot).setFromPoints(r),p=new Kr(c,za);return p.renderOrder=2,u?(this.setRTCUserData(p),p.position.x+=h.x,p.position.y+=h.y):kt.shouldRebasePositionOnRTC(p.position)&&this.setRTCUserData(p),l.children.length>0?(l.add(p),Zi.merge(l,!1),l.traverse((e=>{e.layers.enableAll()})),l):(p.layers.enableAll(),p)}drawDefaultLeadArrow(e,t,i,r){let n=i*(e.x-t.x),s=i*(e.y-t.y),a=s,o=-n,l=new D(t.x+n+a/6,t.y+s+o/6,0),h=new D(t.x+n-a/6,t.y+s-o/6,0);r.push(t,l),r.push(t,h),r.push(l,h)}getBlockByHandle(e,t){if(!this.blocksCache){this.blocksCache={};for(let t in e){let i=e[t];this.blocksCache[i.ownerHandle]||(this.blocksCache[i.ownerHandle]=i)}}return this.blocksCache[t]}static updateMaterialUniforms(e){e instanceof Zt&&(e.uniforms.u_cameraZoom&&(e.uniforms.u_cameraZoom=Jr.cameraZoomUniform),e.uniforms.u_viewportScale&&(e.uniforms.u_viewportScale=Jr.viewportScaleUniform))}static transformAngleByOcsMatrix(e,t){let i=vs.set(1*Math.cos(t),1*Math.sin(t),0).applyMatrix4(e);return Math.atan2(i.y,i.x)}static getArcAnglesByOcsMatrix(e,t,i){let r,n=$t.getArcAngleSpanInRadian(t,i),s=Jr.transformAngleByOcsMatrix(e,t),a=Jr.transformAngleByOcsMatrix(e,i);if($t.areNumbersClose(n,Math.PI)){n=1;let i=Jr.transformAngleByOcsMatrix(e,t+n);r=$t.getArcAngleSpanInRadian(s,i)}else{if($t.areNumbersClose(n,2*Math.PI))return[s,s+2*Math.PI];r=$t.getArcAngleSpanInRadian(s,a)}return $t.areNumbersClose(n,r,1e-5)?[s,a]:[a,s]}drawArc(e,t,i){var r,n,s;if(!e.radius||e.radius<.001)return void re.warn(`[DxfLoader] The radius of arc (handle '${e.handle}') is undefined, ignored!`);if(!e.radius||e.radius<.001)return void re.warn(`[DxfLoader] The radius of arc (handle '${e.handle}') is too small, ignored!`);let a=new D(0,0,1);void 0!==e.extrusionDirectionX&&void 0!==e.extrusionDirectionY&&void 0!==e.extrusionDirectionZ&&a.set(e.extrusionDirectionX,e.extrusionDirectionY,e.extrusionDirectionZ);let o,l,h=Jr.getOcsMatrix(a);if("CIRCLE"===e.type)o=e.startAngle||0,l=o+2*Math.PI;else{if(null==e.startAngle||null==e.endAngle||(o=e.startAngle,l=e.endAngle,$t.areNumbersEqual(o,l,1e-6)))return;if(!$t.areNumbersClose($t.getArcAngleSpanInRadian(o,l),2*Math.PI)){let e=Jr.getArcAnglesByOcsMatrix(h,o,l);o=e[0],l=e[1]}}let u=new Mg(0,0,e.radius,o,l,0!==this.angBase),c=1,p=i;null!=p&&p.xScale&&null!=p&&p.yScale&&(c=Math.max(Math.abs(p.xScale),Math.abs(p.yScale)));let d=this.getDivision(o,l,e.radius*c),f=u.getPoints(d),m=new D,g=!1;this.enableRTC&&(g=kt.checkAndRebasePositionsOnRTC(f,m));let y=(new ot).setFromPoints(f),v=new Sr(y,za),T=new D;e.center&&(T.x=e.center.x,T.y=e.center.y);let x=new D(null==(r=e.center)?void 0:r.x,null==(n=e.center)?void 0:n.y,null==(s=e.center)?void 0:s.z).applyMatrix4(h.invert());T.x=x.x,T.y=x.y,v.position.copy(T);let b=new Bi((new ot).setFromPoints([new D]),r_);return b.userData.handle=e.handle,b.userData.isSnapObject=!0,b.userData.type="CircleCenter",b.layers.set(11),v.add(b),g?(this.setRTCUserData(v),v.position.x+=m.x,v.position.y+=m.y):kt.shouldRebasePositionOnRTC(v.position)&&this.setRTCUserData(v),v.layers.enableAll(),v}addTriangleFacingCamera(e,t,i,r){let n=new D,s=new D;n.subVectors(i,t),s.subVectors(r,t),n.cross(s);let a=new D(t.x,t.y,t.z),o=new D(i.x,i.y,i.z),l=new D(r.x,r.y,r.z);n.z<0?e.push(l,o,a):e.push(a,o,l)}drawSolid(e,t,i){let r=e.points;if(!r||r.length<4)return;if(e.extrusionDirection&&e.extrusionDirection.z){vs.set(0,0,e.extrusionDirection.z);let t=Jr.getOcsMatrix(vs).invert();r.forEach((e=>{let i=vs.set(e.x,e.y,0).applyMatrix4(t);e.x=i.x,e.y=i.y}))}let n=[],s=[];this.addTriangleFacingCamera(n,r[0],r[1],r[2]),s.push(0,1,2),this.addTriangleFacingCamera(n,r[1],r[2],r[3]),s.push(3,4,5);let a=new D,o=!1;this.enableRTC&&(o=kt.checkAndRebasePositionsOnRTC(n,a));let l=(new ot).setFromPoints(n);l.setIndex(s);let h=new Je(l,GE);return o&&(this.setRTCUserData(h),h.position.x+=a.x,h.position.y+=a.y),h.layers.enableAll(),h}getDefaultTextStyle(e){return e.tables.style.styles.STANDARD||e.tables.style.styles.Standard||{}}getDefaultDimensionStyle(e){return e.tables.dimStyle.dimStyles.STANDARD||e.tables.dimStyle.dimStyles.Standard||{}}getTextEncoding(e){return e.bigFontFile&&e.bigFontFile.toUpperCase().startsWith("GB")?"gbk":"utf8"}getTextMesh(e,t,i,r,n){if(!e)return;let s=i.tables.style.styles[t.textStyle]||this.getDefaultTextStyle(i),a=s.styleName;a&&(this.statsInfo.unsupportedTextStyles[a]||(this.statsInfo.unsupportedTextStyles[a]=0),this.statsInfo.unsupportedTextStyles[a]++);let o,l=(n?n.style.textHeight:t.textHeight)||0,h=.67,u={_TCH_DIM:1.45,ROMANS:1};a&&u[a]&&(h=u[a]),t.xScale&&(h*=t.xScale),a&&(h*=(null==s?void 0:s.xScale)||1,l=l||s.textHeight);let c=0;if(t.width&&(c=t.width/h+2),t.contextData&&t.contextData.textWidth&&t.contextData.textHeight<t.contextData.textWidth&&(c=t.contextData.textWidth),this.font instanceof Jc){let i=this.font.getGraphicData(e,l,l/1.5,l/2,l/8,c,3===t.drawingDirection);if(0===i.length)return;let r=bo(i.map((e=>e.toThreeGeometry())));r.scale(h,1,1),o=new Kr(r,za)}else if(this.font instanceof u0){let t={font:this.font,height:0,size:l||12,curveSegments:3,bevelSegments:3},i=new qA(e,t);o=new Je(i,GE)}return o}transformTextMesh(e,t){let i=(new Rt).setFromObject(t).getSize(vs),{halign:r,valign:n}=e,s=e.width||i.x,a=i.y;if(void 0===r&&void 0===n&&e.startPoint||[3,5].includes(r)&&e.startPoint?(t.position.x+=e.startPoint.x,t.position.y+=e.startPoint.y,t.position.z+=e.startPoint.z):e.endPoint&&(t.position.x+=e.endPoint.x,t.position.y+=e.endPoint.y,t.position.z+=e.endPoint.z),3!==r&&5!==r){if(e.rotation){let i=e.rotation*Math.PI/180;t.rotateZ(i)}2===e.mirrored?t.rotateY(Math.PI):4===e.mirrored&&t.rotateX(Math.PI)}switch(r){case 0:default:break;case 1:t.translateX(-s/2);break;case 2:t.translateX(-s);break;case 3:if(e.startPoint&&e.endPoint){let i=new D(e.startPoint.x,e.startPoint.y,e.startPoint.z),r=new D(e.endPoint.x,e.endPoint.y,e.endPoint.z),n=(new D).subVectors(i,r),a=n.length()/s;t.scale.multiplyScalar(a);let o=n.clone().cross(zf),l=n.angleTo(zf);t.rotateZ(o.z>0?Math.PI-l:l-Math.PI),(2===e.mirrored||4===e.mirrored)&&t.rotateX(Math.PI)}break;case 4:t.translateX(-s/2),t.translateY(-a/2);break;case 5:if(e.startPoint&&e.endPoint){let i=new D(e.startPoint.x,e.startPoint.y,e.startPoint.z),r=new D(e.endPoint.x,e.endPoint.y,e.endPoint.z),n=(new D).subVectors(i,r),a=n.length()/s;t.scale.setX(a);let o=n.clone().cross(zf),l=n.angleTo(zf);t.rotateZ(o.z>0?Math.PI-l:l-Math.PI),(2===e.mirrored||4===e.mirrored)&&t.rotateX(Math.PI)}}switch(n){case 0:case 1:default:break;case 2:t.translateY(-a/2);break;case 3:t.translateY(-a)}return t.position.z=0,t}drawText(e,t,i){let r=e.text;if(!r)return;if(!this.font)return void re.info("[DxfLoader] Font file not set, ignoring text entity.");let n=t.tables.style.styles[e.textStyle]||this.getDefaultTextStyle(t);r=$A(r,{encoding:this.getTextEncoding(n)}).map((e=>e.text)).join("");let s=this.getTextMesh(r,e,t,i);if(!s)return;let a=s.geometry;if(s instanceof Je&&!a.getIndex()){let e=a.getAttribute("position"),t=[];for(let i=0;i<e.count;i+=3)t.push(i,i+1,i+2);a.setIndex(t)}if(a.hasAttribute("uv")&&a.deleteAttribute("uv"),a.hasAttribute("normal")&&a.deleteAttribute("normal"),this.transformTextMesh(e,s),kt.shouldRebasePositionOnRTC(s.position))this.setRTCUserData(s);else{let e=kt.caculateGeometryCenter(a);e&&kt.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(s)}return s.layers.enableAll(),s}drawAttDef(e,t,i){let r=e.tag||e.text||e.prompt;if(!r||!this.font)return;r=$A(r).map((e=>e.text)).join();let n=this.getTextMesh(r,e,t,i);if(!n)return;let s=n.geometry;if(s.hasAttribute("uv")&&s.deleteAttribute("uv"),s.hasAttribute("normal")&&s.deleteAttribute("normal"),this.transformTextMesh(e,n),kt.shouldRebasePositionOnRTC(n.position))this.setRTCUserData(n);else{let e=kt.caculateGeometryCenter(s);e&&kt.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(n)}return n.layers.enableAll(),n}drawAttrib(e,t,i){let r=e.text;if(!r||!this.font)return;r=$A(r).map((e=>e.text)).join();let n=this.getTextMesh(r,e,t,i);if(!n)return;let s=n.geometry;if(s.hasAttribute("uv")&&s.deleteAttribute("uv"),s.hasAttribute("normal")&&s.deleteAttribute("normal"),this.transformTextMesh(e,n),kt.shouldRebasePositionOnRTC(n.position))this.setRTCUserData(n);else{let e=kt.caculateGeometryCenter(s);e&&kt.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(n)}return n.layers.enableAll(),n}drawPoint(e,t,i){if(!e.position)return;let r=new ot,n=[new D(e.position.x,e.position.y,e.position.z)];vs.set(0,0,0);let s=vs,a=!1;this.enableRTC&&(a=kt.checkAndRebasePositionsOnRTC(n,s)),r.setFromPoints(n);let o=new Bi(r,r_);return a&&(this.setRTCUserData(o),o.position.x+=s.x,o.position.y+=s.y),o.layers.enableAll(),o}drawDimension(e,t){if(!e.block)return;let i=t.blocks[e.block];if(!i||!i.entities)return;let r=t.tables.dimStyle.dimStyles[e.dimStyleName]||this.getDefaultDimensionStyle(t);r&&r.DIMCLRD>0&&(e.colorIndex=r.DIMCLRD,e.color=o0(e.colorIndex));let n=new ar;for(let a=0;a<i.entities.length;a++){let r=this.drawEntity(i.entities[a],t,e);r&&n.add(r)}if(0===n.children.length){n=void 0;let t=e.name||e.block;return this.statsInfo.ignoredInserts[t]||(this.statsInfo.ignoredInserts[t]=0),void this.statsInfo.ignoredInserts[t]++}this.blockReferencesCache[e.block]||(this.blockReferencesCache[e.block]={referenceCount:0}),this.blockReferencesCache[e.block].referenceCount++,n.name=`${e.type}<${i.name}>`,n.userData.entityType=e.type;let s=null==e?void 0:e.insertionPoint;return s&&(n.position.x+=s.x,n.position.y+=s.y),kt.shouldRebasePositionOnRTC(n.position)&&this.setRTCUserData(n),n}drawImage(e,t,i){var r;if(!e.imageSize||null==(r=t.objects.IMAGEDEF)||!r.length)return;let n=t.objects.IMAGEDEF.filter((t=>t.handle===e.imageDefHandle))[0];if(!n)return;console.log(e,n);let s=e.imageSize.x,a=e.imageSize.y,o=new ar,l=!1;2===e.flags||4===e.flags||8===e.flags||(l=!0);let h=new En(s,a);if(l){let e=new Xt({transparent:!0,side:Xi,map:new gs(this.manager).load(n.filename,void 0,void 0,(()=>{console.warn("Please upload the pictures in the same folder, or use url link in the dxf file.")}))}),t=new Je(h,e);o.add(t)}let u=new Jo(h),c=this.getColor(e,t,i),p=new Kr(u,this.getLineBasicMaterial(c)),d=e.uPixel?new D(e.uPixel.x,e.uPixel.y,e.uPixel.z):new D(n.pixelSize.x,0,0),f=e.vPixel?new D(e.vPixel.x,e.vPixel.y,e.vPixel.z):new D(n.pixelSize.y,0,0);if(o.add(p),o.scale.set(d.x,f.y,1),e.position){let t=new D(e.position.x,e.position.y,e.position.z);t.add(d.multiplyScalar(s/2)).add(f.multiplyScalar(a/2)),o.position.copy(t)}return o}drawInsert(e,t,i=!1){if(!e.block)return;let r=t.blocks[e.block];if(!r.entities)return;e.blockPosition=r.position;let n=new ar;for(let h=0;h<r.entities.length;h++){if("ATTDEF"===r.entities[h].type)continue;let s=this.drawEntity(r.entities[h],t,e,i);s&&n.add(s)}if(0===n.children.length){n=void 0;let t=e.name||e.block;return this.statsInfo.ignoredInserts[t]||(this.statsInfo.ignoredInserts[t]=0),void this.statsInfo.ignoredInserts[t]++}this.blockReferencesCache[e.block]||(this.blockReferencesCache[e.block]={referenceCount:0}),this.blockReferencesCache[e.block].referenceCount++,n.name=`${e.type}<${r.name}>`,n.userData.entityType=e.type,null!=e&&e.blockPosition&&(n.position.x-=e.blockPosition.x,n.position.y-=e.blockPosition.y,n.updateMatrix());let s=vs.set(1,1,1);e.xScale&&(s.x=e.xScale),e.yScale&&(s.y=e.yScale);let a=new _r;e.rotation&&(a.z=e.rotation*Math.PI/180),oge.setFromEuler(a,!1);let o=i_.set(0,0,0);e.position&&(o.x=e.position.x,o.y=e.position.y),Jl.compose(o,oge,s),e.extrusionDirection&&e.extrusionDirection.z<0&&Jl.premultiply(age.identity().makeScale(-1,1,1)),RG.copy(n.matrix),n.applyMatrix4(Jl),kt.shouldRebasePositionOnRTC(n.position)&&this.setRTCUserData(n);let l=this.findSpatialFilterByHandle(e.handle,t);if(l){let t=this.drawSpatialFilter(l),i=l;i&&i.clipPolylines&&i.clipPolylines.length>0&&(n.userData.spatialFilterHandle=l.handle,this.cloneMaterialsForSpatialFilter(n),t&&t.applyMatrix4(RG.invert()),re.debug("[DxfLoader] Spatial filter:",e.associatedSpatialFilter))}return n}drawSpatialFilter(e){let t=e;if(t.threejsObject)return t.threejsObject.clone();let i=e.invertBlockMatrix;Jl.set(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],0,0,0,1);let r=[];e.vertices.forEach((e=>{r.push(new D(e.x,e.y,0))}));let n={polyline:[],bConcave:!1,bReversed:!1};if(2===e.numberOfPointsOnClipBoundary)n.polyline=r;else{let t=e.numberOfPointsOnClipBoundary,i=3;if(t<i)return void re.warn(`[DxfLoader] Invalid clipBoundary: ${e.handle} !`);let s=[],a=-1;for(let e=0;e<t;e++){let i=r[e];for(let n=t-1;n>e;n--){let o=r[n];if($t.areVector3sEqual(i,o)&&e+1<n-1&&e+1<t-1&&$t.areVector3sEqual(r[e+1],r[n-1])){s.push(i),a=n;break}}if(a>0)break;s.push(i)}if(a>0)for(let e=a+1;e<t;e++)s.push(r[e]);if(s.length<i)return void re.warn(`[DxfLoader] Invalid clipBoundary: ${e.handle}!`);let o=[],l=[];if(s.forEach((e=>{o.push(new ce(e.x,e.y)),l.push([e.x,e.y])})),!kt.isConvex(o)){re.warn(`[DxfLoader] Concave polygon is not supported for spatial filter (handle '${e.handle}'), converting to convex polygon!`);let t=(0,hge.default)(l,1/0);s=[],t.forEach((e=>{s.push(new D(e[0],e[1],0))}))}$t.areVector3sEqual(s[0],s[s.length-1])||s.push(s[0]),n.polyline=s,n.bReversed=a>0}return this.enableReleaseData&&(e.vertices=[],e.matrix=[],e.invertBlockMatrix=[]),t.localMatrix=Jl.clone(),t.clipPolylines=[],void t.clipPolylines.push(n)}drawLayout(e,t,i,r,n,s){if(!e.entities)return;let a;if(i.layoutName!==Jr.MODEL_LAYOUT_NAME){let e=i;e.directAssociatedLeafObjectSet||(e.directAssociatedLeafObjectSet=new Set),a=e.directAssociatedLeafObjectSet}let o=new ar;kr.setSharedVariablesOfObject(o);for(let u=0;u<e.entities.length;u++){let r=e.entities[u];this.addViewport(r,s);let l=this.drawEntity(r,t);l&&(this.enableMerge&&Zi.merge(l,!1),o.add(l),l.traverse((e=>{if(e.geometry){let r=e.userData.layerName;!1===this.getLayerVisible(t,r)&&(e.visible=!1);let s=n[r];s||(s=[],n[r]=s),s.push(e),a&&a.add(e),e.userData.isSnapObject&&(this.layoutsSnapObjectsMap[i.layoutName]||(this.layoutsSnapObjectsMap[i.layoutName]=[]),this.layoutsSnapObjectsMap[i.layoutName].push(e))}})))}if(0===o.children.length)return;o.userData.layerName=e.layer;let l=i.layoutName,h=r.children.find((e=>e.name===l));h||(h=new ar,kr.setSharedVariablesOfObject(h),h.name=l,h.userData.isLayoutLevelObject=!0,r.add(h)),h.add(o),e.position&&o.position.set(e.position.x,e.position.y,e.position.z||0),o.matrixAutoUpdate=!1,o.updateMatrix()}convertEdgeToPoints(e){let t=[];switch(e.type){case 1:{let i=e;t.push(new ce(i.startPoint.x,i.startPoint.y)),t.push(new ce(i.endPoint.x,i.endPoint.y));break}case 2:{let i=e,r=i.startAngle*fr.DEG2RAD,n=i.endAngle*fr.DEG2RAD;i.bCounterclockwise||(r=2*Math.PI-r,n=2*Math.PI-n);let s=new Mg(i.center.x,i.center.y,i.radius,r,n,!i.bCounterclockwise),a=this.getDivision(r,n,i.radius);t.push(...s.getPoints(a));break}case 3:{let i=e,r=Math.sqrt(Math.pow(i.majorAxisEndPoint.x,2)+Math.pow(i.majorAxisEndPoint.y,2)),n=r*i.minorRatio,s=Math.atan2(i.majorAxisEndPoint.y,i.majorAxisEndPoint.x),a=i.startAngle*fr.DEG2RAD,o=i.endAngle*fr.DEG2RAD;i.bCounterclockwise||(a=2*Math.PI-a,o=2*Math.PI-o);let l=new Gp(i.center.x,i.center.y,r,n,a,o,!i.bCounterclockwise,s),h=this.getDivision(a,o,Math.max(r,n));t.push(...l.getPoints(h));break}case 4:{let i=e;t.push(...i.controlPoints);break}case 0:{let i=e;t.push(...MG(i.points,i.isClosed));break}}return t}drawHatch(e,t,i){var r;let n=e;if(0==n.boundaryPaths.length)return;let s=[],a=[],o=[];if(n.boundaryPaths.forEach(((e,t)=>{if(this.IsfilteredByPathTypeFlag(e.pathTypeFlag)){let i="[DxfLoader] The %d path type flag is filtered at the %dth boundrayPath (hatch handle '%s')";return void re.info(i,e.pathTypeFlag,t,n.handle)}let i=e.edges;if(0===i.length)return;let r=[];for(let s=0;s<i.length;s++){let e=this.convertEdgeToPoints(i[s]);if(e.length<2){let e="[DxfLoader] The %dth edge of the %dth boundaryPath (hatch handle '%s') has less than 2 points, ignored!";re.warn(e,s,t,n.handle)}else r.push(...e)}if(r.length<3){let e="[DxfLoader] The %dth boundaryPath (hatch handle '%s') has less than 3 points, ignored!";return void re.warn(e,t,n.handle)}if(e.pathTypeFlag>31&&(!(e=>{for(let t=1;t<e.length;++t){let i=e[t-1].endPoint,r=e[t].startPoint;if(!i||!r||!$t.areVector2sEqual(i,r))return!1}return!0})(e.edges)||!n.associativity)){let e="[DxfLoader] The %dth boundaryPath (hatch handle '%s') has unknown path, ignored!";return void re.warn(e,t,n.handle)}$t.areVector2sEqual(r[0],r[r.length-1])||r.push(r[0]);let l=r.map((e=>new ce(Tt.roundNumber(e.x,7),Tt.roundNumber(e.y,7))));if((null==l?void 0:l.length)>0){s.push(l);let e=(new ns).setFromPoints(l);a.push(e);let t=e.getSize(n_),i=t.x*t.y;o.push({area:i,index:s.length-1})}})),0===s.length)return;let l=new ce,h=this.checkAndRebasePolygonsOnRTC(s,l);o.sort(((e,t)=>e.area-t.area));let u=[];o.forEach((e=>{u.push(e.index)}));let c,p=this.buildContainHierarchyTree(s,a,u),d=[];if(this.buildHatchGeometry(s,p,d),d.length>0&&(c=bo(d)),!c||!c.getIndex()||0===(null==(r=c.getIndex())?void 0:r.count))return void re.warn("[DxfLoader] Failed to convert hatch boundaries!");let f=new Je(c,GE);this.setHatchMaterial(f,n,t,l,i);let m=f;return h?(this.setRTCUserData(f),m.position.x+=l.x,m.position.y+=l.y):kt.shouldRebasePositionOnRTC(m.position)&&this.setRTCUserData(m),m.traverse((e=>{e.layers.enableAll(),e.layers.disable(11)})),m}drawOle2frame(e,t){let{leftUpX:i,leftUpY:r,rightDownX:n,rightDownY:s}=e;if(!(i&&r&&n&&s))return;let a=[new ce(i,r),new ce(i,s),new ce(n,s),new ce(n,r),new ce(i,r)],o=new D,l=!1;this.enableRTC&&(l=kt.checkAndRebasePositionsOnRTC(a,o));let h=(new ot).setFromPoints(a),u=this.getLineBasicMaterial(16777215),c=new Sr(h,u);c.layers.enableAll(),l&&(this.setRTCUserData(c),c.position.x+=o.x,c.position.y+=o.y);let p=new ar;p.add(c);let d,f,m=t.objects.DICTIONARY;for(let g of m){let t=g;for(let i in t.entries)if(t.entries[i]===e.handle){d=i;break}}if(d)if(this.meshTextureMaterials[d])f=this.meshTextureMaterials[d];else for(let g=0;g<t.objects.XRECORD.length;g++){let e=t.objects.XRECORD[g];if(e.handle===d){let t=e.binaryData,i="data:image/jpg;base64,"+Tt.hexToBase64(t),r=new Xt({transparent:!0,map:new gs(this.manager).load(i)});this.meshTextureMaterials[d]=r,f=r;break}}if(f){let e=(new ns).setFromPoints(a),t=e.getSize(n_),i=new En(t.x,t.y),r=new Je(i,f),n=e.getCenter(n_);r.position.set(n.x,n.y,0),l&&(this.setRTCUserData(r),r.position.x+=o.x,r.position.y+=o.y),r.layers.enableAll(),p.add(r)}return p.children.length>1?p:c}static getOcsMatrix(e){let t=zf,i=wG,r=tO,n=new D(0,1,0),s=new D(0,0,1);return $t.areVectorsClose(e,s)?Jl.identity():(r=e.clone().normalize(),$t.areVectorsClose(r,s)||(t=Math.abs(r.x)<1/64&&Math.abs(r.y)<1/64?n.cross(r).normalize():s.cross(r).normalize(),i=r.clone().cross(t).normalize()),Jl.set(t.x,t.y,t.z,0,i.x,i.y,i.z,0,r.x,r.y,r.z,0,0,0,0,1))}static getDcs2WcsMatrix(e,t){let i;i=Xxt(e)?e.viewDirectionFromTarget:e.viewDirection;let r,n,s,a=new D($t.roundNumber(i.x,7),$t.roundNumber(i.y,7),i.z),o=new D(e.viewTarget.x,e.viewTarget.y,e.viewTarget.z),l=e.viewTwistAngle;s=a.clone().normalize(),r=tO.clone().cross(a),r.length()>0?(r.normalize(),n=s.clone().cross(r)):s.z<0?(r=zf.clone().negate(),n=wG,s=tO.clone().negate()):(r=zf,n=wG,s=tO);let h=new Be,u=Jl.identity();return u.makeBasis(r,n,s),h.premultiply(u),h.premultiply(Jl.identity().compose(o.clone(),(new Br).setFromAxisAngle(new D(0,0,1),fr.degToRad(t?l:-l)),new D(1,1,1))),h}getViewportMsToPsMatrix(e){let t=new D(e.centerPoint_dcs.x,e.centerPoint_dcs.y,0),i=new D(e.centerPoint.x,e.centerPoint.y,e.centerPoint.z),r=e.viewHeight/e.height_paperSpace,n=Jr.getDcs2WcsMatrix(e,this.angDir),s=new Be;s.setPosition(sge.clone().sub(i));let a=age.identity();a.scale(vs.set(r,r,r));let o=RG.identity().setPosition(sge.clone().sub(i));a.premultiply(o.clone().invert()).multiply(o),s.multiply(a);let l=Jl.identity();l.setPosition(t),n.multiply(l);let h=Jl.identity();return s.invert().multiply(h).multiply(n.invert())}drawViewport(e,t,i){let r=e;if("1"==r.viewportId)return e.psBBox=new Rt,void(e.msToPsMatrix=new Be);let n=[],s=r.centerPoint,a=r.width_paperSpace/2,o=r.height_paperSpace/2;n.push(new D(s.x-a,s.y-o,0)),n.push(new D(s.x-a,s.y+o,0)),n.push(new D(s.x+a,s.y+o,0)),n.push(new D(s.x+a,s.y-o,0)),n.push(n[0]),e.psBBox=new Rt(n[0],n[2]),e.msToPsMatrix=this.getViewportMsToPsMatrix(r);let l=new D,h=!1;this.enableRTC&&(h=kt.checkAndRebasePositionsOnRTC(n,l));let u=(new ot).setFromPoints(n),c=new Sr(u,za);h&&(this.setRTCUserData(c),c.position.x+=l.x,c.position.y+=l.y),c.userData.entityType=e.type,c.layers.enableAll();let p=new ar;p.add(c);let d=e.psBBox.clone();d.applyMatrix4(e.msToPsMatrix.clone().invert()),d.min.z=0,d.max.z=0;let f=[];f.push(d.min),f.push(new D(d.min.x,d.max.y,0)),f.push(d.max),f.push(new D(d.max.x,d.min.y,0)),f.push(f[0]);let m=new D,g=!1;this.enableRTC&&(g=kt.checkAndRebasePositionsOnRTC(f,m));let y=(new ot).setFromPoints(f),v=new Sr(y,za);return g&&(this.setRTCUserData(v),v.position.x+=m.x,v.position.y+=m.y),v.userData.entityType=e.type,v.userData.inPaperSpace=!0,v.layers.enableAll(),p.add(v),c}getColor(e,t,i){var r,n,s,a,o,l;if(this.compareContext){let t=e.compareChangeType;return"Added"===t?Zn.ENTITY_COLOR_ADDED:"Removed"===t?Zn.ENTITY_COLOR_REMOVED:"Modified"===t?this.compareContext.isTheFirstFile?Zn.ENTITY_COLOR_REMOVED:Zn.ENTITY_COLOR_ADDED:Zn.ENTITY_COLOR_NO_CHANGE}let h=e;if(h&&h.isGradientColor){let t=h.gradientColors;if(t&&t.length>=2){if(t[0]!==t[1]){let t=`[DxfLoader] Gradient colors are not supported for hatch '${e.handle}', will use the first color!`;re.warn(t)}return t[0]}}if(e.isTrueColor||e.colorIndex>0&&e.colorIndex<256)return e.color;if(0===e.colorIndex)return i?this.getColor(i,t):null==(n=null==(r=t.tables)?void 0:r.layer)?void 0:n.layers[0].color;if(256===e.colorIndex){let r=null==(a=null==(s=t.tables)?void 0:s.layer)?void 0:a.layers,n=r&&r[e.layer],h=r&&i&&r[i.layer],u=jf;return u=n&&"0"!==n.name?n.color:h?h.color:n?n.color:null==(l=null==(o=t.tables)?void 0:o.layer)?void 0:l.layers[0].color,u}return re.warn("[DxfLoader] Unknown colorIndex"),jf}getLineType(e,t,i){var r,n;if(i&&"DIMENSION"===i.type)return this.getLineType(i,t);if(e.lineType!==AA&&e.lineType!==$k)return e.lineType;if(e.lineType===$k)return i?this.getLineType(i,t):e.lineType;let s=null==(n=null==(r=t.tables)?void 0:r.layer)?void 0:n.layers,a=jxt;if("0"!==e.layer){let t=s&&s[e.layer];if(t)return t.lineType}else if(i){let e=s&&s[i.layer];if(e)return e.lineType}return a}getLayerName(e,t,i){var r,n;let s=null==(n=null==(r=t.tables)?void 0:r.layer)?void 0:n.layers,a=s&&s[e.layer],o=s&&i&&s[i.layer],l=a.name;return a&&"0"===a.name&&o&&(l=o.name),l||"0"}setMaterial(e,t,i,r){let n=e;if(!n.geometry||(this.setRenderOrderByObjectType(e),"OLE2FRAME"===t.type))return;if("MTEXT"===t.type)return void(e.renderOrder=5);if("HATCH"===t.type)return n_.set(0,0),void this.setHatchMaterial(e,t,i,n_,r);if("IMAGE"===t.type)return;let s,a=this.getColor(t,i,r);if("LWPOLYLINE"===t.type&&(n.isMesh?(s=this.getMeshBasicMaterial(a),e.renderOrder=1):e.userData.isOutline&&(s=this.getLineBasicMaterial(a),e.renderOrder=3),s))n.material=s;else{if("SOLID"===t.type)s=this.getMeshBasicMaterial(a);else if("TEXT"===t.type||"ATTDEF"===t.type||"ATTRIB"===t.type)s=this.getLineBasicMaterial(a),e.renderOrder=5;else if("LEADER"===t.type||"MULTILEADER"===t.type||"VIEWPORT"===t.type)s=this.getLineBasicMaterial(a);else if("POINT"===t.type)s=this.getPointsMaterial(a);else{if(e.material instanceof Rn)return s=this.getPointsMaterial(a),void(n.material=s);let o=i.tables.lineType.lineTypes[this.getLineType(t,i,r)],l=t.lineTypeScale||1;o&&o.pattern&&0!==o.pattern.length?(s=this.getLineShaderMaterial(o,a,l),e.renderOrder=3):s=this.getLineBasicMaterial(a)}n.material=s}}setHatchMaterial(e,t,i,r,n){let s=e;if(!s.geometry)return;let a=this.getColor(t,i,n);if(s.isLine)return void(s.material=this.getLineBasicMaterial(a));let o,l=-1;if(t.solidFill)o=this.getMeshBasicMaterial(a);else{if(s.material instanceof Zt){o=s.material;let e=new Ve(a);s.material.uniforms.u_color.value.equals(e)||(o=s.material.clone(),Jr.updateMaterialUniforms(o),o.uniforms.u_color.value.set(a))}else o=this.getHatchShaderMaterial(t,a,r);l=0}o||(o=this.getMeshBasicMaterial(a),l=-1),s.material=o,s.renderOrder=l}setRenderOrderByObjectType(e){let t=e,i=0;t.isMesh?i=-1:t.isLine?i=2:t.isPoints&&(i=4),e.renderOrder=i}getPointsMaterial(e){return this.pointsMaterials[e]||(this.pointsMaterials[e]=new Rn({size:.2,color:e})),this.pointsMaterials[e]}getLineBasicMaterial(e){return this.lineBasicMaterials[e]||(this.lineBasicMaterials[e]=new br({color:e})),this.lineBasicMaterials[e]}getLineShaderMaterial(e,t,i){let r=`${e.name}_${t}_${i}`;if(!this.lineShaderMaterials[r]){let n=this.getLineTypeScales(),s=n.ltScale*n.celtScale*i;this.lineShaderMaterials[r]=YA.createLineShaderMaterial(e.pattern,t,s,Jr.viewportScaleUniform,Jr.cameraZoomUniform)}return this.lineShaderMaterials[r]}getMeshBasicMaterial(e){return this.meshBasicMaterials[e]||(this.meshBasicMaterials[e]=new Xt({color:e})),this.meshBasicMaterials[e]}getHatchShaderMaterial(e,t,i){if(!e.patternLines||e.patternLines.length<1)return;let r=this.findMatchedHatchShaderMaterial(e,t);if(r)return r;let n=2;e.patternLines.forEach((e=>{n=Math.max(e.dashPattern.length,n)}));let s=0,a=[],o=new ce;for(let h of e.patternLines){let t=new ce(h.origin.x,h.origin.y).sub(i).rotateAround(o,-fr.degToRad(e.patternAngle)),r=new ce(h.delta.x,h.delta.y).rotateAround(o,-fr.degToRad(h.angle));if(0===r.y)return void re.warn("[DxfLoader] delta.y is equal to zero !");let l=h.dashPattern.length,u=!0,c=0;for(let e=0;e<l;++e){let t=h.dashPattern[e];t>0&&(u=!1),c+=Math.abs(t)}let p=u?.05:.005,d=[],f=[],m=0;f[0]=m;for(let e=0;e<l;++e)d[e]=h.dashPattern[e],0===d[e]&&(d[e]=p*c),m+=Math.abs(d[e]),f[e+1]=m;for(let e=l;e<n;++e)d[e]=0;for(let e=f.length;e<n+1;++e)f[e]=m;let g={origin:t,delta:r,angle:h.angle-e.patternAngle,pattern:d,patternSum:f,patternLength:m};if(s+=4,s+=n,s+=n+1,s>Jr.maxFragmentUniforms){re.warn("[DxfLoader] There will be warning in fragment shader when number of uniforms exceeds 1024, so extra hatch line patterns are ignored here!");break}a.push(g)}let l=Zme(a,e.patternAngle,Jr.cameraZoomUniform,new Ve(t));return l.defines={MAX_PATTERN_SEGMENT_COUNT:n},this.hatchShaderMaterials.push({patternLines:e.patternLines,patternAngle:e.patternAngle,color:t,material:l}),l}getDivision(e,t,i){let r=Math.round(5e4/this.entityCount);r=Math.max(r,2),r=Math.min(r,10);let n=5*r,s=2*r;this.averageCurveSize&&(s*=Math.pow(i/this.averageCurveSize,.5),s=Math.max(s,r),s=Math.min(s,n));let a=t-e;a<0&&(a+=2*Math.PI),s=Math.ceil(s*(a/Math.PI));let o=8;return a<.087?o=2:a<.174?o=3:a<.52?o=4:a<1.57?o=5:a<3.14?o=6:a<4.71&&(o=7),s=Math.max(s,o),this.averageCurveSize=(this.averageCurveSize*this.curveCount+i)/(this.curveCount+1),this.curveCount++,Math.max(s,12)}getBSplineInterpolationsPerSplineSegment(e,t){let i=1;this.averageCurveSize&&(i=Math.pow(t/this.averageCurveSize,.5),i=Math.max(i,.5),i=Math.min(i,2)),this.averageCurveSize=(this.averageCurveSize*this.curveCount+t)/(this.curveCount+1),this.curveCount++;let r=2*e*i;return e>20&&(r/=Math.log10(e)),r}setDxfDataToIndexedDb(e,t){return ct(this,null,(function*(){let i={dxfDataId:e,dxf:t};return new Promise(((t,r)=>{kE.instance().add(i,(()=>{re.info(`[DxfLoader] Saved '${e}' to indexedDb`),t()}),(e=>{r(e)}))}))}))}getDxfDataFromIndexedDb(e){return ct(this,null,(function*(){return new Promise(((t,i)=>{kE.instance().query(e,(e=>{e&&e.length>0&&t(e[0].dxf),t(void 0)}),(()=>i()))}))}))}buildContainHierarchyTree(e,t,i){var r;let n=new Map,s=i.length;for(let o=0;o<s;o++)n.set(i[o],{index:i[o],children:[]});let a={index:-1,children:[]};for(let o=0;o<s;o++){let l=i[o],h=e[l],u=t[l],c=o+1;for(;c<s;c++){let s=i[c],a=e[s];if(t[s].containsBox(u)&&kt.isPointInPolygon(h[Tt.generateRandomInt(0,h.length-1)],a)){null==(r=n.get(s))||r.children.push(n.get(l));break}}c===s&&a.children.push(n.get(l))}return a}buildHatchGeometry(e,t,i){if(0===t.children.length)return;let r=[],n=new Map;t.children.forEach((e=>{0===e.children.length?r.push(e.index):n.set(e.index,e.children.map((e=>e.index)))}));let s=e=>{try{let t=new Qu(e);t.hasAttribute("uv")&&t.deleteAttribute("uv"),t.hasAttribute("normal")&&t.deleteAttribute("normal"),i.push(t)}catch(t){re.warn(`[DxfLoader] triangulate shape error: ${e.getPoints().map((e=>e.toArray())).toString()}`)}};r.forEach((t=>{let i=e[t];if(0===i.length)return;let r=new Fa(i);s(r)}));let a=e=>e.map((e=>e.toArray()));for(let o of n){let t=new Fa(e[o[0]]),i={regions:[],inverted:!1},r=this.findIntersectHole(e,o[1]);r.forEach((r=>{let n={regions:[],inverted:!1};try{r.forEach(((r,s)=>{if(Ql.epsilon($t.getVector2RelativeEps(e[r][0]),1e-6),0===s)n=Ql.segments({regions:[a(e[r])],inverted:!1});else{let s=Ql.segments({regions:[a(e[r])],inverted:!1}),o=Ql.combine(n,s);i=Ql.polygon(Ql.selectUnion(o)),i.regions.length>0?i.regions.forEach((e=>{if(0===e.length)return;let i=e.map((e=>new ce(e[0],e[1])));t.holes.push(new Ju(i))})):re.warn("[DxfLoader] mergedHoles.regions is empty")}}))}catch(e){re.warn(`[DxfLoader] polybooljs has error: ${e}, epsilon is ${Ql.epsilon()}`)}}));let n=r.flat(2);for(let s=0;s<o[1].length;s++){let i=o[1][s];n.includes(i)||t.holes.push(new Ju(e[i]))}s(t)}t.children.forEach((t=>{t.children.forEach((t=>{this.buildHatchGeometry(e,t,i)}))}))}findIntersectHole(e,t){let i=t.length,r=[];for(let n=0;n<i;n++){let s=e[t[n]],a=!1,o=[];for(let r=n+1;r<i;r++){let i=e[t[r]];kt.arePolygonsIntersect(s,i)&&(a=!0,o.push(t[r]))}a&&(o.push(t[n]),r.push(o))}return r}checkAndRebasePolygonsOnRTC(e,t){if(!this.enableRTC||0===e.length)return!1;let i=0;e.forEach((e=>{e.forEach((e=>{t.add(e),i++}))})),t.divideScalar(i);let r=!1;if(this.enableRTC&&kt.shouldRebasePositionOnRTC(t)){r=!0;for(let i=0;i<e.length;i++){let r=e[i];for(let e=0;e<r.length;e++){let i=r[e].x-t.x,n=r[e].y-t.y;r[e]=new ce(i,n)}}}else t.set(0,0);return r}setRTCUserData(e){e.userData.relativeToCenter=!0,this.statsInfo.rebasedEntityCount++}IsfilteredByPathTypeFlag(e){return e<0}findSpatialFilterByHandle(e,t){let i=t.objects.DICTIONARY;if(!this.dictionaryOwnerHandleAndSpatialFilterHandlesCache){this.dictionaryOwnerHandleAndSpatialFilterHandlesCache={};for(let e of i){let t=e,i="";for(let e in t.entries)if("ACAD_FILTER"===t.entries[e]){i=e;break}i&&(this.dictionaryOwnerHandleAndSpatialFilterHandlesCache[e.ownerHandle]&&re.warn("[DxfLoader] Why this.dictionaryObjectsCache[obj.ownerHandle] already exist?",e.ownerHandle),this.dictionaryOwnerHandleAndSpatialFilterHandlesCache[e.ownerHandle]=i)}}let r=this.dictionaryOwnerHandleAndSpatialFilterHandlesCache[e];if(r){if(!this.spatialFiltersCache){this.spatialFiltersCache={};let e=t.objects.SPATIAL_FILTER||[];for(let t of e){let e=t;e.numberOfPointsOnClipBoundary<2||(this.spatialFiltersCache[e.ownerHandle]&&re.warn("[DxfLoader] Why this.spatialFiltersCache[spatialFilterObj.ownerHandle] already exist?",r),this.spatialFiltersCache[e.ownerHandle]=e)}}return this.spatialFiltersCache[r]}}initRenderOrderInfo(e){let t=new Set,i=e.objects.DICTIONARY;for(let n of i){let e=n;Object.keys(e.entries).forEach((i=>{e.entries[i]&&"ACAD_SORTENTS"===e.entries[i]&&t.add(i)}))}if(0===t.size)return;let r=e.objects.SORTENTSTABLE;if(r)for(let n=0;n<r.length;++n){let e=r[n];if(t.has(e.handle)){for(let t=0;t<e.sortEntsObject.entityHandles.length;++t){let i=e.sortEntsObject.entityHandles[t];2!==i.length||this.entityHandlesWithRenderOrder[i[0]]?re.warn(`[DxfLoader] Failed to handle sortEntsTable: ${e.handle}.`):this.entityHandlesWithRenderOrder[i[0]]=i[1]}break}}}findMatchedHatchShaderMaterial(e,t){let i=e.patternLines;if(!i||i.length<1)return;let r=(e,t)=>Math.abs(e-t)<1e-5,n=(e,t)=>r(e.angle,t.angle)&&r(e.delta.x,t.delta.x)&&r(e.delta.y,t.delta.y)&&r(e.origin.x,t.origin.x)&&r(e.origin.y,t.origin.y)&&((e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!r(e[i],t[i]))return!1;return!0})(e.dashPattern,t.dashPattern),s=this.hatchShaderMaterials.find((r=>r.color===t&&r.patternAngle===e.patternAngle&&((e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!n(e[i],t[i]))return!1;return!0})(r.patternLines,i)));return null==s?void 0:s.material}getLayout(e,t){if(!this.blockRecordsCache){this.blockRecordsCache={};let t=this.blockRecordsCache,i=e.tables.blockRecord.blockRecords;Object.values(i).forEach((e=>{t[e.handle]=e.layoutHandle}))}let i=this.blockRecordsCache[t.ownerHandle];if(i){let t=e.objects.LAYOUT.find((e=>e.handle===i));if(t)return t}if(!this.entitiesCache){this.entitiesCache={};let t=this.entitiesCache;Object.values(e.entities).forEach((e=>{t[e.handle]=e}))}let r=this.entitiesCache[t.ownerHandle];return r?this.getLayout(e,r):(re.warn("[DxfLoader] Failed to find layout name for entity:",t),e.objects.LAYOUT.find((e=>e.layoutName===Jr.MODEL_LAYOUT_NAME)))}getLayerVisible(e,t){var i,r,n;let s=null==(r=null==(i=e.tables)?void 0:i.layer)?void 0:r.layers;return s&&(null==(n=s[t])?void 0:n.visible)}getLayerFrozen(e,t){var i,r,n;let s=null==(r=null==(i=e.tables)?void 0:i.layer)?void 0:r.layers;return s&&(null==(n=s[t.layer])?void 0:n.frozen)}cloneMaterialsForSpatialFilter(e){let t=new Map;e.traverse((e=>{e.material&&(e.material=(e=>{let i;return Array.isArray(e)?(i=[],e.forEach((e=>{if(t.has(e.id))i.push(t.get(e.id));else{let r=e.clone();Jr.updateMaterialUniforms(r),t.set(e.id,r),i.push(r)}}))):e&&(t.has(e.id)?i=t.get(e.id):(i=e.clone(),Jr.updateMaterialUniforms(i),t.set(e.id,i))),i})(e.material))}))}getLineTypeScales(){let e={ltScale:1,celtScale:1};return this.header&&(e.ltScale=this.header.$LTSCALE||1,e.celtScale=this.header.$CELTSCALE||1),e}static getDxfUnits(e){switch(e||0){case 0:return"Unitless";case 1:return"Inches";case 2:return"Feet";case 4:return"Millimeters";case 5:return"Centimeters";case 6:return"Meters";default:re.warn(`[DxfLoader] Unsupported $INSUNITS '${e}'`)}return"Unitless"}static computeLineDistance(e){let t=!0===e.isLineSegments,i=e.geometry,r=e.matrixWorld;if(i.index&&(re.debug(`[DxfLoader] Line with id '${e.id}' contains index buffer, going to convert it to non-indexed.`),i=kt.convertGeometryWithIndexedToNonIndexed(i),e.userData.batches&&e.userData.batches.length>0)){re.debug("[DxfLoader] This line has been merged!");let t=0;e.userData.batches.forEach((e=>{e.positionStart=t,e.positionCount=e.indexCount,e.indexStart=0,e.indexCount=0,t+=e.positionCount}))}if(null===i.index){let n=i.attributes.position;if(!n||0===n.count)return;let s=[];if(t)for(let e=0,t=n.count;e<t;e+=2)vs.fromBufferAttribute(n,e).applyMatrix4(r),i_.fromBufferAttribute(n,e+1).applyMatrix4(r),s[e]=0===e?0:s[e-1],s[e+1]=s[e]+vs.distanceTo(i_);else{s[0]=0;for(let e=1,t=n.count;e<t;e++)vs.fromBufferAttribute(n,e-1).applyMatrix4(r),i_.fromBufferAttribute(n,e).applyMatrix4(r),s[e]=s[e-1],s[e]+=vs.distanceTo(i_)}i.setAttribute("lineDistance",new dt(s,1)),e.geometry=i}else re.warn("[DxfLoader] computeLineDistances only possible with non-indexed BufferGeometry.")}static computeLineDistances(e){let t=Date.now();e.traverse((e=>{let t=e;t.isLine&&t.material instanceof Zt&&Jr.computeLineDistance(t)})),re.debug(`[DxfLoader] Computed line distances in ${(Date.now()-t)/1e3}s`)}static merge(e,t){return ct(this,null,(function*(){let i=Date.now(),r=e=>ct(this,null,(function*(){if(t){t(new ProgressEvent("mergeProgress",{loaded:e,total:100}));let r=500,n=Date.now();n-i>r&&(yield Tt.sleep(0),i=n)}})),n={};e.objects.LAYOUT.forEach((e=>{var t;let i=e;n[i.layoutName]=i,null==(t=i.directAssociatedLeafObjectSet)||t.clear()}));let s=Date.now(),a={},o={},l=0,h=0,u=()=>{let e=Date.now();for(let t in a){let e=a[t];Jr.removeEmptyObjectsFromRemovingMarkedObjects(e.children,e.object),e.children=[]}l=0,h+=Date.now()-e},c=Object.keys(e.layersAndThreejsObjects).length,p=0;for(let t in e.layersAndThreejsObjects){let i=e.layersAndThreejsObjects[t];if(i.length<=1){yield r(++p/c*100);continue}let s=Date.now(),d={},f=[];for(let e of i){if(e.userData.isSnapObject){f.push(e);continue}let t,i=e;for(;i;){if(i.userData.isLayoutLevelObject){t=i;break}i=i.parent}if(!t)continue;let r=t.name;d[r]||(d[r]={object:t,children:[]}),d[r].children.push(e)}let m=Object.keys(d).length,g=0;for(let e in d){let t;if(e!==Jr.MODEL_LAYOUT_NAME){let i=n[e];i.directAssociatedLeafObjectSet||(i.directAssociatedLeafObjectSet=new Set),t=i.directAssociatedLeafObjectSet}let i=d[e],s=Zi.deepMerge(i.children,i.object,!1,!1,!0),y=s.added,v=s.removed;a[e]||(a[e]={object:i.object,children:[]}),o[e]||(o[e]={object:i.object,children:[]});let T=v.length>15e3;if(T){let e=Date.now();Jr.removeEmptyObjectsFromRemovingMarkedObjects(v,i.object),h+=Date.now()-e}else l+=v.length;if(v.length===i.children.length)T||v.forEach((t=>{a[e].children.push(t)}));else{let r=v;v.length>=100&&(r=new Set(v));let n=e=>Array.isArray(r)?r.indexOf(e)>=0:r.has(e);for(let s=0;s<i.children.length;s++){let r=i.children[s];n(r)?T||a[e].children.push(r):(f.push(r),t&&t.add(r))}}for(let r=0;r<y.length;r++){let i=y[r];kr.setSharedVariablesOfObject(i),f.push(i),o[e].children.push(i),t&&t.add(i)}l>15e3&&u(),yield r((p+ ++g/m)/c*100)}yield r(++p/c*100),e.layersAndThreejsObjects[t]=f,re.debug(`[DxfLoader] Merged layer '${t}' in ${(Date.now()-s)/1e3}s`)}l>0&&u();for(let t in o){let i=o[t],r=e.threejsObject.children.find((e=>e.name===t));if(r){let e=r.children.find((e=>e.name===Jr.SNAP_GROUP_NAME));if(e){let i=n[t];i.directAssociatedLeafObjectSet||(i.directAssociatedLeafObjectSet=new Set),e.children.forEach((e=>{var t;return null==(t=i.directAssociatedLeafObjectSet)?void 0:t.add(e)}))}}r||e.threejsObject.add(i.object),i.children.forEach((e=>{i.object.add(e),e.updateWorldMatrix(!1,!1)})),i.children=[]}re.debug(`[DxfLoader] MergeUtils.deepMerge costed ${Zi.mergeInfo.elapsedTime/1e3}s`),re.debug(`[DxfLoader] The remove operation of deep merge costed ${h/1e3}s`),re.debug(`[DxfLoader] Deep merge totally costed ${(Date.now()-s)/1e3}s`);let d=Zi.mergeInfo;re.debug(`[DxfLoader] Totally merged ${d.removedObjects} objects to ${d.mergedMeshes} meshes, ${d.mergedLines} lines, ${d.mergedPoints} points, ${d.mergedUnknownTypeObjects?d.mergedUnknownTypeObjects+" unknown type,":""} `),r(100)}))}static statLayoutAndLayerObjects(e){let t=new WeakSet,i=0;for(let s in e.layersAndThreejsObjects)e.layersAndThreejsObjects[s].forEach((e=>{e.geometry&&(i++,t.has(e)?console.warn(e):t.add(e))}));let r=new WeakSet,n=0;if(e.threejsObject.traverse((e=>{e.geometry&&(n++,r.has(e)?console.warn(e):r.add(e))})),i!=n)for(let s in e.layersAndThreejsObjects)e.layersAndThreejsObjects[s].forEach((e=>{e.geometry&&(r.has(e)||console.warn(e))}));re.info(`[DxfLoader] The count of layer objects is ${i},The count of layout objects is ${n} `)}static removeEmptyObjectsFromRemovingMarkedObjects(e,t){if(0===e.length)return;let i=e=>{let r=[];for(let i of e){i.userData.validCount=0;let e=i.parent;e&&e!==t&&(void 0===e.userData.validCount&&(e.userData.validCount=e.children.length),0==--e.userData.validCount&&r.push(e))}r.length>0&&i(r)};i(e),this.removeEmptyObjectsFromMark(t)}static removeEmptyObjectsFromMark(e){if(0===e.userData.validCount||kr.isEmptyObject(e))return e.removeFromParent(),!0;for(let t=0;t<e.children.length;)this.removeEmptyObjectsFromMark(e.children[t])||++t;return!1}},gr=Jr;gr.MODEL_LAYOUT_NAME="Model",gr.SNAP_GROUP_NAME="InvisibleObjectGroupForOSnap",gr.cameraZoomUniform={value:1},gr.viewportScaleUniform={value:1},gr.transformMatrixUniform={value:new Be},gr.resolutionUniform={value:new ce},gr.maxFragmentUniforms=1024,gr.abortJobs=!1;var pge=class extends Ls{constructor(e){var t;super(),this.drawableList=new Xc("compare"),this.viewer=e,this.overlayRender=this.viewer.overlayRender,null==(t=this.overlayRender)||t.addDrawableList(this.drawableList)}drawCompareDrawable(e){let t=[],i=[],r=[];for(let o of Object.values(e)){let e=o.box;e&&("Added"===o.type?t.push(e):"Removed"===o.type?i.push(e):r.push(e))}let n=kt.mergeBBoxes(t),s=kt.mergeBBoxes(i),a=kt.mergeBBoxes(r);this.drawableList.addDrawable(new s0(Tt.guid(),n)),this.drawableList.addDrawable(new s0(Tt.guid(),s)),this.drawableList.addDrawable(new s0(Tt.guid(),a)),this.viewer.enableRender()}setCompareDrawableVisible(e){this.drawableList.getDrawables().forEach((t=>t.visible=e)),this.viewer.enableRender()}},d0=ps(dge(),1),Qp=class{constructor(e,t){this.current=e,this.next=t,this.inNormal=this.inwardsNormal(),this.outNormal=this.outwardsNormal()}outwardsNormal(){let e=this.inwardsNormal();return[-e[0],-e[1]]}inwardsNormal(){let e=this.next[0]-this.current[0],t=this.next[1]-this.current[1],i=Math.sqrt(e*e+t*t);if(0===i)throw new Error("Vertices overlap");return[-t/i,e/i]}offset(e,t){return Qp.offsetEdge(this.current,this.next,e,t)}inverseOffset(e,t){return Qp.offsetEdge(this.next,this.current,e,t)}inverse(){return new Qp(this.next,this.current)}static offsetEdge(e,t,i,r){return new Qp([e[0]+i,e[1]+r],[t[0]+i,t[1]+r])}},s_=Array.isArray,fge=(e,t)=>e[0]===t[0]&&e[1]===t[1],AG=e=>Array.isArray(e)&&e.length,gge=(e,t=0,i=!1)=>{let r,n;if(AG(e)&&"number"==typeof e[0][0]){let t=0,s=e;for(r=0,n=s.length;r<n;r++){let e=s[r],i=s[(r+1)%n];t+=e[0]*i[1],t-=i[0]*e[1]}(!i&&t>0||i&&t<0)&&s.reverse()}else for(r=0,n=e.length;r<n;r++)gge(e[r],t+1,r>0);if(0===t&&AG(e)&&AG(e[0])&&"number"==typeof e[0][0][0]){let t=e[0].slice(0,1)[0];e[0].pop(),e[0].push([t[0],t[1]])}return e},mge=class{constructor(e,t=5){if(this.distance=0,this.arcSegments=t,!s_(e))throw new Error("Offset requires at least one coodinate to work with");this.edges=[],s_(e)&&"number"==typeof e[0]?this.vertices=e:(this.vertices=gge(e),this.processContour(this.vertices,this.edges))}processContour(e,t){let i,r;if(s_(e[0])&&"number"==typeof e[0][0])for(r=e.length,fge(e[0],e[r-1])&&(r-=1),i=0;i<r;i++)t.push(new Qp(e[i],e[(i+1)%r]));else for(i=0,r=e.length;i<r;i++)t.push([]),this.processContour(e[i],t[t.length-1])}setArcSegments(e){return this.arcSegments=e,this}createArc(e,t,i,r,n,s,a){let o=2*Math.PI,l=Math.atan2(r[1]-t[1],r[0]-t[0]),h=Math.atan2(n[1]-t[1],n[0]-t[0]);s%2==0&&(s-=1),l<0&&(l+=o),h<0&&(h+=o);let u=l>h?l-h:l+o-h,c=(a?-u:o-u)/s;e.push(r);for(let p=1;p<s;++p)u=l+c*p,e.push([t[0]+Math.cos(u)*i,t[1]+Math.sin(u)*i]);return e.push(n),e}setDistance(e){return this.distance=e,this}ensureLastPoint(e){return fge(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e}offset(e){return this.setDistance(e),0===this.distance?this.vertices:this.distance>0?this.margin(this.distance):this.padding(-this.distance)}offsetSegment(e,t,i,r){let n=[i.offset(i.inNormal[0]*r,i.inNormal[1]*r),i.inverseOffset(i.outNormal[0]*r,i.outNormal[1]*r)],s=[];for(let a=0,o=2;a<o;a++){let i=n[a],l=n[(a+o-1)%o];this.createArc(s,0===a?e:t,r,l.next,i.current,this.arcSegments,!0)}return s}margin(e){if(this.setDistance(e),"number"==typeof this.vertices[0])return this.offsetPoint(this.distance);if(0===e)return this.vertices;let t=this.offsetLines(this.distance);return t=(0,d0.union)(this.vertices,t),t}padding(e){if(this.setDistance(e),0===this.distance)return this.vertices;if(2===this.vertices.length&&"number"==typeof this.vertices[0])return this.vertices;let t=this.offsetLines(this.distance);return(0,d0.difference)(this.vertices,t)}offsetLine(e){return 0===e?this.vertices:this.offsetLines(e)}offsetLines(e){if(e<0)throw new Error("Cannot apply negative margin to the line");this.setDistance(e);let t=[];if(s_(this.vertices[0])&&"number"!=typeof this.vertices[0][0]){let e=[];for(let t=0,i=this.edges.length;t<i;t++){let i=this.offsetContour(this.vertices[t],this.edges[t]);i.length>0&&e.push(i)}e.length>0&&(t=1===e.length?e[0]:(0,d0.union)(e[0],...e.slice(1)))}else t=1===this.vertices.length?this.offsetPoint(e):this.offsetContour(this.vertices,this.edges);return t}offsetContour(e,t){let i=[],r=0,n=0;if(s_(e[0])&&"number"==typeof e[0][0]){for(r=0,n=e.length-1;r<n;r++){let n=[this.ensureLastPoint(this.offsetSegment(e[r],e[r+1],t[r],this.distance))];i.push(n)}i.length>0&&(i=1===i.length?[i[0]]:(0,d0.union)(i[0],i.slice(1)))}else{let s=[];for(r=0,n=t.length;r<n;r++){let i=this.offsetContour(e[r],t[r]);i.length>0&&s.push(i)}s.length>0&&(i=1===s.length?s[0]:(0,d0.union)(s[0],...s.slice(1)))}return i}offsetPoint(e){this.setDistance(e);let t=2*this.arcSegments,i=[],r=this.vertices,n=this.distance,s=0;t%2==0&&t++;for(let a=0;a<t;a++)s+=2*Math.PI/t,i.push([r[0]+n*Math.cos(s),r[1]+n*Math.sin(s)]);return[[this.ensureLastPoint(i)]]}},rO=class{constructor(e,t){this.flyDuration=500,this.autoRotateRemainingTime=0,this.automaticallyAdjustCameraPosition=!0,this.rotateIntervalStartTime=0,this.camera=e,this.controls=t}flyTo(e,t,i){let r=this.camera,n=this.controls;if(!r||!n)return;if(e.equals(t))return void console.error("[BimViewer] camera position and lookAt cannot be the same!");if(isNaN(e.x)||isNaN(e.y)||isNaN(e.z)||isNaN(t.x)||isNaN(t.y)||isNaN(t.z))return void console.error("[BimViewer] invalid position or lookAt!");if(this.automaticallyAdjustCameraPosition){let i=e.distanceTo(t);i<r.near?(e=e.clone().sub(t).normalize().multiplyScalar(1.1*r.near),console.warn("[BimViewer] camera could be too close to see the object!")):i>r.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*r.far),console.warn("[BimViewer] camera could be too far to see the object!"))}let s=r.position.clone(),a=n.target.clone(),o=this.flyDuration,l=Date.now();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=setInterval((()=>{let h=Date.now()-l;h>o&&(h=o);let u=(e,t,i)=>{let r=e.x+(t.x-e.x)*i,n=e.y+(t.y-e.y)*i,s=e.z+(t.z-e.z)*i;return new D(r,n,s)};((e,t)=>{r.lookAt(t),r.position.set(e.x,e.y,e.z),n.target.set(t.x,t.y,t.z),n.update()})(u(s,e,h/o),u(a,t,h/o)),h>=o&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0,i&&i())}),10)}lookTo(e){let t=this.camera,i=this.controls;if(!t||!i)return;let r=t.position,n=i.target.distanceTo(r),s=e.normalize().multiplyScalar(n),a=new D(r.x+s.x,r.y+s.y,r.z+s.z);this.flyTo(r,a)}startAutoRotate(){let e=this.camera,t=this.controls;if(!e||!t)return;t.autoRotate=!0;let i=new D;e.getWorldPosition(i);let r=t.target;if(r.y===i.y)return;let n=(r.y-i.y)/50;for(let s=0;s<50;++s)setTimeout((()=>{let e=t.target.y-n;t.target.setY(e),t.update()}),30*s)}delayAutoRotate(){this.autoRotateRemainingTime=5e3,this.controls&&(this.controls.autoRotate=!1)}startToRotate(e){let t=Date.now()-this.rotateIntervalStartTime;this.rotateIntervalStartTime=Date.now(),!(this.rotateInterval&&t<100)&&(this.rotateInterval&&clearInterval(this.rotateInterval),this.rotateInterval=setInterval((()=>{if(Date.now()-this.rotateIntervalStartTime>=100)return clearInterval(this.rotateInterval),void(this.rotateInterval=void 0);"ArrowLeft"===e.code||"ArrowRight"===e.code?this.rotateLeftOrRight(.3,"ArrowLeft"===e.code):("ArrowUp"===e.code||"ArrowDown"===e.code)&&this.rotateUpOrDown(.3,"ArrowUp"===e.code)}),1))}rotateLeftOrRight(e,t=!0){let i=this.controls;if(!this.camera||!i)return;let r=this.camera.position,n=i.target,s=n.clone(),a=Math.PI*e/180;t&&(a=-a),s.x=(n.x-r.x)*Math.cos(a)-(n.z-r.z)*Math.sin(a)+r.x,s.z=(n.z-r.z)*Math.cos(a)+(n.x-r.x)*Math.sin(a)+r.z,this.camera.lookAt(s),i.target=s,i.update()}rotateUpOrDown(e,t=!0){let i=this.controls;if(!this.camera||!i)return;let r=this.camera.position,n=i.target,s=n.clone(),a=Math.PI*e/180,o=new D(n.x-r.x,n.y-r.y,n.z-r.z).length(),l=n.y-r.y;t||(a=-a);let h=Math.asin(l/o)+a;if(h<-Math.PI/2||h>Math.PI/2)return;let u=Math.sin(h)*o;s.y=n.y+(u-l),i.target=s,i.update()}},iO=class{constructor(e){this.object=e}instantiate(){let e=Date.now();this.instantiateInner(this.object),console.log(`[Inst] instantiate() costed ${(Date.now()-e)/1e3}s`)}instantiateInner(e){if(!e.children||0===e.children.length)return;let t=e.children.length,i={},r=[];for(let a=0;a<t;++a){let t=e.children[a];if(this.instantiateInner(t),t.children&&t.children.length>0||!t.geometry)continue;let n=!1,s=Object.values(i);for(let o=s.length-1;o>=0;--o){let l=s[o].indexes[0],h=e.children[l];if(this.geometryEquals(t.geometry,h.geometry)&&ss.materialsEquals(t.material,h.material)){i[l]||(i[l]={indexes:[l]},this.removeFromArray(r,l)),i[l].indexes.push(a),n=!0;break}}for(let o=r.length-1;!n&&o>=0;--o){let s=r[o],l=e.children[s];if(this.geometryEquals(t.geometry,l.geometry)&&ss.materialsEquals(t.material,l.material)){i[s]||(i[s]={indexes:[s]},this.removeFromArray(r,s)),i[s].indexes.push(a),n=!0;break}}n||r.push(a)}if(Object.keys(i).length<=0)return;let n=[],s=[];Object.values(i).forEach((t=>{let i=t.indexes;s.push(...i);let r=e.children[i[0]],a=r.material;if(a instanceof qr)a=a.clone();else if(Array.isArray(a)){let e=[];a.forEach((t=>e.push(t.clone()))),a=e}let o=new sn(r.geometry,a,i.length);o.name=`[Instanced] ${r.name}`;for(let n=0;n<i.length;++n){let t=i[n],r=e.children[t];r.updateMatrix(),o.setMatrixAt(n,r.matrix)}o.matrixAutoUpdate=!1,o.updateMatrix(),n.push(o)})),s.sort(((e,t)=>t-e)),s.forEach((t=>e.remove(e.children[t]))),n.forEach((t=>{t.parent=e,e.children.push(t)})),e.updateMatrix(),console.log(`[Inst] ${s.length}(out of ${t}) objects instanced to ${n.length} InstancedMesh`)}removeFromArray(e,t){for(let i=e.length-1;i>=0;--i)if(e[i]===t)return void e.splice(i,1)}geometryEquals(e,t){return kt.geometryEquals(e,t)}},VE=class{constructor(){this.TIMEOUT="timeout",this.INTERVAL="interval",this.timeoutMap={},this.intervalMap={}}run(e=this.INTERVAL,t,i=16.7){let r=Date.now,n=r(),s=n,a=Symbol(""),o=()=>{this.setIdMap(a,e,o),s=r(),s-n>=i&&(e===this.intervalMap&&(n=r(),s=n),t(),e===this.TIMEOUT&&this.clearTimeout(a))};return this.setIdMap(a,e,o),a}setIdMap(e,t,i){let r=requestAnimationFrame(i);t===this.INTERVAL?this.intervalMap[e]=r:t===this.TIMEOUT&&(this.timeoutMap[e]=r)}setTimeout(e,t){return this.run(this.TIMEOUT,e,t)}clearTimeout(e){cancelAnimationFrame(this.timeoutMap[e])}setInterval(e,t){return this.run(this.INTERVAL,e,t)}clearInterval(e){cancelAnimationFrame(this.intervalMap[e])}},a_=class extends zg{constructor(e){super(e)}parse(e){e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");let t=0,i=new Uint8Array(e),r={id_length:i[t++],colormap_type:i[t++],image_type:i[t++],colormap_index:i[t++]|i[t++]<<8,colormap_length:i[t++]|i[t++]<<8,colormap_size:i[t++],origin:[i[t++]|i[t++]<<8,i[t++]|i[t++]<<8],width:i[t++]|i[t++]<<8,height:i[t++]|i[t++]<<8,pixel_size:i[t++],flags:i[t++]};(function(e){switch(e.image_type){case 1:case 9:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case 2:case 3:case 10:case 11:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case 0:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)})(r),r.id_length+t>e.length&&console.error("THREE.TGALoader: No data."),t+=r.id_length;let n=!1,s=!1,a=!1;switch(r.image_type){case 9:n=!0,s=!0;break;case 1:s=!0;break;case 10:n=!0;break;case 2:break;case 11:n=!0,a=!0;break;case 3:a=!0}let o=new Uint8Array(r.width*r.height*4),l=function(e,t,i,r,n){let s,a,o=i.pixel_size>>3,l=i.width*i.height*o;if(t&&(a=n.subarray(r,r+=i.colormap_length*(i.colormap_size>>3))),e){s=new Uint8Array(l);let e,t,i,a=0,h=new Uint8Array(o);for(;a<l;)if(e=n[r++],t=1+(127&e),128&e){for(i=0;i<o;++i)h[i]=n[r++];for(i=0;i<t;++i)s.set(h,a+i*o);a+=o*t}else{for(t*=o,i=0;i<t;++i)s[a+i]=n[r++];a+=t}}else s=n.subarray(r,r+=t?i.width*i.height:l);return{pixel_data:s,palettes:a}}(n,s,r,t,i);return function(e,t,i,n,s){let o,l,h,u,c,p;switch((48&r.flags)>>4){default:case 2:o=0,h=1,c=t,l=0,u=1,p=i;break;case 0:o=0,h=1,c=t,l=i-1,u=-1,p=-1;break;case 3:o=t-1,h=-1,c=-1,l=0,u=1,p=i;break;case 1:o=t-1,h=-1,c=-1,l=i-1,u=-1,p=-1}if(a)switch(r.pixel_size){case 8:!function(e,t,i,n,s,a,o,l){let h,u,c,p=0,d=r.width;for(c=t;c!==n;c+=i)for(u=s;u!==o;u+=a,p++)h=l[p],e[4*(u+d*c)+0]=h,e[4*(u+d*c)+1]=h,e[4*(u+d*c)+2]=h,e[4*(u+d*c)+3]=255}(e,l,u,p,o,h,c,n);break;case 16:!function(e,t,i,n,s,a,o,l){let h,u,c=0,p=r.width;for(u=t;u!==n;u+=i)for(h=s;h!==o;h+=a,c+=2)e[4*(h+p*u)+0]=l[c+0],e[4*(h+p*u)+1]=l[c+0],e[4*(h+p*u)+2]=l[c+0],e[4*(h+p*u)+3]=l[c+1]}(e,l,u,p,o,h,c,n);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(r.pixel_size){case 8:!function(e,t,i,n,s,a,o,l,h){let u,c,p,d=h,f=0,m=r.width;for(p=t;p!==n;p+=i)for(c=s;c!==o;c+=a,f++)u=l[f],e[4*(c+m*p)+3]=255,e[4*(c+m*p)+2]=d[3*u+0],e[4*(c+m*p)+1]=d[3*u+1],e[4*(c+m*p)+0]=d[3*u+2]}(e,l,u,p,o,h,c,n,s);break;case 16:!function(e,t,i,n,s,a,o,l){let h,u,c,p=0,d=r.width;for(c=t;c!==n;c+=i)for(u=s;u!==o;u+=a,p+=2)h=l[p+0]+(l[p+1]<<8),e[4*(u+d*c)+0]=(31744&h)>>7,e[4*(u+d*c)+1]=(992&h)>>2,e[4*(u+d*c)+2]=(31&h)<<3,e[4*(u+d*c)+3]=32768&h?0:255}(e,l,u,p,o,h,c,n);break;case 24:!function(e,t,i,n,s,a,o,l){let h,u,c=0,p=r.width;for(u=t;u!==n;u+=i)for(h=s;h!==o;h+=a,c+=3)e[4*(h+p*u)+3]=255,e[4*(h+p*u)+2]=l[c+0],e[4*(h+p*u)+1]=l[c+1],e[4*(h+p*u)+0]=l[c+2]}(e,l,u,p,o,h,c,n);break;case 32:!function(e,t,i,n,s,a,o,l){let h,u,c=0,p=r.width;for(u=t;u!==n;u+=i)for(h=s;h!==o;h+=a,c+=4)e[4*(h+p*u)+2]=l[c+0],e[4*(h+p*u)+1]=l[c+1],e[4*(h+p*u)+0]=l[c+2],e[4*(h+p*u)+3]=l[c+3]}(e,l,u,p,o,h,c,n);break;default:console.error("THREE.TGALoader: Format not supported.")}}(o,r.width,r.height,l.pixel_data,l.palettes),{data:o,width:r.width,height:r.height,flipY:!0,generateMipmaps:!0,minFilter:Ha}}},nO=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=""===n.path?qs.extractUrlBase(e):n.path,a=new di(n.manager);a.setPath(n.path),a.setRequestHeader(n.requestHeader),a.setWithCredentials(n.withCredentials),a.load(e,(function(i){try{t(n.parse(i,s))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}parse(e,t){function i(e,t){let i=[],r=e.childNodes;for(let n=0,s=r.length;n<s;n++){let e=r[n];e.nodeName===t&&i.push(e)}return i}function r(e){if(0===e.length)return[];let t=e.trim().split(/\s+/),i=new Array(t.length);for(let r=0,n=t.length;r<n;r++)i[r]=t[r];return i}function n(e){if(0===e.length)return[];let t=e.trim().split(/\s+/),i=new Array(t.length);for(let r=0,n=t.length;r<n;r++)i[r]=parseFloat(t[r]);return i}function s(e){if(0===e.length)return[];let t=e.trim().split(/\s+/),i=new Array(t.length);for(let r=0,n=t.length;r<n;r++)i[r]=parseInt(t[r]);return i}function a(e){return e.substring(1)}function o(e){return 0===Object.keys(e).length}function l(e,t,r,n){let s=i(e,t)[0];if(void 0!==s){let e=i(s,r);for(let t=0;t<e.length;t++)n(e[t])}}function h(e,t){for(let i in e)e[i].build=t(e[i])}function u(e,t){return void 0!==e.build||(e.build=t(e)),e.build}function c(e){let t={inputs:{}};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType&&"input"===r.nodeName){let e=a(r.getAttribute("source")),i=r.getAttribute("semantic");t.inputs[i]=e}}return t}function p(e){let t={},i=e.getAttribute("target").split("/"),r=i.shift(),n=i.shift(),s=-1!==n.indexOf("("),o=-1!==n.indexOf(".");if(o)i=n.split("."),n=i.shift(),t.member=i.shift();else if(s){let e=n.split("(");n=e.shift();for(let t=0;t<e.length;t++)e[t]=parseInt(e[t].replace(/\)/,""));t.indices=e}return t.id=r,t.sid=n,t.arraySyntax=s,t.memberSyntax=o,t.sampler=a(e.getAttribute("source")),t}function d(e){let t=[],i=e.channels,r=e.samplers,n=e.sources;for(let s in i)if(i.hasOwnProperty(s)){let e=i[s],a=r[e.sampler],o=a.inputs.INPUT,l=a.inputs.OUTPUT;T(m(e,n[o],n[l]),t)}return t}function f(e){return u(it.animations[e],d)}function m(e,t,i){let r,n,s,a,o,l,h=it.nodes[e.id],u=Ue(h.id),c=h.transforms[e.sid],p=h.matrix.clone().transpose(),d={};switch(c){case"matrix":for(s=0,a=t.array.length;s<a;s++)if(r=t.array[s],n=s*i.stride,void 0===d[r]&&(d[r]={}),!0===e.arraySyntax){let t=i.array[n],s=e.indices[0]+4*e.indices[1];d[r][s]=t}else for(o=0,l=i.stride;o<l;o++)d[r][o]=i.array[n+o];break;case"translate":case"rotate":case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',c)}let f=function(e,t){let i=[];for(let r in e)i.push({time:parseFloat(r),value:e[r]});i.sort((function(e,t){return e.time-t.time}));for(let r=0;r<16;r++)x(i,r,t.elements[r]);return i}(d,p);return{name:u.uuid,keyframes:f}}let g=new D,y=new D,v=new Br;function T(e,t){let i=e.keyframes,r=e.name,n=[],s=[],a=[],o=[];for(let l=0,h=i.length;l<h;l++){let e=i[l],t=e.time,r=e.value;Me.fromArray(r).transpose(),Me.decompose(g,v,y),n.push(t),s.push(g.x,g.y,g.z),a.push(v.x,v.y,v.z,v.w),o.push(y.x,y.y,y.z)}return s.length>0&&t.push(new fo(r+".position",n,s)),a.length>0&&t.push(new Ba(r+".quaternion",n,a)),o.length>0&&t.push(new fo(r+".scale",n,o)),t}function x(e,t,i){let r,n,s,a=!0;for(n=0,s=e.length;n<s;n++)r=e[n],void 0===r.value[t]?r.value[t]=null:a=!1;if(!0===a)for(n=0,s=e.length;n<s;n++)r=e[n],r.value[t]=i;else!function(e,t){let i,r;for(let n=0,s=e.length;n<s;n++){let s=e[n];if(null===s.value[t]){if(i=b(e,n,t),r=E(e,n,t),null===i){s.value[t]=r.value[t];continue}if(null===r){s.value[t]=i.value[t];continue}_(s,i,r,t)}}}(e,t)}function b(e,t,i){for(;t>=0;){let r=e[t];if(null!==r.value[i])return r;t--}return null}function E(e,t,i){for(;t<e.length;){let r=e[t];if(null!==r.value[i])return r;t++}return null}function _(e,t,i,r){i.time-t.time!=0?e.value[r]=(e.time-t.time)*(i.value[r]-t.value[r])/(i.time-t.time)+t.value[r]:e.value[r]=t.value[r]}function w(e){let t=[],i=e.name,r=e.end-e.start||-1,n=e.animations;for(let s=0,a=n.length;s<a;s++){let e=f(n[s]);for(let i=0,r=e.length;i<r;i++)t.push(e[i])}return new mo(i,r,t)}function S(e){return u(it.clips[e],w)}function M(e){let t={sources:{}};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=n(r.textContent);break;case"source":let e=r.getAttribute("id");t.sources[e]=se(r);break;case"joints":t.joints=I(r);break;case"vertex_weights":t.vertexWeights=A(r)}}return t}function I(e){let t={inputs:{}};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType&&"input"===r.nodeName){let e=r.getAttribute("semantic"),i=a(r.getAttribute("source"));t.inputs[e]=i}}return t}function A(e){let t={inputs:{}};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"input":let e=r.getAttribute("semantic"),i=a(r.getAttribute("source")),n=parseInt(r.getAttribute("offset"));t.inputs[e]={id:i,offset:n};break;case"vcount":t.vcount=s(r.textContent);break;case"v":t.v=s(r.textContent)}}return t}function R(e){let t={id:e.id},i=it.geometries[t.id];return void 0!==e.skin&&(t.skin=function(e){let t,i,r,n={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},s=e.sources,a=e.vertexWeights,o=a.vcount,l=a.v,h=a.inputs.JOINT.offset,u=a.inputs.WEIGHT.offset,c=e.sources[e.joints.inputs.JOINT],p=e.sources[e.joints.inputs.INV_BIND_MATRIX],d=s[a.inputs.WEIGHT.id].array,f=0;for(t=0,r=o.length;t<r;t++){let e=o[t],r=[];for(i=0;i<e;i++){let e=l[f+h],t=d[l[f+u]];r.push({index:e,weight:t}),f+=2}for(r.sort(m),i=0;i<4;i++){let e=r[i];void 0!==e?(n.indices.array.push(e.index),n.weights.array.push(e.weight)):(n.indices.array.push(0),n.weights.array.push(0))}}for(e.bindShapeMatrix?n.bindMatrix=(new Be).fromArray(e.bindShapeMatrix).transpose():n.bindMatrix=(new Be).identity(),t=0,r=c.array.length;t<r;t++){let e=c.array[t],i=(new Be).fromArray(p.array,t*p.stride).transpose();n.joints.push({name:e,boneInverse:i})}return n;function m(e,t){return t.weight-e.weight}}(e.skin),i.sources.skinIndices=t.skin.indices,i.sources.skinWeights=t.skin.weights),t}function C(e){return u(it.controllers[e],R)}function O(e){return void 0!==e.build?e.build:e.init_from}function P(e){let t=it.images[e];return void 0!==t?u(t,O):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",e),null)}function N(e){let t={surfaces:{},samplers:{}};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"newparam":L(r,t);break;case"technique":t.technique=k(r);break;case"extra":t.extra=j(r)}}return t}function L(e,t){let i=e.getAttribute("sid");for(let r=0,n=e.childNodes.length;r<n;r++){let n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"surface":t.surfaces[i]=F(n);break;case"sampler2D":t.samplers[i]=U(n)}}}function F(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"init_from"===r.nodeName&&(t.init_from=r.textContent)}return t}function U(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"source"===r.nodeName&&(t.source=r.textContent)}return t}function k(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=r.nodeName,t.parameters=B(r);break;case"extra":t.extra=j(r)}}return t}function B(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[r.nodeName]=z(r);break;case"transparent":t[r.nodeName]={opaque:r.hasAttribute("opaque")?r.getAttribute("opaque"):"A_ONE",data:z(r)}}}return t}function z(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"color":t[r.nodeName]=n(r.textContent);break;case"float":t[r.nodeName]=parseFloat(r.textContent);break;case"texture":t[r.nodeName]={id:r.getAttribute("texture"),extra:G(r)}}}return t}function G(e){let t={technique:{}};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"extra"===r.nodeName&&H(r,t)}return t}function H(e,t){for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"technique"===r.nodeName&&V(r,t)}}function V(e,t){for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[r.nodeName]=parseFloat(r.textContent);break;case"wrapU":case"wrapV":"TRUE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=1:"FALSE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=0:t.technique[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=Y(r)}}}function j(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"technique"===r.nodeName&&(t.technique=W(r))}return t}function W(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"double_sided":t[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=Y(r)}}return t}function Y(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"texture"===r.nodeName&&(t[r.nodeName]={id:r.getAttribute("texture"),texcoord:r.getAttribute("texcoord"),extra:G(r)})}return t}function X(e){return e}function q(e){let t,i=function(e){return u(it.effects[e],X)}(e.url),r=i.profile.technique;switch(r.type){case"phong":case"blinn":t=new Ws;break;case"lambert":t=new Bl;break;default:t=new Xt}function n(e,t=null){let r=i.profile.samplers[e.id],n=null;if(void 0!==r?n=P(i.profile.surfaces[r.source].init_from):(console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),n=P(e.id)),null!==n){let i=function(e){let t,i=e.slice(2+(e.lastIndexOf(".")-1>>>0));return t="tga"===(i=i.toLowerCase(),i)?Ke:qe,t}(n);if(void 0!==i){let r=i.load(n),s=e.extra;if(void 0!==s&&void 0!==s.technique&&!1===o(s.technique)){let e=s.technique;r.wrapS=e.wrapU?yn:vn,r.wrapT=e.wrapV?yn:vn,r.offset.set(e.offsetU||0,e.offsetV||0),r.repeat.set(e.repeatU||1,e.repeatV||1)}else r.wrapS=yn,r.wrapT=yn;return null!==t&&(r.encoding=t),r}return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",n),null}return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",e.id),null}t.name=e.name||"";let s=r.parameters;for(let o in s){let e=s[o];switch(o){case"diffuse":e.color&&t.color.fromArray(e.color),e.texture&&(t.map=n(e.texture,yr));break;case"specular":e.color&&t.specular&&t.specular.fromArray(e.color),e.texture&&(t.specularMap=n(e.texture));break;case"bump":e.texture&&(t.normalMap=n(e.texture));break;case"ambient":e.texture&&(t.lightMap=n(e.texture,yr));break;case"shininess":e.float&&t.shininess&&(t.shininess=e.float);break;case"emission":e.color&&t.emissive&&t.emissive.fromArray(e.color),e.texture&&(t.emissiveMap=n(e.texture,yr))}}t.color.convertSRGBToLinear(),t.specular&&t.specular.convertSRGBToLinear(),t.emissive&&t.emissive.convertSRGBToLinear();let a=s.transparent,l=s.transparency;if(void 0===l&&a&&(l={float:1}),void 0===a&&l&&(a={opaque:"A_ONE",data:{color:[1,1,1,1]}}),a&&l)if(a.data.texture)t.transparent=!0;else{let e=a.data.color;switch(a.opaque){case"A_ONE":t.opacity=e[3]*l.float;break;case"RGB_ZERO":t.opacity=1-e[0]*l.float;break;case"A_ZERO":t.opacity=1-e[3]*l.float;break;case"RGB_ONE":t.opacity=e[0]*l.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',a.opaque)}t.opacity<1&&(t.transparent=!0)}if(void 0!==r.extra&&void 0!==r.extra.technique){let e=r.extra.technique;for(let i in e){let r=e[i];switch(i){case"double_sided":t.side=1===r?bi:Xi;break;case"bump":t.normalMap=n(r.texture),t.normalScale=new ce(1,1)}}}return t}function Z(e){return u(it.materials[e],q)}function J(e){for(let t=0;t<e.childNodes.length;t++){let i=e.childNodes[t];if("technique_common"===i.nodeName)return K(i)}return{}}function K(e){let t={};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];switch(r.nodeName){case"perspective":case"orthographic":t.technique=r.nodeName,t.parameters=$(r)}}return t}function $(e){let t={};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];switch(r.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[r.nodeName]=parseFloat(r.textContent)}}return t}function Q(e){let t;switch(e.optics.technique){case"perspective":t=new Vr(e.optics.parameters.yfov,e.optics.parameters.aspect_ratio,e.optics.parameters.znear,e.optics.parameters.zfar);break;case"orthographic":let i=e.optics.parameters.ymag,r=e.optics.parameters.xmag,n=e.optics.parameters.aspect_ratio;r=void 0===r?i*n:r,i=void 0===i?r/n:i,r*=.5,i*=.5,t=new Ni(-r,r,i,-i,e.optics.parameters.znear,e.optics.parameters.zfar);break;default:t=new Vr}return t.name=e.name||"",t}function ee(e){let t=it.cameras[e];return void 0!==t?u(t,Q):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",e),null)}function te(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=r.nodeName,t.parameters=ie(r)}}return t}function ie(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"color":let e=n(r.textContent);t.color=(new Ve).fromArray(e).convertSRGBToLinear();break;case"falloff_angle":t.falloffAngle=parseFloat(r.textContent);break;case"quadratic_attenuation":let i=parseFloat(r.textContent);t.distance=i?Math.sqrt(1/i):0}}return t}function re(e){let t;switch(e.technique){case"directional":t=new Ns;break;case"point":t=new zc;break;case"spot":t=new th;break;case"ambient":t=new Gl}return e.parameters.color&&t.color.copy(e.parameters.color),e.parameters.distance&&(t.distance=e.parameters.distance),t}function ne(e){let t=it.lights[e];return void 0!==t?u(t,re):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",e),null)}function se(e){let t={array:[],stride:3};for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];if(1===a.nodeType)switch(a.nodeName){case"float_array":t.array=n(a.textContent);break;case"Name_array":t.array=r(a.textContent);break;case"technique_common":let e=i(a,"accessor")[0];void 0!==e&&(t.stride=parseInt(e.getAttribute("stride")))}}return t}function ae(e){let t={};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];1===r.nodeType&&(t[r.getAttribute("semantic")]=a(r.getAttribute("source")))}return t}function oe(e){let t={type:e.nodeName,material:e.getAttribute("material"),count:parseInt(e.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"input":let e=a(r.getAttribute("source")),i=r.getAttribute("semantic"),n=parseInt(r.getAttribute("offset")),o=parseInt(r.getAttribute("set")),l=o>0?i+o:i;t.inputs[l]={id:e,offset:n},t.stride=Math.max(t.stride,n+1),"TEXCOORD"===i&&(t.hasUV=!0);break;case"vcount":t.vcount=s(r.textContent);break;case"p":t.p=s(r.textContent)}}return t}function le(e){let t=0;for(let i=0,r=e.length;i<r;i++)!0===e[i].hasUV&&t++;t>0&&t<e.length&&(e.uvsNeedsFix=!0)}function he(e){let t={},i=e.sources,r=e.vertices,n=e.primitives;if(0===n.length)return{};let s=function(e){let t={};for(let i=0;i<e.length;i++){let r=e[i];void 0===t[r.type]&&(t[r.type]=[]),t[r.type].push(r)}return t}(n);for(let a in s){let e=s[a];le(e),t[a]=ue(e,i,r)}return t}function ue(e,t,i){let r={},n={array:[],stride:0},s={array:[],stride:0},a={array:[],stride:0},o={array:[],stride:0},l={array:[],stride:0},h=[],u=[],c=new ot,p=[],d=0;for(let f=0;f<e.length;f++){let r=e[f],m=r.inputs,g=0;switch(r.type){case"lines":case"linestrips":g=2*r.count;break;case"triangles":g=3*r.count;break;case"polylist":for(let e=0;e<r.count;e++){let t=r.vcount[e];switch(t){case 3:g+=3;break;case 4:g+=6;break;default:g+=3*(t-2)}}break;default:console.warn("THREE.ColladaLoader: Unknow primitive type:",r.type)}c.addGroup(d,g,f),d+=g,r.material&&p.push(r.material);for(let c in m){let p=m[c];switch(c){case"VERTEX":for(let c in i){let d=i[c];switch(c){case"POSITION":let i=n.array.length;if(pe(r,t[d],p.offset,n.array),n.stride=t[d].stride,t.skinWeights&&t.skinIndices&&(pe(r,t.skinIndices,p.offset,h),pe(r,t.skinWeights,p.offset,u)),!1===r.hasUV&&!0===e.uvsNeedsFix){let e=(n.array.length-i)/n.stride;for(let t=0;t<e;t++)a.array.push(0,0)}break;case"NORMAL":pe(r,t[d],p.offset,s.array),s.stride=t[d].stride;break;case"COLOR":pe(r,t[d],p.offset,l.array),l.stride=t[d].stride;break;case"TEXCOORD":pe(r,t[d],p.offset,a.array),a.stride=t[d].stride;break;case"TEXCOORD1":pe(r,t[d],p.offset,o.array),a.stride=t[d].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',c)}}break;case"NORMAL":pe(r,t[p.id],p.offset,s.array),s.stride=t[p.id].stride;break;case"COLOR":pe(r,t[p.id],p.offset,l.array,!0),l.stride=t[p.id].stride;break;case"TEXCOORD":pe(r,t[p.id],p.offset,a.array),a.stride=t[p.id].stride;break;case"TEXCOORD1":pe(r,t[p.id],p.offset,o.array),o.stride=t[p.id].stride}}}return n.array.length>0&&c.setAttribute("position",new dt(n.array,n.stride)),s.array.length>0&&c.setAttribute("normal",new dt(s.array,s.stride)),l.array.length>0&&c.setAttribute("color",new dt(l.array,l.stride)),a.array.length>0&&c.setAttribute("uv",new dt(a.array,a.stride)),o.array.length>0&&c.setAttribute("uv2",new dt(o.array,o.stride)),h.length>0&&c.setAttribute("skinIndex",new dt(h,4)),u.length>0&&c.setAttribute("skinWeight",new dt(u,4)),r.data=c,r.type=e[0].type,r.materialKeys=p,r}function pe(e,t,i,r,n=!1){let s=e.p,a=e.stride,o=e.vcount;function l(e){let t=s[e+i]*u,a=t+u;for(;t<a;t++)r.push(h[t]);if(n){let e=r.length-u-1;$e.setRGB(r[e+0],r[e+1],r[e+2]).convertSRGBToLinear(),r[e+0]=$e.r,r[e+1]=$e.g,r[e+2]=$e.b}}let h=t.array,u=t.stride;if(void 0!==e.vcount){let e=0;for(let t=0,i=o.length;t<i;t++){let i=o[t];if(4===i){let t=e+1*a,i=e+2*a,r=e+3*a;l(e+0*a),l(t),l(r),l(t),l(i),l(r)}else if(3===i){let t=e+1*a,i=e+2*a;l(e+0*a),l(t),l(i)}else if(i>4)for(let t=1,r=i-2;t<=r;t++){let i=e+a*t,r=e+a*(t+1);l(e+0*a),l(i),l(r)}e+=a*i}}else for(let c=0,p=s.length;c<p;c+=a)l(c)}function de(e){return u(it.geometries[e],he)}function fe(e){return void 0!==e.build?e.build:e}function me(e,t){for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"joint":t.joints[r.getAttribute("sid")]=ge(r);break;case"link":t.links.push(ve(r))}}}function ge(e){let t;for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"prismatic":case"revolute":t=ye(r)}}return t}function ye(e){let t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",axis:new D,limits:{min:0,max:0},type:e.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"axis":let e=n(r.textContent);t.axis.fromArray(e);break;case"limits":let i=r.getElementsByTagName("max")[0],s=r.getElementsByTagName("min")[0];t.limits.max=parseFloat(i.textContent),t.limits.min=parseFloat(s.textContent)}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ve(e){let t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"attachment_full":t.attachments.push(Te(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(xe(r))}}return t}function Te(e){let t={joint:e.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"link":t.links.push(ve(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(xe(r))}}return t}function xe(e){let t={type:e.nodeName},i=n(e.textContent);switch(t.type){case"matrix":t.obj=new Be,t.obj.fromArray(i).transpose();break;case"translate":t.obj=new D,t.obj.fromArray(i);break;case"rotate":t.obj=new D,t.obj.fromArray(i),t.angle=fr.degToRad(i[3])}return t}function be(e,t){for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];1===r.nodeType&&"technique_common"===r.nodeName&&Ee(r,t)}}function Ee(e,t){for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"inertia":t.inertia=n(r.textContent);break;case"mass":t.mass=n(r.textContent)[0]}}}function _e(e){let t={target:e.getAttribute("target").split("/").pop()};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];if(1===r.nodeType&&"axis"===r.nodeName){let e=r.getElementsByTagName("param")[0];t.axis=e.textContent;let i=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=i.substring(0,i.length-1)}}return t}function we(e){return void 0!==e.build?e.build:e}function Se(e){let t=[],i=je.querySelector('[id="'+e.id+'"]');for(let r=0;r<i.childNodes.length;r++){let e,s,a=i.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"matrix":e=n(a.textContent);let i=(new Be).fromArray(e).transpose();t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:i});break;case"translate":case"scale":e=n(a.textContent),s=(new D).fromArray(e),t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:s});break;case"rotate":e=n(a.textContent),s=(new D).fromArray(e);let r=fr.degToRad(e[3]);t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:s,angle:r})}}return t}let Me=new Be,Ie=new D;function De(e){let t={name:e.getAttribute("name")||"",type:e.getAttribute("type"),id:e.getAttribute("id"),sid:e.getAttribute("sid"),matrix:new Be,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let i=0;i<e.childNodes.length;i++){let r,s=e.childNodes[i];if(1===s.nodeType)switch(s.nodeName){case"node":t.nodes.push(s.getAttribute("id")),De(s);break;case"instance_camera":t.instanceCameras.push(a(s.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(Ae(s));break;case"instance_light":t.instanceLights.push(a(s.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(Ae(s));break;case"instance_node":t.instanceNodes.push(a(s.getAttribute("url")));break;case"matrix":r=n(s.textContent),t.matrix.multiply(Me.fromArray(r).transpose()),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"translate":r=n(s.textContent),Ie.fromArray(r),t.matrix.multiply(Me.makeTranslation(Ie.x,Ie.y,Ie.z)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"rotate":r=n(s.textContent);let e=fr.degToRad(r[3]);t.matrix.multiply(Me.makeRotationAxis(Ie.fromArray(r),e)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"scale":r=n(s.textContent),t.matrix.scale(Ie.fromArray(r)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"extra":break;default:console.log(s)}}return Fe(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):it.nodes[t.id]=t,t}function Ae(e){let t={id:a(e.getAttribute("url")),materials:{},skeletons:[]};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];switch(r.nodeName){case"bind_material":let e=r.getElementsByTagName("instance_material");for(let i=0;i<e.length;i++){let r=e[i],n=r.getAttribute("symbol"),s=r.getAttribute("target");t.materials[n]=a(s)}break;case"skeleton":t.skeletons.push(a(r.textContent))}}return t}function Re(e,t){let i,r,n,s=[],a=[];for(i=0;i<e.length;i++){let r,n=e[i];if(Fe(n))r=Ue(n),Ce(r,t,s);else if(ze(n)){let e=it.visualScenes[n].children;for(let i=0;i<e.length;i++){let r=e[i];"JOINT"===r.type&&Ce(Ue(r.id),t,s)}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",n)}for(i=0;i<t.length;i++)for(r=0;r<s.length;r++)if(n=s[r],n.bone.name===t[i].name){a[i]=n,n.processed=!0;break}for(i=0;i<s.length;i++)n=s[i],!1===n.processed&&(a.push(n),n.processed=!0);let o=[],l=[];for(i=0;i<a.length;i++)n=a[i],o.push(n.bone),l.push(n.boneInverse);return new Fl(o,l)}function Ce(e,t,i){e.traverse((function(e){if(!0===e.isBone){let r;for(let i=0;i<t.length;i++){let n=t[i];if(n.name===e.name){r=n.boneInverse;break}}void 0===r&&(r=new Be),i.push({bone:e,boneInverse:r,processed:!1})}}))}function Oe(e){let t,i=[],r=e.matrix,n=e.nodes,s=e.type,a=e.instanceCameras,o=e.instanceControllers,l=e.instanceLights,h=e.instanceGeometries,u=e.instanceNodes;for(let c=0,p=n.length;c<p;c++)i.push(Ue(n[c]));for(let c=0,p=a.length;c<p;c++){let e=ee(a[c]);null!==e&&i.push(e.clone())}for(let c=0,p=o.length;c<p;c++){let e=o[c],t=C(e.id),r=Le(de(t.id),e.materials),n=Re(e.skeletons,t.skin.joints);for(let s=0,a=r.length;s<a;s++){let e=r[s];e.isSkinnedMesh&&(e.bind(n,t.skin.bindMatrix),e.normalizeSkinWeights()),i.push(e)}}for(let c=0,p=l.length;c<p;c++){let e=ne(l[c]);null!==e&&i.push(e.clone())}for(let c=0,p=h.length;c<p;c++){let e=h[c],t=Le(de(e.id),e.materials);for(let r=0,n=t.length;r<n;r++)i.push(t[r])}for(let c=0,p=u.length;c<p;c++)i.push(Ue(u[c]).clone());if(0===n.length&&1===i.length)t=i[0];else{t="JOINT"===s?new Ll:new ar;for(let e=0;e<i.length;e++)t.add(i[e])}return t.name="JOINT"===s?e.sid:e.name,t.matrix.copy(r),t.matrix.decompose(t.position,t.quaternion,t.scale),t}let Pe=new Xt({color:16711935});function Ne(e,t){let i=[];for(let r=0,n=e.length;r<n;r++){let n=t[e[r]];void 0===n?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",e[r]),i.push(Pe)):i.push(Z(n))}return i}function Le(e,t){let i=[];for(let r in e){let n=e[r],s=Ne(n.materialKeys,t);if(0===s.length&&("lines"===r||"linestrips"===r?s.push(new br):s.push(new Ws)),"lines"===r||"linestrips"===r)for(let e=0,t=s.length;e<t;e++){let t=s[e];if(!0===t.isMeshPhongMaterial||!0===t.isMeshLambertMaterial){let i=new br;i.color.copy(t.color),i.opacity=t.opacity,i.transparent=t.transparent,s[e]=i}}let a,o=void 0!==n.data.attributes.skinIndex,l=1===s.length?s[0]:s;switch(r){case"lines":a=new Kr(n.data,l);break;case"linestrips":a=new Sr(n.data,l);break;case"triangles":case"polylist":a=o?new Ku(n.data,l):new Je(n.data,l)}i.push(a)}return i}function Fe(e){return void 0!==it.nodes[e]}function Ue(e){return u(it.nodes[e],Oe)}function ke(e){let t=new ar;t.name=e.name;let i=e.children;for(let r=0;r<i.length;r++){let e=i[r];t.add(Ue(e.id))}return t}function ze(e){return void 0!==it.visualScenes[e]}function Ge(e){return u(it.visualScenes[e],ke)}if(0===e.length)return{scene:new wn};let He=(new DOMParser).parseFromString(e,"application/xml"),je=i(He,"COLLADA")[0],We=He.getElementsByTagName("parsererror")[0];if(void 0!==We){let e,t=i(We,"div")[0];return e=t?t.textContent:function(e){let t="",i=[e];for(;i.length;){let e=i.shift();e.nodeType===Node.TEXT_NODE?t+=e.textContent:(t+="\n",i.push.apply(i,e.childNodes))}return t.trim()}(We),console.error("THREE.ColladaLoader: Failed to parse collada file.\n",e),null}let Ye=je.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Ye);let Xe=(Ze=i(je,"asset")[0],{unit:function(e){return void 0!==e&&!0===e.hasAttribute("meter")?parseFloat(e.getAttribute("meter")):1}(i(Ze,"unit")[0]),upAxis:function(e){return void 0!==e?e.textContent:"Y_UP"}(i(Ze,"up_axis")[0])}),qe=new gs(this.manager);var Ze;let Ke;qe.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),a_&&(Ke=new a_(this.manager),Ke.setPath(this.resourcePath||t));let $e=new Ve,Qe=[],et={},tt=0,it={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};l(je,"library_animations","animation",(function e(t){let i={sources:{},samplers:{},channels:{}},r=!1;for(let n=0,s=t.childNodes.length;n<s;n++){let s,a=t.childNodes[n];if(1===a.nodeType)switch(a.nodeName){case"source":s=a.getAttribute("id"),i.sources[s]=se(a);break;case"sampler":s=a.getAttribute("id"),i.samplers[s]=c(a);break;case"channel":s=a.getAttribute("target"),i.channels[s]=p(a);break;case"animation":e(a),r=!0;break;default:console.log(a)}}!1===r&&(it.animations[t.getAttribute("id")||fr.generateUUID()]=i)})),l(je,"library_animation_clips","animation_clip",(function(e){let t={name:e.getAttribute("id")||"default",start:parseFloat(e.getAttribute("start")||0),end:parseFloat(e.getAttribute("end")||0),animations:[]};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"instance_animation"===r.nodeName&&t.animations.push(a(r.getAttribute("url")))}it.clips[e.getAttribute("id")]=t})),l(je,"library_controllers","controller",(function(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"skin":t.id=a(r.getAttribute("source")),t.skin=M(r);break;case"morph":t.id=a(r.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.")}}it.controllers[e.getAttribute("id")]=t})),l(je,"library_images","image",(function(e){let t={init_from:i(e,"init_from")[0].textContent};it.images[e.getAttribute("id")]=t})),l(je,"library_effects","effect",(function(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"profile_COMMON"===r.nodeName&&(t.profile=N(r))}it.effects[e.getAttribute("id")]=t})),l(je,"library_materials","material",(function(e){let t={name:e.getAttribute("name")};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"instance_effect"===r.nodeName&&(t.url=a(r.getAttribute("url")))}it.materials[e.getAttribute("id")]=t})),l(je,"library_cameras","camera",(function(e){let t={name:e.getAttribute("name")};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"optics"===r.nodeName&&(t.optics=J(r))}it.cameras[e.getAttribute("id")]=t})),l(je,"library_lights","light",(function(e){let t={};for(let i=0,r=e.childNodes.length;i<r;i++){let r=e.childNodes[i];1===r.nodeType&&"technique_common"===r.nodeName&&(t=te(r))}it.lights[e.getAttribute("id")]=t})),l(je,"library_geometries","geometry",(function(e){let t={name:e.getAttribute("name"),sources:{},vertices:{},primitives:[]},r=i(e,"mesh")[0];if(void 0!==r){for(let e=0;e<r.childNodes.length;e++){let i=r.childNodes[e];if(1!==i.nodeType)continue;let n=i.getAttribute("id");switch(i.nodeName){case"source":t.sources[n]=se(i);break;case"vertices":t.vertices=ae(i);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",i.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(oe(i));break;default:console.log(i)}}it.geometries[e.getAttribute("id")]=t}})),l(je,"library_nodes","node",De),l(je,"library_visual_scenes","visual_scene",(function(e){let t={name:e.getAttribute("name"),children:[]};!function(e){let t=e.getElementsByTagName("node");for(let i=0;i<t.length;i++){let e=t[i];!1===e.hasAttribute("id")&&e.setAttribute("id","three_default_"+tt++)}}(e);let r=i(e,"node");for(let i=0;i<r.length;i++)t.children.push(De(r[i]));it.visualScenes[e.getAttribute("id")]=t})),l(je,"library_kinematics_models","kinematics_model",(function(e){let t={name:e.getAttribute("name")||"",joints:{},links:[]};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];1===r.nodeType&&"technique_common"===r.nodeName&&me(r,t)}it.kinematicsModels[e.getAttribute("id")]=t})),l(je,"library_physics_models","physics_model",(function(e){let t={name:e.getAttribute("name")||"",rigidBodies:{}};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];1===r.nodeType&&"rigid_body"===r.nodeName&&(t.rigidBodies[r.getAttribute("name")]={},be(r,t.rigidBodies[r.getAttribute("name")]))}it.physicsModels[e.getAttribute("id")]=t})),l(je,"scene","instance_kinematics_scene",(function(e){let t={bindJointAxis:[]};for(let i=0;i<e.childNodes.length;i++){let r=e.childNodes[i];1===r.nodeType&&"bind_joint_axis"===r.nodeName&&t.bindJointAxis.push(_e(r))}it.kinematicsScenes[a(e.getAttribute("url"))]=t})),h(it.animations,d),h(it.clips,w),h(it.controllers,R),h(it.images,O),h(it.effects,X),h(it.materials,q),h(it.cameras,Q),h(it.lights,re),h(it.geometries,he),h(it.visualScenes,ke),function(){let e=it.clips;if(!0===o(e)){if(!1===o(it.animations)){let e=[];for(let t in it.animations){let i=f(t);for(let t=0,r=i.length;t<r;t++)e.push(i[t])}Qe.push(new mo("default",-1,e))}}else for(let t in e)Qe.push(S(t))}(),function(){let e=Object.keys(it.kinematicsModels)[0],t=Object.keys(it.kinematicsScenes)[0],i=Object.keys(it.visualScenes)[0];if(void 0===e||void 0===t)return;let r=function(e){return u(it.kinematicsModels[e],fe)}(e),n=function(e){return u(it.kinematicsScenes[e],we)}(t),s=Ge(i),a=n.bindJointAxis,o={};for(let u=0,c=a.length;u<c;u++){let e=a[u],t=je.querySelector('[sid="'+e.target+'"]');if(t){let i=t.parentElement;l(e.jointIndex,i)}}function l(e,t){let i=t.getAttribute("name"),n=r.joints[e];s.traverse((function(r){r.name===i&&(o[e]={object:r,transforms:Se(t),joint:n,position:n.zeroPosition})}))}let h=new Be;et={joints:r&&r.joints,getJointValue:function(e){let t=o[e];if(t)return t.position;console.warn("THREE.ColladaLoader: Joint "+e+" doesn't exist.")},setJointValue:function(e,t){let i=o[e];if(i){let r=i.joint;if(t>r.limits.max||t<r.limits.min)console.warn("THREE.ColladaLoader: Joint "+e+" value "+t+" outside of limits (min: "+r.limits.min+", max: "+r.limits.max+").");else if(r.static)console.warn("THREE.ColladaLoader: Joint "+e+" is static.");else{let n=i.object,s=r.axis,a=i.transforms;Me.identity();for(let i=0;i<a.length;i++){let n=a[i];if(n.sid&&-1!==n.sid.indexOf(e))switch(r.type){case"revolute":Me.multiply(h.makeRotationAxis(s,fr.degToRad(t)));break;case"prismatic":Me.multiply(h.makeTranslation(s.x*t,s.y*t,s.z*t));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+r.type)}else switch(n.type){case"matrix":Me.multiply(n.obj);break;case"translate":Me.multiply(h.makeTranslation(n.obj.x,n.obj.y,n.obj.z));break;case"scale":Me.scale(n.obj);break;case"rotate":Me.multiply(h.makeRotationAxis(n.obj,n.angle))}}n.matrix.copy(Me),n.matrix.decompose(n.position,n.quaternion,n.scale),o[e].position=t}}else console.log("THREE.ColladaLoader: "+e+" does not exist.")}}}();let rt=function(e){return Ge(a(i(e,"instance_visual_scene")[0].getAttribute("url")))}(i(je,"scene")[0]);return rt.animations=Qe,"Z_UP"===Xe.upAxis&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),rt.rotation.set(-Math.PI/2,0,0)),rt.scale.multiplyScalar(Xe.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Qe},kinematics:et,library:it,scene:rt}}},OG=new WeakMap,sO=class extends pi{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){let n=new di(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,(e=>{this.decodeDracoFile(e,t).catch(r)}),i,r)}decodeDracoFile(e,t,i,r){let n={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};return this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){let i=JSON.stringify(t);if(OG.has(e)){let t=OG.get(e);if(t.key===i)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r,n=this.workerNextTaskID++,s=e.byteLength,a=this._getWorker(n,s).then((i=>(r=i,new Promise(((i,s)=>{r._callbacks[n]={resolve:i,reject:s},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return a.catch((()=>!0)).then((()=>{r&&n&&this._releaseTask(r,n)})),OG.set(e,{key:i,promise:a}),a}_createGeometry(e){let t=new ot;e.index&&t.setIndex(new Wt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){let r=e.attributes[i],n=r.name,s=r.array,a=r.itemSize;t.setAttribute(n,new Wt(s,a))}return t}_loadLibrary(e,t){let i=new di(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{i.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{let i=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=eIt.toString(),n=["/* draco decoder */",i,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let i=t.data;switch(i.type){case"decode":e._callbacks[i.id].resolve(i);break;case"error":e._callbacks[i.id].reject(i);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+i.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));let i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}};function eIt(){let e,t;function i(e,t,i,r,n,s){let a=s.num_components(),o=i.num_points()*a,l=o*n.BYTES_PER_ELEMENT,h=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,n),u=e._malloc(l);t.GetAttributeDataArrayForAllPoints(i,s,h,l,u);let c=new n(e.HEAPF32.buffer,u,o).slice();return e._free(u),{name:r,array:c,itemSize:a}}onmessage=function(r){let n=r.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":let r=n.buffer,s=n.taskConfig;t.then((e=>{let t=e.draco,a=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(r),r.byteLength);try{let e=function(e,t,r,n){let s,a,o=n.attributeIDs,l=n.attributeTypes,h=t.GetEncodedGeometryType(r);if(h===e.TRIANGULAR_MESH)s=new e.Mesh,a=t.DecodeBufferToMesh(r,s);else{if(h!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");s=new e.PointCloud,a=t.DecodeBufferToPointCloud(r,s)}if(!a.ok()||0===s.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());let u={index:null,attributes:[]};for(let c in o){let r,a,h=self[l[c]];if(n.useUniqueIDs)a=o[c],r=t.GetAttributeByUniqueId(s,a);else{if(a=t.GetAttributeId(s,e[o[c]]),-1===a)continue;r=t.GetAttribute(s,a)}u.attributes.push(i(e,t,s,c,h,r))}return h===e.TRIANGULAR_MESH&&(u.index=function(e,t,i){let r=3*i.num_faces(),n=4*r,s=e._malloc(n);t.GetTrianglesUInt32Array(i,n,s);let a=new Uint32Array(e.HEAPF32.buffer,s,r).slice();return e._free(s),{array:a,itemSize:1}}(e,t,s)),e.destroy(s),u}(t,a,o,s),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(o),t.destroy(a)}}))}}}var vge=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},tIt=function(e){return new Worker(e)};try{URL.revokeObjectURL(vge(""))}catch(e){vge=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},tIt=function(e){return new Worker(e,{type:"module"})}}var ec=Uint8Array,Wf=Uint16Array,LG=Uint32Array,yge=new ec([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ege=new ec([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rIt=new ec([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tge=function(e,t){for(var i=new Wf(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var n=new LG(i[30]);for(r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)n[s]=s-i[r]<<5|r;return[i,n]},bge=Tge(yge,2),xge=bge[0],iIt=bge[1];xge[28]=258,iIt[258]=28;var Ige=Tge(Ege,0),nIt=Ige[0],rpr=Ige[1],FG=new Wf(32768);for(ji=0;ji<32768;++ji)ed=(61680&(ed=(52428&(ed=(43690&ji)>>>1|(21845&ji)<<1))>>>2|(13107&ed)<<2))>>>4|(3855&ed)<<4,FG[ji]=((65280&ed)>>>8|(255&ed)<<8)>>>1;var ed,o_=function(e,t,i){for(var r=e.length,n=0,s=new Wf(t);n<r;++n)++s[e[n]-1];var a,o=new Wf(t);for(n=0;n<t;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new Wf(1<<t);var l=15-t;for(n=0;n<r;++n)if(e[n])for(var h=n<<4|e[n],u=t-e[n],c=o[e[n]-1]++<<u,p=c|(1<<u)-1;c<=p;++c)a[FG[c]>>>l]=h}else for(a=new Wf(r),n=0;n<r;++n)e[n]&&(a[n]=FG[o[e[n]-1]++]>>>15-e[n]);return a},l_=new ec(288);for(ji=0;ji<144;++ji)l_[ji]=8;for(ji=144;ji<256;++ji)l_[ji]=9;for(ji=256;ji<280;++ji)l_[ji]=7;for(ji=280;ji<288;++ji)l_[ji]=8;var ji,_ge=new ec(32);for(ji=0;ji<32;++ji)_ge[ji]=5;var sIt=o_(l_,9,1),aIt=o_(_ge,5,1),PG=function(e){for(var t=e[0],i=1;i<e.length;++i)e[i]>t&&(t=e[i]);return t},Qc=function(e,t,i){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&i},NG=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},oIt=function(e){return(e/8|0)+(7&e&&1)},lIt=function(e,t,i){(null==t||t<0)&&(t=0),(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof Wf?Wf:e instanceof LG?LG:ec)(i-t);return r.set(e.subarray(t,i)),r},cIt=function(e,t,i){var r=e.length;if(!r||i&&!i.l&&r<5)return t||new ec(0);var n=!t||i,s=!i||i.i;i||(i={}),t||(t=new ec(3*r));var a=function(e){var i=t.length;if(e>i){var r=new ec(Math.max(2*i,e));r.set(t),t=r}},o=i.f||0,l=i.p||0,h=i.b||0,u=i.l,c=i.d,p=i.m,d=i.n,f=8*r;do{if(!u){i.f=o=Qc(e,l,1);var m=Qc(e,l+1,3);if(l+=3,!m){var g=e[(I=oIt(l)+4)-4]|e[I-3]<<8,y=I+g;if(y>r){if(s)throw"unexpected EOF";break}n&&a(h+g),t.set(e.subarray(I,y),h),i.b=h+=g,i.p=l=8*y;continue}if(1==m)u=sIt,c=aIt,p=9,d=5;else{if(2!=m)throw"invalid block type";var v=Qc(e,l,31)+257,T=Qc(e,l+10,15)+4,x=v+Qc(e,l+5,31)+1;l+=14;for(var b=new ec(x),E=new ec(19),_=0;_<T;++_)E[rIt[_]]=Qc(e,l+3*_,7);l+=3*T;var w=PG(E),S=(1<<w)-1,M=o_(E,w,1);for(_=0;_<x;){var I,D=M[Qc(e,l,S)];if(l+=15&D,(I=D>>>4)<16)b[_++]=I;else{var A=0,R=0;for(16==I?(R=3+Qc(e,l,3),l+=2,A=b[_-1]):17==I?(R=3+Qc(e,l,7),l+=3):18==I&&(R=11+Qc(e,l,127),l+=7);R--;)b[_++]=A}}var C=b.subarray(0,v),O=b.subarray(v);p=PG(C),d=PG(O),u=o_(C,p,1),c=o_(O,d,1)}if(l>f){if(s)throw"unexpected EOF";break}}n&&a(h+131072);for(var P=(1<<p)-1,N=(1<<d)-1,L=l;;L=l){var F=(A=u[NG(e,l)&P])>>>4;if((l+=15&A)>f){if(s)throw"unexpected EOF";break}if(!A)throw"invalid length/literal";if(F<256)t[h++]=F;else{if(256==F){L=l,u=null;break}var U=F-254;if(F>264){var k=yge[_=F-257];U=Qc(e,l,(1<<k)-1)+xge[_],l+=k}var B=c[NG(e,l)&N],z=B>>>4;if(!B)throw"invalid distance";if(l+=15&B,O=nIt[z],z>3&&(k=Ege[z],O+=NG(e,l)&(1<<k)-1,l+=k),l>f){if(s)throw"unexpected EOF";break}n&&a(h+131072);for(var G=h+U;h<G;h+=4)t[h]=t[h-O],t[h+1]=t[h+1-O],t[h+2]=t[h+2-O],t[h+3]=t[h+3-O];h=G}}i.l=u,i.p=L,i.b=h,u&&(o=1,i.m=p,i.d=c,i.n=d)}while(!o);return h==t.length?t:lIt(t,0,h)},uIt=new ec(0),hIt=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function Sge(e,t){return cIt((hIt(e),e.subarray(2,-4)),t)}var pIt="undefined"!=typeof TextDecoder&&new TextDecoder,dIt=0;try{pIt.decode(uIt,{stream:!0}),dIt=1}catch(e){}function wge(e,t,i){let r=i.length-e-1;if(t>=i[r])return r-1;if(t<=i[e])return e;let n=e,s=r,a=Math.floor((n+s)/2);for(;t<i[a]||t>=i[a+1];)t<i[a]?s=a:n=a,a=Math.floor((n+s)/2);return a}function mIt(e,t,i,r){let n=[],s=[],a=[];n[0]=1;for(let o=1;o<=i;++o){s[o]=t-r[e+1-o],a[o]=r[e+o]-t;let i=0;for(let e=0;e<o;++e){let t=a[e+1],r=s[o-e],l=n[e]/(t+r);n[e]=i+t*l,i=r*l}n[o]=i}return n}function Rge(e,t,i,r){let n=wge(e,r,t),s=mIt(n,r,e,t),a=new jr(0,0,0,0);for(let o=0;o<=e;++o){let t=i[n-e+o],r=s[o],l=t.w*r;a.x+=t.x*l,a.y+=t.y*l,a.z+=t.z*l,a.w+=t.w*r}return a}function gIt(e,t,i,r,n){let s=[];for(let c=0;c<=i;++c)s[c]=0;let a=[];for(let c=0;c<=r;++c)a[c]=s.slice(0);let o=[];for(let c=0;c<=i;++c)o[c]=s.slice(0);o[0][0]=1;let l=s.slice(0),h=s.slice(0);for(let c=1;c<=i;++c){l[c]=t-n[e+1-c],h[c]=n[e+c]-t;let i=0;for(let e=0;e<c;++e){let t=h[e+1],r=l[c-e];o[c][e]=t+r;let n=o[e][c-1]/o[c][e];o[e][c]=i+t*n,i=r*n}o[c][c]=i}for(let c=0;c<=i;++c)a[0][c]=o[c][i];for(let c=0;c<=i;++c){let e=0,t=1,n=[];for(let r=0;r<=i;++r)n[r]=s.slice(0);n[0][0]=1;for(let s=1;s<=r;++s){let r=0,l=c-s,h=i-s;c>=s&&(n[t][0]=n[e][0]/o[h+1][l],r=n[t][0]*o[l][h]);let u=c-1<=h?s-1:i-c;for(let i=l>=-1?1:-l;i<=u;++i)n[t][i]=(n[e][i]-n[e][i-1])/o[h+1][l+i],r+=n[t][i]*o[l+i][h];c<=h&&(n[t][s]=-n[e][s-1]/o[h+1][c],r+=n[t][s]*o[c][h]),a[s][c]=r;let p=e;e=t,t=p}}let u=i;for(let c=1;c<=r;++c){for(let e=0;e<=i;++e)a[c][e]*=u;u*=i-c}return a}function vIt(e,t,i,r,n){let s=n<e?n:e,a=[],o=wge(e,r,t),l=gIt(o,r,e,s,t),h=[];for(let u=0;u<i.length;++u){let e=i[u].clone(),t=e.w;e.x*=t,e.y*=t,e.z*=t,h[u]=e}for(let u=0;u<=s;++u){let t=h[o-e].clone().multiplyScalar(l[u][0]);for(let i=1;i<=e;++i)t.add(h[o-e+i].clone().multiplyScalar(l[u][i]));a[u]=t}for(let u=s+1;u<=n+1;++u)a[u]=new jr(0,0,0);return a}function yIt(e,t){let i=1;for(let n=2;n<=e;++n)i*=n;let r=1;for(let n=2;n<=t;++n)r*=n;for(let n=2;n<=e-t;++n)r*=n;return i/r}function EIt(e){let t=e.length,i=[],r=[];for(let s=0;s<t;++s){let t=e[s];i[s]=new D(t.x,t.y,t.z),r[s]=t.w}let n=[];for(let s=0;s<t;++s){let e=i[s].clone();for(let t=1;t<=s;++t)e.sub(n[s-t].clone().multiplyScalar(yIt(s,t)*r[t]));n[s]=e.divideScalar(r[0])}return n}function Mge(e,t,i,r,n){return EIt(vIt(e,t,i,r,n))}var mi,os,So,aO=class extends Ua{constructor(e,t,i,r,n){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=r||0,this.endKnot=n||this.knots.length-1;for(let s=0;s<i.length;++s){let e=i[s];this.controlPoints[s]=new jr(e.x,e.y,e.z,e.w)}}getPoint(e,t=new D){let i=t,r=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),n=Rge(this.degree,this.knots,this.controlPoints,r);return 1!==n.w&&n.divideScalar(n.w),i.set(n.x,n.y,n.z)}getTangent(e,t=new D){let i=t,r=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),n=Mge(this.degree,this.knots,this.controlPoints,r,1);return i.copy(n[1]).normalize(),i}},lO=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=""===n.path?qs.extractUrlBase(e):n.path,a=new di(this.manager);a.setPath(n.path),a.setResponseType("arraybuffer"),a.setRequestHeader(n.requestHeader),a.setWithCredentials(n.withCredentials),a.load(e,(function(i){try{t(n.parse(i,s))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}parse(e,t){if(bIt(e))mi=(new zG).parse(e);else{let t=Pge(e);if(!xIt(t))throw new Error("THREE.FBXLoader: Unknown format.");if(Dge(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Dge(t));mi=(new VG).parse(t)}let i=new gs(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new BG(i,this.manager).parse(mi)}},BG=class{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){os=this.parseConnections();let e=this.parseImages(),t=this.parseTextures(e),i=this.parseMaterials(t),r=this.parseDeformers(),n=(new kG).parse(r);return this.parseScene(r,n,i),So}parseConnections(){let e=new Map;return"Connections"in mi&&mi.Connections.connections.forEach((function(t){let i=t[0],r=t[1],n=t[2];e.has(i)||e.set(i,{parents:[],children:[]});let s={ID:r,relationship:n};e.get(i).parents.push(s),e.has(r)||e.set(r,{parents:[],children:[]});let a={ID:i,relationship:n};e.get(r).children.push(a)})),e}parseImages(){let e={},t={};if("Video"in mi.Objects){let i=mi.Objects.Video;for(let r in i){let n=i[r];if(e[parseInt(r)]=n.RelativeFilename||n.Filename,"Content"in n){let e=n.Content instanceof ArrayBuffer&&n.Content.byteLength>0,s="string"==typeof n.Content&&""!==n.Content;if(e||s){let e=this.parseImage(i[r]);t[n.RelativeFilename||n.Filename]=e}}}}for(let i in e){let r=e[i];void 0!==t[r]?e[i]=t[r]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){let t,i=e.Content,r=e.RelativeFilename||e.Filename,n=r.slice(r.lastIndexOf(".")+1).toLowerCase();switch(n){case"bmp":t="image/bmp";break;case"jpg":case"jpeg":t="image/jpeg";break;case"png":t="image/png";break;case"tif":t="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",r),t="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+n+'" is not supported.')}if("string"==typeof i)return"data:"+t+";base64,"+i;{let e=new Uint8Array(i);return window.URL.createObjectURL(new Blob([e],{type:t}))}}parseTextures(e){let t=new Map;if("Texture"in mi.Objects){let i=mi.Objects.Texture;for(let r in i){let n=this.parseTexture(i[r],e);t.set(parseInt(r),n)}}return t}parseTexture(e,t){let i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;let r=e.WrapModeU,n=e.WrapModeV,s=void 0!==r?r.value:0,a=void 0!==n?n.value:0;if(i.wrapS=0===s?yn:vn,i.wrapT=0===a?yn:vn,"Scaling"in e){let t=e.Scaling.value;i.repeat.x=t[0],i.repeat.y=t[1]}if("Translation"in e){let t=e.Translation.value;i.offset.x=t[0],i.offset.y=t[1]}return i}loadTexture(e,t){let i,r=this.textureLoader.path,n=os.get(e.id).children;void 0!==n&&n.length>0&&void 0!==t[n[0].ID]&&(i=t[n[0].ID],(0===i.indexOf("blob:")||0===i.indexOf("data:"))&&this.textureLoader.setPath(void 0));let s,a=e.FileName.slice(-3).toLowerCase();if("tga"===a){let t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),s=new Pi):(t.setPath(this.textureLoader.path),s=t.load(i))}else"psd"===a?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),s=new Pi):s=this.textureLoader.load(i);return this.textureLoader.setPath(r),s}parseMaterials(e){let t=new Map;if("Material"in mi.Objects){let i=mi.Objects.Material;for(let r in i){let n=this.parseMaterial(i[r],e);null!==n&&t.set(parseInt(r),n)}}return t}parseMaterial(e,t){let i=e.id,r=e.attrName,n=e.ShadingModel;if("object"==typeof n&&(n=n.value),!os.has(i))return null;let s,a=this.parseParameters(e,t,i);switch(n.toLowerCase()){case"phong":s=new Ws;break;case"lambert":s=new Bl;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',n),s=new Ws}return s.setValues(a),s.name=r,s}parseParameters(e,t,i){let r={};e.BumpFactor&&(r.bumpScale=e.BumpFactor.value),e.Diffuse?r.color=(new Ve).fromArray(e.Diffuse.value):e.DiffuseColor&&("Color"===e.DiffuseColor.type||"ColorRGB"===e.DiffuseColor.type)&&(r.color=(new Ve).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(r.displacementScale=e.DisplacementFactor.value),e.Emissive?r.emissive=(new Ve).fromArray(e.Emissive.value):e.EmissiveColor&&("Color"===e.EmissiveColor.type||"ColorRGB"===e.EmissiveColor.type)&&(r.emissive=(new Ve).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(r.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(r.opacity=parseFloat(e.Opacity.value)),r.opacity<1&&(r.transparent=!0),e.ReflectionFactor&&(r.reflectivity=e.ReflectionFactor.value),e.Shininess&&(r.shininess=e.Shininess.value),e.Specular?r.specular=(new Ve).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(r.specular=(new Ve).fromArray(e.SpecularColor.value));let n=this;return os.get(i).children.forEach((function(e){let i=e.relationship;switch(i){case"Bump":r.bumpMap=n.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":r.aoMap=n.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":r.map=n.getTexture(t,e.ID),void 0!==r.map&&(r.map.encoding=yr);break;case"DisplacementColor":r.displacementMap=n.getTexture(t,e.ID);break;case"EmissiveColor":r.emissiveMap=n.getTexture(t,e.ID),void 0!==r.emissiveMap&&(r.emissiveMap.encoding=yr);break;case"NormalMap":case"Maya|TEX_normal_map":r.normalMap=n.getTexture(t,e.ID);break;case"ReflectionColor":r.envMap=n.getTexture(t,e.ID),void 0!==r.envMap&&(r.envMap.mapping=Sg,r.envMap.encoding=yr);break;case"SpecularColor":r.specularMap=n.getTexture(t,e.ID),void 0!==r.specularMap&&(r.specularMap.encoding=yr);break;case"TransparentColor":case"TransparencyFactor":r.alphaMap=n.getTexture(t,e.ID),r.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",i)}})),r}getTexture(e,t){return"LayeredTexture"in mi.Objects&&t in mi.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=os.get(t).children[0].ID),e.get(t)}parseDeformers(){let e={},t={};if("Deformer"in mi.Objects){let i=mi.Objects.Deformer;for(let r in i){let n=i[r],s=os.get(parseInt(r));if("Skin"===n.attrType){let t=this.parseSkeleton(s,i);t.ID=r,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=s.parents[0].ID,e[r]=t}else if("BlendShape"===n.attrType){let e={id:r};e.rawTargets=this.parseMorphTargets(s,i),e.id=r,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[r]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){let i=[];return e.children.forEach((function(e){let r=t[e.ID];if("Cluster"!==r.attrType)return;let n={ID:e.ID,indices:[],weights:[],transformLink:(new Be).fromArray(r.TransformLink.a)};"Indexes"in r&&(n.indices=r.Indexes.a,n.weights=r.Weights.a),i.push(n)})),{rawBones:i,bones:[]}}parseMorphTargets(e,t){let i=[];for(let r=0;r<e.children.length;r++){let n=e.children[r],s=t[n.ID],a={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a};if("BlendShapeChannel"!==s.attrType)return;a.geoID=os.get(parseInt(n.ID)).children.filter((function(e){return void 0===e.relationship}))[0].ID,i.push(a)}return i}parseScene(e,t,i){So=new ar;let r=this.parseModels(e.skeletons,t,i),n=mi.Objects.Model,s=this;r.forEach((function(e){let t=n[e.ID];s.setLookAtProperties(e,t),os.get(e.ID).parents.forEach((function(t){let i=r.get(t.ID);void 0!==i&&i.add(e)})),null===e.parent&&So.add(e)})),this.bindSkeleton(e.skeletons,t,r),this.createAmbientLight(),So.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);let t=Age(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));let a=(new GG).parse();1===So.children.length&&So.children[0].isGroup&&(So.children[0].animations=a,So=So.children[0]),So.animations=a}parseModels(e,t,i){let r=new Map,n=mi.Objects.Model;for(let s in n){let a=parseInt(s),o=n[s],l=os.get(a),h=this.buildSkeleton(l,e,a,o.attrName);if(!h){switch(o.attrType){case"Camera":h=this.createCamera(l);break;case"Light":h=this.createLight(l);break;case"Mesh":h=this.createMesh(l,t,i);break;case"NurbsCurve":h=this.createCurve(l,t);break;case"LimbNode":case"Root":h=new Ll;break;default:h=new ar}h.name=o.attrName?Cr.sanitizeNodeName(o.attrName):"",h.ID=a}this.getTransformData(h,o),r.set(a,h)}return r}buildSkeleton(e,t,i,r){let n=null;return e.parents.forEach((function(e){for(let s in t){let a=t[s];a.rawBones.forEach((function(t,s){if(t.ID===e.ID){let e=n;n=new Ll,n.matrixWorld.copy(t.transformLink),n.name=r?Cr.sanitizeNodeName(r):"",n.ID=i,a.bones[s]=n,null!==e&&n.add(e)}}))}})),n}createCamera(e){let t,i;if(e.children.forEach((function(e){let t=mi.Objects.NodeAttribute[e.ID];void 0!==t&&(i=t)})),void 0===i)t=new qt;else{let e=0;void 0!==i.CameraProjectionType&&1===i.CameraProjectionType.value&&(e=1);let r=1;void 0!==i.NearPlane&&(r=i.NearPlane.value/1e3);let n=1e3;void 0!==i.FarPlane&&(n=i.FarPlane.value/1e3);let s=window.innerWidth,a=window.innerHeight;void 0!==i.AspectWidth&&void 0!==i.AspectHeight&&(s=i.AspectWidth.value,a=i.AspectHeight.value);let o=s/a,l=45;void 0!==i.FieldOfView&&(l=i.FieldOfView.value);let h=i.FocalLength?i.FocalLength.value:null;switch(e){case 0:t=new Vr(l,o,r,n),null!==h&&t.setFocalLength(h);break;case 1:t=new Ni(-s/2,s/2,a/2,-a/2,r,n);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new qt}}return t}createLight(e){let t,i;if(e.children.forEach((function(e){let t=mi.Objects.NodeAttribute[e.ID];void 0!==t&&(i=t)})),void 0===i)t=new qt;else{let e;e=void 0===i.LightType?0:i.LightType.value;let r=16777215;void 0!==i.Color&&(r=(new Ve).fromArray(i.Color.value));let n=void 0===i.Intensity?1:i.Intensity.value/100;void 0!==i.CastLightOnObject&&0===i.CastLightOnObject.value&&(n=0);let s=0;void 0!==i.FarAttenuationEnd&&(s=void 0!==i.EnableFarAttenuation&&0===i.EnableFarAttenuation.value?0:i.FarAttenuationEnd.value);let a=1;switch(e){case 0:t=new zc(r,n,s,a);break;case 1:t=new Ns(r,n);break;case 2:let e=Math.PI/3;void 0!==i.InnerAngle&&(e=fr.degToRad(i.InnerAngle.value));let o=0;void 0!==i.OuterAngle&&(o=fr.degToRad(i.OuterAngle.value),o=Math.max(o,1)),t=new th(r,n,s,e,o,a);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),t=new zc(r,n)}void 0!==i.CastShadows&&1===i.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,i){let r,n=null,s=null,a=[];return e.children.forEach((function(e){t.has(e.ID)&&(n=t.get(e.ID)),i.has(e.ID)&&a.push(i.get(e.ID))})),a.length>1?s=a:a.length>0?s=a[0]:(s=new Ws({color:13421772}),a.push(s)),"color"in n.attributes&&a.forEach((function(e){e.vertexColors=!0})),n.FBX_Deformer?(r=new Ku(n,s),r.normalizeSkinWeights()):r=new Je(n,s),r}createCurve(e,t){let i=e.children.reduce((function(e,i){return t.has(i.ID)&&(e=t.get(i.ID)),e}),null),r=new br({color:3342591,linewidth:1});return new Sr(i,r)}getTransformData(e,t){let i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),i.eulerOrder="RotationOrder"in t?Oge(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&os.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){let i=mi.Objects.Model[t.ID];if("Lcl_Translation"in i){let t=i.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),So.add(e.target)):e.lookAt((new D).fromArray(t))}}}))}bindSkeleton(e,t,i){let r=this.parsePoseNodes();for(let n in e){let s=e[n];os.get(parseInt(s.ID)).parents.forEach((function(e){if(t.has(e.ID)){let t=e.ID;os.get(t).parents.forEach((function(e){i.has(e.ID)&&i.get(e.ID).bind(new Fl(s.bones),r[e.ID])}))}}))}}parsePoseNodes(){let e={};if("Pose"in mi.Objects){let t=mi.Objects.Pose;for(let i in t)if("BindPose"===t[i].attrType&&t[i].NbPoseNodes>0){let r=t[i].PoseNode;Array.isArray(r)?r.forEach((function(t){e[t.Node]=(new Be).fromArray(t.Matrix.a)})):e[r.Node]=(new Be).fromArray(r.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in mi&&"AmbientColor"in mi.GlobalSettings){let e=mi.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],r=e[2];if(0!==t||0!==i||0!==r){let e=new Ve(t,i,r);So.add(new Gl(e,1))}}}},kG=class{constructor(){this.negativeMaterialIndices=!1}parse(e){let t=new Map;if("Geometry"in mi.Objects){let i=mi.Objects.Geometry;for(let r in i){let n=os.get(parseInt(r)),s=this.parseGeometry(n,i[r],e);t.set(parseInt(r),s)}}return!0===this.negativeMaterialIndices&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){let r=i.skeletons,n=[],s=e.parents.map((function(e){return mi.Objects.Model[e.ID]}));if(0===s.length)return;let a=e.children.reduce((function(e,t){return void 0!==r[t.ID]&&(e=r[t.ID]),e}),null);e.children.forEach((function(e){void 0!==i.morphTargets[e.ID]&&n.push(i.morphTargets[e.ID])}));let o=s[0],l={};"RotationOrder"in o&&(l.eulerOrder=Oge(o.RotationOrder.value)),"InheritType"in o&&(l.inheritType=parseInt(o.InheritType.value)),"GeometricTranslation"in o&&(l.translation=o.GeometricTranslation.value),"GeometricRotation"in o&&(l.rotation=o.GeometricRotation.value),"GeometricScaling"in o&&(l.scale=o.GeometricScaling.value);let h=Age(l);return this.genGeometry(t,a,n,h)}genGeometry(e,t,i,r){let n=new ot;e.attrName&&(n.name=e.attrName);let s=this.parseGeoNode(e,t),a=this.genBuffers(s),o=new dt(a.vertex,3);if(o.applyMatrix4(r),n.setAttribute("position",o),a.colors.length>0&&n.setAttribute("color",new dt(a.colors,3)),t&&(n.setAttribute("skinIndex",new wg(a.weightsIndices,4)),n.setAttribute("skinWeight",new dt(a.vertexWeights,4)),n.FBX_Deformer=t),a.normal.length>0){let e=(new Ui).getNormalMatrix(r),t=new dt(a.normal,3);t.applyNormalMatrix(e),n.setAttribute("normal",t)}if(a.uvs.forEach((function(e,t){let i="uv"+(t+1).toString();0===t&&(i="uv"),n.setAttribute(i,new dt(a.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){let e=a.materialIndex[0],t=0;if(a.materialIndex.forEach((function(i,r){i!==e&&(n.addGroup(t,r-t,e),e=i,t=r)})),n.groups.length>0){let t=n.groups[n.groups.length-1],i=t.start+t.count;i!==a.materialIndex.length&&n.addGroup(i,a.materialIndex.length-i,e)}0===n.groups.length&&n.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(n,e,i,r),n}parseGeoNode(e,t){let i={};if(i.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],i.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return i.weightTable={},null!==t&&(i.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(r,n){void 0===i.weightTable[r]&&(i.weightTable[r]=[]),i.weightTable[r].push({id:t,weight:e.weights[n]})}))}))),i}genBuffers(e){let t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,r=0,n=!1,s=[],a=[],o=[],l=[],h=[],u=[],c=this;return e.vertexIndices.forEach((function(p,d){let f,m=!1;p<0&&(p^=-1,m=!0);let g=[],y=[];if(s.push(3*p,3*p+1,3*p+2),e.color){let t=oO(d,i,p,e.color);o.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[p]&&e.weightTable[p].forEach((function(e){y.push(e.weight),g.push(e.id)})),y.length>4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);let e=[0,0,0,0],t=[0,0,0,0];y.forEach((function(i,r){let n=i,s=g[r];t.forEach((function(t,i,r){if(n>t){r[i]=n,n=t;let a=e[i];e[i]=s,s=a}}))})),g=e,y=t}for(;y.length<4;)y.push(0),g.push(0);for(let e=0;e<4;++e)h.push(y[e]),u.push(g[e])}if(e.normal){let t=oO(d,i,p,e.normal);a.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(f=oO(d,i,p,e.material)[0],f<0&&(c.negativeMaterialIndices=!0,f=0)),e.uv&&e.uv.forEach((function(e,t){let r=oO(d,i,p,e);void 0===l[t]&&(l[t]=[]),l[t].push(r[0]),l[t].push(r[1])})),r++,m&&(r>4&&console.warn("THREE.FBXLoader: Polygons with more than four sides are not supported. Make sure to triangulate the geometry during export."),c.genFace(t,e,s,f,a,o,l,h,u,r),i++,r=0,s=[],a=[],o=[],l=[],h=[],u=[])})),t}genFace(e,t,i,r,n,s,a,o,l,h){for(let u=2;u<h;u++)e.vertex.push(t.vertexPositions[i[0]]),e.vertex.push(t.vertexPositions[i[1]]),e.vertex.push(t.vertexPositions[i[2]]),e.vertex.push(t.vertexPositions[i[3*(u-1)]]),e.vertex.push(t.vertexPositions[i[3*(u-1)+1]]),e.vertex.push(t.vertexPositions[i[3*(u-1)+2]]),e.vertex.push(t.vertexPositions[i[3*u]]),e.vertex.push(t.vertexPositions[i[3*u+1]]),e.vertex.push(t.vertexPositions[i[3*u+2]]),t.skeleton&&(e.vertexWeights.push(o[0]),e.vertexWeights.push(o[1]),e.vertexWeights.push(o[2]),e.vertexWeights.push(o[3]),e.vertexWeights.push(o[4*(u-1)]),e.vertexWeights.push(o[4*(u-1)+1]),e.vertexWeights.push(o[4*(u-1)+2]),e.vertexWeights.push(o[4*(u-1)+3]),e.vertexWeights.push(o[4*u]),e.vertexWeights.push(o[4*u+1]),e.vertexWeights.push(o[4*u+2]),e.vertexWeights.push(o[4*u+3]),e.weightsIndices.push(l[0]),e.weightsIndices.push(l[1]),e.weightsIndices.push(l[2]),e.weightsIndices.push(l[3]),e.weightsIndices.push(l[4*(u-1)]),e.weightsIndices.push(l[4*(u-1)+1]),e.weightsIndices.push(l[4*(u-1)+2]),e.weightsIndices.push(l[4*(u-1)+3]),e.weightsIndices.push(l[4*u]),e.weightsIndices.push(l[4*u+1]),e.weightsIndices.push(l[4*u+2]),e.weightsIndices.push(l[4*u+3])),t.color&&(e.colors.push(s[0]),e.colors.push(s[1]),e.colors.push(s[2]),e.colors.push(s[3*(u-1)]),e.colors.push(s[3*(u-1)+1]),e.colors.push(s[3*(u-1)+2]),e.colors.push(s[3*u]),e.colors.push(s[3*u+1]),e.colors.push(s[3*u+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(r),e.materialIndex.push(r),e.materialIndex.push(r)),t.normal&&(e.normal.push(n[0]),e.normal.push(n[1]),e.normal.push(n[2]),e.normal.push(n[3*(u-1)]),e.normal.push(n[3*(u-1)+1]),e.normal.push(n[3*(u-1)+2]),e.normal.push(n[3*u]),e.normal.push(n[3*u+1]),e.normal.push(n[3*u+2])),t.uv&&t.uv.forEach((function(t,i){void 0===e.uvs[i]&&(e.uvs[i]=[]),e.uvs[i].push(a[i][0]),e.uvs[i].push(a[i][1]),e.uvs[i].push(a[i][2*(u-1)]),e.uvs[i].push(a[i][2*(u-1)+1]),e.uvs[i].push(a[i][2*u]),e.uvs[i].push(a[i][2*u+1])}))}addMorphTargets(e,t,i,r){if(0===i.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];let n=this;i.forEach((function(i){i.rawTargets.forEach((function(i){let s=mi.Objects.Geometry[i.geoID];void 0!==s&&n.genMorphGeometry(e,t,s,r,i.name)}))}))}genMorphGeometry(e,t,i,r,n){let s=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],a=void 0!==i.Vertices?i.Vertices.a:[],o=void 0!==i.Indexes?i.Indexes.a:[],l=3*e.attributes.position.count,h=new Float32Array(l);for(let d=0;d<o.length;d++){let e=3*o[d];h[e]=a[3*d],h[e+1]=a[3*d+1],h[e+2]=a[3*d+2]}let u={vertexIndices:s,vertexPositions:h},c=this.genBuffers(u),p=new dt(c.vertex,3);p.name=n||i.attrName,p.applyMatrix4(r),e.morphAttributes.position.push(p)}parseNormals(e){let t=e.MappingInformationType,i=e.ReferenceInformationType,r=e.Normals.a,n=[];return"IndexToDirect"===i&&("NormalIndex"in e?n=e.NormalIndex.a:"NormalsIndex"in e&&(n=e.NormalsIndex.a)),{dataSize:3,buffer:r,indices:n,mappingType:t,referenceType:i}}parseUVs(e){let t=e.MappingInformationType,i=e.ReferenceInformationType,r=e.UV.a,n=[];return"IndexToDirect"===i&&(n=e.UVIndex.a),{dataSize:2,buffer:r,indices:n,mappingType:t,referenceType:i}}parseVertexColors(e){let t=e.MappingInformationType,i=e.ReferenceInformationType,r=e.Colors.a,n=[];return"IndexToDirect"===i&&(n=e.ColorIndex.a),{dataSize:4,buffer:r,indices:n,mappingType:t,referenceType:i}}parseMaterialIndices(e){let t=e.MappingInformationType,i=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};let r=e.Materials.a,n=[];for(let s=0;s<r.length;++s)n.push(s);return{dataSize:1,buffer:r,indices:n,mappingType:t,referenceType:i}}parseNurbsGeometry(e){let t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new ot;let i,r,n=t-1,s=e.KnotVector.a,a=[],o=e.Points.a;for(let h=0,u=o.length;h<u;h+=4)a.push((new jr).fromArray(o,h));if("Closed"===e.Form)a.push(a[0]);else if("Periodic"===e.Form){i=n,r=s.length-1-i;for(let e=0;e<n;++e)a.push(a[e])}let l=new aO(n,s,a,i,r).getPoints(12*a.length);return(new ot).setFromPoints(l)}},GG=class{parse(){let e=[],t=this.parseClips();if(void 0!==t)for(let i in t){let r=t[i],n=this.addClip(r);e.push(n)}return e}parseClips(){if(void 0===mi.Objects.AnimationCurve)return;let e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);let t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){let e=mi.Objects.AnimationCurveNode,t=new Map;for(let i in e){let r=e[i];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){let e={id:r.id,attr:r.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){let t=mi.Objects.AnimationCurve;for(let i in t){let r={id:t[i].id,times:t[i].KeyTime.a.map(IIt),values:t[i].KeyValueFloat.a},n=os.get(r.id);if(void 0!==n){let t=n.parents[0].ID,i=n.parents[0].relationship;i.match(/X/)?e.get(t).curves.x=r:i.match(/Y/)?e.get(t).curves.y=r:i.match(/Z/)?e.get(t).curves.z=r:i.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=r)}}}parseAnimationLayers(e){let t=mi.Objects.AnimationLayer,i=new Map;for(let r in t){let t=[],n=os.get(parseInt(r));void 0!==n&&(n.children.forEach((function(i,r){if(e.has(i.ID)){let n=e.get(i.ID);if(void 0!==n.curves.x||void 0!==n.curves.y||void 0!==n.curves.z){if(void 0===t[r]){let e=os.get(i.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){let n=mi.Objects.Model[e.toString()];if(void 0===n)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",i);let s={modelName:n.attrName?Cr.sanitizeNodeName(n.attrName):"",ID:n.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};So.traverse((function(e){e.ID===n.id&&(s.transform=e.matrix,e.userData.transformData&&(s.eulerOrder=e.userData.transformData.eulerOrder))})),s.transform||(s.transform=new Be),"PreRotation"in n&&(s.preRotation=n.PreRotation.value),"PostRotation"in n&&(s.postRotation=n.PostRotation.value),t[r]=s}}t[r]&&(t[r][n.attr]=n)}else if(void 0!==n.curves.morph){if(void 0===t[r]){let e=os.get(i.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID,n=os.get(e).parents[0].ID,s=os.get(n).parents[0].ID,a=os.get(s).parents[0].ID,o=mi.Objects.Model[a],l={modelName:o.attrName?Cr.sanitizeNodeName(o.attrName):"",morphName:mi.Objects.Deformer[e].attrName};t[r]=l}t[r][n.attr]=n}}})),i.set(parseInt(r),t))}return i}parseAnimStacks(e){let t=mi.Objects.AnimationStack,i={};for(let r in t){let n=os.get(parseInt(r)).children;n.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");let s=e.get(n[0].ID);i[r]={name:t[r].attrName,layer:s}}return i}addClip(e){let t=[],i=this;return e.layer.forEach((function(e){t=t.concat(i.generateTracks(e))})),new mo(e.name,-1,t)}generateTracks(e){let t=[],i=new D,r=new Br,n=new D;if(e.transform&&e.transform.decompose(i,r,n),i=i.toArray(),r=(new _r).setFromQuaternion(r,e.eulerOrder).toArray(),n=n.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){let r=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){let i=this.generateRotationTrack(e.modelName,e.R.curves,r,e.preRotation,e.postRotation,e.eulerOrder);void 0!==i&&t.push(i)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){let i=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");void 0!==i&&t.push(i)}if(void 0!==e.DeformPercent){let i=this.generateMorphTrack(e);void 0!==i&&t.push(i)}return t}generateVectorTrack(e,t,i,r){let n=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(n,t,i);return new fo(e+"."+r,n,s)}generateRotationTrack(e,t,i,r,n,s){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(fr.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(fr.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(fr.degToRad));let a=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(a,t,i);void 0!==r&&((r=r.map(fr.degToRad)).push(s),r=(new _r).fromArray(r),r=(new Br).setFromEuler(r)),void 0!==n&&((n=n.map(fr.degToRad)).push(s),n=(new _r).fromArray(n),n=(new Br).setFromEuler(n).invert());let l=new Br,h=new _r,u=[];for(let c=0;c<o.length;c+=3)h.set(o[c],o[c+1],o[c+2],s),l.setFromEuler(h),void 0!==r&&l.premultiply(r),void 0!==n&&l.multiply(n),l.toArray(u,c/3*4);return new Ba(e+".quaternion",a,u)}generateMorphTrack(e){let t=e.DeformPercent.curves.morph,i=t.values.map((function(e){return e/100})),r=So.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Vc(e.modelName+".morphTargetInfluences["+r+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})),t.length>1){let e=1,i=t[0];for(let r=1;r<t.length;r++){let n=t[r];n!==i&&(t[e]=n,i=n,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,i){let r=i,n=[],s=-1,a=-1,o=-1;return e.forEach((function(e){if(t.x&&(s=t.x.times.indexOf(e)),t.y&&(a=t.y.times.indexOf(e)),t.z&&(o=t.z.times.indexOf(e)),-1!==s){let e=t.x.values[s];n.push(e),r[0]=e}else n.push(r[0]);if(-1!==a){let e=t.y.values[a];n.push(e),r[1]=e}else n.push(r[1]);if(-1!==o){let e=t.z.values[o];n.push(e),r[2]=e}else n.push(r[2])})),n}interpolateRotations(e){for(let t=1;t<e.values.length;t++){let i=e.values[t-1],r=e.values[t]-i,n=Math.abs(r);if(n>=180){let s=n/180,a=r/s,o=i+a,l=e.times[t-1],h=(e.times[t]-l)/s,u=l+h,c=[],p=[];for(;u<e.times[t];)c.push(u),u+=h,p.push(o),o+=a;e.times=Cge(e.times,t,c),e.values=Cge(e.values,t,p)}}}},VG=class{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new uO,this.nodeStack=[],this.currentProp=[],this.currentPropName="";let t=this,i=e.split(/[\r\n]+/);return i.forEach((function(e,r){let n=e.match(/^[\s\t]*;/),s=e.match(/^[\s\t]*$/);if(n||s)return;let a=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),o=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");a?t.parseNodeBegin(e,a):o?t.parseNodeProperty(e,o,i[++r]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){let i=t[1].trim().replace(/^"/,"").replace(/"$/,""),r=t[2].split(",").map((function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")})),n={name:i},s=this.parseNodeAttr(r),a=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(i,n):i in a?("PoseNode"===i?a.PoseNode.push(n):void 0!==a[i].id&&(a[i]={},a[i][a[i].id]=a[i]),""!==s.id&&(a[i][s.id]=n)):"number"==typeof s.id?(a[i]={},a[i][s.id]=n):"Properties70"!==i&&(a[i]="PoseNode"===i?[n]:n),"number"==typeof s.id&&(n.id=s.id),""!==s.name&&(n.attrName=s.name),""!==s.type&&(n.attrType=s.type),this.pushStack(n)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",r="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:i,type:r}}parseNodeProperty(e,t,i){let r=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===r&&","===n&&(n=i.replace(/"/g,"").replace(/,$/,"").trim());let s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===r){let e=n.split(",").slice(1),t=parseInt(e[0]),i=parseInt(e[1]),a=n.split(",").slice(3);a=a.map((function(e){return e.trim().replace(/^"/,"")})),r="connections",n=[t,i],SIt(n,a),void 0===s[r]&&(s[r]=[])}"Node"===r&&(s.id=n),r in s&&Array.isArray(s[r])?s[r].push(n):"a"!==r?s[r]=n:s.a=n,this.setCurrentProp(s,r),"a"===r&&","!==n.slice(-1)&&(s.a=UG(n))}else this.parseNodeSpecialProperty(e,r,n)}parseNodePropertyContinued(e){let t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=UG(t.a))}parseNodeSpecialProperty(e,t,i){let r=i.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),n=r[0],s=r[1],a=r[2],o=r[3],l=r[4];switch(s){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=UG(l)}this.getPrevNode()[n]={type:s,type2:a,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),n)}},zG=class{parse(e){let t=new cO(e);t.skip(23);let i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);let r=new uO;for(;!this.endOfContent(t);){let e=this.parseNode(t,i);null!==e&&r.add(e.name,e)}return r}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){let i={},r=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();let s=e.getUint8(),a=e.getString(s);if(0===r)return null;let o=[];for(let c=0;c<n;c++)o.push(this.parseProperty(e));let l=o.length>0?o[0]:"",h=o.length>1?o[1]:"",u=o.length>2?o[2]:"";for(i.singleProperty=1===n&&e.getOffset()===r;r>e.getOffset();){let r=this.parseNode(e,t);null!==r&&this.parseSubNode(a,i,r)}return i.propertyList=o,"number"==typeof l&&(i.id=l),""!==h&&(i.attrName=h),""!==u&&(i.attrType=u),""!==a&&(i.name=a),i}parseSubNode(e,t,i){if(!0===i.singleProperty){let e=i.propertyList[0];Array.isArray(e)?(t[i.name]=i,i.a=e):t[i.name]=e}else if("Connections"===e&&"C"===i.name){let e=[];i.propertyList.forEach((function(t,i){0!==i&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===i.name)Object.keys(i).forEach((function(e){t[e]=i[e]}));else if("Properties70"===e&&"P"===i.name){let e,r=i.propertyList[0],n=i.propertyList[1],s=i.propertyList[2],a=i.propertyList[3];0===r.indexOf("Lcl ")&&(r=r.replace("Lcl ","Lcl_")),0===n.indexOf("Lcl ")&&(n=n.replace("Lcl ","Lcl_")),e="Color"===n||"ColorRGB"===n||"Vector"===n||"Vector3D"===n||0===n.indexOf("Lcl_")?[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:i.propertyList[4],t[r]={type:n,type2:s,flag:a,value:e}}else void 0===t[i.name]?"number"==typeof i.id?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:"PoseNode"===i.name?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):void 0===t[i.name][i.id]&&(t[i.name][i.id]=i)}parseProperty(e){let t,i=e.getString(1);switch(i){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return t=e.getUint32(),e.getArrayBuffer(t);case"S":return t=e.getUint32(),e.getString(t);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":let r=e.getUint32(),n=e.getUint32(),s=e.getUint32();if(0===n)switch(i){case"b":case"c":return e.getBooleanArray(r);case"d":return e.getFloat64Array(r);case"f":return e.getFloat32Array(r);case"i":return e.getInt32Array(r);case"l":return e.getInt64Array(r)}let a=Sge(new Uint8Array(e.getArrayBuffer(s))),o=new cO(a.buffer);switch(i){case"b":case"c":return o.getBooleanArray(r);case"d":return o.getFloat64Array(r);case"f":return o.getFloat32Array(r);case"i":return o.getInt32Array(r);case"l":return o.getInt64Array(r)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+i)}}},cO=class{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){let t=[];for(let i=0;i<e;i++)t.push(this.getBoolean());return t}getUint8(){let e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){let e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){let e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getInt32());return t}getUint32(){let e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){let e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getFloat32());return t}getFloat64(){let e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getFloat64());return t}getArrayBuffer(e){let t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=this.offset,i=new Uint8Array(this.dv.buffer,t,e);this.skip(e);let r=i.indexOf(0);return r>=0&&(i=new Uint8Array(this.dv.buffer,t,r)),this._textDecoder.decode(i)}},uO=class{add(e,t){this[e]=t}};function bIt(e){return e.byteLength>=21&&"Kaydara FBX Binary \0"===Pge(e,0,21)}function xIt(e){let t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],i=0;function r(t){let r=e[t-1];return e=e.slice(i+t),i++,r}for(let n=0;n<t.length;++n)if(r(1)===t[n])return!1;return!0}function Dge(e){let t=e.match(/FBXVersion: (\d+)/);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function IIt(e){return e/46186158e3}var _It=[];function oO(e,t,i,r){let n;switch(r.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=i;break;case"AllSame":n=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(n=r.indices[n]);let s=n*r.dataSize,a=s+r.dataSize;return wIt(_It,r.buffer,s,a)}var HG=new _r,zE=new D;function Age(e){let t=new Be,i=new Be,r=new Be,n=new Be,s=new Be,a=new Be,o=new Be,l=new Be,h=new Be,u=new Be,c=new Be,p=new Be,d=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(zE.fromArray(e.translation)),e.preRotation){let t=e.preRotation.map(fr.degToRad);t.push(e.eulerOrder||_r.DEFAULT_ORDER),i.makeRotationFromEuler(HG.fromArray(t))}if(e.rotation){let t=e.rotation.map(fr.degToRad);t.push(e.eulerOrder||_r.DEFAULT_ORDER),r.makeRotationFromEuler(HG.fromArray(t))}if(e.postRotation){let t=e.postRotation.map(fr.degToRad);t.push(e.eulerOrder||_r.DEFAULT_ORDER),n.makeRotationFromEuler(HG.fromArray(t)),n.invert()}e.scale&&s.scale(zE.fromArray(e.scale)),e.scalingOffset&&o.setPosition(zE.fromArray(e.scalingOffset)),e.scalingPivot&&a.setPosition(zE.fromArray(e.scalingPivot)),e.rotationOffset&&l.setPosition(zE.fromArray(e.rotationOffset)),e.rotationPivot&&h.setPosition(zE.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(c.copy(e.parentMatrix),u.copy(e.parentMatrixWorld));let f=i.clone().multiply(r).multiply(n),m=new Be;m.extractRotation(u);let g=new Be;g.copyPosition(u);let y=g.clone().invert().multiply(u),v=m.clone().invert().multiply(y),T=s,x=new Be;if(0===d)x.copy(m).multiply(f).multiply(v).multiply(T);else if(1===d)x.copy(m).multiply(v).multiply(f).multiply(T);else{let e=(new Be).scale((new D).setFromMatrixScale(c)).clone().invert(),t=v.clone().multiply(e);x.copy(m).multiply(f).multiply(t).multiply(T)}let b=h.clone().invert(),E=a.clone().invert(),_=t.clone().multiply(l).multiply(h).multiply(i).multiply(r).multiply(n).multiply(b).multiply(o).multiply(a).multiply(s).multiply(E),w=(new Be).copyPosition(_),S=u.clone().multiply(w);return p.copyPosition(S),_=p.clone().multiply(x),_.premultiply(u.invert()),_}function Oge(e){let t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function UG(e){return e.split(",").map((function(e){return parseFloat(e)}))}function Pge(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=e.byteLength),(new TextDecoder).decode(new Uint8Array(e,t,i))}function SIt(e,t){for(let i=0,r=e.length,n=t.length;i<n;i++,r++)e[r]=t[i]}function wIt(e,t,i,r){for(let n=i,s=0;n<r;n++,s++)e[s]=t[n];return e}function Cge(e,t,i){return e.slice(0,t).concat(i).concat(e.slice(t))}var gh=class extends pi{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new $G(e)})),this.register((function(e){return new r8(e)})),this.register((function(e){return new i8(e)})),this.register((function(e){return new KG(e)})),this.register((function(e){return new JG(e)})),this.register((function(e){return new QG(e)})),this.register((function(e){return new e8(e)})),this.register((function(e){return new XG(e)})),this.register((function(e){return new t8(e)})),this.register((function(e){return new ZG(e)})),this.register((function(e){return new qG(e)})),this.register((function(e){return new n8(e)})),this.register((function(e){return new s8(e)}))}load(e,t,i,r){let n,s=this;n=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:qs.extractUrlBase(e),this.manager.itemStart(e);let a=function(t){r?r(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},o=new di(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(i){try{s.parse(i,n,(function(i){t(i),s.manager.itemEnd(e)}),a)}catch(e){a(e)}}),i,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,r){let n,s={},a={},o=new TextDecoder;if("string"==typeof e)n=JSON.parse(e);else if(e instanceof ArrayBuffer)if(o.decode(new Uint8Array(e,0,4))===Bge){try{s[Fi.KHR_BINARY_GLTF]=new a8(e)}catch(e){return void(r&&r(e))}n=JSON.parse(s[Fi.KHR_BINARY_GLTF].content)}else n=JSON.parse(o.decode(e));else n=e;if(void 0===n.asset||n.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));let l=new d8(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){let e=this.pluginCallbacks[h](l);a[e.name]=e,s[e.name]=!0}if(n.extensionsUsed)for(let h=0;h<n.extensionsUsed.length;++h){let e=n.extensionsUsed[h],t=n.extensionsRequired||[];switch(e){case Fi.KHR_MATERIALS_UNLIT:s[e]=new YG;break;case Fi.KHR_DRACO_MESH_COMPRESSION:s[e]=new o8(n,this.dracoLoader);break;case Fi.KHR_TEXTURE_TRANSFORM:s[e]=new l8;break;case Fi.KHR_MESH_QUANTIZATION:s[e]=new c8;break;default:t.indexOf(e)>=0&&void 0===a[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}l.setExtensions(s),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){let i=this;return new Promise((function(r,n){i.parse(e,t,r,n)}))}};function RIt(){let e={};return{get:function(t){return e[t]},add:function(t,i){e[t]=i},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var Fi={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},qG=class{constructor(e){this.parser=e,this.name=Fi.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){let r=t[i];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,i="light:"+e,r=t.cache.get(i);if(r)return r;let n,s=t.json,a=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e],o=new Ve(16777215);void 0!==a.color&&o.fromArray(a.color);let l=void 0!==a.range?a.range:0;switch(a.type){case"directional":n=new Ns(o),n.target.position.set(0,0,-1),n.add(n.target);break;case"point":n=new zc(o),n.distance=l;break;case"spot":n=new th(o),n.distance=l,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,n.angle=a.spot.outerConeAngle,n.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return n.position.set(0,0,0),n.decay=2,Yf(n,a),void 0!==a.intensity&&(n.intensity=a.intensity),n.name=t.createUniqueName(a.name||"light_"+e),r=Promise.resolve(n),t.cache.add(i,r),r}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,i=this.parser,r=i.json.nodes[e],n=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===n?null:this._loadLight(n).then((function(e){return i._getNodeRef(t.cache,n,e)}))}},YG=class{constructor(){this.name=Fi.KHR_MATERIALS_UNLIT}getMaterialType(){return Xt}extendParams(e,t,i){let r=[];e.color=new Ve(1,1,1),e.opacity=1;let n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){let t=n.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==n.baseColorTexture&&r.push(i.assignTexture(e,"map",n.baseColorTexture,yr))}return Promise.all(r)}},XG=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let r=i.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}},$G=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ul:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&n.push(i.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&n.push(i.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(n.push(i.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){let e=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new ce(e,e)}return Promise.all(n)}},ZG=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ul:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],s=r.extensions[this.name];return void 0!==s.iridescenceFactor&&(t.iridescence=s.iridescenceFactor),void 0!==s.iridescenceTexture&&n.push(i.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),void 0!==s.iridescenceIor&&(t.iridescenceIOR=s.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==s.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),void 0!==s.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),void 0!==s.iridescenceThicknessTexture&&n.push(i.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(n)}},KG=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ul:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[];t.sheenColor=new Ve(0,0,0),t.sheenRoughness=0,t.sheen=1;let s=r.extensions[this.name];return void 0!==s.sheenColorFactor&&t.sheenColor.fromArray(s.sheenColorFactor),void 0!==s.sheenRoughnessFactor&&(t.sheenRoughness=s.sheenRoughnessFactor),void 0!==s.sheenColorTexture&&n.push(i.assignTexture(t,"sheenColorMap",s.sheenColorTexture,yr)),void 0!==s.sheenRoughnessTexture&&n.push(i.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(n)}},JG=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ul:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],s=r.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&n.push(i.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(n)}},QG=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ul:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],s=r.extensions[this.name];t.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&n.push(i.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;let a=s.attenuationColor||[1,1,1];return t.attenuationColor=new Ve(a[0],a[1],a[2]),Promise.all(n)}},e8=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ul:null}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let r=i.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}},t8=class{constructor(e){this.parser=e,this.name=Fi.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ul:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],s=r.extensions[this.name];t.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&n.push(i.assignTexture(t,"specularIntensityMap",s.specularTexture));let a=s.specularColorFactor||[1,1,1];return t.specularColor=new Ve(a[0],a[1],a[2]),void 0!==s.specularColorTexture&&n.push(i.assignTexture(t,"specularColorMap",s.specularColorTexture,yr)),Promise.all(n)}},r8=class{constructor(e){this.parser=e,this.name=Fi.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let n=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,s)}},i8=class{constructor(e){this.parser=e,this.name=Fi.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,i=this.parser,r=i.json,n=r.textures[e];if(!n.extensions||!n.extensions[t])return null;let s=n.extensions[t],a=r.images[s.source],o=i.textureLoader;if(a.uri){let e=i.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(n){if(n)return i.loadTextureImage(e,s.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}},n8=class{constructor(e){this.name=Fi.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){let e=i.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then((function(t){let i=e.byteOffset||0,r=e.byteLength||0,s=e.count,a=e.byteStride,o=new Uint8Array(t,i,r);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(s,a,o,e.mode,e.filter).then((function(e){return e.buffer})):n.ready.then((function(){let t=new ArrayBuffer(s*a);return n.decodeGltfBuffer(new Uint8Array(t),s,a,o,e.mode,e.filter),t}))}))}return null}},s8=class{constructor(e){this.name=Fi.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||void 0===i.mesh)return null;let r=t.meshes[i.mesh];for(let o of r.primitives)if(o.mode!==tc.TRIANGLES&&o.mode!==tc.TRIANGLE_STRIP&&o.mode!==tc.TRIANGLE_FAN&&void 0!==o.mode)return null;let n=i.extensions[this.name].attributes,s=[],a={};for(let o in n)s.push(this.parser.getDependency("accessor",n[o]).then((e=>(a[o]=e,a[o]))));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then((e=>{let t=e.pop(),i=t.isGroup?t.children:[t],r=e[0].count,n=[];for(let s of i){let e=new Be,t=new D,i=new Br,o=new D(1,1,1),l=new sn(s.geometry,s.material,r);for(let n=0;n<r;n++)a.TRANSLATION&&t.fromBufferAttribute(a.TRANSLATION,n),a.ROTATION&&i.fromBufferAttribute(a.ROTATION,n),a.SCALE&&o.fromBufferAttribute(a.SCALE,n),l.setMatrixAt(n,e.compose(t,i,o));for(let r in a)"TRANSLATION"!==r&&"ROTATION"!==r&&"SCALE"!==r&&s.geometry.setAttribute(r,a[r]);qt.prototype.copy.call(l,s),l.frustumCulled=!1,this.parser.assignFinalMaterial(l),n.push(l)}return t.isGroup?(t.clear(),t.add(...n),t):n[0]})))}},Bge="glTF",c_=12,Nge={JSON:1313821514,BIN:5130562},a8=class{constructor(e){this.name=Fi.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,c_),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Bge)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let r=this.header.length-c_,n=new DataView(e,c_),s=0;for(;s<r;){let t=n.getUint32(s,!0);s+=4;let r=n.getUint32(s,!0);if(s+=4,r===Nge.JSON){let r=new Uint8Array(e,c_+s,t);this.content=i.decode(r)}else if(r===Nge.BIN){let i=c_+s;this.body=e.slice(i,i+t)}s+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}},o8=class{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Fi.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let i=this.json,r=this.dracoLoader,n=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,a={},o={},l={};for(let h in s){let e=h8[h]||h.toLowerCase();a[e]=s[h]}for(let h in e.attributes){let t=h8[h]||h.toLowerCase();if(void 0!==s[h]){let r=i.accessors[e.attributes[h]],n=jE[r.componentType];l[t]=n.name,o[t]=!0===r.normalized}}return t.getDependency("bufferView",n).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(let t in e.attributes){let i=e.attributes[t],r=o[t];void 0!==r&&(i.normalized=r)}t(e)}),a,l)}))}))}},l8=class{constructor(){this.name=Fi.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}},c8=class{constructor(){this.name=Fi.KHR_MESH_QUANTIZATION}},hO=class extends jp{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r*3+r;for(let s=0;s!==r;s++)t[s]=i[n+s];return t}interpolate_(e,t,i,r){let n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,h=r-t,u=(i-t)/h,c=u*u,p=c*u,d=e*l,f=d-l,m=-2*p+3*c,g=p-c,y=1-m,v=g-c+u;for(let T=0;T!==a;T++){let e=s[f+T+a],t=s[f+T+o]*h,i=s[d+T+a],r=s[d+T]*h;n[T]=y*e+v*t+m*i+g*r}return n}},MIt=new Br,u8=class extends hO{interpolate_(e,t,i,r){let n=super.interpolate_(e,t,i,r);return MIt.fromArray(n).normalize().toArray(n),n}},tc={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},jE={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Lge={9728:Oi,9729:hi,9984:mf,9985:jg,9986:Cp,9987:Ha},Fge={33071:vn,33648:Pp,10497:yn},jG={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},h8={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},qf={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},DIt={CUBICSPLINE:void 0,LINEAR:$u,STEP:Lp},WG={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function CIt(e){return void 0===e.DefaultMaterial&&(e.DefaultMaterial=new Ef({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Xi})),e.DefaultMaterial}function u_(e,t,i){for(let r in i.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=i.extensions[r])}function Yf(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function AIt(e,t,i){let r=!1,n=!1,s=!1;for(let h=0,u=t.length;h<u;h++){let e=t[h];if(void 0!==e.POSITION&&(r=!0),void 0!==e.NORMAL&&(n=!0),void 0!==e.COLOR_0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(e);let a=[],o=[],l=[];for(let h=0,u=t.length;h<u;h++){let u=t[h];if(r){let t=void 0!==u.POSITION?i.getDependency("accessor",u.POSITION):e.attributes.position;a.push(t)}if(n){let t=void 0!==u.NORMAL?i.getDependency("accessor",u.NORMAL):e.attributes.normal;o.push(t)}if(s){let t=void 0!==u.COLOR_0?i.getDependency("accessor",u.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then((function(t){let i=t[0],a=t[1],o=t[2];return r&&(e.morphAttributes.position=i),n&&(e.morphAttributes.normal=a),s&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}function OIt(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let i=0,r=t.weights.length;i<r;i++)e.morphTargetInfluences[i]=t.weights[i];if(t.extras&&Array.isArray(t.extras.targetNames)){let i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(let t=0,r=i.length;t<r;t++)e.morphTargetDictionary[i[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function PIt(e){let t,i=e.extensions&&e.extensions[Fi.KHR_DRACO_MESH_COMPRESSION];return t=i?"draco:"+i.bufferView+":"+i.indices+":"+Hge(i.attributes):e.indices+":"+Hge(e.attributes)+":"+e.mode,t}function Hge(e){let t="",i=Object.keys(e).sort();for(let r=0,n=i.length;r<n;r++)t+=i[r]+":"+e[i[r]]+";";return t}function p8(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function NIt(e){return e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"}var LIt=new Be,d8=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new RIt,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,n=-1;"undefined"!=typeof navigator&&(i=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),r=navigator.userAgent.indexOf("Firefox")>-1,n=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||i||r&&n<98?this.textureLoader=new gs(this.options.manager):this.textureLoader=new Cx(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new di(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let i=this,r=this.json,n=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])})).then((function(t){let s={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:i,userData:{}};u_(n,s,r),Yf(s,r),Promise.all(i._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){e(s)}))})).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,n=t.length;r<n;r++){let i=t[r].joints;for(let t=0,r=i.length;t<r;t++)e[i[t]].isBone=!0}for(let r=0,n=e.length;r<n;r++){let t=e[r];void 0!==t.mesh&&(this._addNodeRef(this.meshCache,t.mesh),void 0!==t.skin&&(i[t.mesh].isSkinnedMesh=!0)),void 0!==t.camera&&this._addNodeRef(this.cameraCache,t.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;let r=i.clone(),n=(e,t)=>{let i=this.associations.get(e);null!=i&&this.associations.set(t,i);for(let[r,s]of e.children.entries())n(s,t.children[r])};return n(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){let r=e(t[i]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let i=[];for(let r=0;r<t.length;r++){let n=e(t[r]);n&&i.push(n)}return i}getDependency(e,t){let i=e+":"+t,r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne((function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)})),!r)throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let i=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return i.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],i=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[Fi.KHR_BINARY_GLTF].body);let r=this.options;return new Promise((function(e,n){i.load(qs.resolveURL(t.uri,r.path),e,void 0,(function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){let i=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+i)}))}loadAccessor(e){let t=this,i=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse){let e=jG[r.type],t=jE[r.componentType],i=!0===r.normalized,n=new t(r.count*e);return Promise.resolve(new Wt(n,e,i))}let n=[];return void 0!==r.bufferView?n.push(this.getDependency("bufferView",r.bufferView)):n.push(null),void 0!==r.sparse&&(n.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(n).then((function(e){let n,s,a=e[0],o=jG[r.type],l=jE[r.componentType],h=l.BYTES_PER_ELEMENT,u=h*o,c=r.byteOffset||0,p=void 0!==r.bufferView?i.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;if(p&&p!==u){let e=Math.floor(c/p),i="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count,u=t.cache.get(i);u||(n=new l(a,e*p,r.count*p/h),u=new Bp(n,p/h),t.cache.add(i,u)),s=new ho(u,o,c%p/h,d)}else n=null===a?new l(r.count*o):new l(a,c,r.count*o),s=new Wt(n,o,d);if(void 0!==r.sparse){let t=jG.SCALAR,i=jE[r.sparse.indices.componentType],n=r.sparse.indices.byteOffset||0,h=r.sparse.values.byteOffset||0,u=new i(e[1],n,r.sparse.count*t),c=new l(e[2],h,r.sparse.count*o);null!==a&&(s=new Wt(s.array.slice(),s.itemSize,s.normalized));for(let e=0,r=u.length;e<r;e++){let t=u[e];if(s.setX(t,c[e*o]),o>=2&&s.setY(t,c[e*o+1]),o>=3&&s.setZ(t,c[e*o+2]),o>=4&&s.setW(t,c[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return s}))}loadTexture(e){let t=this.json,i=this.options,r=t.textures[e].source,n=t.images[r],s=this.textureLoader;if(n.uri){let e=i.manager.getHandler(n.uri);null!==e&&(s=e)}return this.loadTextureImage(e,r,s)}loadTextureImage(e,t,i){let r=this,n=this.json,s=n.textures[e],a=n.images[t],o=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[o])return this.textureCache[o];let l=this.loadImageSource(t,i).then((function(t){t.flipY=!1,t.name=s.name||a.name||"";let i=(n.samplers||{})[s.sampler]||{};return t.magFilter=Lge[i.magFilter]||hi,t.minFilter=Lge[i.minFilter]||Ha,t.wrapS=Fge[i.wrapS]||yn,t.wrapT=Fge[i.wrapT]||yn,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[o]=l,l}loadImageSource(e,t){let i=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));let n=i.images[e],s=self.URL||self.webkitURL,a=n.uri||"",o=!1;if(void 0!==n.bufferView)a=this.getDependency("bufferView",n.bufferView).then((function(e){o=!0;let t=new Blob([e],{type:n.mimeType});return a=s.createObjectURL(t),a}));else if(void 0===n.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(a).then((function(e){return new Promise((function(i,n){let s=i;!0===t.isImageBitmapLoader&&(s=function(e){let t=new Pi(e);t.needsUpdate=!0,i(t)}),t.load(qs.resolveURL(e,r.path),s,void 0,n)}))})).then((function(e){return!0===o&&s.revokeObjectURL(a),e.userData.mimeType=n.mimeType||NIt(n.uri),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=l,l}assignTexture(e,t,i,r){let n=this;return this.getDependency("texture",i.index).then((function(s){if(!s)return null;if(void 0!==i.texCoord&&0!=i.texCoord&&!("aoMap"===t&&1==i.texCoord)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),n.extensions[Fi.KHR_TEXTURE_TRANSFORM]){let e=void 0!==i.extensions?i.extensions[Fi.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(s);s=n.extensions[Fi.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),n.associations.set(s,t)}}return void 0!==r&&(s.encoding=r),e[t]=s,s}))}assignFinalMaterial(e){let t=e.geometry,i=e.material,r=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,s=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+i.uuid,t=this.cache.get(e);t||(t=new Rn,qr.prototype.copy.call(t,i),t.color.copy(i.color),t.map=i.map,t.sizeAttenuation=!1,this.cache.add(e,t)),i=t}else if(e.isLine){let e="LineBasicMaterial:"+i.uuid,t=this.cache.get(e);t||(t=new br,qr.prototype.copy.call(t,i),t.color.copy(i.color),this.cache.add(e,t)),i=t}if(r||n||s){let e="ClonedMaterial:"+i.uuid+":";r&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),s&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=i.clone(),n&&(t.vertexColors=!0),s&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(i))),i=t}i.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Ef}loadMaterial(e){let t,i=this,r=this.json,n=this.extensions,s=r.materials[e],a={},o=[];if((s.extensions||{})[Fi.KHR_MATERIALS_UNLIT]){let e=n[Fi.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),o.push(e.extendParams(a,s,i))}else{let r=s.pbrMetallicRoughness||{};if(a.color=new Ve(1,1,1),a.opacity=1,Array.isArray(r.baseColorFactor)){let e=r.baseColorFactor;a.color.fromArray(e),a.opacity=e[3]}void 0!==r.baseColorTexture&&o.push(i.assignTexture(a,"map",r.baseColorTexture,yr)),a.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,a.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(o.push(i.assignTexture(a,"metalnessMap",r.metallicRoughnessTexture)),o.push(i.assignTexture(a,"roughnessMap",r.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),o.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===s.doubleSided&&(a.side=bi);let l=s.alphaMode||WG.OPAQUE;if(l===WG.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,l===WG.MASK&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&t!==Xt&&(o.push(i.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new ce(1,1),void 0!==s.normalTexture.scale)){let e=s.normalTexture.scale;a.normalScale.set(e,e)}return void 0!==s.occlusionTexture&&t!==Xt&&(o.push(i.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&t!==Xt&&(a.emissive=(new Ve).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&t!==Xt&&o.push(i.assignTexture(a,"emissiveMap",s.emissiveTexture,yr)),Promise.all(o).then((function(){let r=new t(a);return s.name&&(r.name=s.name),Yf(r,s),i.associations.set(r,{materials:e}),s.extensions&&u_(n,r,s),r}))}createUniqueName(e){let t=Cr.sanitizeNodeName(e||""),i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){let t=this,i=this.extensions,r=this.primitiveCache;function n(e){return i[Fi.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(i){return Uge(i,e,t)}))}let s=[];for(let a=0,o=e.length;a<o;a++){let i=e[a],o=PIt(i),l=r[o];if(l)s.push(l.promise);else{let e;e=i.extensions&&i.extensions[Fi.KHR_DRACO_MESH_COMPRESSION]?n(i):Uge(new ot,i,t),r[o]={primitive:i,promise:e},s.push(e)}}return Promise.all(s)}loadMesh(e){let t=this,i=this.json,r=this.extensions,n=i.meshes[e],s=n.primitives,a=[];for(let o=0,l=s.length;o<l;o++){let e=void 0===s[o].material?CIt(this.cache):this.getDependency("material",s[o].material);a.push(e)}return a.push(t.loadGeometries(s)),Promise.all(a).then((function(i){let a=i.slice(0,i.length-1),o=i[i.length-1],l=[];for(let u=0,c=o.length;u<c;u++){let i,h=o[u],c=s[u],p=a[u];if(c.mode===tc.TRIANGLES||c.mode===tc.TRIANGLE_STRIP||c.mode===tc.TRIANGLE_FAN||void 0===c.mode)i=!0===n.isSkinnedMesh?new Ku(h,p):new Je(h,p),!0===i.isSkinnedMesh&&!i.geometry.attributes.skinWeight.normalized&&i.normalizeSkinWeights(),c.mode===tc.TRIANGLE_STRIP?i.geometry=yk(i.geometry,Gx):c.mode===tc.TRIANGLE_FAN&&(i.geometry=yk(i.geometry,Jy));else if(c.mode===tc.LINES)i=new Kr(h,p);else if(c.mode===tc.LINE_STRIP)i=new Sr(h,p);else if(c.mode===tc.LINE_LOOP)i=new zy(h,p);else{if(c.mode!==tc.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);i=new Bi(h,p)}Object.keys(i.geometry.morphAttributes).length>0&&OIt(i,n),i.name=t.createUniqueName(n.name||"mesh_"+e),Yf(i,n),c.extensions&&u_(r,i,c),t.assignFinalMaterial(i),l.push(i)}for(let r=0,n=l.length;r<n;r++)t.associations.set(l[r],{meshes:e,primitives:r});if(1===l.length)return l[0];let h=new ar;t.associations.set(h,{meshes:e});for(let e=0,t=l.length;e<t;e++)h.add(l[e]);return h}))}loadCamera(e){let t,i=this.json.cameras[e],r=i[i.type];if(r)return"perspective"===i.type?t=new Vr(fr.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===i.type&&(t=new Ni(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Yf(t,i),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){let t=this.json.skins[e],i=[];for(let r=0,n=t.joints.length;r<n;r++)i.push(this.getDependency("node",t.joints[r]));return void 0!==t.inverseBindMatrices?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then((function(e){let i=e.pop(),r=e,n=[],s=[];for(let a=0,o=r.length;a<o;a++){let e=r[a];if(e){n.push(e);let t=new Be;null!==i&&t.fromArray(i.array,16*a),s.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new Fl(n,s)}))}loadAnimation(e){let t=this.json.animations[e],i=[],r=[],n=[],s=[],a=[];for(let o=0,l=t.channels.length;o<l;o++){let e=t.channels[o],l=t.samplers[e.sampler],h=e.target,u=h.node,c=void 0!==t.parameters?t.parameters[l.input]:l.input,p=void 0!==t.parameters?t.parameters[l.output]:l.output;i.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",c)),n.push(this.getDependency("accessor",p)),s.push(l),a.push(h)}return Promise.all([Promise.all(i),Promise.all(r),Promise.all(n),Promise.all(s),Promise.all(a)]).then((function(i){let r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],l=[];for(let e=0,t=r.length;e<t;e++){let t,i=r[e],h=n[e],u=s[e],c=a[e],p=o[e];if(void 0===i)continue;switch(i.updateMatrix(),qf[p.path]){case qf.weights:t=Vc;break;case qf.rotation:t=Ba;break;case qf.position:case qf.scale:default:t=fo}let d=i.name?i.name:i.uuid,f=void 0!==c.interpolation?DIt[c.interpolation]:$u,m=[];qf[p.path]===qf.weights?i.traverse((function(e){e.morphTargetInfluences&&m.push(e.name?e.name:e.uuid)})):m.push(d);let g=u.array;if(u.normalized){let e=p8(g.constructor),t=new Float32Array(g.length);for(let i=0,r=g.length;i<r;i++)t[i]=g[i]*e;g=t}for(let e=0,r=m.length;e<r;e++){let i=new t(m[e]+"."+qf[p.path],h.array,g,f);"CUBICSPLINE"===c.interpolation&&(i.createInterpolant=function(e){return new(this instanceof Ba?u8:hO)(this.times,this.values,this.getValueSize()/3,e)},i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(i)}}let h=t.name?t.name:"animation_"+e;return new mo(h,void 0,l)}))}createNodeMesh(e){let t=this.json,i=this,r=t.nodes[e];return void 0===r.mesh?null:i.getDependency("mesh",r.mesh).then((function(e){let t=i._getNodeRef(i.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,i=r.weights.length;t<i;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){let t=this.json,i=this.extensions,r=this,n=t.nodes[e],s=n.name?r.createUniqueName(n.name):"";return function(){let t=[],i=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));i&&t.push(i),void 0!==n.camera&&t.push(r.getDependency("camera",n.camera).then((function(e){return r._getNodeRef(r.cameraCache,n.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)}));let s=[],a=n.children||[];for(let e=0,n=a.length;e<n;e++)s.push(r.getDependency("node",a[e]));let o=void 0===n.skin?Promise.resolve(null):r.getDependency("skin",n.skin);return Promise.all([Promise.all(t),Promise.all(s),o])}().then((function(t){let a,o=t[0],l=t[1],h=t[2];if(a=!0===n.isBone?new Ll:o.length>1?new ar:1===o.length?o[0]:new qt,a!==o[0])for(let e=0,i=o.length;e<i;e++)a.add(o[e]);if(n.name&&(a.userData.name=n.name,a.name=s),Yf(a,n),n.extensions&&u_(i,a,n),void 0!==n.matrix){let e=new Be;e.fromArray(n.matrix),a.applyMatrix4(e)}else void 0!==n.translation&&a.position.fromArray(n.translation),void 0!==n.rotation&&a.quaternion.fromArray(n.rotation),void 0!==n.scale&&a.scale.fromArray(n.scale);r.associations.has(a)||r.associations.set(a,{}),r.associations.get(a).nodes=e,null!==h&&a.traverse((function(e){e.isSkinnedMesh&&e.bind(h,LIt)}));for(let e=0,i=l.length;e<i;e++)a.add(l[e]);return a}))}loadScene(e){let t=this.extensions,i=this.json.scenes[e],r=this,n=new ar;i.name&&(n.name=r.createUniqueName(i.name)),Yf(n,i),i.extensions&&u_(t,n,i);let s=i.nodes||[],a=[];for(let o=0,l=s.length;o<l;o++)a.push(r.getDependency("node",s[o]));return Promise.all(a).then((function(e){for(let t=0,i=e.length;t<i;t++)n.add(e[t]);return r.associations=(e=>{let t=new Map;for(let[i,n]of r.associations)(i instanceof qr||i instanceof Pi)&&t.set(i,n);return e.traverse((e=>{let i=r.associations.get(e);null!=i&&t.set(e,i)})),t})(n),n}))}};function FIt(e,t,i){let r=t.attributes,n=new Rt;if(void 0===r.POSITION)return;{let e=i.json.accessors[r.POSITION],t=e.min,s=e.max;if(void 0===t||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(n.set(new D(t[0],t[1],t[2]),new D(s[0],s[1],s[2])),e.normalized){let t=p8(jE[e.componentType]);n.min.multiplyScalar(t),n.max.multiplyScalar(t)}}let s=t.targets;if(void 0!==s){let e=new D,t=new D;for(let r=0,n=s.length;r<n;r++){let n=s[r];if(void 0!==n.POSITION){let r=i.json.accessors[n.POSITION],s=r.min,a=r.max;if(void 0!==s&&void 0!==a){if(t.setX(Math.max(Math.abs(s[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(s[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(s[2]),Math.abs(a[2]))),r.normalized){let e=p8(jE[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(e)}e.boundingBox=n;let a=new $i;n.getCenter(a.center),a.radius=n.min.distanceTo(n.max)/2,e.boundingSphere=a}function Uge(e,t,i){let r=t.attributes,n=[];function s(t,r){return i.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(let a in r){let t=h8[a]||a.toLowerCase();t in e.attributes||n.push(s(r[a],t))}if(void 0!==t.indices&&!e.index){let r=i.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));n.push(r)}return Yf(e,t),FIt(e,t,i),Promise.all(n).then((function(){return void 0!==t.targets?AIt(e,t.targets,i):e}))}var HIt=Object.defineProperty,kge=Object.getOwnPropertySymbols,UIt=Object.prototype.hasOwnProperty,BIt=Object.prototype.propertyIsEnumerable,Gge=(e,t,i)=>t in e?HIt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Vge=(e,t)=>{for(var i in t||(t={}))UIt.call(t,i)&&Gge(e,i,t[i]);if(kge)for(var i of kge(t))BIt.call(t,i)&&Gge(e,i,t[i]);return e},f8=e=>{if(void 0!==_2)return _2(e);throw new Error('Dynamic require of "'+e+'" is not supported')},jge=(e,t)=>function(){return t||(0,e[Object.keys(e)[0]])((t={exports:{}}).exports,t),t.exports},kIt=(e,t,i)=>new Promise(((r,n)=>{var s=e=>{try{o(i.next(e))}catch(e){n(e)}},a=e=>{try{o(i.throw(e))}catch(e){n(e)}},o=e=>e.done?r(e.value):Promise.resolve(e.value).then(s,a);o((i=i.apply(e,t)).next())})),GIt=jge({"(disabled):crypto"(){}}),VIt=jge({"dist/web-ifc.js"(e,t){var i,r=(i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(i=i||__filename),function(e){var t,r,n=void 0!==(e=e||{})?e:{};n.ready=new Promise((function(e,i){t=e,r=i}));var s,a={};for(s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);var o,l,h,u,c=[],p="./this.program",d=function(e,t){throw t};h="object"==typeof window,u="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,l=!h&&!o&&!u;var f,m,g,y,v="";o?(v=u?f8("path").dirname(v)+"/":__dirname+"/",f=function(e,t){return g||(g=f8("fs")),y||(y=f8("path")),e=y.normalize(e),g.readFileSync(e,t?null:"utf8")},m=function(e){var t=f(e,!0);return t.buffer||(t=new Uint8Array(t)),S(t.buffer),t},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),c=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof $t))throw e})),process.on("unhandledRejection",oe),d=function(e){process.exit(e)},n.inspect=function(){return"[Emscripten Module object]"}):l?("undefined"!=typeof read&&(f=function(e){return read(e)}),m=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(S("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?c=scriptArgs:void 0!==arguments&&(c=arguments),"function"==typeof quit&&(d=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(h||u)&&(u?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),i&&(v=i),v=0!==v.indexOf("blob:")?v.slice(0,v.lastIndexOf("/")+1):"",f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(m=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var T=n.print||console.log.bind(console),x=n.printErr||console.warn.bind(console);for(s in a)a.hasOwnProperty(s)&&(n[s]=a[s]);a=null,n.arguments&&(c=n.arguments),n.thisProgram&&(p=n.thisProgram),n.quit&&(d=n.quit);var b,E;n.wasmBinary&&(b=n.wasmBinary),n.noExitRuntime&&(E=n.noExitRuntime),"object"!=typeof WebAssembly&&oe("no native wasm support detected");var _,w=!1;function S(e,t){e||oe("Assertion failed: "+t)}var M="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(e,t,i){for(var r=(t>>>=0)+i,n=t;e[n>>>0]&&!(n>=r);)++n;if(n-t>16&&e.subarray&&M)return M.decode(e.subarray(t>>>0,n>>>0));for(var s="";t<n;){var a=e[t++>>>0];if(128&a){var o=63&e[t++>>>0];if(192!=(224&a)){var l=63&e[t++>>>0];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&e[t++>>>0])<65536)s+=String.fromCharCode(a);else{var h=a-65536;s+=String.fromCharCode(55296|h>>10,56320|1023&h)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}function D(e,t){return(e>>>=0)?I(N,e,t):""}function A(e,t,i,r){if(!(r>0))return 0;for(var n=i>>>=0,s=i+r-1,a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),o<=127){if(i>=s)break;t[i++>>>0]=o}else if(o<=2047){if(i+1>=s)break;t[i++>>>0]=192|o>>6,t[i++>>>0]=128|63&o}else if(o<=65535){if(i+2>=s)break;t[i++>>>0]=224|o>>12,t[i++>>>0]=128|o>>6&63,t[i++>>>0]=128|63&o}else{if(i+3>=s)break;t[i++>>>0]=240|o>>18,t[i++>>>0]=128|o>>12&63,t[i++>>>0]=128|o>>6&63,t[i++>>>0]=128|63&o}}return t[i>>>0]=0,i-n}function R(e,t,i){return A(e,N,t,i)}function C(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++i)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}var O,P,N,L,F,U,k,B,z,G="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function H(e,t){for(var i=e,r=i>>1,n=r+t/2;!(r>=n)&&F[r>>>0];)++r;if((i=r<<1)-e>32&&G)return G.decode(N.subarray(e>>>0,i>>>0));for(var s="",a=0;!(a>=t/2);++a){var o=L[e+2*a>>>1];if(0==o)break;s+=String.fromCharCode(o)}return s}function V(e,t,i){if(void 0===i&&(i=2147483647),i<2)return 0;for(var r=t,n=(i-=2)<2*e.length?i/2:e.length,s=0;s<n;++s){var a=e.charCodeAt(s);L[t>>>1]=a,t+=2}return L[t>>>1]=0,t-r}function j(e){return 2*e.length}function W(e,t){for(var i=0,r="";!(i>=t/4);){var n=U[e+4*i>>>2];if(0==n)break;if(++i,n>=65536){var s=n-65536;r+=String.fromCharCode(55296|s>>10,56320|1023&s)}else r+=String.fromCharCode(n)}return r}function Y(e,t,i){if(void 0===i&&(i=2147483647),i<4)return 0;for(var r=t>>>=0,n=r+i-4,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),U[t>>>2]=a,(t+=4)+4>n)break}return U[t>>>2]=0,t-r}function X(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r>=55296&&r<=57343&&++i,t+=4}return t}function q(e,t){return e%t>0&&(e+=t-e%t),e}function Z(e){O=e,n.HEAP8=P=new Int8Array(e),n.HEAP16=L=new Int16Array(e),n.HEAP32=U=new Int32Array(e),n.HEAPU8=N=new Uint8Array(e),n.HEAPU16=F=new Uint16Array(e),n.HEAPU32=k=new Uint32Array(e),n.HEAPF32=B=new Float32Array(e),n.HEAPF64=z=new Float64Array(e)}var J=n.INITIAL_MEMORY||16777216;(_=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:J/65536,maximum:65536}))&&(O=_.buffer),J=O.byteLength,Z(O);var K,$=[],Q=[],ee=[],te=[],ie=0,re=null,ne=null;function se(e){ie++,n.monitorRunDependencies&&n.monitorRunDependencies(ie)}function ae(e){if(ie--,n.monitorRunDependencies&&n.monitorRunDependencies(ie),0==ie&&(null!==re&&(clearInterval(re),re=null),ne)){var t=ne;ne=null,t()}}function oe(e){n.onAbort&&n.onAbort(e),x(e+=""),w=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw r(t),t}function le(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}n.preloadedImages={},n.preloadedAudios={};function he(e){return le(e,"data:application/octet-stream;base64,")}function ue(e){return le(e,"file://")}var ce,pe,de,fe=hCe+"web-ifc.wasm";function me(){try{if(b)return new Uint8Array(b);if(m)return m(fe);throw"both async and sync fetching of the wasm failed"}catch(e){oe(e)}}function ge(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var i=t.func;"number"==typeof i?void 0===t.arg?K.get(i)():K.get(i)(t.arg):i(void 0===t.arg?null:t.arg)}else t(n)}}function ye(e){return U[Jt()>>>2]=e,e}he(fe)||(ce=fe,fe=n.locateFile?n.locateFile(ce,v):v+ce);var ve={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var i=0,r=e.length-1;r>=0;r--){var n=e[r];"."===n?e.splice(r,1):".."===n?(e.splice(r,1),i++):i&&(e.splice(r,1),i--)}if(t)for(;i;i--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),i="/"===e.slice(-1);return!(e=ve.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))&&!t&&(e="."),e&&i&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=ve.splitPath(e),i=t[0],r=t[1];return i||r?(r&&(r=r.slice(0,r.length-1)),i+r):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=ve.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.slice(t+1)},extname:function(e){return ve.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ve.normalize(e.join("/"))},join2:function(e,t){return ve.normalize(e+"/"+t)}},Te={resolve:function(){for(var e="",t=!1,i=arguments.length-1;i>=-1&&!t;i--){var r=i>=0?arguments[i]:Ee.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t="/"===r.charAt(0)}return(t?"/":"")+(e=ve.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function i(e){for(var t=0;t<e.length&&""===e[t];t++);for(var i=e.length-1;i>=0&&""===e[i];i--);return t>i?[]:e.slice(t,i-t+1)}e=Te.resolve(e).slice(1),t=Te.resolve(t).slice(1);for(var r=i(e.split("/")),n=i(t.split("/")),s=Math.min(r.length,n.length),a=s,o=0;o<s;o++)if(r[o]!==n[o]){a=o;break}var l=[];for(o=a;o<r.length;o++)l.push("..");return(l=l.concat(n.slice(a))).join("/")}},xe={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){xe.ttys[e]={input:[],output:[],ops:t},Ee.registerDevice(e,xe.stream_ops)},stream_ops:{open:function(e){var t=xe.ttys[e.node.rdev];if(!t)throw new Ee.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,i,r,n){if(!e.tty||!e.tty.ops.get_char)throw new Ee.ErrnoError(60);for(var s=0,a=0;a<r;a++){var o;try{o=e.tty.ops.get_char(e.tty)}catch(e){throw new Ee.ErrnoError(29)}if(void 0===o&&0===s)throw new Ee.ErrnoError(6);if(null==o)break;s++,t[i+a]=o}return s&&(e.node.timestamp=Date.now()),s},write:function(e,t,i,r,n){if(!e.tty||!e.tty.ops.put_char)throw new Ee.ErrnoError(60);try{for(var s=0;s<r;s++)e.tty.ops.put_char(e.tty,t[i+s])}catch(e){throw new Ee.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),s}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(o){var i=Buffer.alloc?Buffer.alloc(256):new Buffer(256),r=0;try{r=g.readSync(process.stdin.fd,i,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;r=0}t=r>0?i.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=jt(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(T(I(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(T(I(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(x(I(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(x(I(e.output,0)),e.output=[])}}};var be={ops_table:null,mount:function(e){return be.createNode(null,"/",16895,0)},createNode:function(e,t,i,r){if(Ee.isBlkdev(i)||Ee.isFIFO(i))throw new Ee.ErrnoError(63);be.ops_table||(be.ops_table={dir:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,lookup:be.node_ops.lookup,mknod:be.node_ops.mknod,rename:be.node_ops.rename,unlink:be.node_ops.unlink,rmdir:be.node_ops.rmdir,readdir:be.node_ops.readdir,symlink:be.node_ops.symlink},stream:{llseek:be.stream_ops.llseek}},file:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:{llseek:be.stream_ops.llseek,read:be.stream_ops.read,write:be.stream_ops.write,allocate:be.stream_ops.allocate,mmap:be.stream_ops.mmap,msync:be.stream_ops.msync}},link:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,readlink:be.node_ops.readlink},stream:{}},chrdev:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:Ee.chrdev_stream_ops}});var n=Ee.createNode(e,t,i,r);return Ee.isDir(n.mode)?(n.node_ops=be.ops_table.dir.node,n.stream_ops=be.ops_table.dir.stream,n.contents={}):Ee.isFile(n.mode)?(n.node_ops=be.ops_table.file.node,n.stream_ops=be.ops_table.file.stream,n.usedBytes=0,n.contents=null):Ee.isLink(n.mode)?(n.node_ops=be.ops_table.link.node,n.stream_ops=be.ops_table.link.stream):Ee.isChrdev(n.mode)&&(n.node_ops=be.ops_table.chrdev.node,n.stream_ops=be.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[t]=n),n},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var t=[],i=0;i<e.usedBytes;++i)t.push(e.contents[i]);return t}return e.contents},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){t>>>=0;var i=e.contents?e.contents.length:0;if(!(i>=t)){t=Math.max(t,i*(i<1048576?2:1.125)>>>0),0!=i&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(t>>>=0,e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var i=e.contents;return e.contents=new Uint8Array(t),i&&e.contents.set(i.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length<t;)e.contents.push(0);e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=Ee.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ee.isDir(e.mode)?t.size=4096:Ee.isFile(e.mode)?t.size=e.usedBytes:Ee.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&be.resizeFileStorage(e,t.size)},lookup:function(e,t){throw Ee.genericErrors[44]},mknod:function(e,t,i,r){return be.createNode(e,t,i,r)},rename:function(e,t,i){if(Ee.isDir(e.mode)){var r;try{r=Ee.lookupNode(t,i)}catch(e){}if(r)for(var n in r.contents)throw new Ee.ErrnoError(55)}delete e.parent.contents[e.name],e.name=i,t.contents[i]=e,e.parent=t},unlink:function(e,t){delete e.contents[t]},rmdir:function(e,t){var i=Ee.lookupNode(e,t);for(var r in i.contents)throw new Ee.ErrnoError(55);delete e.contents[t]},readdir:function(e){var t=[".",".."];for(var i in e.contents)e.contents.hasOwnProperty(i)&&t.push(i);return t},symlink:function(e,t,i){var r=be.createNode(e,t,41471,0);return r.link=i,r},readlink:function(e){if(!Ee.isLink(e.mode))throw new Ee.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,i,r,n){var s=e.node.contents;if(n>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-n,r);if(a>8&&s.subarray)t.set(s.subarray(n,n+a),i);else for(var o=0;o<a;o++)t[i+o]=s[n+o];return a},write:function(e,t,i,r,n,s){if(t.buffer===P.buffer&&(s=!1),!r)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(s)return a.contents=t.subarray(i,i+r),a.usedBytes=r,r;if(0===a.usedBytes&&0===n)return a.contents=t.slice(i,i+r),a.usedBytes=r,r;if(n+r<=a.usedBytes)return a.contents.set(t.subarray(i,i+r),n),r}if(be.expandFileStorage(a,n+r),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(i,i+r),n);else for(var o=0;o<r;o++)a.contents[n+o]=t[i+o];return a.usedBytes=Math.max(a.usedBytes,n+r),r},llseek:function(e,t,i){var r=t;if(1===i?r+=e.position:2===i&&Ee.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new Ee.ErrnoError(28);return r},allocate:function(e,t,i){be.expandFileStorage(e.node,t+i),e.node.usedBytes=Math.max(e.node.usedBytes,t+i)},mmap:function(e,t,i,r,n,s){if(S(0===t),!Ee.isFile(e.node.mode))throw new Ee.ErrnoError(43);var a,o,l=e.node.contents;if(2&s||l.buffer!==O){if((r>0||r+i<l.length)&&(l=l.subarray?l.subarray(r,r+i):Array.prototype.slice.call(l,r,r+i)),o=!0,!(a=function(e){for(var t=function(e,t){return t||(t=16),Math.ceil(e/t)*t}(e,16384),i=qt(t);e<t;)P[i+e++>>>0]=0;return i}(i)))throw new Ee.ErrnoError(48);a>>>=0,P.set(l,a>>>0)}else o=!1,a=l.byteOffset;return{ptr:a,allocated:o}},msync:function(e,t,i,r,n){if(!Ee.isFile(e.node.mode))throw new Ee.ErrnoError(43);return 2&n||be.stream_ops.write(e,t,0,r,i,!1),0}}},Ee={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,t){if(t=t||{},!(e=Te.resolve(Ee.cwd(),e)))return{path:"",node:null};var i={follow_mount:!0,recurse_count:0};for(var r in i)void 0===t[r]&&(t[r]=i[r]);if(t.recurse_count>8)throw new Ee.ErrnoError(32);for(var n=ve.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),s=Ee.root,a="/",o=0;o<n.length;o++){var l=o===n.length-1;if(l&&t.parent)break;if(s=Ee.lookupNode(s,n[o]),a=ve.join2(a,n[o]),Ee.isMountpoint(s)&&(!l||l&&t.follow_mount)&&(s=s.mounted.root),!l||t.follow)for(var h=0;Ee.isLink(s.mode);){var u=Ee.readlink(a);if(a=Te.resolve(ve.dirname(a),u),s=Ee.lookupPath(a,{recurse_count:t.recurse_count}).node,h++>40)throw new Ee.ErrnoError(32)}}return{path:a,node:s}},getPath:function(e){for(var t;;){if(Ee.isRoot(e)){var i=e.mount.mountpoint;return t?"/"!==i[i.length-1]?i+"/"+t:i+t:i}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var i=0,r=0;r<t.length;r++)i=(i<<5)-i+t.charCodeAt(r)|0;return(e+i>>>0)%Ee.nameTable.length},hashAddNode:function(e){var t=Ee.hashName(e.parent.id,e.name);e.name_next=Ee.nameTable[t],Ee.nameTable[t]=e},hashRemoveNode:function(e){var t=Ee.hashName(e.parent.id,e.name);if(Ee.nameTable[t]===e)Ee.nameTable[t]=e.name_next;else for(var i=Ee.nameTable[t];i;){if(i.name_next===e){i.name_next=e.name_next;break}i=i.name_next}},lookupNode:function(e,t){var i=Ee.mayLookup(e);if(i)throw new Ee.ErrnoError(i,e);for(var r=Ee.hashName(e.id,t),n=Ee.nameTable[r];n;n=n.name_next){var s=n.name;if(n.parent.id===e.id&&s===t)return n}return Ee.lookup(e,t)},createNode:function(e,t,i,r){var n=new Ee.FSNode(e,t,i,r);return Ee.hashAddNode(n),n},destroyNode:function(e){Ee.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=Ee.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return Ee.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){return Ee.nodePermissions(e,"x")||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return Ee.lookupNode(e,t),20}catch(e){}return Ee.nodePermissions(e,"wx")},mayDelete:function(e,t,i){var r;try{r=Ee.lookupNode(e,t)}catch(e){return e.errno}var n=Ee.nodePermissions(e,"wx");if(n)return n;if(i){if(!Ee.isDir(r.mode))return 54;if(Ee.isRoot(r)||Ee.getPath(r)===Ee.cwd())return 10}else if(Ee.isDir(r.mode))return 31;return 0},mayOpen:function(e,t){return e?Ee.isLink(e.mode)?32:Ee.isDir(e.mode)&&("r"!==Ee.flagsToPermissionString(t)||512&t)?31:Ee.nodePermissions(e,Ee.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||Ee.MAX_OPEN_FDS;for(var i=e;i<=t;i++)if(!Ee.streams[i])return i;throw new Ee.ErrnoError(33)},getStream:function(e){return Ee.streams[e]},createStream:function(e,t,i){Ee.FSStream||(Ee.FSStream=function(){},Ee.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var r=new Ee.FSStream;for(var n in e)r[n]=e[n];e=r;var s=Ee.nextfd(t,i);return e.fd=s,Ee.streams[s]=e,e},closeStream:function(e){Ee.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=Ee.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new Ee.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){Ee.devices[e]={stream_ops:t}},getDevice:function(e){return Ee.devices[e]},getMounts:function(e){for(var t=[],i=[e];i.length;){var r=i.pop();t.push(r),i.push.apply(i,r.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),Ee.syncFSRequests++,Ee.syncFSRequests>1&&x("warning: "+Ee.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var i=Ee.getMounts(Ee.root.mount),r=0;function n(e){return Ee.syncFSRequests--,t(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,n(e));++r>=i.length&&n(null)}i.forEach((function(t){if(!t.type.syncfs)return s(null);t.type.syncfs(t,e,s)}))},mount:function(e,t,i){var r,n="/"===i,s=!i;if(n&&Ee.root)throw new Ee.ErrnoError(10);if(!n&&!s){var a=Ee.lookupPath(i,{follow_mount:!1});if(i=a.path,r=a.node,Ee.isMountpoint(r))throw new Ee.ErrnoError(10);if(!Ee.isDir(r.mode))throw new Ee.ErrnoError(54)}var o={type:e,opts:t,mountpoint:i,mounts:[]},l=e.mount(o);return l.mount=o,o.root=l,n?Ee.root=l:r&&(r.mounted=o,r.mount&&r.mount.mounts.push(o)),l},unmount:function(e){var t=Ee.lookupPath(e,{follow_mount:!1});if(!Ee.isMountpoint(t.node))throw new Ee.ErrnoError(28);var i=t.node,r=i.mounted,n=Ee.getMounts(r);Object.keys(Ee.nameTable).forEach((function(e){for(var t=Ee.nameTable[e];t;){var i=t.name_next;-1!==n.indexOf(t.mount)&&Ee.destroyNode(t),t=i}})),i.mounted=null;var s=i.mount.mounts.indexOf(r);i.mount.mounts.splice(s,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,i){var r=Ee.lookupPath(e,{parent:!0}).node,n=ve.basename(e);if(!n||"."===n||".."===n)throw new Ee.ErrnoError(28);var s=Ee.mayCreate(r,n);if(s)throw new Ee.ErrnoError(s);if(!r.node_ops.mknod)throw new Ee.ErrnoError(63);return r.node_ops.mknod(r,n,t,i)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,Ee.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,Ee.mknod(e,t,0)},mkdirTree:function(e,t){for(var i=e.split("/"),r="",n=0;n<i.length;++n)if(i[n]){r+="/"+i[n];try{Ee.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,i){return void 0===i&&(i=t,t=438),t|=8192,Ee.mknod(e,t,i)},symlink:function(e,t){if(!Te.resolve(e))throw new Ee.ErrnoError(44);var i=Ee.lookupPath(t,{parent:!0}).node;if(!i)throw new Ee.ErrnoError(44);var r=ve.basename(t),n=Ee.mayCreate(i,r);if(n)throw new Ee.ErrnoError(n);if(!i.node_ops.symlink)throw new Ee.ErrnoError(63);return i.node_ops.symlink(i,r,e)},rename:function(e,t){var i,r,n=ve.dirname(e),s=ve.dirname(t),a=ve.basename(e),o=ve.basename(t);if(i=Ee.lookupPath(e,{parent:!0}).node,r=Ee.lookupPath(t,{parent:!0}).node,!i||!r)throw new Ee.ErrnoError(44);if(i.mount!==r.mount)throw new Ee.ErrnoError(75);var l,h=Ee.lookupNode(i,a),u=Te.relative(e,s);if("."!==u.charAt(0))throw new Ee.ErrnoError(28);if("."!==(u=Te.relative(t,n)).charAt(0))throw new Ee.ErrnoError(55);try{l=Ee.lookupNode(r,o)}catch(e){}if(h!==l){var c=Ee.isDir(h.mode),p=Ee.mayDelete(i,a,c);if(p)throw new Ee.ErrnoError(p);if(p=l?Ee.mayDelete(r,o,c):Ee.mayCreate(r,o))throw new Ee.ErrnoError(p);if(!i.node_ops.rename)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(h)||l&&Ee.isMountpoint(l))throw new Ee.ErrnoError(10);if(r!==i&&(p=Ee.nodePermissions(i,"w")))throw new Ee.ErrnoError(p);try{Ee.trackingDelegate.willMovePath&&Ee.trackingDelegate.willMovePath(e,t)}catch(i){x("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+i.message)}Ee.hashRemoveNode(h);try{i.node_ops.rename(h,r,o)}catch(e){throw e}finally{Ee.hashAddNode(h)}try{Ee.trackingDelegate.onMovePath&&Ee.trackingDelegate.onMovePath(e,t)}catch(i){x("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+i.message)}}},rmdir:function(e){var t=Ee.lookupPath(e,{parent:!0}).node,i=ve.basename(e),r=Ee.lookupNode(t,i),n=Ee.mayDelete(t,i,!0);if(n)throw new Ee.ErrnoError(n);if(!t.node_ops.rmdir)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(r))throw new Ee.ErrnoError(10);try{Ee.trackingDelegate.willDeletePath&&Ee.trackingDelegate.willDeletePath(e)}catch(t){x("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,i),Ee.destroyNode(r);try{Ee.trackingDelegate.onDeletePath&&Ee.trackingDelegate.onDeletePath(e)}catch(t){x("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=Ee.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ee.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=Ee.lookupPath(e,{parent:!0}).node,i=ve.basename(e),r=Ee.lookupNode(t,i),n=Ee.mayDelete(t,i,!1);if(n)throw new Ee.ErrnoError(n);if(!t.node_ops.unlink)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(r))throw new Ee.ErrnoError(10);try{Ee.trackingDelegate.willDeletePath&&Ee.trackingDelegate.willDeletePath(e)}catch(t){x("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,i),Ee.destroyNode(r);try{Ee.trackingDelegate.onDeletePath&&Ee.trackingDelegate.onDeletePath(e)}catch(t){x("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=Ee.lookupPath(e).node;if(!t)throw new Ee.ErrnoError(44);if(!t.node_ops.readlink)throw new Ee.ErrnoError(28);return Te.resolve(Ee.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var i=Ee.lookupPath(e,{follow:!t}).node;if(!i)throw new Ee.ErrnoError(44);if(!i.node_ops.getattr)throw new Ee.ErrnoError(63);return i.node_ops.getattr(i)},lstat:function(e){return Ee.stat(e,!0)},chmod:function(e,t,i){var r;if(!(r="string"==typeof e?Ee.lookupPath(e,{follow:!i}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod:function(e,t){Ee.chmod(e,t,!0)},fchmod:function(e,t){var i=Ee.getStream(e);if(!i)throw new Ee.ErrnoError(8);Ee.chmod(i.node,t)},chown:function(e,t,i,r){var n;if(!(n="string"==typeof e?Ee.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:function(e,t,i){Ee.chown(e,t,i,!0)},fchown:function(e,t,i){var r=Ee.getStream(e);if(!r)throw new Ee.ErrnoError(8);Ee.chown(r.node,t,i)},truncate:function(e,t){if(t<0)throw new Ee.ErrnoError(28);var i;if(!(i="string"==typeof e?Ee.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);if(Ee.isDir(i.mode))throw new Ee.ErrnoError(31);if(!Ee.isFile(i.mode))throw new Ee.ErrnoError(28);var r=Ee.nodePermissions(i,"w");if(r)throw new Ee.ErrnoError(r);i.node_ops.setattr(i,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var i=Ee.getStream(e);if(!i)throw new Ee.ErrnoError(8);if(!(2097155&i.flags))throw new Ee.ErrnoError(28);Ee.truncate(i.node,t)},utime:function(e,t,i){var r=Ee.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,i)})},open:function(e,t,i,r,s){if(""===e)throw new Ee.ErrnoError(44);var a;if(i=void 0===i?438:i,i=64&(t="string"==typeof t?Ee.modeStringToFlags(t):t)?4095&i|32768:0,"object"==typeof e)a=e;else{e=ve.normalize(e);try{a=Ee.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(a){if(128&t)throw new Ee.ErrnoError(20)}else a=Ee.mknod(e,i,0),o=!0;if(!a)throw new Ee.ErrnoError(44);if(Ee.isChrdev(a.mode)&&(t&=-513),65536&t&&!Ee.isDir(a.mode))throw new Ee.ErrnoError(54);if(!o){var l=Ee.mayOpen(a,t);if(l)throw new Ee.ErrnoError(l)}512&t&&Ee.truncate(a,0),t&=-131713;var h=Ee.createStream({node:a,path:Ee.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},r,s);h.stream_ops.open&&h.stream_ops.open(h),n.logReadFiles&&!(1&t)&&(Ee.readFiles||(Ee.readFiles={}),e in Ee.readFiles||(Ee.readFiles[e]=1,x("FS.trackingDelegate error on read file: "+e)));try{if(Ee.trackingDelegate.onOpenFile){var u=0;1!=(2097155&t)&&(u|=Ee.tracking.openFlags.READ),2097155&t&&(u|=Ee.tracking.openFlags.WRITE),Ee.trackingDelegate.onOpenFile(e,u)}}catch(t){x("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return h},close:function(e){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ee.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,i){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ee.ErrnoError(70);if(0!=i&&1!=i&&2!=i)throw new Ee.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,i),e.ungotten=[],e.position},read:function(e,t,i,r,n){if(i>>>=0,r<0||n<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(1==(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.read)throw new Ee.ErrnoError(28);var s=void 0!==n;if(s){if(!e.seekable)throw new Ee.ErrnoError(70)}else n=e.position;var a=e.stream_ops.read(e,t,i,r,n);return s||(e.position+=a),a},write:function(e,t,i,r,n,s){if(i>>>=0,r<0||n<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.write)throw new Ee.ErrnoError(28);e.seekable&&1024&e.flags&&Ee.llseek(e,0,2);var a=void 0!==n;if(a){if(!e.seekable)throw new Ee.ErrnoError(70)}else n=e.position;var o=e.stream_ops.write(e,t,i,r,n,s);a||(e.position+=o);try{e.path&&Ee.trackingDelegate.onWriteToFile&&Ee.trackingDelegate.onWriteToFile(e.path)}catch(t){x("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return o},allocate:function(e,t,i){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(t<0||i<=0)throw new Ee.ErrnoError(28);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(!Ee.isFile(e.node.mode)&&!Ee.isDir(e.node.mode))throw new Ee.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ee.ErrnoError(138);e.stream_ops.allocate(e,t,i)},mmap:function(e,t,i,r,n,s){if(t>>>=0,2&n&&!(2&s)&&2!=(2097155&e.flags))throw new Ee.ErrnoError(2);if(1==(2097155&e.flags))throw new Ee.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ee.ErrnoError(43);return e.stream_ops.mmap(e,t,i,r,n,s)},msync:function(e,t,i,r,n){return i>>>=0,e&&e.stream_ops.msync?e.stream_ops.msync(e,t,i,r,n):0},munmap:function(e){return 0},ioctl:function(e,t,i){if(!e.stream_ops.ioctl)throw new Ee.ErrnoError(59);return e.stream_ops.ioctl(e,t,i)},readFile:function(e,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var i,r=Ee.open(e,t.flags),n=Ee.stat(e).size,s=new Uint8Array(n);return Ee.read(r,s,0,n,0),"utf8"===t.encoding?i=I(s,0):"binary"===t.encoding&&(i=s),Ee.close(r),i},writeFile:function(e,t,i){(i=i||{}).flags=i.flags||577;var r=Ee.open(e,i.flags,i.mode);if("string"==typeof t){var n=new Uint8Array(C(t)+1),s=A(t,n,0,n.length);Ee.write(r,n,0,s,void 0,i.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ee.write(r,t,0,t.byteLength,void 0,i.canOwn)}Ee.close(r)},cwd:function(){return Ee.currentPath},chdir:function(e){var t=Ee.lookupPath(e,{follow:!0});if(null===t.node)throw new Ee.ErrnoError(44);if(!Ee.isDir(t.node.mode))throw new Ee.ErrnoError(54);var i=Ee.nodePermissions(t.node,"x");if(i)throw new Ee.ErrnoError(i);Ee.currentPath=t.path},createDefaultDirectories:function(){Ee.mkdir("/tmp"),Ee.mkdir("/home"),Ee.mkdir("/home/web_user")},createDefaultDevices:function(){Ee.mkdir("/dev"),Ee.registerDevice(Ee.makedev(1,3),{read:function(){return 0},write:function(e,t,i,r,n){return r}}),Ee.mkdev("/dev/null",Ee.makedev(1,3)),xe.register(Ee.makedev(5,0),xe.default_tty_ops),xe.register(Ee.makedev(6,0),xe.default_tty1_ops),Ee.mkdev("/dev/tty",Ee.makedev(5,0)),Ee.mkdev("/dev/tty1",Ee.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(o)try{var t=GIt();return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){oe("randomDevice")}}();Ee.createDevice("/dev","random",e),Ee.createDevice("/dev","urandom",e),Ee.mkdir("/dev/shm"),Ee.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Ee.mkdir("/proc"),Ee.mkdir("/proc/self"),Ee.mkdir("/proc/self/fd"),Ee.mount({mount:function(){var e=Ee.createNode("/proc/self","fd",16895,73);return e.node_ops={lookup:function(e,t){var i=+t,r=Ee.getStream(i);if(!r)throw new Ee.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return r.path}}};return n.parent=n,n}},e}},{},"/proc/self/fd")},createStandardStreams:function(){n.stdin?Ee.createDevice("/dev","stdin",n.stdin):Ee.symlink("/dev/tty","/dev/stdin"),n.stdout?Ee.createDevice("/dev","stdout",null,n.stdout):Ee.symlink("/dev/tty","/dev/stdout"),n.stderr?Ee.createDevice("/dev","stderr",null,n.stderr):Ee.symlink("/dev/tty1","/dev/stderr"),Ee.open("/dev/stdin",0),Ee.open("/dev/stdout",1),Ee.open("/dev/stderr",1)},ensureErrnoError:function(){Ee.ErrnoError||(Ee.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Ee.ErrnoError.prototype=new Error,Ee.ErrnoError.prototype.constructor=Ee.ErrnoError,[44].forEach((function(e){Ee.genericErrors[e]=new Ee.ErrnoError(e),Ee.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){Ee.ensureErrnoError(),Ee.nameTable=new Array(4096),Ee.mount(be,{},"/"),Ee.createDefaultDirectories(),Ee.createDefaultDevices(),Ee.createSpecialDirectories(),Ee.filesystems={MEMFS:be}},init:function(e,t,i){Ee.init.initialized=!0,Ee.ensureErrnoError(),n.stdin=e||n.stdin,n.stdout=t||n.stdout,n.stderr=i||n.stderr,Ee.createStandardStreams()},quit:function(){Ee.init.initialized=!1;var e=n._fflush;e&&e(0);for(var t=0;t<Ee.streams.length;t++){var i=Ee.streams[t];i&&Ee.close(i)}},getMode:function(e,t){var i=0;return e&&(i|=365),t&&(i|=146),i},findObject:function(e,t){var i=Ee.analyzePath(e,t);return i.exists?i.object:null},analyzePath:function(e,t){try{e=(r=Ee.lookupPath(e,{follow:!t})).path}catch(e){}var i={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=Ee.lookupPath(e,{parent:!0});i.parentExists=!0,i.parentPath=r.path,i.parentObject=r.node,i.name=ve.basename(e),r=Ee.lookupPath(e,{follow:!t}),i.exists=!0,i.path=r.path,i.object=r.node,i.name=r.node.name,i.isRoot="/"===r.path}catch(e){i.error=e.errno}return i},createPath:function(e,t,i,r){e="string"==typeof e?e:Ee.getPath(e);for(var n=t.split("/").reverse();n.length;){var s=n.pop();if(s){var a=ve.join2(e,s);try{Ee.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,i,r,n){var s=ve.join2("string"==typeof e?e:Ee.getPath(e),t),a=Ee.getMode(r,n);return Ee.create(s,a)},createDataFile:function(e,t,i,r,n,s){var a=t?ve.join2("string"==typeof e?e:Ee.getPath(e),t):e,o=Ee.getMode(r,n),l=Ee.create(a,o);if(i){if("string"==typeof i){for(var h=new Array(i.length),u=0,c=i.length;u<c;++u)h[u]=i.charCodeAt(u);i=h}Ee.chmod(l,146|o);var p=Ee.open(l,577);Ee.write(p,i,0,i.length,0,s),Ee.close(p),Ee.chmod(l,o)}return l},createDevice:function(e,t,i,r){var n=ve.join2("string"==typeof e?e:Ee.getPath(e),t),s=Ee.getMode(!!i,!!r);Ee.createDevice.major||(Ee.createDevice.major=64);var a=Ee.makedev(Ee.createDevice.major++,0);return Ee.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,t,r,n,s){for(var a=0,o=0;o<n;o++){var l;try{l=i()}catch(e){throw new Ee.ErrnoError(29)}if(void 0===l&&0===a)throw new Ee.ErrnoError(6);if(null==l)break;a++,t[r+o]=l}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,i,n,s){for(var a=0;a<n;a++)try{r(t[i+a])}catch(e){throw new Ee.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}}),Ee.mkdev(n,s,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=jt(f(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ee.ErrnoError(29)}},createLazyFile:function(e,t,i,r,n){function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,i=e/this.chunkSize|0;return this.getter(i)[t]}},s.prototype.setDataGetter=function(e){this.getter=e},s.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",i,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+i+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,s=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;n||(a=r);var o=this;o.setDataGetter((function(e){var t=e*a,n=(e+1)*a-1;if(n=Math.min(n,r-1),void 0===o.chunks[e]&&(o.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",i,!1),r!==a&&n.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(n.responseType="arraybuffer"),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+i+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):jt(n.responseText||"",!0)}(t,n)),void 0===o.chunks[e])throw new Error("doXHR failed!");return o.chunks[e]})),(s||!r)&&(a=r=1,r=this.getter(0).length,a=r,T("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new s;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var o={isDevice:!1,contents:a}}else o={isDevice:!1,url:i};var l=Ee.createFile(e,t,o,r,n);o.contents?l.contents=o.contents:o.url&&(l.contents=null,l.url=o.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var h={};return Object.keys(l.stream_ops).forEach((function(e){var t=l.stream_ops[e];h[e]=function(){return Ee.forceLoadFile(l),t.apply(null,arguments)}})),h.read=function(e,t,i,r,n){Ee.forceLoadFile(l);var s=e.node.contents;if(n>=s.length)return 0;var a=Math.min(s.length-n,r);if(s.slice)for(var o=0;o<a;o++)t[i+o]=s[n+o];else for(o=0;o<a;o++)t[i+o]=s.get(n+o);return a},l.stream_ops=h,l},createPreloadedFile:function(e,t,i,r,s,a,o,l,h,u){Browser.init();var c=t?Te.resolve(ve.join2(e,t)):e;function p(i){function p(i){u&&u(),l||Ee.createDataFile(e,t,i,r,s,h),a&&a(),ae()}var d=!1;n.preloadPlugins.forEach((function(e){d||e.canHandle(c)&&(e.handle(i,c,p,(function(){o&&o(),ae()})),d=!0)})),d||p(i)}se(),"string"==typeof i?Browser.asyncLoad(i,(function(e){p(e)}),o):p(i)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,i){t=t||function(){},i=i||function(){};var r=Ee.indexedDB();try{var n=r.open(Ee.DB_NAME(),Ee.DB_VERSION)}catch(e){return i(e)}n.onupgradeneeded=function(){T("creating db"),n.result.createObjectStore(Ee.DB_STORE_NAME)},n.onsuccess=function(){var r=n.result.transaction([Ee.DB_STORE_NAME],"readwrite"),s=r.objectStore(Ee.DB_STORE_NAME),a=0,o=0,l=e.length;function h(){0==o?t():i()}e.forEach((function(e){var t=s.put(Ee.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+o==l&&h()},t.onerror=function(){o++,a+o==l&&h()}})),r.onerror=i},n.onerror=i},loadFilesFromDB:function(e,t,i){t=t||function(){},i=i||function(){};var r=Ee.indexedDB();try{var n=r.open(Ee.DB_NAME(),Ee.DB_VERSION)}catch(e){return i(e)}n.onupgradeneeded=i,n.onsuccess=function(){var r=n.result;try{var s=r.transaction([Ee.DB_STORE_NAME],"readonly")}catch(e){return void i(e)}var a=s.objectStore(Ee.DB_STORE_NAME),o=0,l=0,h=e.length;function u(){0==l?t():i()}e.forEach((function(e){var t=a.get(e);t.onsuccess=function(){Ee.analyzePath(e).exists&&Ee.unlink(e),Ee.createDataFile(ve.dirname(e),ve.basename(e),t.result,!0,!0,!0),++o+l==h&&u()},t.onerror=function(){l++,o+l==h&&u()}})),s.onerror=i},n.onerror=i}},_e={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(e,t){if("/"!==t[0]){var i;if(-100===e)i=Ee.cwd();else{var r=Ee.getStream(e);if(!r)throw new Ee.ErrnoError(8);i=r.path}t=ve.join2(i,t)}return t},doStat:function(e,t,i){try{var r=e(t)}catch(e){if(e&&e.node&&ve.normalize(t)!==ve.normalize(Ee.getPath(e.node)))return-54;throw e}return U[i>>>2]=r.dev,U[i+4>>>2]=0,U[i+8>>>2]=r.ino,U[i+12>>>2]=r.mode,U[i+16>>>2]=r.nlink,U[i+20>>>2]=r.uid,U[i+24>>>2]=r.gid,U[i+28>>>2]=r.rdev,U[i+32>>>2]=0,de=[r.size>>>0,(pe=r.size,+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],U[i+40>>>2]=de[0],U[i+44>>>2]=de[1],U[i+48>>>2]=4096,U[i+52>>>2]=r.blocks,U[i+56>>>2]=r.atime.getTime()/1e3|0,U[i+60>>>2]=0,U[i+64>>>2]=r.mtime.getTime()/1e3|0,U[i+68>>>2]=0,U[i+72>>>2]=r.ctime.getTime()/1e3|0,U[i+76>>>2]=0,de=[r.ino>>>0,(pe=r.ino,+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],U[i+80>>>2]=de[0],U[i+84>>>2]=de[1],0},doMsync:function(e,t,i,r,n){var s=N.slice(e,e+i);Ee.msync(t,s,n,i,r)},doMkdir:function(e,t){return"/"===(e=ve.normalize(e))[e.length-1]&&(e=e.slice(0,e.length-1)),Ee.mkdir(e,t,0),0},doMknod:function(e,t,i){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Ee.mknod(e,t,i),0},doReadlink:function(e,t,i){if(i<=0)return-28;var r=Ee.readlink(e),n=Math.min(i,C(r)),s=P[t+n>>>0];return R(r,t,i+1),P[t+n>>>0]=s,n},doAccess:function(e,t){if(-8&t)return-28;var i;if(!(i=Ee.lookupPath(e,{follow:!0}).node))return-44;var r="";return 4&t&&(r+="r"),2&t&&(r+="w"),1&t&&(r+="x"),r&&Ee.nodePermissions(i,r)?-2:0},doDup:function(e,t,i){var r=Ee.getStream(i);return r&&Ee.close(r),Ee.open(e,t,0,i,i).fd},doReadv:function(e,t,i,r){for(var n=0,s=0;s<i;s++){var a=U[t+8*s>>>2],o=U[t+(8*s+4)>>>2],l=Ee.read(e,P,a,o,r);if(l<0)return-1;if(n+=l,l<o)break}return n},doWritev:function(e,t,i,r){for(var n=0,s=0;s<i;s++){var a=U[t+8*s>>>2],o=U[t+(8*s+4)>>>2],l=Ee.write(e,P,a,o,r);if(l<0)return-1;n+=l}return n},varargs:void 0,get:function(){return _e.varargs+=4,U[_e.varargs-4>>>2]},getStr:function(e){return D(e)},getStreamFromFD:function(e){var t=Ee.getStream(e);if(!t)throw new Ee.ErrnoError(8);return t},get64:function(e,t){return e}},we={};function Se(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Me(e){return this.fromWireType(k[e>>>2])}var Ie={},De={},Ae={},Re=48,Ce=57;function Oe(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=Re&&t<=Ce?"_"+e:e}function Pe(e,t){return e=Oe(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function Ne(e,t){var i=Pe(t,(function(e){this.name=t,this.message=e;var i=new Error(e).stack;void 0!==i&&(this.stack=this.toString()+"\n"+i.replace(/^Error(:[^\n]*)?\n/,""))}));return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},i}var Le=void 0;function Fe(e){throw new Le(e)}function Ue(e,t,i){function r(t){var r=i(t);r.length!==e.length&&Fe("Mismatched type converter count");for(var n=0;n<e.length;++n)je(e[n],r[n])}e.forEach((function(e){Ae[e]=t}));var n=new Array(t.length),s=[],a=0;t.forEach((function(e,t){De.hasOwnProperty(e)?n[t]=De[e]:(s.push(e),Ie.hasOwnProperty(e)||(Ie[e]=[]),Ie[e].push((function(){n[t]=De[e],++a===s.length&&r(n)})))})),0===s.length&&r(n)}var ke={};function Be(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var ze=void 0;function Ge(e){for(var t="",i=e;N[i>>>0];)t+=ze[N[i++>>>0]];return t}var He=void 0;function Ve(e){throw new He(e)}function je(e,t,i){if(i=i||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(e||Ve('type "'+r+'" must have a positive integer typeid pointer'),De.hasOwnProperty(e)){if(i.ignoreDuplicateRegistrations)return;Ve("Cannot register type '"+r+"' twice")}if(De[e]=t,delete Ae[e],Ie.hasOwnProperty(e)){var n=Ie[e];delete Ie[e],n.forEach((function(e){e()}))}}function We(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function Ye(e){Ve(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Xe=!1;function qe(e){}function Ze(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function Je(e){return"undefined"==typeof FinalizationGroup?(Je=function(e){return e},e):(Xe=new FinalizationGroup((function(e){for(var t=e.next();!t.done;t=e.next()){var i=t.value;i.ptr?Ze(i):console.warn("object already deleted: "+i.ptr)}})),qe=function(e){Xe.unregister(e.$$)},(Je=function(e){return Xe.register(e,e.$$,e.$$),e})(e))}var Ke=void 0,$e=[];function Qe(){for(;$e.length;){var e=$e.pop();e.$$.deleteScheduled=!1,e.delete()}}function et(){}var tt={};function it(e,t,i){if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ve("Function '"+i+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}}function rt(e,t,i){n.hasOwnProperty(e)?((void 0===i||void 0!==n[e].overloadTable&&void 0!==n[e].overloadTable[i])&&Ve("Cannot register public name '"+e+"' twice"),it(n,e,e),n.hasOwnProperty(i)&&Ve("Cannot register multiple overloads of a function with the same number of arguments ("+i+")!"),n[e].overloadTable[i]=t):(n[e]=t,void 0!==i&&(n[e].numArguments=i))}function nt(e,t,i,r,n,s,a,o){this.name=e,this.constructor=t,this.instancePrototype=i,this.rawDestructor=r,this.baseClass=n,this.getActualType=s,this.upcast=a,this.downcast=o,this.pureVirtualFunctions=[]}function st(e,t,i){for(;t!==i;)t.upcast||Ve("Expected null or instance of "+i.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function at(e,t){if(null===t)return this.isReference&&Ve("null is not a valid "+this.name),0;t.$$||Ve('Cannot pass "'+wt(t)+'" as a '+this.name),t.$$.ptr||Ve("Cannot pass deleted object as a pointer of type "+this.name);var i=t.$$.ptrType.registeredClass;return st(t.$$.ptr,i,this.registeredClass)}function ot(e,t){var i;if(null===t)return this.isReference&&Ve("null is not a valid "+this.name),this.isSmartPointer?(i=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,i),i):0;t.$$||Ve('Cannot pass "'+wt(t)+'" as a '+this.name),t.$$.ptr||Ve("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&Ve("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;if(i=st(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ve("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?i=t.$$.smartPtr:Ve("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:i=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)i=t.$$.smartPtr;else{var n=t.clone();i=this.rawShare(i,_t((function(){n.delete()}))),null!==e&&e.push(this.rawDestructor,i)}break;default:Ve("Unsupporting sharing policy")}return i}function lt(e,t){if(null===t)return this.isReference&&Ve("null is not a valid "+this.name),0;t.$$||Ve('Cannot pass "'+wt(t)+'" as a '+this.name),t.$$.ptr||Ve("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&Ve("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var i=t.$$.ptrType.registeredClass;return st(t.$$.ptr,i,this.registeredClass)}function ht(e,t,i){if(t===i)return e;if(void 0===i.baseClass)return null;var r=ht(e,t,i.baseClass);return null===r?null:i.downcast(r)}var ut={};function ct(e,t){return(!t.ptrType||!t.ptr)&&Fe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Fe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Je(Object.create(e,{$$:{value:t}}))}function pt(e,t,i,r,n,s,a,o,l,h,u){this.name=e,this.registeredClass=t,this.isReference=i,this.isConst=r,this.isSmartPointer=n,this.pointeeType=s,this.sharingPolicy=a,this.rawGetPointee=o,this.rawConstructor=l,this.rawShare=h,this.rawDestructor=u,n||void 0!==t.baseClass?this.toWireType=ot:r?(this.toWireType=at,this.destructorFunction=null):(this.toWireType=lt,this.destructorFunction=null)}function dt(e,t,i){n.hasOwnProperty(e)||Fe("Replacing nonexistant public symbol"),void 0!==n[e].overloadTable&&void 0!==i?n[e].overloadTable[i]=t:(n[e]=t,n[e].argCount=i)}function ft(e,t){var i=-1!=(e=Ge(e)).indexOf("j")?function(e,t){S(e.indexOf("j")>=0,"getDynCaller should only be called with i64 sigs");var i=[];return function(){i.length=arguments.length;for(var r=0;r<arguments.length;r++)i[r]=arguments[r];return function(e,t,i){return-1!=e.indexOf("j")?function(e,t,i){return i&&i.length?n["dynCall_"+e].apply(null,[t].concat(i)):n["dynCall_"+e].call(null,t)}(e,t,i):K.get(t).apply(null,i)}(e,t,i)}}(e,t):K.get(t);return"function"!=typeof i&&Ve("unknown function pointer with signature "+e+": "+t),i}var mt=void 0;function gt(e){var t=Zt(e),i=Ge(t);return Kt(t),i}function yt(e,t){var i=[],r={};throw t.forEach((function e(t){if(!r[t]&&!De[t]){if(Ae[t])return void Ae[t].forEach(e);i.push(t),r[t]=!0}})),new mt(e+": "+i.map(gt).join([", "]))}function vt(e,t){for(var i=[],r=0;r<e;r++)i.push(U[(t>>2)+r>>>0]);return i}function Tt(e,t,i,r,n){var s=t.length;s<2&&Ve("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==i,o=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){o=!0;break}var h="void"!==t[0].name,u="",c="";for(l=0;l<s-2;++l)u+=(0!==l?", ":"")+"arg"+l,c+=(0!==l?", ":"")+"arg"+l+"Wired";var p="return function "+Oe(e)+"("+u+") {\nif (arguments.length !== "+(s-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(s-2)+" args!');\n}\n";o&&(p+="var destructors = [];\n");var d=o?"destructors":"null",f=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[Ve,r,n,Se,t[0],t[1]];for(a&&(p+="var thisWired = classParam.toWireType("+d+", this);\n"),l=0;l<s-2;++l)p+="var arg"+l+"Wired = argType"+l+".toWireType("+d+", arg"+l+"); // "+t[l+2].name+"\n",f.push("argType"+l),m.push(t[l+2]);if(a&&(c="thisWired"+(c.length>0?", ":"")+c),p+=(h?"var rv = ":"")+"invoker(fn"+(c.length>0?", ":"")+c+");\n",o)p+="runDestructors(destructors);\n";else for(l=a?1:2;l<t.length;++l){var g=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(p+=g+"_dtor("+g+"); // "+t[l].name+"\n",f.push(g+"_dtor"),m.push(t[l].destructorFunction))}h&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",f.push(p);var y=function(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var i=Pe(e.name||"unknownFunctionName",(function(){}));i.prototype=e.prototype;var r=new i,n=e.apply(r,t);return n instanceof Object?n:r}(Function,f).apply(null,m);return y}var xt=[],bt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Et(e){e>4&&0==--bt[e].refcount&&(bt[e]=void 0,xt.push(e))}function _t(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=xt.length?xt.pop():bt.length;return bt[t]={refcount:1,value:e},t}}function wt(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function St(e,t){switch(t){case 2:return function(e){return this.fromWireType(B[e>>>2])};case 3:return function(e){return this.fromWireType(z[e>>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Mt(e,t,i){switch(t){case 0:return i?function(e){return P[e>>>0]}:function(e){return N[e>>>0]};case 1:return i?function(e){return L[e>>>1]}:function(e){return F[e>>>1]};case 2:return i?function(e){return U[e>>>2]}:function(e){return k[e>>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function It(e){return e||Ve("Cannot use deleted val. handle = "+e),bt[e].value}function Dt(e,t){var i=De[e];return void 0===i&&Ve(t+" has unknown type "+gt(e)),i}var At,Rt={};function Ct(e){var t=Rt[e];return void 0===t?Ge(e):t}function Ot(){return"object"==typeof globalThis?globalThis:Function("return this")()}function Pt(e){try{return _.grow(e-O.byteLength+65535>>>16),Z(_.buffer),1}catch(e){}}At=o?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var Nt={};function Lt(){if(!Lt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in Nt)e[t]=Nt[t];var i=[];for(var t in e)i.push(t+"="+e[t]);Lt.strings=i}return Lt.strings}function Ft(e){return e%4==0&&(e%100!=0||e%400==0)}function Ut(e,t){for(var i=0,r=0;r<=t;i+=e[r++]);return i}var kt=[31,29,31,30,31,30,31,31,30,31,30,31],Bt=[31,28,31,30,31,30,31,31,30,31,30,31];function zt(e,t){for(var i=new Date(e.getTime());t>0;){var r=Ft(i.getFullYear()),n=i.getMonth(),s=(r?kt:Bt)[n];if(!(t>s-i.getDate()))return i.setDate(i.getDate()+t),i;t-=s-i.getDate()+1,i.setDate(1),n<11?i.setMonth(n+1):(i.setMonth(0),i.setFullYear(i.getFullYear()+1))}return i}var Gt=function(e,t,i,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ee.nextInode++,this.name=t,this.mode=i,this.node_ops={},this.stream_ops={},this.rdev=r},Ht=365,Vt=146;function jt(e,t,i){var r=i>0?i:C(e)+1,n=new Array(r),s=A(e,n,0,n.length);return t&&(n.length=s),n}Object.defineProperties(Gt.prototype,{read:{get:function(){return(this.mode&Ht)===Ht},set:function(e){e?this.mode|=Ht:this.mode&=~Ht}},write:{get:function(){return(this.mode&Vt)===Vt},set:function(e){e?this.mode|=Vt:this.mode&=~Vt}},isFolder:{get:function(){return Ee.isDir(this.mode)}},isDevice:{get:function(){return Ee.isChrdev(this.mode)}}}),Ee.FSNode=Gt,Ee.staticInit(),n.FS_createPath=Ee.createPath,n.FS_createDataFile=Ee.createDataFile,n.FS_createPreloadedFile=Ee.createPreloadedFile,n.FS_createLazyFile=Ee.createLazyFile,n.FS_createDevice=Ee.createDevice,n.FS_unlink=Ee.unlink,Le=n.InternalError=Ne(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);ze=e}(),He=n.BindingError=Ne(Error,"BindingError"),et.prototype.isAliasOf=function(e){if(!(this instanceof et&&e instanceof et))return!1;for(var t=this.$$.ptrType.registeredClass,i=this.$$.ptr,r=e.$$.ptrType.registeredClass,n=e.$$.ptr;t.baseClass;)i=t.upcast(i),t=t.baseClass;for(;r.baseClass;)n=r.upcast(n),r=r.baseClass;return t===r&&i===n},et.prototype.clone=function(){if(this.$$.ptr||Ye(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:We(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},et.prototype.delete=function(){this.$$.ptr||Ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ve("Object already scheduled for deletion"),qe(this),Ze(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},et.prototype.isDeleted=function(){return!this.$$.ptr},et.prototype.deleteLater=function(){return this.$$.ptr||Ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ve("Object already scheduled for deletion"),$e.push(this),1===$e.length&&Ke&&Ke(Qe),this.$$.deleteScheduled=!0,this},pt.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},pt.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},pt.prototype.argPackAdvance=8,pt.prototype.readValueFromPointer=Me,pt.prototype.deleteObject=function(e){null!==e&&e.delete()},pt.prototype.fromWireType=function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var i=function(e,t){return t=function(e,t){for(void 0===t&&Ve("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),ut[t]}(this.registeredClass,t);if(void 0!==i){if(0===i.$$.count.value)return i.$$.ptr=t,i.$$.smartPtr=e,i.clone();var r=i.clone();return this.destructor(e),r}function n(){return this.isSmartPointer?ct(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):ct(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,a=this.registeredClass.getActualType(t),o=tt[a];if(!o)return n.call(this);s=this.isConst?o.constPointerType:o.pointerType;var l=ht(t,this.registeredClass,s.registeredClass);return null===l?n.call(this):this.isSmartPointer?ct(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:e}):ct(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})},n.getInheritedInstanceCount=function(){return Object.keys(ut).length},n.getLiveInheritedInstances=function(){var e=[];for(var t in ut)ut.hasOwnProperty(t)&&e.push(ut[t]);return e},n.flushPendingDeletes=Qe,n.setDelayFunction=function(e){Ke=e,$e.length&&Ke&&Ke(Qe)},mt=n.UnboundTypeError=Ne(Error,"UnboundTypeError"),n.count_emval_handles=function(){for(var e=0,t=5;t<bt.length;++t)void 0!==bt[t]&&++e;return e},n.get_first_emval=function(){for(var e=5;e<bt.length;++e)if(void 0!==bt[e])return bt[e];return null},Q.push({func:function(){Xt()}});var Wt,Yt={x:function(e,t,i,r){oe("Assertion failed: "+D(e)+", at: "+[t?D(t):"unknown filename",i,r?D(r):"unknown function"])},A:function(e,t,i){_e.varargs=i;try{var r=_e.getStreamFromFD(e);switch(t){case 0:return(n=_e.get())<0?-28:Ee.open(r.path,r.flags,0,n).fd;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:var n=_e.get();return r.flags|=n,0;case 12:return n=_e.get(),L[n+0>>>1]=2,0;case 16:case 8:default:return-28;case 9:return ye(28),-1}}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),-e.errno}},P:function(e,t,i){_e.varargs=i;try{var r=_e.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return r.tty?0:-59;case 21519:if(!r.tty)return-59;var n=_e.get();return U[n>>>2]=0,0;case 21520:return r.tty?-28:-59;case 21531:return n=_e.get(),Ee.ioctl(r,t,n);default:oe("bad ioctl syscall "+t)}}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),-e.errno}},Q:function(e,t,i){_e.varargs=i;try{var r=_e.getStr(e),n=_e.get();return Ee.open(r,t,n).fd}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),-e.errno}},U:function(e){var t=we[e];delete we[e];var i=t.elements,r=i.length,n=i.map((function(e){return e.getterReturnType})).concat(i.map((function(e){return e.setterArgumentType}))),s=t.rawConstructor,a=t.rawDestructor;Ue([e],n,(function(e){return i.forEach((function(t,i){var n=e[i],s=t.getter,a=t.getterContext,o=e[i+r],l=t.setter,h=t.setterContext;t.read=function(e){return n.fromWireType(s(a,e))},t.write=function(e,t){var i=[];l(h,e,o.toWireType(i,t)),Se(i)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(r),n=0;n<r;++n)t[n]=i[n].read(e);return a(e),t},toWireType:function(e,n){if(r!==n.length)throw new TypeError("Incorrect number of tuple elements for "+t.name+": expected="+r+", actual="+n.length);for(var o=s(),l=0;l<r;++l)i[l].write(o,n[l]);return null!==e&&e.push(a,o),o},argPackAdvance:8,readValueFromPointer:Me,destructorFunction:a}]}))},s:function(e){var t=ke[e];delete ke[e];var i=t.rawConstructor,r=t.rawDestructor,n=t.fields;Ue([e],n.map((function(e){return e.getterReturnType})).concat(n.map((function(e){return e.setterArgumentType}))),(function(e){var s={};return n.forEach((function(t,i){var r=t.fieldName,a=e[i],o=t.getter,l=t.getterContext,h=e[i+n.length],u=t.setter,c=t.setterContext;s[r]={read:function(e){return a.fromWireType(o(l,e))},write:function(e,t){var i=[];u(c,e,h.toWireType(i,t)),Se(i)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var i in s)t[i]=s[i].read(e);return r(e),t},toWireType:function(e,t){for(var n in s)if(!(n in t))throw new TypeError('Missing field: "'+n+'"');var a=i();for(n in s)s[n].write(a,t[n]);return null!==e&&e.push(r,a),a},argPackAdvance:8,readValueFromPointer:Me,destructorFunction:r}]}))},S:function(e,t,i,r,n){var s=Be(i);je(e,{name:t=Ge(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){var r;if(1===i)r=P;else if(2===i)r=L;else{if(4!==i)throw new TypeError("Unknown boolean type size: "+t);r=U}return this.fromWireType(r[e>>>s])},destructorFunction:null})},v:function(e,t,i,r,n,s,a,o,l,h,u,c,p){u=Ge(u),s=ft(n,s),o&&(o=ft(a,o)),h&&(h=ft(l,h)),p=ft(c,p);var d=Oe(u);rt(d,(function(){yt("Cannot construct "+u+" due to unbound types",[r])})),Ue([e,t,i],r?[r]:[],(function(t){var i,n;t=t[0],n=r?(i=t.registeredClass).instancePrototype:et.prototype;var a=Pe(d,(function(){if(Object.getPrototypeOf(this)!==l)throw new He("Use 'new' to construct "+u);if(void 0===c.constructor_body)throw new He(u+" has no accessible constructor");var e=c.constructor_body[arguments.length];if(void 0===e)throw new He("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(c.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),l=Object.create(n,{constructor:{value:a}});a.prototype=l;var c=new nt(u,a,l,p,i,s,o,h),f=new pt(u,c,!0,!1,!1),m=new pt(u+"*",c,!1,!1,!1),g=new pt(u+" const*",c,!1,!0,!1);return tt[e]={pointerType:m,constPointerType:g},dt(d,a),[f,m,g]}))},u:function(e,t,i,r,n,s){S(t>0);var a=vt(t,i);n=ft(r,n);var o=[s],l=[];Ue([],[e],(function(e){var i="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new He("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=function(){yt("Cannot construct "+e.name+" due to unbound types",a)},Ue([],a,(function(r){return e.registeredClass.constructor_body[t-1]=function(){arguments.length!==t-1&&Ve(i+" called with "+arguments.length+" arguments, expected "+(t-1)),l.length=0,o.length=t;for(var e=1;e<t;++e)o[e]=r[e].toWireType(l,arguments[e-1]);var s=n.apply(null,o);return Se(l),r[0].fromWireType(s)},[]})),[]}))},d:function(e,t,i,r,n,s,a,o){var l=vt(i,r);t=Ge(t),s=ft(n,s),Ue([],[e],(function(e){var r=(e=e[0]).name+"."+t;function n(){yt("Cannot call "+r+" due to unbound types",l)}o&&e.registeredClass.pureVirtualFunctions.push(t);var h=e.registeredClass.instancePrototype,u=h[t];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===i-2?(n.argCount=i-2,n.className=e.name,h[t]=n):(it(h,t,r),h[t].overloadTable[i-2]=n),Ue([],l,(function(n){var o=Tt(r,n,e,s,a);return void 0===h[t].overloadTable?(o.argCount=i-2,h[t]=o):h[t].overloadTable[i-2]=o,[]})),[]}))},R:function(e,t){je(e,{name:t=Ge(t),fromWireType:function(e){var t=bt[e].value;return Et(e),t},toWireType:function(e,t){return _t(t)},argPackAdvance:8,readValueFromPointer:Me,destructorFunction:null})},C:function(e,t,i){var r=Be(i);je(e,{name:t=Ge(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+wt(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:St(t,r),destructorFunction:null})},h:function(e,t,i,r,n,s){var a=vt(t,i);e=Ge(e),n=ft(r,n),rt(e,(function(){yt("Cannot call "+e+" due to unbound types",a)}),t-1),Ue([],a,(function(i){var r=[i[0],null].concat(i.slice(1));return dt(e,Tt(e,r,null,n,s),t-1),[]}))},m:function(e,t,i,r,n){t=Ge(t),-1===n&&(n=4294967295);var s=Be(i),a=function(e){return e};if(0===r){var o=32-8*i;a=function(e){return e<<o>>>o}}var l=-1!=t.indexOf("unsigned");je(e,{name:t,fromWireType:a,toWireType:function(e,i){if("number"!=typeof i&&"boolean"!=typeof i)throw new TypeError('Cannot convert "'+wt(i)+'" to '+this.name);if(i<r||i>n)throw new TypeError('Passing a number "'+wt(i)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+n+"]!");return l?i>>>0:0|i},argPackAdvance:8,readValueFromPointer:Mt(t,s,0!==r),destructorFunction:null})},k:function(e,t,i){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function n(e){var t=k,i=t[(e>>=2)>>>0],n=t[e+1>>>0];return new r(O,n,i)}je(e,{name:i=Ge(i),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},D:function(e,t){var i="std::string"===(t=Ge(t));je(e,{name:t,fromWireType:function(e){var t,r=k[e>>>2];if(i)for(var n=e+4,s=0;s<=r;++s){var a=e+4+s;if(s==r||0==N[a>>>0]){var o=D(n,a-n);void 0===t?t=o:(t+=String.fromCharCode(0),t+=o),n=a+1}}else{var l=new Array(r);for(s=0;s<r;++s)l[s]=String.fromCharCode(N[e+4+s>>>0]);t=l.join("")}return Kt(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ve("Cannot pass non-string to std::string");var n=(i&&r?function(){return C(t)}:function(){return t.length})(),s=qt(4+n+1);if(k[(s>>>=0)>>>2]=n,i&&r)R(t,s+4,n+1);else if(r)for(var a=0;a<n;++a){var o=t.charCodeAt(a);o>255&&(Kt(s),Ve("String has UTF-16 code units that do not fit in 8 bits")),N[s+4+a>>>0]=o}else for(a=0;a<n;++a)N[s+4+a>>>0]=t[a];return null!==e&&e.push(Kt,s),s},argPackAdvance:8,readValueFromPointer:Me,destructorFunction:function(e){Kt(e)}})},w:function(e,t,i){var r,n,s,a,o;i=Ge(i),2===t?(r=H,n=V,a=j,s=function(){return F},o=1):4===t&&(r=W,n=Y,a=X,s=function(){return k},o=2),je(e,{name:i,fromWireType:function(e){for(var i,n=k[e>>>2],a=s(),l=e+4,h=0;h<=n;++h){var u=e+4+h*t;if(h==n||0==a[u>>>o]){var c=r(l,u-l);void 0===i?i=c:(i+=String.fromCharCode(0),i+=c),l=u+t}}return Kt(e),i},toWireType:function(e,r){"string"!=typeof r&&Ve("Cannot pass non-string to C++ string type "+i);var s=a(r),l=qt(4+s+t);return k[(l>>>=0)>>>2]=s>>o,n(r,l+4,s+t),null!==e&&e.push(Kt,l),l},argPackAdvance:8,readValueFromPointer:Me,destructorFunction:function(e){Kt(e)}})},V:function(e,t,i,r,n,s){we[e]={name:Ge(t),rawConstructor:ft(i,r),rawDestructor:ft(n,s),elements:[]}},g:function(e,t,i,r,n,s,a,o,l){we[e].elements.push({getterReturnType:t,getter:ft(i,r),getterContext:n,setterArgumentType:s,setter:ft(a,o),setterContext:l})},t:function(e,t,i,r,n,s){ke[e]={name:Ge(t),rawConstructor:ft(i,r),rawDestructor:ft(n,s),fields:[]}},j:function(e,t,i,r,n,s,a,o,l,h){ke[e].fields.push({fieldName:Ge(t),getterReturnType:i,getter:ft(r,n),getterContext:s,setterArgumentType:a,setter:ft(o,l),setterContext:h})},T:function(e,t){je(e,{isVoid:!0,name:t=Ge(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},q:function(e,t,i){e=It(e),t=Dt(t,"emval::as");var r=[],n=_t(r);return U[i>>>2]=n,t.toWireType(r,e)},W:function(e,t,i,r){e=It(e);for(var n=function(e,t){for(var i=new Array(e),r=0;r<e;++r)i[r]=Dt(U[(t>>2)+r>>>0],"parameter "+r);return i}(t,i),s=new Array(t),a=0;a<t;++a){var o=n[a];s[a]=o.readValueFromPointer(r),r+=o.argPackAdvance}return _t(e.apply(void 0,s))},b:Et,F:function(e){return 0===e?_t(Ot()):(e=Ct(e),_t(Ot()[e]))},n:function(e,t){return _t((e=It(e))[t=It(t)])},l:function(e){e>4&&(bt[e].refcount+=1)},N:function(e,t){return(e=It(e))instanceof It(t)},E:function(e){return"number"==typeof(e=It(e))},y:function(){return _t([])},f:function(e){return _t(Ct(e))},r:function(){return _t({})},p:function(e){Se(bt[e].value),Et(e)},i:function(e,t,i){e=It(e),t=It(t),i=It(i),e[t]=i},e:function(e,t){return _t((e=Dt(e,"_emval_take_value")).readValueFromPointer(t))},c:function(){oe()},M:function(e,t){var i;if(0===e)i=Date.now();else{if(1!==e&&4!==e)return ye(28),-1;i=At()}return U[t>>>2]=i/1e3|0,U[t+4>>>2]=i%1e3*1e3*1e3|0,0},I:function(e,t,i){N.copyWithin(e>>>0,t>>>0,t+i>>>0)},o:function(e){e>>>=0;var t=N.length,i=4294967296;if(e>i)return!1;for(var r=1;r<=4;r*=2){var n=t*(1+.2/r);if(n=Math.min(n,e+100663296),Pt(Math.min(i,q(Math.max(16777216,e,n),65536))))return!0}return!1},K:function(e,t){try{var i=0;return Lt().forEach((function(r,n){var s=t+i;U[e+4*n>>>2]=s,function(e,t,i){for(var r=0;r<e.length;++r)P[t++>>>0]=e.charCodeAt(r);P[t>>>0]=0}(r,s),i+=r.length+1})),0}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),e.errno}},L:function(e,t){try{var i=Lt();U[e>>>2]=i.length;var r=0;return i.forEach((function(e){r+=e.length+1})),U[t>>>2]=r,0}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),e.errno}},B:function(e){try{var t=_e.getStreamFromFD(e);return Ee.close(t),0}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),e.errno}},O:function(e,t,i,r){try{var n=_e.getStreamFromFD(e),s=_e.doReadv(n,t,i);return U[r>>>2]=s,0}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),e.errno}},G:function(e,t,i,r,n){try{var s=_e.getStreamFromFD(e),a=4294967296*i+(t>>>0),o=9007199254740992;return a<=-o||a>=o?-61:(Ee.llseek(s,a,r),de=[s.position>>>0,(pe=s.position,+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],U[n>>>2]=de[0],U[n+4>>>2]=de[1],s.getdents&&0===a&&0===r&&(s.getdents=null),0)}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),e.errno}},z:function(e,t,i,r){try{var n=_e.getStreamFromFD(e),s=_e.doWritev(n,t,i);return U[r>>>2]=s,0}catch(e){return(void 0===Ee||!(e instanceof Ee.ErrnoError))&&oe(e),e.errno}},a:_,H:function(e){},J:function(e,t,i,r){return function(e,t,i,r){var n=U[r+40>>>2],s={tm_sec:U[r>>>2],tm_min:U[r+4>>>2],tm_hour:U[r+8>>>2],tm_mday:U[r+12>>>2],tm_mon:U[r+16>>>2],tm_year:U[r+20>>>2],tm_wday:U[r+24>>>2],tm_yday:U[r+28>>>2],tm_isdst:U[r+32>>>2],tm_gmtoff:U[r+36>>>2],tm_zone:n?D(n):""},a=D(i),o={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in o)a=a.replace(new RegExp(l,"g"),o[l]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function c(e,t,i){for(var r="number"==typeof e?e.toString():e||"";r.length<t;)r=i[0]+r;return r}function p(e,t){return c(e,t,"0")}function d(e,t){function i(e){return e<0?-1:e>0?1:0}var r;return 0===(r=i(e.getFullYear()-t.getFullYear()))&&0===(r=i(e.getMonth()-t.getMonth()))&&(r=i(e.getDate()-t.getDate())),r}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=zt(new Date(e.tm_year+1900,0,1),e.tm_yday),i=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),n=f(i),s=f(r);return d(n,t)<=0?d(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return h[e.tm_wday].substring(0,3)},"%A":function(e){return h[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return p((e.tm_year+1900)/100|0,2)},"%d":function(e){return p(e.tm_mday,2)},"%e":function(e){return c(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return p(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":function(e){return p(e.tm_mday+Ut(Ft(e.tm_year+1900)?kt:Bt,e.tm_mon-1),3)},"%m":function(e){return p(e.tm_mon+1,2)},"%M":function(e){return p(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return p(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),i=0===t.getDay()?t:zt(t,7-t.getDay()),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(d(i,r)<0){var n=Ut(Ft(r.getFullYear())?kt:Bt,r.getMonth()-1)-31,s=31-i.getDate()+n+r.getDate();return p(Math.ceil(s/7),2)}return 0===d(i,t)?"01":"00"},"%V":function(e){var t,i=new Date(e.tm_year+1900,0,4),r=new Date(e.tm_year+1901,0,4),n=f(i),s=f(r),a=zt(new Date(e.tm_year+1900,0,1),e.tm_yday);return d(a,n)<0?"53":d(s,a)<=0?"01":(t=n.getFullYear()<e.tm_year+1900?e.tm_yday+32-n.getDate():e.tm_yday+1-n.getDate(),p(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),i=1===t.getDay()?t:zt(t,0===t.getDay()?1:7-t.getDay()+1),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(d(i,r)<0){var n=Ut(Ft(r.getFullYear())?kt:Bt,r.getMonth()-1)-31,s=31-i.getDate()+n+r.getDate();return p(Math.ceil(s/7),2)}return 0===d(i,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,i=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(i?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in g)a.indexOf(l)>=0&&(a=a.replace(new RegExp(l,"g"),g[l](s)));var y=jt(a,!1);return y.length>t?0:(function(e,t){P.set(e,t>>>0)}(y,e),y.length-1)}(e,t,i,r)}},Xt=(function(){var e={a:Yt};function t(e,t){var i=e.exports;n.asm=i,K=n.asm.X,ae()}function i(e){t(e.instance)}function s(t){return(b||!h&&!u||"function"!=typeof fetch||ue(fe)?Promise.resolve().then(me):fetch(fe,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+fe+"'";return e.arrayBuffer()})).catch((function(){return me()}))).then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){x("failed to asynchronously prepare wasm: "+e),oe(e)}))}if(se(),n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(e){return x("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||he(fe)||ue(fe)||"function"!=typeof fetch?s(i):fetch(fe,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(i,(function(e){return x("wasm streaming compile failed: "+e),x("falling back to ArrayBuffer instantiation"),s(i)}))}))).catch(r)}(),n.___wasm_call_ctors=function(){return(Xt=n.___wasm_call_ctors=n.asm.Y).apply(null,arguments)}),qt=(n._main=function(){return(n._main=n.asm.Z).apply(null,arguments)},n._malloc=function(){return(qt=n._malloc=n.asm._).apply(null,arguments)}),Zt=n.___getTypeName=function(){return(Zt=n.___getTypeName=n.asm.$).apply(null,arguments)},Jt=(n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.aa).apply(null,arguments)},n.___errno_location=function(){return(Jt=n.___errno_location=n.asm.ba).apply(null,arguments)}),Kt=n._free=function(){return(Kt=n._free=n.asm.ca).apply(null,arguments)};function $t(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Qt(e){function i(){Wt||(Wt=!0,n.calledRun=!0,!w&&(!n.noFSInit&&!Ee.init.initialized&&Ee.init(),xe.init(),ge(Q),Ee.ignorePermissions=!1,ge(ee),t(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),ei&&function(e){var t=n._main;try{!function(e,t){E&&0===e||(E||(n.onExit&&n.onExit(e),w=!0),d(e,new $t(e)))}(t(0,0))}catch(e){if(e instanceof $t)return;if("unwind"==e)return void(E=!0);var i=e;e&&"object"==typeof e&&e.stack&&(i=[e,e.stack]),x("exception thrown: "+i),d(1,e)}}(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)e=n.postRun.shift(),te.unshift(e);var e;ge(te)}()))}e=e||c,ie>0||(function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)e=n.preRun.shift(),$.unshift(e);var e;ge($)}(),ie>0)||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),i()}),1)):i())}if(n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.da).apply(null,arguments)},n.dynCall_viijii=function(){return(n.dynCall_viijii=n.asm.ea).apply(null,arguments)},n.dynCall_iiiiiijj=function(){return(n.dynCall_iiiiiijj=n.asm.fa).apply(null,arguments)},n.dynCall_iiiiij=function(){return(n.dynCall_iiiiij=n.asm.ga).apply(null,arguments)},n.dynCall_iiiiijj=function(){return(n.dynCall_iiiiijj=n.asm.ha).apply(null,arguments)},n.addRunDependency=se,n.removeRunDependency=ae,n.FS_createPath=Ee.createPath,n.FS_createDataFile=Ee.createDataFile,n.FS_createPreloadedFile=Ee.createPreloadedFile,n.FS_createLazyFile=Ee.createLazyFile,n.FS_createDevice=Ee.createDevice,n.FS_unlink=Ee.unlink,n.FS=Ee,ne=function e(){Wt||Qt(),Wt||(ne=e)},n.run=Qt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();var ei=!0;return n.noInitialRun&&(ei=!1),E=!0,Qt(),e.ready});"object"==typeof e&&"object"==typeof t?t.exports=r:"function"==typeof define&&define.amd?define([],(function(){return r})):"object"==typeof e&&(e.WebIFCWasm=r)}}),zIt=3821786052,jIt=2296667514,WIt=3630933823,qIt=4288193352,YIt=2874132201,XIt=618182010,$It=1635779807,ZIt=2603310189,KIt=3406155212,JIt=1634111441,QIt=177149247,e_t=1411407467,t_t=3352864051,r_t=2056796094,i_t=1871374353,n_t=3087945054,s_t=3001207471,a_t=325726236,o_t=749761778,l_t=3199563722,c_t=2483840362,u_t=3379348081,h_t=3239324667,p_t=4263986512,d_t=53199957,f_t=2029264950,m_t=3512275521,g_t=1674181508,v_t=669184980,y_t=639542469,E_t=411424972,T_t=130549933,b_t=3869604511,x_t=3798115385,I_t=1310608509,__t=2705031697,S_t=3460190687,w_t=3207858831,R_t=277319702,M_t=1532957894,D_t=4261334040,C_t=3125803723,A_t=2740243338,O_t=1967976161,P_t=2461110595,N_t=2887950389,L_t=167062518,F_t=753842376,H_t=2906023776,U_t=819618141,B_t=4196446775,k_t=3649138523,G_t=616511568,V_t=1334484129,z_t=32344328,j_t=231477066,W_t=3649129432,q_t=2736907675,Y_t=4037036970,X_t=1136057603,$_t=1560379544,Z_t=3367102660,K_t=1387855156,J_t=2069777674,Q_t=1260505505,eSt=4182860854,tSt=2581212453,rSt=2713105998,iSt=644574406,nSt=963979645,sSt=4031249490,aSt=3299480353,oSt=2979338954,lSt=39481116,cSt=1095909175,uSt=1909888760,hSt=1950629157,pSt=3124254112,dSt=1177604601,fSt=2938176219,mSt=2188180465,gSt=2898889636,vSt=635142910,ySt=395041908,ESt=3758799889,TSt=3293546465,bSt=1051757585,xSt=2674252688,ISt=4217484030,_St=1285652485,SSt=3999819293,wSt=3203706013,RSt=1123145078,MSt=574549367,DSt=1675464909,CSt=2059837836,ASt=59481748,OSt=3749851601,PSt=3486308946,NSt=3331915920,LSt=1416205885,FSt=3150382593,HSt=3902619387,USt=2951183804,BSt=3296154744,kSt=2197970202,GSt=2611217952,VSt=2937912522,zSt=1383045692,jSt=1062206242,WSt=1677625105,qSt=3893394355,YSt=747523909,XSt=647927063,$St=2205249479,ZSt=639361253,KSt=2301859152,JSt=776857604,QSt=3285139300,ewt=3264961684,twt=843113511,rwt=905975707,iwt=300633059,nwt=3221913625,swt=400855858,awt=2542286263,owt=3875453745,lwt=3732776249,cwt=15328376,uwt=2485617015,hwt=1485152156,pwt=3571504051,dwt=3850581409,fwt=2272882330,mwt=2816379211,gwt=2510884976,vwt=370225590,ywt=1981873012,Ewt=2859738748,Twt=45288368,bwt=2614616156,xwt=2732653382,Iwt=775493141,_wt=1959218052,Swt=3898045240,wwt=2185764099,Rwt=1060000209,Mwt=4105962743,Dwt=488727124,Cwt=1525564444,Awt=2559216714,Owt=2574617495,Pwt=3419103109,Nwt=3050246964,Lwt=3293443760,Fwt=25142252,Hwt=578613899,Uwt=2889183280,Bwt=2713554722,kwt=4136498852,Gwt=335055490,Vwt=3640358203,zwt=2954562838,jwt=1785450214,Wwt=1466758467,qwt=3895139033,Ywt=1419761937,Xwt=602808272,$wt=1973544240,Zwt=1916426348,Kwt=3295246426,Jwt=1815067380,Qwt=2506170314,eRt=2147822146,tRt=539742890,rRt=3495092785,iRt=1457835157,nRt=2601014836,sRt=2827736869,aRt=2629017746,oRt=1186437898,lRt=3800577675,cRt=1105321065,uRt=2367409068,hRt=3510044353,pRt=1213902940,dRt=4074379575,fRt=3961806047,mRt=3426335179,gRt=1306400036,vRt=3632507154,yRt=1765591967,ERt=1045800335,TRt=2949456006,bRt=32440307,xRt=1335981549,IRt=2635815018,_Rt=1945343521,SRt=1052013943,wRt=1599208980,RRt=562808652,MRt=1062813311,DRt=2063403501,CRt=1945004755,ARt=3256556792,ORt=3040386961,PRt=3849074793,NRt=3041715199,LRt=3205830791,FRt=1154170062,HRt=770865208,URt=3732053477,BRt=395920057,kRt=2963535650,GRt=1714330368,VRt=3242481149,zRt=526551008,jRt=2323601079,WRt=445594917,qRt=4006246654,YRt=342316401,XRt=869906466,$Rt=3518393246,ZRt=3760055223,KRt=1360408905,JRt=2030761528,QRt=3900360178,eMt=476780140,tMt=1472233963,rMt=1904799276,iMt=663422040,nMt=862014818,sMt=2417008758,aMt=3310460725,oMt=3277789161,lMt=264262732,cMt=1534661035,uMt=402227799,hMt=1217240411,pMt=1003880860,dMt=712377611,fMt=1758889154,mMt=4123344466,gMt=2397081782,vMt=1623761950,yMt=2590856083,EMt=1883228015,TMt=339256511,bMt=2777663545,xMt=1704287377,IMt=2835456948,_Mt=1658829314,SMt=2107101300,wMt=2814081492,RMt=132023988,MMt=3747195512,DMt=3174744832,CMt=484807127,AMt=3390157468,OMt=4148101412,PMt=211053100,NMt=4024345920,LMt=297599258,FMt=4294318154,HMt=3200245327,UMt=1437805879,BMt=1209101575,kMt=2853485674,GMt=2242383968,VMt=1040185647,zMt=3548104201,jMt=477187591,WMt=2804161546,qMt=2556980723,YMt=2047409740,XMt=1809719519,$Mt=803316827,ZMt=3008276851,KMt=807026263,JMt=3737207727,QMt=24185140,eDt=1310830890,tDt=4219587988,rDt=3415622556,iDt=346874300,nDt=647756555,sDt=2489546625,aDt=2827207264,oDt=2143335405,lDt=1287392070,cDt=738692330,uDt=374418227,hDt=315944413,pDt=819412036,dDt=1810631287,fDt=1426591983,mDt=4222183408,gDt=2652556860,vDt=2058353004,yDt=3907093117,EDt=4278956645,TDt=3198132628,bDt=182646315,xDt=4037862832,IDt=2188021234,_Dt=3815607619,SDt=3132237377,wDt=1482959167,RDt=987401354,MDt=1834744321,DDt=707683696,CDt=1339347760,ADt=2223149337,ODt=2297155007,PDt=3508470533,NDt=3009222698,LDt=900683007,FDt=1893162501,HDt=263784265,UDt=4238390223,BDt=1509553395,kDt=1268542332,GDt=3493046030,VDt=4095422895,zDt=987898635,jDt=3448662350,WDt=2453401579,qDt=4142052618,YDt=3590301190,XDt=3009204131,$Dt=852622518,ZDt=178086475,KDt=2706460486,JDt=812098782,QDt=3319311131,eCt=1251058090,tCt=2068733104,rCt=1806887404,iCt=1484403080,nCt=3905492369,sCt=3570813810,aCt=2571569899,oCt=178912537,lCt=2294589976,cCt=1437953363,uCt=2133299955,hCt=4175244083,pCt=3946677679,dCt=3113134337,fCt=2391368822,mCt=3741457305,gCt=3020489413,vCt=2176052936,yCt=4288270099,ECt=572779678,TCt=3827777499,bCt=428585644,xCt=1585845231,ICt=76236018,_Ct=1051575348,SCt=2655187982,wCt=3452421091,RCt=4162380809,MCt=629592764,DCt=1161773419,CCt=1566485204,ACt=1402838566,OCt=125510826,PCt=2604431987,NCt=4266656042,LCt=1520743889,FCt=3422422726,HCt=1281925730,UCt=3092502836,BCt=388784114,kCt=1154579445,GCt=2624227202,VCt=1008929658,zCt=1425443689,jCt=3057273783,WCt=2347385850,qCt=1838606355,YCt=1847130766,XCt=3708119e3,$Ct=2852063980,ZCt=760658860,KCt=2022407955,JCt=248100487,QCt=3303938423,eAt=1303795690,tAt=1847252529,rAt=2199411900,iAt=2235152071,nAt=164193824,sAt=3079605661,aAt=3404854881,oAt=552965576,lAt=3265635763,cAt=853536259,uAt=1507914824,hAt=2597039031,pAt=377706215,dAt=2108223431,fAt=1437502449,mAt=1114901282,gAt=1073191201,vAt=1911478936,yAt=3181161470,EAt=3368373690,TAt=2998442950,bAt=2706619895,xAt=2474470126,IAt=977012517,_At=1918398963,SAt=3888040117,wAt=219451334,RAt=3701648758,MAt=2251480897,DAt=4143007308,CAt=590820931,AAt=3388369263,OAt=3505215534,PAt=2485787929,NAt=2665983363,LAt=3588315303,FAt=3079942009,HAt=4251960020,UAt=1411181986,BAt=643959842,kAt=1029017970,GAt=144952367,VAt=3694346114,zAt=2837617999,jAt=1207048766,WAt=2529465313,qAt=2519244187,YAt=1682466193,XAt=2382730787,$At=3566463478,ZAt=3327091369,KAt=2077209135,JAt=101040310,QAt=3021840470,eOt=2483315170,tOt=2226359599,rOt=1687234759,iOt=1158309216,nOt=310824031,sOt=804291784,aOt=3612865200,oOt=4231323485,lOt=597895409,cOt=2004835150,uOt=603570806,hOt=1663979128,pOt=220341763,dOt=3171933400,fOt=1156407060,mOt=4017108033,gOt=2067069095,vOt=4022376103,yOt=1423911732,EOt=2924175390,TOt=2775532180,bOt=2839578677,xOt=3724593414,IOt=3740093272,_Ot=1946335990,SOt=3355820592,wOt=759155922,ROt=2559016684,MOt=3727388367,DOt=3778827333,COt=3967405729,AOt=1775413392,OOt=677532197,POt=2022622350,NOt=1304840413,LOt=3119450353,FOt=2417041796,HOt=2744685151,UOt=569719735,BOt=2945172077,kOt=4208778838,GOt=673634403,VOt=2095639259,zOt=3958567839,jOt=2802850158,pO=103090709,WOt=653396225,qOt=2904328755,YOt=3843373140,XOt=3651124850,$Ot=2598011224,ZOt=986844984,KOt=871118103,JOt=1680319473,QOt=148025276,e3t=4166981789,t3t=3710013099,r3t=2752243245,i3t=941946838,n3t=1451395588,s3t=3357820518,a3t=492091185,o3t=3650150729,l3t=110355661,c3t=3521284610,u3t=1482703590,h3t=738039164,p3t=2295281155,d3t=655969474,f3t=1842657554,m3t=3219374653,g3t=90941305,v3t=2250791053,y3t=2044713172,E3t=2093928680,T3t=931644368,b3t=2090586900,x3t=3252649465,I3t=2405470396,_3t=825690147,S3t=2262370178,w3t=2893384427,R3t=3024970846,M3t=3283111854,D3t=2324767716,C3t=1469900589,A3t=1232101972,O3t=683857671,P3t=2770003689,N3t=3615266464,L3t=2798486643,F3t=3454111270,H3t=3915482550,U3t=2433181523,B3t=4021432810,k3t=3413951693,G3t=1580146022,V3t=3765753017,z3t=979691226,j3t=2572171363,W3t=3027567501,q3t=964333572,Y3t=2320036040,X3t=2310774935,m8=160246688,$3t=3939117080,Z3t=1683148259,K3t=2495723537,J3t=1307041759,Q3t=1027710054,ePt=4278684876,tPt=2857406711,rPt=205026976,iPt=1865459582,nPt=4095574036,sPt=919958153,aPt=2728634034,oPt=982818633,lPt=3840914261,g8=2655215786,cPt=826625072,uPt=1204542856,hPt=3945020480,pPt=4201705270,dPt=3190031847,fPt=2127690289,mPt=1638771189,gPt=504942748,vPt=3678494232,v8=3242617779,yPt=886880790,EPt=2802773753,TPt=2565941209,bPt=2551354335,xPt=693640335,IPt=1462361463,y8=4186316022,_Pt=307848117,E8=781010003,SPt=3940055652,wPt=279856033,RPt=427948657,MPt=3268803585,DPt=1441486842,CPt=750771296,APt=1245217292,OPt=4122056220,PPt=366585022,NPt=3451746338,LPt=3523091289,FPt=1521410863,HPt=1401173127,UPt=478536968,BPt=816062949,kPt=1076942058,GPt=3377609919,VPt=3008791417,zPt=1660063152,jPt=2914609552,WPt=2943643501,qPt=1608871552,YPt=2439245199,XPt=1042787934,$Pt=1856042241,ZPt=3243963512,KPt=4158566097,JPt=3626867408,QPt=2016517767,e2t=2781568857,t2t=2341007311,r2t=2778083089,i2t=448429030,n2t=3053780830,s2t=1768891740,a2t=1054537805,o2t=2157484638,l2t=2042790032,c2t=4165799628,u2t=1862484736,h2t=1290935644,p2t=1509187699,d2t=4086658281,f2t=1783015770,m2t=1329646415,g2t=4074543187,v2t=867548509,y2t=3982875396,E2t=4240577450,T2t=4124623270,b2t=3692461612,x2t=3663146110,I2t=4097777520,_2t=1529196076,S2t=3127900445,w2t=3027962421,R2t=2533589738,M2t=2609359061,D2t=3420628829,C2t=1072016465,A2t=723233188,O2t=3856911033,P2t=1999602285,N2t=1305183839,L2t=3812236995,F2t=1412071761,H2t=710998568,U2t=2706606064,B2t=3893378262,k2t=463610769,G2t=2481509218,V2t=451544542,z2t=4015995234,j2t=1404847402,W2t=3112655638,q2t=331165859,Y2t=4252922144,X2t=1039846685,$2t=338393293,Z2t=682877961,K2t=3544373492,J2t=2515109513,Q2t=1179482911,eNt=2273995522,tNt=1004757350,rNt=4243806635,iNt=214636428,nNt=2445595289,sNt=2757150158,aNt=3136571912,oNt=1807405624,lNt=2162789131,cNt=385403989,uNt=3478079324,hNt=1252848954,pNt=1595516126,dNt=609421318,fNt=2668620305,mNt=2473145415,gNt=1973038258,vNt=1597423693,yNt=1190533807,ENt=2525727697,TNt=3408363356,bNt=530289379,xNt=1621171031,INt=2082059205,_Nt=734778138,SNt=1235345126,wNt=3689010777,RNt=2986769608,MNt=3657597509,DNt=1975003073,CNt=3979015343,ANt=2218152070,ONt=603775116,PNt=2830218821,NNt=3958052878,LNt=3049322572,FNt=148013059,HNt=4095615324,UNt=2233826070,BNt=2513912981,kNt=699246055,GNt=2028607225,VNt=3101698114,zNt=2809605785,jNt=4124788165,WNt=2934153892,qNt=1300840506,YNt=3303107099,XNt=1607154358,$Nt=1878645084,ZNt=846575682,KNt=1351298697,JNt=626085974,QNt=2247615214,eLt=1260650574,tLt=1096409881,rLt=230924584,iLt=1162798199,nLt=2315554128,sLt=2254336722,aLt=413509423,oLt=1580310250,lLt=3071757647,cLt=985171141,uLt=2043862942,hLt=531007025,pLt=812556717,dLt=5716631,fLt=3473067441,mLt=1549132990,gLt=2771591690,vLt=3206491090,yLt=912023232,ELt=3824725483,TLt=2347447852,bLt=3081323446,xLt=3663046924,ILt=2281632017,_Lt=2415094496,SLt=2387106220,wLt=901063453,RLt=4282788508,MLt=3124975700,DLt=1447204868,CLt=1983826977,ALt=2636378356,OLt=1640371178,PLt=280115917,NLt=1742049831,LLt=2552916305,FLt=1210645708,HLt=3611470254,ULt=1199560280,BLt=3101149627,kLt=581633288,GLt=1377556343,VLt=1735638870,zLt=1935646853,jLt=3825984169,WLt=1692211062,qLt=2595432518,YLt=1620046519,XLt=2097647324,$Lt=2715220739,ZLt=2916149573,KLt=1229763772,JLt=3593883385,QLt=3026737570,eFt=1600972822,tFt=1628702193,rFt=3736923433,iFt=2347495698,nFt=3698973494,sFt=427810014,aFt=180925521,oFt=630975310,lFt=3179687236,cFt=4292641817,uFt=1911125066,hFt=4207607924,pFt=728799441,dFt=1417489154,fFt=2799835756,mFt=2759199220,gFt=1907098498,vFt=1530820697,yFt=3956297820,EFt=2391383451,TFt=3313531582,bFt=2769231204,xFt=891718957,IFt=926996030,_Ft=2391406946,SFt=4156078855,wFt=3512223829,RFt=1898987631,MFt=4237592921,DFt=1133259667,CFt=3304561284,AFt=336235671,OFt=512836454,PFt=486154966,NFt=1299126871,LFt=4009809668,FFt=4088093105,HFt=1028945134,UFt=4218914973,BFt=3342526732,kFt=1236880293,GFt=2543172580,VFt=1033361043,P={};P[zIt]=e=>s0e.FromTape(e.ID,e.type,e.arguments),P[jIt]=e=>a0e.FromTape(e.ID,e.type,e.arguments),P[WIt]=e=>o0e.FromTape(e.ID,e.type,e.arguments),P[qIt]=e=>l0e.FromTape(e.ID,e.type,e.arguments),P[YIt]=e=>c0e.FromTape(e.ID,e.type,e.arguments),P[XIt]=e=>u0e.FromTape(e.ID,e.type,e.arguments),P[$It]=e=>h0e.FromTape(e.ID,e.type,e.arguments),P[ZIt]=e=>p0e.FromTape(e.ID,e.type,e.arguments),P[KIt]=e=>d0e.FromTape(e.ID,e.type,e.arguments),P[JIt]=e=>f0e.FromTape(e.ID,e.type,e.arguments),P[QIt]=e=>m0e.FromTape(e.ID,e.type,e.arguments),P[e_t]=e=>g0e.FromTape(e.ID,e.type,e.arguments),P[t_t]=e=>v0e.FromTape(e.ID,e.type,e.arguments),P[r_t]=e=>y0e.FromTape(e.ID,e.type,e.arguments),P[i_t]=e=>E0e.FromTape(e.ID,e.type,e.arguments),P[n_t]=e=>T0e.FromTape(e.ID,e.type,e.arguments),P[s_t]=e=>b0e.FromTape(e.ID,e.type,e.arguments),P[a_t]=e=>x0e.FromTape(e.ID,e.type,e.arguments),P[o_t]=e=>I0e.FromTape(e.ID,e.type,e.arguments),P[l_t]=e=>_0e.FromTape(e.ID,e.type,e.arguments),P[c_t]=e=>S0e.FromTape(e.ID,e.type,e.arguments),P[u_t]=e=>w0e.FromTape(e.ID,e.type,e.arguments),P[h_t]=e=>R0e.FromTape(e.ID,e.type,e.arguments),P[p_t]=e=>M0e.FromTape(e.ID,e.type,e.arguments),P[d_t]=e=>D0e.FromTape(e.ID,e.type,e.arguments),P[f_t]=e=>C0e.FromTape(e.ID,e.type,e.arguments),P[m_t]=e=>A0e.FromTape(e.ID,e.type,e.arguments),P[g_t]=e=>O0e.FromTape(e.ID,e.type,e.arguments),P[v_t]=e=>P0e.FromTape(e.ID,e.type,e.arguments),P[y_t]=e=>N0e.FromTape(e.ID,e.type,e.arguments),P[E_t]=e=>L0e.FromTape(e.ID,e.type,e.arguments),P[T_t]=e=>F0e.FromTape(e.ID,e.type,e.arguments),P[b_t]=e=>H0e.FromTape(e.ID,e.type,e.arguments),P[x_t]=e=>U0e.FromTape(e.ID,e.type,e.arguments),P[I_t]=e=>B0e.FromTape(e.ID,e.type,e.arguments),P[__t]=e=>k0e.FromTape(e.ID,e.type,e.arguments),P[S_t]=e=>G0e.FromTape(e.ID,e.type,e.arguments),P[w_t]=e=>V0e.FromTape(e.ID,e.type,e.arguments),P[R_t]=e=>z0e.FromTape(e.ID,e.type,e.arguments),P[M_t]=e=>j0e.FromTape(e.ID,e.type,e.arguments),P[D_t]=e=>W0e.FromTape(e.ID,e.type,e.arguments),P[C_t]=e=>q0e.FromTape(e.ID,e.type,e.arguments),P[A_t]=e=>Y0e.FromTape(e.ID,e.type,e.arguments),P[O_t]=e=>X0e.FromTape(e.ID,e.type,e.arguments),P[P_t]=e=>$0e.FromTape(e.ID,e.type,e.arguments),P[N_t]=e=>Z0e.FromTape(e.ID,e.type,e.arguments),P[L_t]=e=>K0e.FromTape(e.ID,e.type,e.arguments),P[F_t]=e=>J0e.FromTape(e.ID,e.type,e.arguments),P[H_t]=e=>Q0e.FromTape(e.ID,e.type,e.arguments),P[U_t]=e=>eve.FromTape(e.ID,e.type,e.arguments),P[B_t]=e=>tve.FromTape(e.ID,e.type,e.arguments),P[k_t]=e=>rve.FromTape(e.ID,e.type,e.arguments),P[G_t]=e=>ive.FromTape(e.ID,e.type,e.arguments),P[V_t]=e=>nve.FromTape(e.ID,e.type,e.arguments),P[z_t]=e=>sve.FromTape(e.ID,e.type,e.arguments),P[j_t]=e=>ave.FromTape(e.ID,e.type,e.arguments),P[W_t]=e=>ove.FromTape(e.ID,e.type,e.arguments),P[q_t]=e=>lve.FromTape(e.ID,e.type,e.arguments),P[Y_t]=e=>cve.FromTape(e.ID,e.type,e.arguments),P[X_t]=e=>uve.FromTape(e.ID,e.type,e.arguments),P[$_t]=e=>hve.FromTape(e.ID,e.type,e.arguments),P[Z_t]=e=>pve.FromTape(e.ID,e.type,e.arguments),P[K_t]=e=>dve.FromTape(e.ID,e.type,e.arguments),P[J_t]=e=>fve.FromTape(e.ID,e.type,e.arguments),P[Q_t]=e=>mve.FromTape(e.ID,e.type,e.arguments),P[eSt]=e=>gve.FromTape(e.ID,e.type,e.arguments),P[tSt]=e=>vve.FromTape(e.ID,e.type,e.arguments),P[rSt]=e=>yve.FromTape(e.ID,e.type,e.arguments),P[iSt]=e=>Eve.FromTape(e.ID,e.type,e.arguments),P[nSt]=e=>Tve.FromTape(e.ID,e.type,e.arguments),P[sSt]=e=>bve.FromTape(e.ID,e.type,e.arguments),P[aSt]=e=>xve.FromTape(e.ID,e.type,e.arguments),P[oSt]=e=>Ive.FromTape(e.ID,e.type,e.arguments),P[lSt]=e=>_ve.FromTape(e.ID,e.type,e.arguments),P[cSt]=e=>Sve.FromTape(e.ID,e.type,e.arguments),P[uSt]=e=>wve.FromTape(e.ID,e.type,e.arguments),P[hSt]=e=>Rve.FromTape(e.ID,e.type,e.arguments),P[pSt]=e=>Mve.FromTape(e.ID,e.type,e.arguments),P[dSt]=e=>Dve.FromTape(e.ID,e.type,e.arguments),P[fSt]=e=>Cve.FromTape(e.ID,e.type,e.arguments),P[mSt]=e=>Ave.FromTape(e.ID,e.type,e.arguments),P[gSt]=e=>Ove.FromTape(e.ID,e.type,e.arguments),P[vSt]=e=>Pve.FromTape(e.ID,e.type,e.arguments),P[ySt]=e=>Nve.FromTape(e.ID,e.type,e.arguments),P[ESt]=e=>Lve.FromTape(e.ID,e.type,e.arguments),P[TSt]=e=>Fve.FromTape(e.ID,e.type,e.arguments),P[bSt]=e=>Hve.FromTape(e.ID,e.type,e.arguments),P[xSt]=e=>Uve.FromTape(e.ID,e.type,e.arguments),P[ISt]=e=>Bve.FromTape(e.ID,e.type,e.arguments),P[_St]=e=>kve.FromTape(e.ID,e.type,e.arguments),P[SSt]=e=>Gve.FromTape(e.ID,e.type,e.arguments),P[wSt]=e=>Vve.FromTape(e.ID,e.type,e.arguments),P[RSt]=e=>zve.FromTape(e.ID,e.type,e.arguments),P[MSt]=e=>jve.FromTape(e.ID,e.type,e.arguments),P[DSt]=e=>Wve.FromTape(e.ID,e.type,e.arguments),P[CSt]=e=>qve.FromTape(e.ID,e.type,e.arguments),P[ASt]=e=>Yve.FromTape(e.ID,e.type,e.arguments),P[OSt]=e=>Xve.FromTape(e.ID,e.type,e.arguments),P[PSt]=e=>$ve.FromTape(e.ID,e.type,e.arguments),P[NSt]=e=>Zve.FromTape(e.ID,e.type,e.arguments),P[LSt]=e=>Kve.FromTape(e.ID,e.type,e.arguments),P[FSt]=e=>Jve.FromTape(e.ID,e.type,e.arguments),P[HSt]=e=>Qve.FromTape(e.ID,e.type,e.arguments),P[USt]=e=>eye.FromTape(e.ID,e.type,e.arguments),P[BSt]=e=>tye.FromTape(e.ID,e.type,e.arguments),P[kSt]=e=>rye.FromTape(e.ID,e.type,e.arguments),P[GSt]=e=>iye.FromTape(e.ID,e.type,e.arguments),P[VSt]=e=>nye.FromTape(e.ID,e.type,e.arguments),P[zSt]=e=>sye.FromTape(e.ID,e.type,e.arguments),P[jSt]=e=>aye.FromTape(e.ID,e.type,e.arguments),P[WSt]=e=>oye.FromTape(e.ID,e.type,e.arguments),P[qSt]=e=>lye.FromTape(e.ID,e.type,e.arguments),P[YSt]=e=>cye.FromTape(e.ID,e.type,e.arguments),P[XSt]=e=>uye.FromTape(e.ID,e.type,e.arguments),P[$St]=e=>hye.FromTape(e.ID,e.type,e.arguments),P[ZSt]=e=>pye.FromTape(e.ID,e.type,e.arguments),P[KSt]=e=>dye.FromTape(e.ID,e.type,e.arguments),P[JSt]=e=>fye.FromTape(e.ID,e.type,e.arguments),P[QSt]=e=>mye.FromTape(e.ID,e.type,e.arguments),P[ewt]=e=>gye.FromTape(e.ID,e.type,e.arguments),P[twt]=e=>vye.FromTape(e.ID,e.type,e.arguments),P[rwt]=e=>yye.FromTape(e.ID,e.type,e.arguments),P[iwt]=e=>Eye.FromTape(e.ID,e.type,e.arguments),P[nwt]=e=>Tye.FromTape(e.ID,e.type,e.arguments),P[swt]=e=>bye.FromTape(e.ID,e.type,e.arguments),P[awt]=e=>xye.FromTape(e.ID,e.type,e.arguments),P[owt]=e=>Iye.FromTape(e.ID,e.type,e.arguments),P[lwt]=e=>_ye.FromTape(e.ID,e.type,e.arguments),P[cwt]=e=>Sye.FromTape(e.ID,e.type,e.arguments),P[uwt]=e=>wye.FromTape(e.ID,e.type,e.arguments),P[hwt]=e=>Rye.FromTape(e.ID,e.type,e.arguments),P[pwt]=e=>Mye.FromTape(e.ID,e.type,e.arguments),P[dwt]=e=>Dye.FromTape(e.ID,e.type,e.arguments),P[fwt]=e=>Cye.FromTape(e.ID,e.type,e.arguments),P[mwt]=e=>Aye.FromTape(e.ID,e.type,e.arguments),P[gwt]=e=>Oye.FromTape(e.ID,e.type,e.arguments),P[vwt]=e=>Pye.FromTape(e.ID,e.type,e.arguments),P[ywt]=e=>Nye.FromTape(e.ID,e.type,e.arguments),P[Ewt]=e=>Lye.FromTape(e.ID,e.type,e.arguments),P[Twt]=e=>Fye.FromTape(e.ID,e.type,e.arguments),P[bwt]=e=>Hye.FromTape(e.ID,e.type,e.arguments),P[xwt]=e=>Uye.FromTape(e.ID,e.type,e.arguments),P[Iwt]=e=>Bye.FromTape(e.ID,e.type,e.arguments),P[_wt]=e=>kye.FromTape(e.ID,e.type,e.arguments),P[Swt]=e=>Gye.FromTape(e.ID,e.type,e.arguments),P[wwt]=e=>Vye.FromTape(e.ID,e.type,e.arguments),P[Rwt]=e=>zye.FromTape(e.ID,e.type,e.arguments),P[Mwt]=e=>jye.FromTape(e.ID,e.type,e.arguments),P[Dwt]=e=>Wye.FromTape(e.ID,e.type,e.arguments),P[Cwt]=e=>qye.FromTape(e.ID,e.type,e.arguments),P[Awt]=e=>Yye.FromTape(e.ID,e.type,e.arguments),P[Owt]=e=>Xye.FromTape(e.ID,e.type,e.arguments),P[Pwt]=e=>$ye.FromTape(e.ID,e.type,e.arguments),P[Nwt]=e=>Zye.FromTape(e.ID,e.type,e.arguments),P[Lwt]=e=>Kye.FromTape(e.ID,e.type,e.arguments),P[Fwt]=e=>Jye.FromTape(e.ID,e.type,e.arguments),P[Hwt]=e=>Qye.FromTape(e.ID,e.type,e.arguments),P[Uwt]=e=>eEe.FromTape(e.ID,e.type,e.arguments),P[Bwt]=e=>tEe.FromTape(e.ID,e.type,e.arguments),P[kwt]=e=>rEe.FromTape(e.ID,e.type,e.arguments),P[Gwt]=e=>iEe.FromTape(e.ID,e.type,e.arguments),P[Vwt]=e=>nEe.FromTape(e.ID,e.type,e.arguments),P[zwt]=e=>sEe.FromTape(e.ID,e.type,e.arguments),P[jwt]=e=>aEe.FromTape(e.ID,e.type,e.arguments),P[Wwt]=e=>oEe.FromTape(e.ID,e.type,e.arguments),P[qwt]=e=>lEe.FromTape(e.ID,e.type,e.arguments),P[Ywt]=e=>cEe.FromTape(e.ID,e.type,e.arguments),P[Xwt]=e=>uEe.FromTape(e.ID,e.type,e.arguments),P[$wt]=e=>hEe.FromTape(e.ID,e.type,e.arguments),P[Zwt]=e=>pEe.FromTape(e.ID,e.type,e.arguments),P[Kwt]=e=>dEe.FromTape(e.ID,e.type,e.arguments),P[Jwt]=e=>fEe.FromTape(e.ID,e.type,e.arguments),P[Qwt]=e=>mEe.FromTape(e.ID,e.type,e.arguments),P[eRt]=e=>gEe.FromTape(e.ID,e.type,e.arguments),P[tRt]=e=>vEe.FromTape(e.ID,e.type,e.arguments),P[rRt]=e=>yEe.FromTape(e.ID,e.type,e.arguments),P[iRt]=e=>EEe.FromTape(e.ID,e.type,e.arguments),P[nRt]=e=>TEe.FromTape(e.ID,e.type,e.arguments),P[sRt]=e=>bEe.FromTape(e.ID,e.type,e.arguments),P[aRt]=e=>xEe.FromTape(e.ID,e.type,e.arguments),P[oRt]=e=>IEe.FromTape(e.ID,e.type,e.arguments),P[lRt]=e=>_Ee.FromTape(e.ID,e.type,e.arguments),P[cRt]=e=>SEe.FromTape(e.ID,e.type,e.arguments),P[uRt]=e=>wEe.FromTape(e.ID,e.type,e.arguments),P[hRt]=e=>REe.FromTape(e.ID,e.type,e.arguments),P[pRt]=e=>MEe.FromTape(e.ID,e.type,e.arguments),P[dRt]=e=>DEe.FromTape(e.ID,e.type,e.arguments),P[fRt]=e=>CEe.FromTape(e.ID,e.type,e.arguments),P[mRt]=e=>AEe.FromTape(e.ID,e.type,e.arguments),P[gRt]=e=>OEe.FromTape(e.ID,e.type,e.arguments),P[vRt]=e=>PEe.FromTape(e.ID,e.type,e.arguments),P[yRt]=e=>NEe.FromTape(e.ID,e.type,e.arguments),P[ERt]=e=>LEe.FromTape(e.ID,e.type,e.arguments),P[TRt]=e=>FEe.FromTape(e.ID,e.type,e.arguments),P[bRt]=e=>HEe.FromTape(e.ID,e.type,e.arguments),P[xRt]=e=>UEe.FromTape(e.ID,e.type,e.arguments),P[IRt]=e=>BEe.FromTape(e.ID,e.type,e.arguments),P[_Rt]=e=>kEe.FromTape(e.ID,e.type,e.arguments),P[SRt]=e=>GEe.FromTape(e.ID,e.type,e.arguments),P[wRt]=e=>VEe.FromTape(e.ID,e.type,e.arguments),P[RRt]=e=>zEe.FromTape(e.ID,e.type,e.arguments),P[MRt]=e=>jEe.FromTape(e.ID,e.type,e.arguments),P[DRt]=e=>WEe.FromTape(e.ID,e.type,e.arguments),P[CRt]=e=>qEe.FromTape(e.ID,e.type,e.arguments),P[ARt]=e=>YEe.FromTape(e.ID,e.type,e.arguments),P[ORt]=e=>XEe.FromTape(e.ID,e.type,e.arguments),P[PRt]=e=>$Ee.FromTape(e.ID,e.type,e.arguments),P[NRt]=e=>ZEe.FromTape(e.ID,e.type,e.arguments),P[LRt]=e=>KEe.FromTape(e.ID,e.type,e.arguments),P[FRt]=e=>JEe.FromTape(e.ID,e.type,e.arguments),P[HRt]=e=>QEe.FromTape(e.ID,e.type,e.arguments),P[URt]=e=>eTe.FromTape(e.ID,e.type,e.arguments),P[BRt]=e=>tTe.FromTape(e.ID,e.type,e.arguments),P[kRt]=e=>rTe.FromTape(e.ID,e.type,e.arguments),P[GRt]=e=>iTe.FromTape(e.ID,e.type,e.arguments),P[VRt]=e=>nTe.FromTape(e.ID,e.type,e.arguments),P[zRt]=e=>sTe.FromTape(e.ID,e.type,e.arguments),P[jRt]=e=>aTe.FromTape(e.ID,e.type,e.arguments),P[WRt]=e=>oTe.FromTape(e.ID,e.type,e.arguments),P[qRt]=e=>lTe.FromTape(e.ID,e.type,e.arguments),P[YRt]=e=>cTe.FromTape(e.ID,e.type,e.arguments),P[XRt]=e=>uTe.FromTape(e.ID,e.type,e.arguments),P[$Rt]=e=>hTe.FromTape(e.ID,e.type,e.arguments),P[ZRt]=e=>pTe.FromTape(e.ID,e.type,e.arguments),P[KRt]=e=>dTe.FromTape(e.ID,e.type,e.arguments),P[JRt]=e=>fTe.FromTape(e.ID,e.type,e.arguments),P[QRt]=e=>mTe.FromTape(e.ID,e.type,e.arguments),P[eMt]=e=>gTe.FromTape(e.ID,e.type,e.arguments),P[tMt]=e=>vTe.FromTape(e.ID,e.type,e.arguments),P[rMt]=e=>yTe.FromTape(e.ID,e.type,e.arguments),P[iMt]=e=>ETe.FromTape(e.ID,e.type,e.arguments),P[nMt]=e=>TTe.FromTape(e.ID,e.type,e.arguments),P[sMt]=e=>bTe.FromTape(e.ID,e.type,e.arguments),P[aMt]=e=>xTe.FromTape(e.ID,e.type,e.arguments),P[oMt]=e=>ITe.FromTape(e.ID,e.type,e.arguments),P[lMt]=e=>_Te.FromTape(e.ID,e.type,e.arguments),P[cMt]=e=>STe.FromTape(e.ID,e.type,e.arguments),P[uMt]=e=>wTe.FromTape(e.ID,e.type,e.arguments),P[hMt]=e=>RTe.FromTape(e.ID,e.type,e.arguments),P[pMt]=e=>MTe.FromTape(e.ID,e.type,e.arguments),P[dMt]=e=>DTe.FromTape(e.ID,e.type,e.arguments),P[fMt]=e=>CTe.FromTape(e.ID,e.type,e.arguments),P[mMt]=e=>ATe.FromTape(e.ID,e.type,e.arguments),P[gMt]=e=>OTe.FromTape(e.ID,e.type,e.arguments),P[vMt]=e=>PTe.FromTape(e.ID,e.type,e.arguments),P[yMt]=e=>NTe.FromTape(e.ID,e.type,e.arguments),P[EMt]=e=>LTe.FromTape(e.ID,e.type,e.arguments),P[TMt]=e=>FTe.FromTape(e.ID,e.type,e.arguments),P[bMt]=e=>HTe.FromTape(e.ID,e.type,e.arguments),P[xMt]=e=>UTe.FromTape(e.ID,e.type,e.arguments),P[IMt]=e=>BTe.FromTape(e.ID,e.type,e.arguments),P[_Mt]=e=>kTe.FromTape(e.ID,e.type,e.arguments),P[SMt]=e=>GTe.FromTape(e.ID,e.type,e.arguments),P[wMt]=e=>VTe.FromTape(e.ID,e.type,e.arguments),P[RMt]=e=>zTe.FromTape(e.ID,e.type,e.arguments),P[MMt]=e=>jTe.FromTape(e.ID,e.type,e.arguments),P[DMt]=e=>WTe.FromTape(e.ID,e.type,e.arguments),P[CMt]=e=>qTe.FromTape(e.ID,e.type,e.arguments),P[AMt]=e=>YTe.FromTape(e.ID,e.type,e.arguments),P[OMt]=e=>XTe.FromTape(e.ID,e.type,e.arguments),P[PMt]=e=>$Te.FromTape(e.ID,e.type,e.arguments),P[NMt]=e=>ZTe.FromTape(e.ID,e.type,e.arguments),P[LMt]=e=>KTe.FromTape(e.ID,e.type,e.arguments),P[FMt]=e=>JTe.FromTape(e.ID,e.type,e.arguments),P[HMt]=e=>QTe.FromTape(e.ID,e.type,e.arguments),P[UMt]=e=>e1e.FromTape(e.ID,e.type,e.arguments),P[BMt]=e=>t1e.FromTape(e.ID,e.type,e.arguments),P[kMt]=e=>r1e.FromTape(e.ID,e.type,e.arguments),P[GMt]=e=>i1e.FromTape(e.ID,e.type,e.arguments),P[VMt]=e=>n1e.FromTape(e.ID,e.type,e.arguments),P[zMt]=e=>s1e.FromTape(e.ID,e.type,e.arguments),P[jMt]=e=>a1e.FromTape(e.ID,e.type,e.arguments),P[WMt]=e=>o1e.FromTape(e.ID,e.type,e.arguments),P[qMt]=e=>l1e.FromTape(e.ID,e.type,e.arguments),P[YMt]=e=>c1e.FromTape(e.ID,e.type,e.arguments),P[XMt]=e=>u1e.FromTape(e.ID,e.type,e.arguments),P[$Mt]=e=>h1e.FromTape(e.ID,e.type,e.arguments),P[ZMt]=e=>p1e.FromTape(e.ID,e.type,e.arguments),P[KMt]=e=>d1e.FromTape(e.ID,e.type,e.arguments),P[JMt]=e=>f1e.FromTape(e.ID,e.type,e.arguments),P[QMt]=e=>m1e.FromTape(e.ID,e.type,e.arguments),P[eDt]=e=>g1e.FromTape(e.ID,e.type,e.arguments),P[tDt]=e=>v1e.FromTape(e.ID,e.type,e.arguments),P[rDt]=e=>y1e.FromTape(e.ID,e.type,e.arguments),P[iDt]=e=>E1e.FromTape(e.ID,e.type,e.arguments),P[nDt]=e=>T1e.FromTape(e.ID,e.type,e.arguments),P[sDt]=e=>b1e.FromTape(e.ID,e.type,e.arguments),P[aDt]=e=>x1e.FromTape(e.ID,e.type,e.arguments),P[oDt]=e=>I1e.FromTape(e.ID,e.type,e.arguments),P[lDt]=e=>_1e.FromTape(e.ID,e.type,e.arguments),P[cDt]=e=>S1e.FromTape(e.ID,e.type,e.arguments),P[uDt]=e=>w1e.FromTape(e.ID,e.type,e.arguments),P[hDt]=e=>R1e.FromTape(e.ID,e.type,e.arguments),P[pDt]=e=>M1e.FromTape(e.ID,e.type,e.arguments),P[dDt]=e=>D1e.FromTape(e.ID,e.type,e.arguments),P[fDt]=e=>C1e.FromTape(e.ID,e.type,e.arguments),P[mDt]=e=>A1e.FromTape(e.ID,e.type,e.arguments),P[gDt]=e=>O1e.FromTape(e.ID,e.type,e.arguments),P[vDt]=e=>P1e.FromTape(e.ID,e.type,e.arguments),P[yDt]=e=>N1e.FromTape(e.ID,e.type,e.arguments),P[EDt]=e=>L1e.FromTape(e.ID,e.type,e.arguments),P[TDt]=e=>F1e.FromTape(e.ID,e.type,e.arguments),P[bDt]=e=>H1e.FromTape(e.ID,e.type,e.arguments),P[xDt]=e=>U1e.FromTape(e.ID,e.type,e.arguments),P[IDt]=e=>B1e.FromTape(e.ID,e.type,e.arguments),P[_Dt]=e=>k1e.FromTape(e.ID,e.type,e.arguments),P[SDt]=e=>G1e.FromTape(e.ID,e.type,e.arguments),P[wDt]=e=>V1e.FromTape(e.ID,e.type,e.arguments),P[RDt]=e=>z1e.FromTape(e.ID,e.type,e.arguments),P[MDt]=e=>j1e.FromTape(e.ID,e.type,e.arguments),P[DDt]=e=>W1e.FromTape(e.ID,e.type,e.arguments),P[CDt]=e=>q1e.FromTape(e.ID,e.type,e.arguments),P[ADt]=e=>Y1e.FromTape(e.ID,e.type,e.arguments),P[ODt]=e=>X1e.FromTape(e.ID,e.type,e.arguments),P[PDt]=e=>$1e.FromTape(e.ID,e.type,e.arguments),P[NDt]=e=>Z1e.FromTape(e.ID,e.type,e.arguments),P[LDt]=e=>K1e.FromTape(e.ID,e.type,e.arguments),P[FDt]=e=>J1e.FromTape(e.ID,e.type,e.arguments),P[HDt]=e=>Q1e.FromTape(e.ID,e.type,e.arguments),P[UDt]=e=>ebe.FromTape(e.ID,e.type,e.arguments),P[BDt]=e=>tbe.FromTape(e.ID,e.type,e.arguments),P[kDt]=e=>rbe.FromTape(e.ID,e.type,e.arguments),P[GDt]=e=>ibe.FromTape(e.ID,e.type,e.arguments),P[VDt]=e=>nbe.FromTape(e.ID,e.type,e.arguments),P[zDt]=e=>sbe.FromTape(e.ID,e.type,e.arguments),P[jDt]=e=>abe.FromTape(e.ID,e.type,e.arguments),P[WDt]=e=>obe.FromTape(e.ID,e.type,e.arguments),P[qDt]=e=>lbe.FromTape(e.ID,e.type,e.arguments),P[YDt]=e=>cbe.FromTape(e.ID,e.type,e.arguments),P[XDt]=e=>ube.FromTape(e.ID,e.type,e.arguments),P[$Dt]=e=>hbe.FromTape(e.ID,e.type,e.arguments),P[ZDt]=e=>pbe.FromTape(e.ID,e.type,e.arguments),P[KDt]=e=>dbe.FromTape(e.ID,e.type,e.arguments),P[JDt]=e=>fbe.FromTape(e.ID,e.type,e.arguments),P[QDt]=e=>mbe.FromTape(e.ID,e.type,e.arguments),P[eCt]=e=>gbe.FromTape(e.ID,e.type,e.arguments),P[tCt]=e=>vbe.FromTape(e.ID,e.type,e.arguments),P[rCt]=e=>ybe.FromTape(e.ID,e.type,e.arguments),P[iCt]=e=>Ebe.FromTape(e.ID,e.type,e.arguments),P[nCt]=e=>Tbe.FromTape(e.ID,e.type,e.arguments),P[sCt]=e=>bbe.FromTape(e.ID,e.type,e.arguments),P[aCt]=e=>xbe.FromTape(e.ID,e.type,e.arguments),P[oCt]=e=>Ibe.FromTape(e.ID,e.type,e.arguments),P[lCt]=e=>_be.FromTape(e.ID,e.type,e.arguments),P[cCt]=e=>Sbe.FromTape(e.ID,e.type,e.arguments),P[uCt]=e=>wbe.FromTape(e.ID,e.type,e.arguments),P[hCt]=e=>Rbe.FromTape(e.ID,e.type,e.arguments),P[pCt]=e=>Mbe.FromTape(e.ID,e.type,e.arguments),P[dCt]=e=>Dbe.FromTape(e.ID,e.type,e.arguments),P[fCt]=e=>Cbe.FromTape(e.ID,e.type,e.arguments),P[mCt]=e=>Abe.FromTape(e.ID,e.type,e.arguments),P[gCt]=e=>Obe.FromTape(e.ID,e.type,e.arguments),P[vCt]=e=>Pbe.FromTape(e.ID,e.type,e.arguments),P[yCt]=e=>Nbe.FromTape(e.ID,e.type,e.arguments),P[ECt]=e=>Lbe.FromTape(e.ID,e.type,e.arguments),P[TCt]=e=>Fbe.FromTape(e.ID,e.type,e.arguments),P[bCt]=e=>Hbe.FromTape(e.ID,e.type,e.arguments),P[xCt]=e=>Ube.FromTape(e.ID,e.type,e.arguments),P[ICt]=e=>Bbe.FromTape(e.ID,e.type,e.arguments),P[_Ct]=e=>kbe.FromTape(e.ID,e.type,e.arguments),P[SCt]=e=>Gbe.FromTape(e.ID,e.type,e.arguments),P[wCt]=e=>Vbe.FromTape(e.ID,e.type,e.arguments),P[RCt]=e=>zbe.FromTape(e.ID,e.type,e.arguments),P[MCt]=e=>jbe.FromTape(e.ID,e.type,e.arguments),P[DCt]=e=>Wbe.FromTape(e.ID,e.type,e.arguments),P[CCt]=e=>qbe.FromTape(e.ID,e.type,e.arguments),P[ACt]=e=>Ybe.FromTape(e.ID,e.type,e.arguments),P[OCt]=e=>Xbe.FromTape(e.ID,e.type,e.arguments),P[PCt]=e=>$be.FromTape(e.ID,e.type,e.arguments),P[NCt]=e=>Zbe.FromTape(e.ID,e.type,e.arguments),P[LCt]=e=>Kbe.FromTape(e.ID,e.type,e.arguments),P[FCt]=e=>Jbe.FromTape(e.ID,e.type,e.arguments),P[HCt]=e=>Qbe.FromTape(e.ID,e.type,e.arguments),P[UCt]=e=>exe.FromTape(e.ID,e.type,e.arguments),P[BCt]=e=>txe.FromTape(e.ID,e.type,e.arguments),P[kCt]=e=>rxe.FromTape(e.ID,e.type,e.arguments),P[GCt]=e=>ixe.FromTape(e.ID,e.type,e.arguments),P[VCt]=e=>nxe.FromTape(e.ID,e.type,e.arguments),P[zCt]=e=>sxe.FromTape(e.ID,e.type,e.arguments),P[jCt]=e=>axe.FromTape(e.ID,e.type,e.arguments),P[WCt]=e=>oxe.FromTape(e.ID,e.type,e.arguments),P[qCt]=e=>lxe.FromTape(e.ID,e.type,e.arguments),P[YCt]=e=>cxe.FromTape(e.ID,e.type,e.arguments),P[XCt]=e=>uxe.FromTape(e.ID,e.type,e.arguments),P[$Ct]=e=>hxe.FromTape(e.ID,e.type,e.arguments),P[ZCt]=e=>pxe.FromTape(e.ID,e.type,e.arguments),P[KCt]=e=>dxe.FromTape(e.ID,e.type,e.arguments),P[JCt]=e=>fxe.FromTape(e.ID,e.type,e.arguments),P[QCt]=e=>mxe.FromTape(e.ID,e.type,e.arguments),P[eAt]=e=>gxe.FromTape(e.ID,e.type,e.arguments),P[tAt]=e=>vxe.FromTape(e.ID,e.type,e.arguments),P[rAt]=e=>yxe.FromTape(e.ID,e.type,e.arguments),P[iAt]=e=>Exe.FromTape(e.ID,e.type,e.arguments),P[nAt]=e=>Txe.FromTape(e.ID,e.type,e.arguments),P[sAt]=e=>bxe.FromTape(e.ID,e.type,e.arguments),P[aAt]=e=>xxe.FromTape(e.ID,e.type,e.arguments),P[oAt]=e=>Ixe.FromTape(e.ID,e.type,e.arguments),P[lAt]=e=>_xe.FromTape(e.ID,e.type,e.arguments),P[cAt]=e=>Sxe.FromTape(e.ID,e.type,e.arguments),P[uAt]=e=>wxe.FromTape(e.ID,e.type,e.arguments),P[hAt]=e=>Rxe.FromTape(e.ID,e.type,e.arguments),P[pAt]=e=>Mxe.FromTape(e.ID,e.type,e.arguments),P[dAt]=e=>Dxe.FromTape(e.ID,e.type,e.arguments),P[fAt]=e=>Cxe.FromTape(e.ID,e.type,e.arguments),P[mAt]=e=>Axe.FromTape(e.ID,e.type,e.arguments),P[gAt]=e=>Oxe.FromTape(e.ID,e.type,e.arguments),P[vAt]=e=>Pxe.FromTape(e.ID,e.type,e.arguments),P[yAt]=e=>Nxe.FromTape(e.ID,e.type,e.arguments),P[EAt]=e=>Lxe.FromTape(e.ID,e.type,e.arguments),P[TAt]=e=>Fxe.FromTape(e.ID,e.type,e.arguments),P[bAt]=e=>Hxe.FromTape(e.ID,e.type,e.arguments),P[xAt]=e=>Uxe.FromTape(e.ID,e.type,e.arguments),P[IAt]=e=>Bxe.FromTape(e.ID,e.type,e.arguments),P[_At]=e=>kxe.FromTape(e.ID,e.type,e.arguments),P[SAt]=e=>Gxe.FromTape(e.ID,e.type,e.arguments),P[wAt]=e=>Vxe.FromTape(e.ID,e.type,e.arguments),P[RAt]=e=>zxe.FromTape(e.ID,e.type,e.arguments),P[MAt]=e=>jxe.FromTape(e.ID,e.type,e.arguments),P[DAt]=e=>Wxe.FromTape(e.ID,e.type,e.arguments),P[CAt]=e=>qxe.FromTape(e.ID,e.type,e.arguments),P[AAt]=e=>Yxe.FromTape(e.ID,e.type,e.arguments),P[OAt]=e=>Xxe.FromTape(e.ID,e.type,e.arguments),P[PAt]=e=>$xe.FromTape(e.ID,e.type,e.arguments),P[NAt]=e=>Zxe.FromTape(e.ID,e.type,e.arguments),P[LAt]=e=>Kxe.FromTape(e.ID,e.type,e.arguments),P[FAt]=e=>Jxe.FromTape(e.ID,e.type,e.arguments),P[HAt]=e=>Qxe.FromTape(e.ID,e.type,e.arguments),P[UAt]=e=>eIe.FromTape(e.ID,e.type,e.arguments),P[BAt]=e=>tIe.FromTape(e.ID,e.type,e.arguments),P[kAt]=e=>rIe.FromTape(e.ID,e.type,e.arguments),P[GAt]=e=>iIe.FromTape(e.ID,e.type,e.arguments),P[VAt]=e=>nIe.FromTape(e.ID,e.type,e.arguments),P[zAt]=e=>sIe.FromTape(e.ID,e.type,e.arguments),P[jAt]=e=>aIe.FromTape(e.ID,e.type,e.arguments),P[WAt]=e=>oIe.FromTape(e.ID,e.type,e.arguments),P[qAt]=e=>lIe.FromTape(e.ID,e.type,e.arguments),P[YAt]=e=>cIe.FromTape(e.ID,e.type,e.arguments),P[XAt]=e=>uIe.FromTape(e.ID,e.type,e.arguments),P[$At]=e=>hIe.FromTape(e.ID,e.type,e.arguments),P[ZAt]=e=>pIe.FromTape(e.ID,e.type,e.arguments),P[KAt]=e=>dIe.FromTape(e.ID,e.type,e.arguments),P[JAt]=e=>fIe.FromTape(e.ID,e.type,e.arguments),P[QAt]=e=>mIe.FromTape(e.ID,e.type,e.arguments),P[eOt]=e=>gIe.FromTape(e.ID,e.type,e.arguments),P[tOt]=e=>vIe.FromTape(e.ID,e.type,e.arguments),P[rOt]=e=>yIe.FromTape(e.ID,e.type,e.arguments),P[iOt]=e=>EIe.FromTape(e.ID,e.type,e.arguments),P[nOt]=e=>TIe.FromTape(e.ID,e.type,e.arguments),P[sOt]=e=>bIe.FromTape(e.ID,e.type,e.arguments),P[aOt]=e=>xIe.FromTape(e.ID,e.type,e.arguments),P[oOt]=e=>IIe.FromTape(e.ID,e.type,e.arguments),P[lOt]=e=>_Ie.FromTape(e.ID,e.type,e.arguments),P[cOt]=e=>SIe.FromTape(e.ID,e.type,e.arguments),P[uOt]=e=>wIe.FromTape(e.ID,e.type,e.arguments),P[hOt]=e=>RIe.FromTape(e.ID,e.type,e.arguments),P[pOt]=e=>MIe.FromTape(e.ID,e.type,e.arguments),P[dOt]=e=>DIe.FromTape(e.ID,e.type,e.arguments),P[fOt]=e=>CIe.FromTape(e.ID,e.type,e.arguments),P[mOt]=e=>AIe.FromTape(e.ID,e.type,e.arguments),P[gOt]=e=>OIe.FromTape(e.ID,e.type,e.arguments),P[vOt]=e=>PIe.FromTape(e.ID,e.type,e.arguments),P[yOt]=e=>NIe.FromTape(e.ID,e.type,e.arguments),P[EOt]=e=>LIe.FromTape(e.ID,e.type,e.arguments),P[TOt]=e=>FIe.FromTape(e.ID,e.type,e.arguments),P[bOt]=e=>HIe.FromTape(e.ID,e.type,e.arguments),P[xOt]=e=>UIe.FromTape(e.ID,e.type,e.arguments),P[IOt]=e=>BIe.FromTape(e.ID,e.type,e.arguments),P[_Ot]=e=>kIe.FromTape(e.ID,e.type,e.arguments),P[SOt]=e=>GIe.FromTape(e.ID,e.type,e.arguments),P[wOt]=e=>VIe.FromTape(e.ID,e.type,e.arguments),P[ROt]=e=>zIe.FromTape(e.ID,e.type,e.arguments),P[MOt]=e=>jIe.FromTape(e.ID,e.type,e.arguments),P[DOt]=e=>WIe.FromTape(e.ID,e.type,e.arguments),P[COt]=e=>qIe.FromTape(e.ID,e.type,e.arguments),P[AOt]=e=>YIe.FromTape(e.ID,e.type,e.arguments),P[OOt]=e=>XIe.FromTape(e.ID,e.type,e.arguments),P[POt]=e=>$Ie.FromTape(e.ID,e.type,e.arguments),P[NOt]=e=>ZIe.FromTape(e.ID,e.type,e.arguments),P[LOt]=e=>KIe.FromTape(e.ID,e.type,e.arguments),P[FOt]=e=>JIe.FromTape(e.ID,e.type,e.arguments),P[HOt]=e=>QIe.FromTape(e.ID,e.type,e.arguments),P[UOt]=e=>e_e.FromTape(e.ID,e.type,e.arguments),P[BOt]=e=>t_e.FromTape(e.ID,e.type,e.arguments),P[kOt]=e=>r_e.FromTape(e.ID,e.type,e.arguments),P[GOt]=e=>i_e.FromTape(e.ID,e.type,e.arguments),P[VOt]=e=>n_e.FromTape(e.ID,e.type,e.arguments),P[zOt]=e=>s_e.FromTape(e.ID,e.type,e.arguments),P[jOt]=e=>a_e.FromTape(e.ID,e.type,e.arguments),P[pO]=e=>o_e.FromTape(e.ID,e.type,e.arguments),P[WOt]=e=>l_e.FromTape(e.ID,e.type,e.arguments),P[qOt]=e=>c_e.FromTape(e.ID,e.type,e.arguments),P[YOt]=e=>u_e.FromTape(e.ID,e.type,e.arguments),P[XOt]=e=>h_e.FromTape(e.ID,e.type,e.arguments),P[$Ot]=e=>p_e.FromTape(e.ID,e.type,e.arguments),P[ZOt]=e=>d_e.FromTape(e.ID,e.type,e.arguments),P[KOt]=e=>f_e.FromTape(e.ID,e.type,e.arguments),P[JOt]=e=>m_e.FromTape(e.ID,e.type,e.arguments),P[QOt]=e=>g_e.FromTape(e.ID,e.type,e.arguments),P[e3t]=e=>v_e.FromTape(e.ID,e.type,e.arguments),P[t3t]=e=>y_e.FromTape(e.ID,e.type,e.arguments),P[r3t]=e=>E_e.FromTape(e.ID,e.type,e.arguments),P[i3t]=e=>T_e.FromTape(e.ID,e.type,e.arguments),P[n3t]=e=>b_e.FromTape(e.ID,e.type,e.arguments),P[s3t]=e=>x_e.FromTape(e.ID,e.type,e.arguments),P[a3t]=e=>I_e.FromTape(e.ID,e.type,e.arguments),P[o3t]=e=>__e.FromTape(e.ID,e.type,e.arguments),P[l3t]=e=>S_e.FromTape(e.ID,e.type,e.arguments),P[c3t]=e=>w_e.FromTape(e.ID,e.type,e.arguments),P[u3t]=e=>R_e.FromTape(e.ID,e.type,e.arguments),P[h3t]=e=>M_e.FromTape(e.ID,e.type,e.arguments),P[p3t]=e=>D_e.FromTape(e.ID,e.type,e.arguments),P[d3t]=e=>C_e.FromTape(e.ID,e.type,e.arguments),P[f3t]=e=>A_e.FromTape(e.ID,e.type,e.arguments),P[m3t]=e=>O_e.FromTape(e.ID,e.type,e.arguments),P[g3t]=e=>P_e.FromTape(e.ID,e.type,e.arguments),P[v3t]=e=>N_e.FromTape(e.ID,e.type,e.arguments),P[y3t]=e=>L_e.FromTape(e.ID,e.type,e.arguments),P[E3t]=e=>F_e.FromTape(e.ID,e.type,e.arguments),P[T3t]=e=>H_e.FromTape(e.ID,e.type,e.arguments),P[b3t]=e=>U_e.FromTape(e.ID,e.type,e.arguments),P[x3t]=e=>B_e.FromTape(e.ID,e.type,e.arguments),P[I3t]=e=>k_e.FromTape(e.ID,e.type,e.arguments),P[_3t]=e=>G_e.FromTape(e.ID,e.type,e.arguments),P[S3t]=e=>V_e.FromTape(e.ID,e.type,e.arguments),P[w3t]=e=>z_e.FromTape(e.ID,e.type,e.arguments),P[R3t]=e=>j_e.FromTape(e.ID,e.type,e.arguments),P[M3t]=e=>W_e.FromTape(e.ID,e.type,e.arguments),P[D3t]=e=>q_e.FromTape(e.ID,e.type,e.arguments),P[C3t]=e=>Y_e.FromTape(e.ID,e.type,e.arguments),P[A3t]=e=>X_e.FromTape(e.ID,e.type,e.arguments),P[O3t]=e=>$_e.FromTape(e.ID,e.type,e.arguments),P[P3t]=e=>Z_e.FromTape(e.ID,e.type,e.arguments),P[N3t]=e=>K_e.FromTape(e.ID,e.type,e.arguments),P[L3t]=e=>J_e.FromTape(e.ID,e.type,e.arguments),P[F3t]=e=>Q_e.FromTape(e.ID,e.type,e.arguments),P[H3t]=e=>eSe.FromTape(e.ID,e.type,e.arguments),P[U3t]=e=>tSe.FromTape(e.ID,e.type,e.arguments),P[B3t]=e=>rSe.FromTape(e.ID,e.type,e.arguments),P[k3t]=e=>iSe.FromTape(e.ID,e.type,e.arguments),P[G3t]=e=>nSe.FromTape(e.ID,e.type,e.arguments),P[V3t]=e=>sSe.FromTape(e.ID,e.type,e.arguments),P[z3t]=e=>aSe.FromTape(e.ID,e.type,e.arguments),P[j3t]=e=>oSe.FromTape(e.ID,e.type,e.arguments),P[W3t]=e=>lSe.FromTape(e.ID,e.type,e.arguments),P[q3t]=e=>cSe.FromTape(e.ID,e.type,e.arguments),P[Y3t]=e=>uSe.FromTape(e.ID,e.type,e.arguments),P[X3t]=e=>hSe.FromTape(e.ID,e.type,e.arguments),P[m8]=e=>pSe.FromTape(e.ID,e.type,e.arguments),P[$3t]=e=>dSe.FromTape(e.ID,e.type,e.arguments),P[Z3t]=e=>fSe.FromTape(e.ID,e.type,e.arguments),P[K3t]=e=>mSe.FromTape(e.ID,e.type,e.arguments),P[J3t]=e=>gSe.FromTape(e.ID,e.type,e.arguments),P[Q3t]=e=>vSe.FromTape(e.ID,e.type,e.arguments),P[ePt]=e=>ySe.FromTape(e.ID,e.type,e.arguments),P[tPt]=e=>ESe.FromTape(e.ID,e.type,e.arguments),P[rPt]=e=>TSe.FromTape(e.ID,e.type,e.arguments),P[iPt]=e=>bSe.FromTape(e.ID,e.type,e.arguments),P[nPt]=e=>xSe.FromTape(e.ID,e.type,e.arguments),P[sPt]=e=>ISe.FromTape(e.ID,e.type,e.arguments),P[aPt]=e=>_Se.FromTape(e.ID,e.type,e.arguments),P[oPt]=e=>SSe.FromTape(e.ID,e.type,e.arguments),P[lPt]=e=>wSe.FromTape(e.ID,e.type,e.arguments),P[g8]=e=>RSe.FromTape(e.ID,e.type,e.arguments),P[cPt]=e=>MSe.FromTape(e.ID,e.type,e.arguments),P[uPt]=e=>DSe.FromTape(e.ID,e.type,e.arguments),P[hPt]=e=>CSe.FromTape(e.ID,e.type,e.arguments),P[pPt]=e=>ASe.FromTape(e.ID,e.type,e.arguments),P[dPt]=e=>OSe.FromTape(e.ID,e.type,e.arguments),P[fPt]=e=>PSe.FromTape(e.ID,e.type,e.arguments),P[mPt]=e=>NSe.FromTape(e.ID,e.type,e.arguments),P[gPt]=e=>LSe.FromTape(e.ID,e.type,e.arguments),P[vPt]=e=>FSe.FromTape(e.ID,e.type,e.arguments),P[v8]=e=>HSe.FromTape(e.ID,e.type,e.arguments),P[yPt]=e=>USe.FromTape(e.ID,e.type,e.arguments),P[EPt]=e=>BSe.FromTape(e.ID,e.type,e.arguments),P[TPt]=e=>kSe.FromTape(e.ID,e.type,e.arguments),P[bPt]=e=>GSe.FromTape(e.ID,e.type,e.arguments),P[xPt]=e=>VSe.FromTape(e.ID,e.type,e.arguments),P[IPt]=e=>zSe.FromTape(e.ID,e.type,e.arguments),P[y8]=e=>jSe.FromTape(e.ID,e.type,e.arguments),P[_Pt]=e=>WSe.FromTape(e.ID,e.type,e.arguments),P[E8]=e=>qSe.FromTape(e.ID,e.type,e.arguments),P[SPt]=e=>YSe.FromTape(e.ID,e.type,e.arguments),P[wPt]=e=>XSe.FromTape(e.ID,e.type,e.arguments),P[RPt]=e=>$Se.FromTape(e.ID,e.type,e.arguments),P[MPt]=e=>ZSe.FromTape(e.ID,e.type,e.arguments),P[DPt]=e=>KSe.FromTape(e.ID,e.type,e.arguments),P[CPt]=e=>JSe.FromTape(e.ID,e.type,e.arguments),P[APt]=e=>QSe.FromTape(e.ID,e.type,e.arguments),P[OPt]=e=>ewe.FromTape(e.ID,e.type,e.arguments),P[PPt]=e=>twe.FromTape(e.ID,e.type,e.arguments),P[NPt]=e=>rwe.FromTape(e.ID,e.type,e.arguments),P[LPt]=e=>iwe.FromTape(e.ID,e.type,e.arguments),P[FPt]=e=>nwe.FromTape(e.ID,e.type,e.arguments),P[HPt]=e=>swe.FromTape(e.ID,e.type,e.arguments),P[UPt]=e=>awe.FromTape(e.ID,e.type,e.arguments),P[BPt]=e=>owe.FromTape(e.ID,e.type,e.arguments),P[kPt]=e=>lwe.FromTape(e.ID,e.type,e.arguments),P[GPt]=e=>cwe.FromTape(e.ID,e.type,e.arguments),P[VPt]=e=>uwe.FromTape(e.ID,e.type,e.arguments),P[zPt]=e=>hwe.FromTape(e.ID,e.type,e.arguments),P[jPt]=e=>pwe.FromTape(e.ID,e.type,e.arguments),P[WPt]=e=>dwe.FromTape(e.ID,e.type,e.arguments),P[qPt]=e=>fwe.FromTape(e.ID,e.type,e.arguments),P[YPt]=e=>mwe.FromTape(e.ID,e.type,e.arguments),P[XPt]=e=>gwe.FromTape(e.ID,e.type,e.arguments),P[$Pt]=e=>vwe.FromTape(e.ID,e.type,e.arguments),P[ZPt]=e=>ywe.FromTape(e.ID,e.type,e.arguments),P[KPt]=e=>Ewe.FromTape(e.ID,e.type,e.arguments),P[JPt]=e=>Twe.FromTape(e.ID,e.type,e.arguments),P[QPt]=e=>bwe.FromTape(e.ID,e.type,e.arguments),P[e2t]=e=>xwe.FromTape(e.ID,e.type,e.arguments),P[t2t]=e=>Iwe.FromTape(e.ID,e.type,e.arguments),P[r2t]=e=>_we.FromTape(e.ID,e.type,e.arguments),P[i2t]=e=>Swe.FromTape(e.ID,e.type,e.arguments),P[n2t]=e=>wwe.FromTape(e.ID,e.type,e.arguments),P[s2t]=e=>Rwe.FromTape(e.ID,e.type,e.arguments),P[a2t]=e=>Mwe.FromTape(e.ID,e.type,e.arguments),P[o2t]=e=>Dwe.FromTape(e.ID,e.type,e.arguments),P[l2t]=e=>Cwe.FromTape(e.ID,e.type,e.arguments),P[c2t]=e=>Awe.FromTape(e.ID,e.type,e.arguments),P[u2t]=e=>Owe.FromTape(e.ID,e.type,e.arguments),P[h2t]=e=>Pwe.FromTape(e.ID,e.type,e.arguments),P[p2t]=e=>Nwe.FromTape(e.ID,e.type,e.arguments),P[d2t]=e=>Lwe.FromTape(e.ID,e.type,e.arguments),P[f2t]=e=>Fwe.FromTape(e.ID,e.type,e.arguments),P[m2t]=e=>Hwe.FromTape(e.ID,e.type,e.arguments),P[g2t]=e=>Uwe.FromTape(e.ID,e.type,e.arguments),P[v2t]=e=>Bwe.FromTape(e.ID,e.type,e.arguments),P[y2t]=e=>kwe.FromTape(e.ID,e.type,e.arguments),P[E2t]=e=>Gwe.FromTape(e.ID,e.type,e.arguments),P[T2t]=e=>Vwe.FromTape(e.ID,e.type,e.arguments),P[b2t]=e=>zwe.FromTape(e.ID,e.type,e.arguments),P[x2t]=e=>jwe.FromTape(e.ID,e.type,e.arguments),P[I2t]=e=>Wwe.FromTape(e.ID,e.type,e.arguments),P[_2t]=e=>qwe.FromTape(e.ID,e.type,e.arguments),P[S2t]=e=>Ywe.FromTape(e.ID,e.type,e.arguments),P[w2t]=e=>Xwe.FromTape(e.ID,e.type,e.arguments),P[R2t]=e=>$we.FromTape(e.ID,e.type,e.arguments),P[M2t]=e=>Zwe.FromTape(e.ID,e.type,e.arguments),P[D2t]=e=>Kwe.FromTape(e.ID,e.type,e.arguments),P[C2t]=e=>Jwe.FromTape(e.ID,e.type,e.arguments),P[A2t]=e=>Qwe.FromTape(e.ID,e.type,e.arguments),P[O2t]=e=>eRe.FromTape(e.ID,e.type,e.arguments),P[P2t]=e=>tRe.FromTape(e.ID,e.type,e.arguments),P[N2t]=e=>rRe.FromTape(e.ID,e.type,e.arguments),P[L2t]=e=>iRe.FromTape(e.ID,e.type,e.arguments),P[F2t]=e=>nRe.FromTape(e.ID,e.type,e.arguments),P[H2t]=e=>sRe.FromTape(e.ID,e.type,e.arguments),P[U2t]=e=>aRe.FromTape(e.ID,e.type,e.arguments),P[B2t]=e=>oRe.FromTape(e.ID,e.type,e.arguments),P[k2t]=e=>lRe.FromTape(e.ID,e.type,e.arguments),P[G2t]=e=>cRe.FromTape(e.ID,e.type,e.arguments),P[V2t]=e=>uRe.FromTape(e.ID,e.type,e.arguments),P[z2t]=e=>hRe.FromTape(e.ID,e.type,e.arguments),P[j2t]=e=>pRe.FromTape(e.ID,e.type,e.arguments),P[W2t]=e=>dRe.FromTape(e.ID,e.type,e.arguments),P[q2t]=e=>fRe.FromTape(e.ID,e.type,e.arguments),P[Y2t]=e=>mRe.FromTape(e.ID,e.type,e.arguments),P[X2t]=e=>gRe.FromTape(e.ID,e.type,e.arguments),P[$2t]=e=>vRe.FromTape(e.ID,e.type,e.arguments),P[Z2t]=e=>yRe.FromTape(e.ID,e.type,e.arguments),P[K2t]=e=>ERe.FromTape(e.ID,e.type,e.arguments),P[J2t]=e=>TRe.FromTape(e.ID,e.type,e.arguments),P[Q2t]=e=>bRe.FromTape(e.ID,e.type,e.arguments),P[eNt]=e=>xRe.FromTape(e.ID,e.type,e.arguments),P[tNt]=e=>IRe.FromTape(e.ID,e.type,e.arguments),P[rNt]=e=>_Re.FromTape(e.ID,e.type,e.arguments),P[iNt]=e=>SRe.FromTape(e.ID,e.type,e.arguments),P[nNt]=e=>wRe.FromTape(e.ID,e.type,e.arguments),P[sNt]=e=>RRe.FromTape(e.ID,e.type,e.arguments),P[aNt]=e=>MRe.FromTape(e.ID,e.type,e.arguments),P[oNt]=e=>DRe.FromTape(e.ID,e.type,e.arguments),P[lNt]=e=>CRe.FromTape(e.ID,e.type,e.arguments),P[cNt]=e=>ARe.FromTape(e.ID,e.type,e.arguments),P[uNt]=e=>ORe.FromTape(e.ID,e.type,e.arguments),P[hNt]=e=>PRe.FromTape(e.ID,e.type,e.arguments),P[pNt]=e=>NRe.FromTape(e.ID,e.type,e.arguments),P[dNt]=e=>LRe.FromTape(e.ID,e.type,e.arguments),P[fNt]=e=>FRe.FromTape(e.ID,e.type,e.arguments),P[mNt]=e=>HRe.FromTape(e.ID,e.type,e.arguments),P[gNt]=e=>URe.FromTape(e.ID,e.type,e.arguments),P[vNt]=e=>BRe.FromTape(e.ID,e.type,e.arguments),P[yNt]=e=>kRe.FromTape(e.ID,e.type,e.arguments),P[ENt]=e=>GRe.FromTape(e.ID,e.type,e.arguments),P[TNt]=e=>VRe.FromTape(e.ID,e.type,e.arguments),P[bNt]=e=>zRe.FromTape(e.ID,e.type,e.arguments),P[xNt]=e=>jRe.FromTape(e.ID,e.type,e.arguments),P[INt]=e=>WRe.FromTape(e.ID,e.type,e.arguments),P[_Nt]=e=>qRe.FromTape(e.ID,e.type,e.arguments),P[SNt]=e=>YRe.FromTape(e.ID,e.type,e.arguments),P[wNt]=e=>XRe.FromTape(e.ID,e.type,e.arguments),P[RNt]=e=>$Re.FromTape(e.ID,e.type,e.arguments),P[MNt]=e=>ZRe.FromTape(e.ID,e.type,e.arguments),P[DNt]=e=>KRe.FromTape(e.ID,e.type,e.arguments),P[CNt]=e=>JRe.FromTape(e.ID,e.type,e.arguments),P[ANt]=e=>QRe.FromTape(e.ID,e.type,e.arguments),P[ONt]=e=>eMe.FromTape(e.ID,e.type,e.arguments),P[PNt]=e=>tMe.FromTape(e.ID,e.type,e.arguments),P[NNt]=e=>rMe.FromTape(e.ID,e.type,e.arguments),P[LNt]=e=>iMe.FromTape(e.ID,e.type,e.arguments),P[FNt]=e=>nMe.FromTape(e.ID,e.type,e.arguments),P[HNt]=e=>sMe.FromTape(e.ID,e.type,e.arguments),P[UNt]=e=>aMe.FromTape(e.ID,e.type,e.arguments),P[BNt]=e=>oMe.FromTape(e.ID,e.type,e.arguments),P[kNt]=e=>lMe.FromTape(e.ID,e.type,e.arguments),P[GNt]=e=>cMe.FromTape(e.ID,e.type,e.arguments),P[VNt]=e=>uMe.FromTape(e.ID,e.type,e.arguments),P[zNt]=e=>hMe.FromTape(e.ID,e.type,e.arguments),P[jNt]=e=>pMe.FromTape(e.ID,e.type,e.arguments),P[WNt]=e=>dMe.FromTape(e.ID,e.type,e.arguments),P[qNt]=e=>fMe.FromTape(e.ID,e.type,e.arguments),P[YNt]=e=>mMe.FromTape(e.ID,e.type,e.arguments),P[XNt]=e=>gMe.FromTape(e.ID,e.type,e.arguments),P[$Nt]=e=>vMe.FromTape(e.ID,e.type,e.arguments),P[ZNt]=e=>yMe.FromTape(e.ID,e.type,e.arguments),P[KNt]=e=>EMe.FromTape(e.ID,e.type,e.arguments),P[JNt]=e=>TMe.FromTape(e.ID,e.type,e.arguments),P[QNt]=e=>bMe.FromTape(e.ID,e.type,e.arguments),P[eLt]=e=>xMe.FromTape(e.ID,e.type,e.arguments),P[tLt]=e=>IMe.FromTape(e.ID,e.type,e.arguments),P[rLt]=e=>_Me.FromTape(e.ID,e.type,e.arguments),P[iLt]=e=>SMe.FromTape(e.ID,e.type,e.arguments),P[nLt]=e=>wMe.FromTape(e.ID,e.type,e.arguments),P[sLt]=e=>RMe.FromTape(e.ID,e.type,e.arguments),P[aLt]=e=>MMe.FromTape(e.ID,e.type,e.arguments),P[oLt]=e=>DMe.FromTape(e.ID,e.type,e.arguments),P[lLt]=e=>CMe.FromTape(e.ID,e.type,e.arguments),P[cLt]=e=>AMe.FromTape(e.ID,e.type,e.arguments),P[uLt]=e=>OMe.FromTape(e.ID,e.type,e.arguments),P[hLt]=e=>PMe.FromTape(e.ID,e.type,e.arguments),P[pLt]=e=>NMe.FromTape(e.ID,e.type,e.arguments),P[dLt]=e=>LMe.FromTape(e.ID,e.type,e.arguments),P[fLt]=e=>FMe.FromTape(e.ID,e.type,e.arguments),P[mLt]=e=>HMe.FromTape(e.ID,e.type,e.arguments),P[gLt]=e=>UMe.FromTape(e.ID,e.type,e.arguments),P[vLt]=e=>BMe.FromTape(e.ID,e.type,e.arguments),P[yLt]=e=>kMe.FromTape(e.ID,e.type,e.arguments),P[ELt]=e=>GMe.FromTape(e.ID,e.type,e.arguments),P[TLt]=e=>VMe.FromTape(e.ID,e.type,e.arguments),P[bLt]=e=>zMe.FromTape(e.ID,e.type,e.arguments),P[xLt]=e=>jMe.FromTape(e.ID,e.type,e.arguments),P[ILt]=e=>WMe.FromTape(e.ID,e.type,e.arguments),P[_Lt]=e=>qMe.FromTape(e.ID,e.type,e.arguments),P[SLt]=e=>YMe.FromTape(e.ID,e.type,e.arguments),P[wLt]=e=>XMe.FromTape(e.ID,e.type,e.arguments),P[RLt]=e=>$Me.FromTape(e.ID,e.type,e.arguments),P[MLt]=e=>ZMe.FromTape(e.ID,e.type,e.arguments),P[DLt]=e=>KMe.FromTape(e.ID,e.type,e.arguments),P[CLt]=e=>JMe.FromTape(e.ID,e.type,e.arguments),P[ALt]=e=>QMe.FromTape(e.ID,e.type,e.arguments),P[OLt]=e=>eDe.FromTape(e.ID,e.type,e.arguments),P[PLt]=e=>tDe.FromTape(e.ID,e.type,e.arguments),P[NLt]=e=>rDe.FromTape(e.ID,e.type,e.arguments),P[LLt]=e=>iDe.FromTape(e.ID,e.type,e.arguments),P[FLt]=e=>nDe.FromTape(e.ID,e.type,e.arguments),P[HLt]=e=>sDe.FromTape(e.ID,e.type,e.arguments),P[ULt]=e=>aDe.FromTape(e.ID,e.type,e.arguments),P[BLt]=e=>oDe.FromTape(e.ID,e.type,e.arguments),P[kLt]=e=>lDe.FromTape(e.ID,e.type,e.arguments),P[GLt]=e=>cDe.FromTape(e.ID,e.type,e.arguments),P[VLt]=e=>uDe.FromTape(e.ID,e.type,e.arguments),P[zLt]=e=>hDe.FromTape(e.ID,e.type,e.arguments),P[jLt]=e=>pDe.FromTape(e.ID,e.type,e.arguments),P[WLt]=e=>dDe.FromTape(e.ID,e.type,e.arguments),P[qLt]=e=>fDe.FromTape(e.ID,e.type,e.arguments),P[YLt]=e=>mDe.FromTape(e.ID,e.type,e.arguments),P[XLt]=e=>gDe.FromTape(e.ID,e.type,e.arguments),P[$Lt]=e=>vDe.FromTape(e.ID,e.type,e.arguments),P[ZLt]=e=>yDe.FromTape(e.ID,e.type,e.arguments),P[KLt]=e=>EDe.FromTape(e.ID,e.type,e.arguments),P[JLt]=e=>TDe.FromTape(e.ID,e.type,e.arguments),P[QLt]=e=>bDe.FromTape(e.ID,e.type,e.arguments),P[eFt]=e=>xDe.FromTape(e.ID,e.type,e.arguments),P[tFt]=e=>IDe.FromTape(e.ID,e.type,e.arguments),P[rFt]=e=>_De.FromTape(e.ID,e.type,e.arguments),P[iFt]=e=>SDe.FromTape(e.ID,e.type,e.arguments),P[nFt]=e=>wDe.FromTape(e.ID,e.type,e.arguments),P[sFt]=e=>RDe.FromTape(e.ID,e.type,e.arguments),P[aFt]=e=>MDe.FromTape(e.ID,e.type,e.arguments),P[oFt]=e=>DDe.FromTape(e.ID,e.type,e.arguments),P[lFt]=e=>CDe.FromTape(e.ID,e.type,e.arguments),P[cFt]=e=>ADe.FromTape(e.ID,e.type,e.arguments),P[uFt]=e=>ODe.FromTape(e.ID,e.type,e.arguments),P[hFt]=e=>PDe.FromTape(e.ID,e.type,e.arguments),P[pFt]=e=>NDe.FromTape(e.ID,e.type,e.arguments),P[dFt]=e=>LDe.FromTape(e.ID,e.type,e.arguments),P[fFt]=e=>FDe.FromTape(e.ID,e.type,e.arguments),P[mFt]=e=>HDe.FromTape(e.ID,e.type,e.arguments),P[gFt]=e=>UDe.FromTape(e.ID,e.type,e.arguments),P[vFt]=e=>BDe.FromTape(e.ID,e.type,e.arguments),P[yFt]=e=>kDe.FromTape(e.ID,e.type,e.arguments),P[EFt]=e=>GDe.FromTape(e.ID,e.type,e.arguments),P[TFt]=e=>VDe.FromTape(e.ID,e.type,e.arguments),P[bFt]=e=>zDe.FromTape(e.ID,e.type,e.arguments),P[xFt]=e=>jDe.FromTape(e.ID,e.type,e.arguments),P[IFt]=e=>WDe.FromTape(e.ID,e.type,e.arguments),P[_Ft]=e=>qDe.FromTape(e.ID,e.type,e.arguments),P[SFt]=e=>YDe.FromTape(e.ID,e.type,e.arguments),P[wFt]=e=>XDe.FromTape(e.ID,e.type,e.arguments);P[RFt]=e=>$De.FromTape(e.ID,e.type,e.arguments),P[MFt]=e=>ZDe.FromTape(e.ID,e.type,e.arguments),P[DFt]=e=>KDe.FromTape(e.ID,e.type,e.arguments),P[CFt]=e=>JDe.FromTape(e.ID,e.type,e.arguments),P[AFt]=e=>QDe.FromTape(e.ID,e.type,e.arguments),P[OFt]=e=>eCe.FromTape(e.ID,e.type,e.arguments),P[PFt]=e=>tCe.FromTape(e.ID,e.type,e.arguments),P[NFt]=e=>rCe.FromTape(e.ID,e.type,e.arguments),P[LFt]=e=>iCe.FromTape(e.ID,e.type,e.arguments),P[FFt]=e=>nCe.FromTape(e.ID,e.type,e.arguments),P[HFt]=e=>sCe.FromTape(e.ID,e.type,e.arguments),P[UFt]=e=>aCe.FromTape(e.ID,e.type,e.arguments),P[BFt]=e=>oCe.FromTape(e.ID,e.type,e.arguments),P[kFt]=e=>lCe.FromTape(e.ID,e.type,e.arguments),P[GFt]=e=>cCe.FromTape(e.ID,e.type,e.arguments),P[VFt]=e=>uCe.FromTape(e.ID,e.type,e.arguments);var f0=class{constructor(e){this.value=e}};f0.EMAIL="EMAIL",f0.FAX="FAX",f0.PHONE="PHONE",f0.POST="POST",f0.VERBAL="VERBAL",f0.USERDEFINED="USERDEFINED",f0.NOTDEFINED="NOTDEFINED";var fn=class{constructor(e){this.value=e}};fn.DEAD_LOAD_G="DEAD_LOAD_G",fn.COMPLETION_G1="COMPLETION_G1",fn.LIVE_LOAD_Q="LIVE_LOAD_Q",fn.SNOW_S="SNOW_S",fn.WIND_W="WIND_W",fn.PRESTRESSING_P="PRESTRESSING_P",fn.SETTLEMENT_U="SETTLEMENT_U",fn.TEMPERATURE_T="TEMPERATURE_T",fn.EARTHQUAKE_E="EARTHQUAKE_E",fn.FIRE="FIRE",fn.IMPULSE="IMPULSE",fn.IMPACT="IMPACT",fn.TRANSPORT="TRANSPORT",fn.ERECTION="ERECTION",fn.PROPPING="PROPPING",fn.SYSTEM_IMPERFECTION="SYSTEM_IMPERFECTION",fn.SHRINKAGE="SHRINKAGE",fn.CREEP="CREEP",fn.LACK_OF_FIT="LACK_OF_FIT",fn.BUOYANCY="BUOYANCY",fn.ICE="ICE",fn.CURRENT="CURRENT",fn.WAVE="WAVE",fn.RAIN="RAIN",fn.BRAKES="BRAKES",fn.USERDEFINED="USERDEFINED",fn.NOTDEFINED="NOTDEFINED";var h_=class{constructor(e){this.value=e}};h_.PERMANENT_G="PERMANENT_G",h_.VARIABLE_Q="VARIABLE_Q",h_.EXTRAORDINARY_A="EXTRAORDINARY_A",h_.USERDEFINED="USERDEFINED",h_.NOTDEFINED="NOTDEFINED";var m0=class{constructor(e){this.value=e}};m0.ELECTRICACTUATOR="ELECTRICACTUATOR",m0.HANDOPERATEDACTUATOR="HANDOPERATEDACTUATOR",m0.HYDRAULICACTUATOR="HYDRAULICACTUATOR",m0.PNEUMATICACTUATOR="PNEUMATICACTUATOR",m0.THERMOSTATICACTUATOR="THERMOSTATICACTUATOR",m0.USERDEFINED="USERDEFINED",m0.NOTDEFINED="NOTDEFINED";var p_=class{constructor(e){this.value=e}};p_.OFFICE="OFFICE",p_.SITE="SITE",p_.HOME="HOME",p_.DISTRIBUTIONPOINT="DISTRIBUTIONPOINT",p_.USERDEFINED="USERDEFINED";var d_=class{constructor(e){this.value=e}};d_.CONSTANTFLOW="CONSTANTFLOW",d_.VARIABLEFLOWPRESSUREDEPENDANT="VARIABLEFLOWPRESSUREDEPENDANT",d_.VARIABLEFLOWPRESSUREINDEPENDANT="VARIABLEFLOWPRESSUREINDEPENDANT",d_.USERDEFINED="USERDEFINED",d_.NOTDEFINED="NOTDEFINED";var WE=class{constructor(e){this.value=e}};WE.DIFFUSER="DIFFUSER",WE.GRILLE="GRILLE",WE.LOUVRE="LOUVRE",WE.REGISTER="REGISTER",WE.USERDEFINED="USERDEFINED",WE.NOTDEFINED="NOTDEFINED";var eu=class{constructor(e){this.value=e}};eu.FIXEDPLATECOUNTERFLOWEXCHANGER="FIXEDPLATECOUNTERFLOWEXCHANGER",eu.FIXEDPLATECROSSFLOWEXCHANGER="FIXEDPLATECROSSFLOWEXCHANGER",eu.FIXEDPLATEPARALLELFLOWEXCHANGER="FIXEDPLATEPARALLELFLOWEXCHANGER",eu.ROTARYWHEEL="ROTARYWHEEL",eu.RUNAROUNDCOILLOOP="RUNAROUNDCOILLOOP",eu.HEATPIPE="HEATPIPE",eu.TWINTOWERENTHALPYRECOVERYLOOPS="TWINTOWERENTHALPYRECOVERYLOOPS",eu.THERMOSIPHONSEALEDTUBEHEATEXCHANGERS="THERMOSIPHONSEALEDTUBEHEATEXCHANGERS",eu.THERMOSIPHONCOILTYPEHEATEXCHANGERS="THERMOSIPHONCOILTYPEHEATEXCHANGERS",eu.USERDEFINED="USERDEFINED",eu.NOTDEFINED="NOTDEFINED";var Xf=class{constructor(e){this.value=e}};Xf.BELL="BELL",Xf.BREAKGLASSBUTTON="BREAKGLASSBUTTON",Xf.LIGHT="LIGHT",Xf.MANUALPULLBOX="MANUALPULLBOX",Xf.SIREN="SIREN",Xf.WHISTLE="WHISTLE",Xf.USERDEFINED="USERDEFINED",Xf.NOTDEFINED="NOTDEFINED";var Wge=class{constructor(e){this.value=e}};Wge.USERDEFINED="USERDEFINED",Wge.NOTDEFINED="NOTDEFINED";var f_=class{constructor(e){this.value=e}};f_.IN_PLANE_LOADING_2D="IN_PLANE_LOADING_2D",f_.OUT_PLANE_LOADING_2D="OUT_PLANE_LOADING_2D",f_.LOADING_3D="LOADING_3D",f_.USERDEFINED="USERDEFINED",f_.NOTDEFINED="NOTDEFINED";var qE=class{constructor(e){this.value=e}};qE.FIRST_ORDER_THEORY="FIRST_ORDER_THEORY",qE.SECOND_ORDER_THEORY="SECOND_ORDER_THEORY",qE.THIRD_ORDER_THEORY="THIRD_ORDER_THEORY",qE.FULL_NONLINEAR_THEORY="FULL_NONLINEAR_THEORY",qE.USERDEFINED="USERDEFINED",qE.NOTDEFINED="NOTDEFINED";var dO=class{constructor(e){this.value=e}};dO.ADD="ADD",dO.DIVIDE="DIVIDE",dO.MULTIPLY="MULTIPLY",dO.SUBTRACT="SUBTRACT";var T8=class{constructor(e){this.value=e}};T8.SITE="SITE",T8.FACTORY="FACTORY",T8.NOTDEFINED="NOTDEFINED";var ol=class{constructor(e){this.value=e}};ol.AMPLIFIER="AMPLIFIER",ol.CAMERA="CAMERA",ol.DISPLAY="DISPLAY",ol.MICROPHONE="MICROPHONE",ol.PLAYER="PLAYER",ol.PROJECTOR="PROJECTOR",ol.RECEIVER="RECEIVER",ol.SPEAKER="SPEAKER",ol.SWITCHER="SWITCHER",ol.TELEPHONE="TELEPHONE",ol.TUNER="TUNER",ol.USERDEFINED="USERDEFINED",ol.NOTDEFINED="NOTDEFINED";var YE=class{constructor(e){this.value=e}};YE.POLYLINE_FORM="POLYLINE_FORM",YE.CIRCULAR_ARC="CIRCULAR_ARC",YE.ELLIPTIC_ARC="ELLIPTIC_ARC",YE.PARABOLIC_ARC="PARABOLIC_ARC",YE.HYPERBOLIC_ARC="HYPERBOLIC_ARC",YE.UNSPECIFIED="UNSPECIFIED";var tu=class{constructor(e){this.value=e}};tu.PLANE_SURF="PLANE_SURF",tu.CYLINDRICAL_SURF="CYLINDRICAL_SURF",tu.CONICAL_SURF="CONICAL_SURF",tu.SPHERICAL_SURF="SPHERICAL_SURF",tu.TOROIDAL_SURF="TOROIDAL_SURF",tu.SURF_OF_REVOLUTION="SURF_OF_REVOLUTION",tu.RULED_SURF="RULED_SURF",tu.GENERALISED_CONE="GENERALISED_CONE",tu.QUADRIC_SURF="QUADRIC_SURF",tu.SURF_OF_LINEAR_EXTRUSION="SURF_OF_LINEAR_EXTRUSION",tu.UNSPECIFIED="UNSPECIFIED";var wo=class{constructor(e){this.value=e}};wo.BEAM="BEAM",wo.JOIST="JOIST",wo.HOLLOWCORE="HOLLOWCORE",wo.LINTEL="LINTEL",wo.SPANDREL="SPANDREL",wo.T_BEAM="T_BEAM",wo.GIRDER_SEGMENT="GIRDER_SEGMENT",wo.DIAPHRAGM="DIAPHRAGM",wo.PIERCAP="PIERCAP",wo.HATSTONE="HATSTONE",wo.CORNICE="CORNICE",wo.EDGEBEAM="EDGEBEAM",wo.USERDEFINED="USERDEFINED",wo.NOTDEFINED="NOTDEFINED";var m_=class{constructor(e){this.value=e}};m_.FIXED_MOVEMENT="FIXED_MOVEMENT",m_.GUIDED_LONGITUDINAL="GUIDED_LONGITUDINAL",m_.GUIDED_TRANSVERSAL="GUIDED_TRANSVERSAL",m_.FREE_MOVEMENT="FREE_MOVEMENT",m_.NOTDEFINED="NOTDEFINED";var vh=class{constructor(e){this.value=e}};vh.CYLINDRICAL="CYLINDRICAL",vh.SPHERICAL="SPHERICAL",vh.ELASTOMERIC="ELASTOMERIC",vh.POT="POT",vh.GUIDE="GUIDE",vh.ROCKER="ROCKER",vh.ROLLER="ROLLER",vh.DISK="DISK",vh.USERDEFINED="USERDEFINED",vh.NOTDEFINED="NOTDEFINED";var yh=class{constructor(e){this.value=e}};yh.GREATERTHAN="GREATERTHAN",yh.GREATERTHANOREQUALTO="GREATERTHANOREQUALTO",yh.LESSTHAN="LESSTHAN",yh.LESSTHANOREQUALTO="LESSTHANOREQUALTO",yh.EQUALTO="EQUALTO",yh.NOTEQUALTO="NOTEQUALTO",yh.INCLUDES="INCLUDES",yh.NOTINCLUDES="NOTINCLUDES",yh.INCLUDEDIN="INCLUDEDIN",yh.NOTINCLUDEDIN="NOTINCLUDEDIN";var fO=class{constructor(e){this.value=e}};fO.WATER="WATER",fO.STEAM="STEAM",fO.USERDEFINED="USERDEFINED",fO.NOTDEFINED="NOTDEFINED";var b8=class{constructor(e){this.value=e}};b8.UNION="UNION",b8.INTERSECTION="INTERSECTION",b8.DIFFERENCE="DIFFERENCE";var rc=class{constructor(e){this.value=e}};rc.ABUTMENT="ABUTMENT",rc.DECK="DECK",rc.DECK_SEGMENT="DECK_SEGMENT",rc.FOUNDATION="FOUNDATION",rc.PIER="PIER",rc.PIER_SEGMENT="PIER_SEGMENT",rc.PYLON="PYLON",rc.SUBSTRUCTURE="SUBSTRUCTURE",rc.SUPERSTRUCTURE="SUPERSTRUCTURE",rc.SURFACESTRUCTURE="SURFACESTRUCTURE",rc.USERDEFINED="USERDEFINED",rc.NOTDEFINED="NOTDEFINED";var Eh=class{constructor(e){this.value=e}};Eh.ARCHED="ARCHED",Eh.CABLE_STAYED="CABLE_STAYED",Eh.CANTILEVER="CANTILEVER",Eh.CULVERT="CULVERT",Eh.FRAMEWORK="FRAMEWORK",Eh.GIRDER="GIRDER",Eh.SUSPENSION="SUSPENSION",Eh.TRUSS="TRUSS",Eh.USERDEFINED="USERDEFINED",Eh.NOTDEFINED="NOTDEFINED";var g_=class{constructor(e){this.value=e}};g_.INSULATION="INSULATION",g_.PRECASTPANEL="PRECASTPANEL",g_.APRON="APRON",g_.USERDEFINED="USERDEFINED",g_.NOTDEFINED="NOTDEFINED";var g0=class{constructor(e){this.value=e}};g0.COMPLEX="COMPLEX",g0.ELEMENT="ELEMENT",g0.PARTIAL="PARTIAL",g0.PROVISIONFORVOID="PROVISIONFORVOID",g0.PROVISIONFORSPACE="PROVISIONFORSPACE",g0.USERDEFINED="USERDEFINED",g0.NOTDEFINED="NOTDEFINED";var Th=class{constructor(e){this.value=e}};Th.FENESTRATION="FENESTRATION",Th.FOUNDATION="FOUNDATION",Th.LOADBEARING="LOADBEARING",Th.OUTERSHELL="OUTERSHELL",Th.SHADING="SHADING",Th.TRANSPORT="TRANSPORT",Th.REINFORCING="REINFORCING",Th.PRESTRESSING="PRESTRESSING",Th.USERDEFINED="USERDEFINED",Th.NOTDEFINED="NOTDEFINED";var qge=class{constructor(e){this.value=e}};qge.USERDEFINED="USERDEFINED",qge.NOTDEFINED="NOTDEFINED";var XE=class{constructor(e){this.value=e}};XE.BEND="BEND",XE.CROSS="CROSS",XE.REDUCER="REDUCER",XE.TEE="TEE",XE.USERDEFINED="USERDEFINED",XE.NOTDEFINED="NOTDEFINED";var $E=class{constructor(e){this.value=e}};$E.CABLELADDERSEGMENT="CABLELADDERSEGMENT",$E.CABLETRAYSEGMENT="CABLETRAYSEGMENT",$E.CABLETRUNKINGSEGMENT="CABLETRUNKINGSEGMENT",$E.CONDUITSEGMENT="CONDUITSEGMENT",$E.USERDEFINED="USERDEFINED",$E.NOTDEFINED="NOTDEFINED";var v0=class{constructor(e){this.value=e}};v0.CONNECTOR="CONNECTOR",v0.ENTRY="ENTRY",v0.EXIT="EXIT",v0.JUNCTION="JUNCTION",v0.TRANSITION="TRANSITION",v0.USERDEFINED="USERDEFINED",v0.NOTDEFINED="NOTDEFINED";var ZE=class{constructor(e){this.value=e}};ZE.BUSBARSEGMENT="BUSBARSEGMENT",ZE.CABLESEGMENT="CABLESEGMENT",ZE.CONDUCTORSEGMENT="CONDUCTORSEGMENT",ZE.CORESEGMENT="CORESEGMENT",ZE.USERDEFINED="USERDEFINED",ZE.NOTDEFINED="NOTDEFINED";var mO=class{constructor(e){this.value=e}};mO.WELL="WELL",mO.CAISSON="CAISSON",mO.USERDEFINED="USERDEFINED",mO.NOTDEFINED="NOTDEFINED";var v_=class{constructor(e){this.value=e}};v_.NOCHANGE="NOCHANGE",v_.MODIFIED="MODIFIED",v_.ADDED="ADDED",v_.DELETED="DELETED",v_.NOTDEFINED="NOTDEFINED";var y_=class{constructor(e){this.value=e}};y_.AIRCOOLED="AIRCOOLED",y_.WATERCOOLED="WATERCOOLED",y_.HEATRECOVERY="HEATRECOVERY",y_.USERDEFINED="USERDEFINED",y_.NOTDEFINED="NOTDEFINED";var Yge=class{constructor(e){this.value=e}};Yge.USERDEFINED="USERDEFINED",Yge.NOTDEFINED="NOTDEFINED";var td=class{constructor(e){this.value=e}};td.DXCOOLINGCOIL="DXCOOLINGCOIL",td.ELECTRICHEATINGCOIL="ELECTRICHEATINGCOIL",td.GASHEATINGCOIL="GASHEATINGCOIL",td.HYDRONICCOIL="HYDRONICCOIL",td.STEAMHEATINGCOIL="STEAMHEATINGCOIL",td.WATERCOOLINGCOIL="WATERCOOLINGCOIL",td.WATERHEATINGCOIL="WATERHEATINGCOIL",td.USERDEFINED="USERDEFINED",td.NOTDEFINED="NOTDEFINED";var y0=class{constructor(e){this.value=e}};y0.COLUMN="COLUMN",y0.PILASTER="PILASTER",y0.PIERSTEM="PIERSTEM",y0.PIERSTEM_SEGMENT="PIERSTEM_SEGMENT",y0.STANDCOLUMN="STANDCOLUMN",y0.USERDEFINED="USERDEFINED",y0.NOTDEFINED="NOTDEFINED";var Ro=class{constructor(e){this.value=e}};Ro.ANTENNA="ANTENNA",Ro.COMPUTER="COMPUTER",Ro.FAX="FAX",Ro.GATEWAY="GATEWAY",Ro.MODEM="MODEM",Ro.NETWORKAPPLIANCE="NETWORKAPPLIANCE",Ro.NETWORKBRIDGE="NETWORKBRIDGE",Ro.NETWORKHUB="NETWORKHUB",Ro.PRINTER="PRINTER",Ro.REPEATER="REPEATER",Ro.ROUTER="ROUTER",Ro.SCANNER="SCANNER",Ro.USERDEFINED="USERDEFINED",Ro.NOTDEFINED="NOTDEFINED";var Xge=class{constructor(e){this.value=e}};Xge.P_COMPLEX="P_COMPLEX",Xge.Q_COMPLEX="Q_COMPLEX";var Zs=class{constructor(e){this.value=e}};Zs.DYNAMIC="DYNAMIC",Zs.RECIPROCATING="RECIPROCATING",Zs.ROTARY="ROTARY",Zs.SCROLL="SCROLL",Zs.TROCHOIDAL="TROCHOIDAL",Zs.SINGLESTAGE="SINGLESTAGE",Zs.BOOSTER="BOOSTER",Zs.OPENTYPE="OPENTYPE",Zs.HERMETIC="HERMETIC",Zs.SEMIHERMETIC="SEMIHERMETIC",Zs.WELDEDSHELLHERMETIC="WELDEDSHELLHERMETIC",Zs.ROLLINGPISTON="ROLLINGPISTON",Zs.ROTARYVANE="ROTARYVANE",Zs.SINGLESCREW="SINGLESCREW",Zs.TWINSCREW="TWINSCREW",Zs.USERDEFINED="USERDEFINED",Zs.NOTDEFINED="NOTDEFINED";var rd=class{constructor(e){this.value=e}};rd.AIRCOOLED="AIRCOOLED",rd.EVAPORATIVECOOLED="EVAPORATIVECOOLED",rd.WATERCOOLED="WATERCOOLED",rd.WATERCOOLEDBRAZEDPLATE="WATERCOOLEDBRAZEDPLATE",rd.WATERCOOLEDSHELLCOIL="WATERCOOLEDSHELLCOIL",rd.WATERCOOLEDSHELLTUBE="WATERCOOLEDSHELLTUBE",rd.WATERCOOLEDTUBEINTUBE="WATERCOOLEDTUBEINTUBE",rd.USERDEFINED="USERDEFINED",rd.NOTDEFINED="NOTDEFINED";var gO=class{constructor(e){this.value=e}};gO.ATPATH="ATPATH",gO.ATSTART="ATSTART",gO.ATEND="ATEND",gO.NOTDEFINED="NOTDEFINED";var E_=class{constructor(e){this.value=e}};E_.HARD="HARD",E_.SOFT="SOFT",E_.ADVISORY="ADVISORY",E_.USERDEFINED="USERDEFINED",E_.NOTDEFINED="NOTDEFINED";var bh=class{constructor(e){this.value=e}};bh.DEMOLISHING="DEMOLISHING",bh.EARTHMOVING="EARTHMOVING",bh.ERECTING="ERECTING",bh.HEATING="HEATING",bh.LIGHTING="LIGHTING",bh.PAVING="PAVING",bh.PUMPING="PUMPING",bh.TRANSPORTING="TRANSPORTING",bh.USERDEFINED="USERDEFINED",bh.NOTDEFINED="NOTDEFINED";var ru=class{constructor(e){this.value=e}};ru.AGGREGATES="AGGREGATES",ru.CONCRETE="CONCRETE",ru.DRYWALL="DRYWALL",ru.FUEL="FUEL",ru.GYPSUM="GYPSUM",ru.MASONRY="MASONRY",ru.METAL="METAL",ru.PLASTIC="PLASTIC",ru.WOOD="WOOD",ru.NOTDEFINED="NOTDEFINED",ru.USERDEFINED="USERDEFINED";var vO=class{constructor(e){this.value=e}};vO.ASSEMBLY="ASSEMBLY",vO.FORMWORK="FORMWORK",vO.USERDEFINED="USERDEFINED",vO.NOTDEFINED="NOTDEFINED";var E0=class{constructor(e){this.value=e}};E0.FLOATING="FLOATING",E0.PROGRAMMABLE="PROGRAMMABLE",E0.PROPORTIONAL="PROPORTIONAL",E0.MULTIPOSITION="MULTIPOSITION",E0.TWOPOSITION="TWOPOSITION",E0.USERDEFINED="USERDEFINED",E0.NOTDEFINED="NOTDEFINED";var yO=class{constructor(e){this.value=e}};yO.ACTIVE="ACTIVE",yO.PASSIVE="PASSIVE",yO.USERDEFINED="USERDEFINED",yO.NOTDEFINED="NOTDEFINED";var T_=class{constructor(e){this.value=e}};T_.NATURALDRAFT="NATURALDRAFT",T_.MECHANICALINDUCEDDRAFT="MECHANICALINDUCEDDRAFT",T_.MECHANICALFORCEDDRAFT="MECHANICALFORCEDDRAFT",T_.USERDEFINED="USERDEFINED",T_.NOTDEFINED="NOTDEFINED";var $ge=class{constructor(e){this.value=e}};$ge.USERDEFINED="USERDEFINED",$ge.NOTDEFINED="NOTDEFINED";var id=class{constructor(e){this.value=e}};id.BUDGET="BUDGET",id.COSTPLAN="COSTPLAN",id.ESTIMATE="ESTIMATE",id.TENDER="TENDER",id.PRICEDBILLOFQUANTITIES="PRICEDBILLOFQUANTITIES",id.UNPRICEDBILLOFQUANTITIES="UNPRICEDBILLOFQUANTITIES",id.SCHEDULEOFRATES="SCHEDULEOFRATES",id.USERDEFINED="USERDEFINED",id.NOTDEFINED="NOTDEFINED";var ll=class{constructor(e){this.value=e}};ll.CEILING="CEILING",ll.FLOORING="FLOORING",ll.CLADDING="CLADDING",ll.ROOFING="ROOFING",ll.MOLDING="MOLDING",ll.SKIRTINGBOARD="SKIRTINGBOARD",ll.INSULATION="INSULATION",ll.MEMBRANE="MEMBRANE",ll.SLEEVING="SLEEVING",ll.WRAPPING="WRAPPING",ll.COPING="COPING",ll.USERDEFINED="USERDEFINED",ll.NOTDEFINED="NOTDEFINED";var EO=class{constructor(e){this.value=e}};EO.OFFICE="OFFICE",EO.SITE="SITE",EO.USERDEFINED="USERDEFINED",EO.NOTDEFINED="NOTDEFINED";var Zge=class{constructor(e){this.value=e}};Zge.USERDEFINED="USERDEFINED",Zge.NOTDEFINED="NOTDEFINED";var TO=class{constructor(e){this.value=e}};TO.LINEAR="LINEAR",TO.LOG_LINEAR="LOG_LINEAR",TO.LOG_LOG="LOG_LOG",TO.NOTDEFINED="NOTDEFINED";var cl=class{constructor(e){this.value=e}};cl.BACKDRAFTDAMPER="BACKDRAFTDAMPER",cl.BALANCINGDAMPER="BALANCINGDAMPER",cl.BLASTDAMPER="BLASTDAMPER",cl.CONTROLDAMPER="CONTROLDAMPER",cl.FIREDAMPER="FIREDAMPER",cl.FIRESMOKEDAMPER="FIRESMOKEDAMPER",cl.FUMEHOODEXHAUST="FUMEHOODEXHAUST",cl.GRAVITYDAMPER="GRAVITYDAMPER",cl.GRAVITYRELIEFDAMPER="GRAVITYRELIEFDAMPER",cl.RELIEFDAMPER="RELIEFDAMPER",cl.SMOKEDAMPER="SMOKEDAMPER",cl.USERDEFINED="USERDEFINED",cl.NOTDEFINED="NOTDEFINED";var b_=class{constructor(e){this.value=e}};b_.MEASURED="MEASURED",b_.PREDICTED="PREDICTED",b_.SIMULATED="SIMULATED",b_.USERDEFINED="USERDEFINED",b_.NOTDEFINED="NOTDEFINED";var mr=class{constructor(e){this.value=e}};mr.ANGULARVELOCITYUNIT="ANGULARVELOCITYUNIT",mr.AREADENSITYUNIT="AREADENSITYUNIT",mr.COMPOUNDPLANEANGLEUNIT="COMPOUNDPLANEANGLEUNIT",mr.DYNAMICVISCOSITYUNIT="DYNAMICVISCOSITYUNIT",mr.HEATFLUXDENSITYUNIT="HEATFLUXDENSITYUNIT",mr.INTEGERCOUNTRATEUNIT="INTEGERCOUNTRATEUNIT",mr.ISOTHERMALMOISTURECAPACITYUNIT="ISOTHERMALMOISTURECAPACITYUNIT",mr.KINEMATICVISCOSITYUNIT="KINEMATICVISCOSITYUNIT",mr.LINEARVELOCITYUNIT="LINEARVELOCITYUNIT",mr.MASSDENSITYUNIT="MASSDENSITYUNIT",mr.MASSFLOWRATEUNIT="MASSFLOWRATEUNIT",mr.MOISTUREDIFFUSIVITYUNIT="MOISTUREDIFFUSIVITYUNIT",mr.MOLECULARWEIGHTUNIT="MOLECULARWEIGHTUNIT",mr.SPECIFICHEATCAPACITYUNIT="SPECIFICHEATCAPACITYUNIT",mr.THERMALADMITTANCEUNIT="THERMALADMITTANCEUNIT",mr.THERMALCONDUCTANCEUNIT="THERMALCONDUCTANCEUNIT",mr.THERMALRESISTANCEUNIT="THERMALRESISTANCEUNIT",mr.THERMALTRANSMITTANCEUNIT="THERMALTRANSMITTANCEUNIT",mr.VAPORPERMEABILITYUNIT="VAPORPERMEABILITYUNIT",mr.VOLUMETRICFLOWRATEUNIT="VOLUMETRICFLOWRATEUNIT",mr.ROTATIONALFREQUENCYUNIT="ROTATIONALFREQUENCYUNIT",mr.TORQUEUNIT="TORQUEUNIT",mr.MOMENTOFINERTIAUNIT="MOMENTOFINERTIAUNIT",mr.LINEARMOMENTUNIT="LINEARMOMENTUNIT",mr.LINEARFORCEUNIT="LINEARFORCEUNIT",mr.PLANARFORCEUNIT="PLANARFORCEUNIT",mr.MODULUSOFELASTICITYUNIT="MODULUSOFELASTICITYUNIT",mr.SHEARMODULUSUNIT="SHEARMODULUSUNIT",mr.LINEARSTIFFNESSUNIT="LINEARSTIFFNESSUNIT",mr.ROTATIONALSTIFFNESSUNIT="ROTATIONALSTIFFNESSUNIT",mr.MODULUSOFSUBGRADEREACTIONUNIT="MODULUSOFSUBGRADEREACTIONUNIT",mr.ACCELERATIONUNIT="ACCELERATIONUNIT",mr.CURVATUREUNIT="CURVATUREUNIT",mr.HEATINGVALUEUNIT="HEATINGVALUEUNIT",mr.IONCONCENTRATIONUNIT="IONCONCENTRATIONUNIT",mr.LUMINOUSINTENSITYDISTRIBUTIONUNIT="LUMINOUSINTENSITYDISTRIBUTIONUNIT",mr.MASSPERLENGTHUNIT="MASSPERLENGTHUNIT",mr.MODULUSOFLINEARSUBGRADEREACTIONUNIT="MODULUSOFLINEARSUBGRADEREACTIONUNIT",mr.MODULUSOFROTATIONALSUBGRADEREACTIONUNIT="MODULUSOFROTATIONALSUBGRADEREACTIONUNIT",mr.PHUNIT="PHUNIT",mr.ROTATIONALMASSUNIT="ROTATIONALMASSUNIT",mr.SECTIONAREAINTEGRALUNIT="SECTIONAREAINTEGRALUNIT",mr.SECTIONMODULUSUNIT="SECTIONMODULUSUNIT",mr.SOUNDPOWERLEVELUNIT="SOUNDPOWERLEVELUNIT",mr.SOUNDPOWERUNIT="SOUNDPOWERUNIT",mr.SOUNDPRESSURELEVELUNIT="SOUNDPRESSURELEVELUNIT",mr.SOUNDPRESSUREUNIT="SOUNDPRESSUREUNIT",mr.TEMPERATUREGRADIENTUNIT="TEMPERATUREGRADIENTUNIT",mr.TEMPERATURERATEOFCHANGEUNIT="TEMPERATURERATEOFCHANGEUNIT",mr.THERMALEXPANSIONCOEFFICIENTUNIT="THERMALEXPANSIONCOEFFICIENTUNIT",mr.WARPINGCONSTANTUNIT="WARPINGCONSTANTUNIT",mr.WARPINGMOMENTUNIT="WARPINGMOMENTUNIT",mr.USERDEFINED="USERDEFINED";var Kge=class{constructor(e){this.value=e}};Kge.POSITIVE="POSITIVE",Kge.NEGATIVE="NEGATIVE";var KE=class{constructor(e){this.value=e}};KE.ANCHORPLATE="ANCHORPLATE",KE.BRACKET="BRACKET",KE.SHOE="SHOE",KE.EXPANSION_JOINT_DEVICE="EXPANSION_JOINT_DEVICE",KE.USERDEFINED="USERDEFINED",KE.NOTDEFINED="NOTDEFINED";var xh=class{constructor(e){this.value=e}};xh.FORMEDDUCT="FORMEDDUCT",xh.INSPECTIONCHAMBER="INSPECTIONCHAMBER",xh.INSPECTIONPIT="INSPECTIONPIT",xh.MANHOLE="MANHOLE",xh.METERCHAMBER="METERCHAMBER",xh.SUMP="SUMP",xh.TRENCH="TRENCH",xh.VALVECHAMBER="VALVECHAMBER",xh.USERDEFINED="USERDEFINED",xh.NOTDEFINED="NOTDEFINED";var JE=class{constructor(e){this.value=e}};JE.CABLE="CABLE",JE.CABLECARRIER="CABLECARRIER",JE.DUCT="DUCT",JE.PIPE="PIPE",JE.USERDEFINED="USERDEFINED",JE.NOTDEFINED="NOTDEFINED";var Fr=class{constructor(e){this.value=e}};Fr.AIRCONDITIONING="AIRCONDITIONING",Fr.AUDIOVISUAL="AUDIOVISUAL",Fr.CHEMICAL="CHEMICAL",Fr.CHILLEDWATER="CHILLEDWATER",Fr.COMMUNICATION="COMMUNICATION",Fr.COMPRESSEDAIR="COMPRESSEDAIR",Fr.CONDENSERWATER="CONDENSERWATER",Fr.CONTROL="CONTROL",Fr.CONVEYING="CONVEYING",Fr.DATA="DATA",Fr.DISPOSAL="DISPOSAL",Fr.DOMESTICCOLDWATER="DOMESTICCOLDWATER",Fr.DOMESTICHOTWATER="DOMESTICHOTWATER",Fr.DRAINAGE="DRAINAGE",Fr.EARTHING="EARTHING",Fr.ELECTRICAL="ELECTRICAL",Fr.ELECTROACOUSTIC="ELECTROACOUSTIC",Fr.EXHAUST="EXHAUST",Fr.FIREPROTECTION="FIREPROTECTION",Fr.FUEL="FUEL",Fr.GAS="GAS",Fr.HAZARDOUS="HAZARDOUS",Fr.HEATING="HEATING",Fr.LIGHTING="LIGHTING",Fr.LIGHTNINGPROTECTION="LIGHTNINGPROTECTION",Fr.MUNICIPALSOLIDWASTE="MUNICIPALSOLIDWASTE",Fr.OIL="OIL",Fr.OPERATIONAL="OPERATIONAL",Fr.POWERGENERATION="POWERGENERATION",Fr.RAINWATER="RAINWATER",Fr.REFRIGERATION="REFRIGERATION",Fr.SECURITY="SECURITY",Fr.SEWAGE="SEWAGE",Fr.SIGNAL="SIGNAL",Fr.STORMWATER="STORMWATER",Fr.TELEPHONE="TELEPHONE",Fr.TV="TV",Fr.VACUUM="VACUUM",Fr.VENT="VENT",Fr.VENTILATION="VENTILATION",Fr.WASTEWATER="WASTEWATER",Fr.WATERSUPPLY="WATERSUPPLY",Fr.USERDEFINED="USERDEFINED",Fr.NOTDEFINED="NOTDEFINED";var QE=class{constructor(e){this.value=e}};QE.PUBLIC="PUBLIC",QE.RESTRICTED="RESTRICTED",QE.CONFIDENTIAL="CONFIDENTIAL",QE.PERSONAL="PERSONAL",QE.USERDEFINED="USERDEFINED",QE.NOTDEFINED="NOTDEFINED";var x_=class{constructor(e){this.value=e}};x_.DRAFT="DRAFT",x_.FINALDRAFT="FINALDRAFT",x_.FINAL="FINAL",x_.REVISION="REVISION",x_.NOTDEFINED="NOTDEFINED";var nd=class{constructor(e){this.value=e}};nd.SWINGING="SWINGING",nd.DOUBLE_ACTING="DOUBLE_ACTING",nd.SLIDING="SLIDING",nd.FOLDING="FOLDING",nd.REVOLVING="REVOLVING",nd.ROLLINGUP="ROLLINGUP",nd.FIXEDPANEL="FIXEDPANEL",nd.USERDEFINED="USERDEFINED",nd.NOTDEFINED="NOTDEFINED";var bO=class{constructor(e){this.value=e}};bO.LEFT="LEFT",bO.MIDDLE="MIDDLE",bO.RIGHT="RIGHT",bO.NOTDEFINED="NOTDEFINED";var sd=class{constructor(e){this.value=e}};sd.ALUMINIUM="ALUMINIUM",sd.HIGH_GRADE_STEEL="HIGH_GRADE_STEEL",sd.STEEL="STEEL",sd.WOOD="WOOD",sd.ALUMINIUM_WOOD="ALUMINIUM_WOOD",sd.ALUMINIUM_PLASTIC="ALUMINIUM_PLASTIC",sd.PLASTIC="PLASTIC",sd.USERDEFINED="USERDEFINED",sd.NOTDEFINED="NOTDEFINED";var Fs=class{constructor(e){this.value=e}};Fs.SINGLE_SWING_LEFT="SINGLE_SWING_LEFT",Fs.SINGLE_SWING_RIGHT="SINGLE_SWING_RIGHT",Fs.DOUBLE_DOOR_SINGLE_SWING="DOUBLE_DOOR_SINGLE_SWING",Fs.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT",Fs.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT",Fs.DOUBLE_SWING_LEFT="DOUBLE_SWING_LEFT",Fs.DOUBLE_SWING_RIGHT="DOUBLE_SWING_RIGHT",Fs.DOUBLE_DOOR_DOUBLE_SWING="DOUBLE_DOOR_DOUBLE_SWING",Fs.SLIDING_TO_LEFT="SLIDING_TO_LEFT",Fs.SLIDING_TO_RIGHT="SLIDING_TO_RIGHT",Fs.DOUBLE_DOOR_SLIDING="DOUBLE_DOOR_SLIDING",Fs.FOLDING_TO_LEFT="FOLDING_TO_LEFT",Fs.FOLDING_TO_RIGHT="FOLDING_TO_RIGHT",Fs.DOUBLE_DOOR_FOLDING="DOUBLE_DOOR_FOLDING",Fs.REVOLVING="REVOLVING",Fs.ROLLINGUP="ROLLINGUP",Fs.USERDEFINED="USERDEFINED",Fs.NOTDEFINED="NOTDEFINED";var I_=class{constructor(e){this.value=e}};I_.DOOR="DOOR",I_.GATE="GATE",I_.TRAPDOOR="TRAPDOOR",I_.USERDEFINED="USERDEFINED",I_.NOTDEFINED="NOTDEFINED";var ys=class{constructor(e){this.value=e}};ys.SINGLE_SWING_LEFT="SINGLE_SWING_LEFT",ys.SINGLE_SWING_RIGHT="SINGLE_SWING_RIGHT",ys.DOUBLE_DOOR_SINGLE_SWING="DOUBLE_DOOR_SINGLE_SWING",ys.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT",ys.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT",ys.DOUBLE_SWING_LEFT="DOUBLE_SWING_LEFT",ys.DOUBLE_SWING_RIGHT="DOUBLE_SWING_RIGHT",ys.DOUBLE_DOOR_DOUBLE_SWING="DOUBLE_DOOR_DOUBLE_SWING",ys.SLIDING_TO_LEFT="SLIDING_TO_LEFT",ys.SLIDING_TO_RIGHT="SLIDING_TO_RIGHT",ys.DOUBLE_DOOR_SLIDING="DOUBLE_DOOR_SLIDING",ys.FOLDING_TO_LEFT="FOLDING_TO_LEFT",ys.FOLDING_TO_RIGHT="FOLDING_TO_RIGHT",ys.DOUBLE_DOOR_FOLDING="DOUBLE_DOOR_FOLDING",ys.REVOLVING="REVOLVING",ys.ROLLINGUP="ROLLINGUP",ys.SWING_FIXED_LEFT="SWING_FIXED_LEFT",ys.SWING_FIXED_RIGHT="SWING_FIXED_RIGHT",ys.USERDEFINED="USERDEFINED",ys.NOTDEFINED="NOTDEFINED";var ad=class{constructor(e){this.value=e}};ad.BEND="BEND",ad.CONNECTOR="CONNECTOR",ad.ENTRY="ENTRY",ad.EXIT="EXIT",ad.JUNCTION="JUNCTION",ad.OBSTRUCTION="OBSTRUCTION",ad.TRANSITION="TRANSITION",ad.USERDEFINED="USERDEFINED",ad.NOTDEFINED="NOTDEFINED";var xO=class{constructor(e){this.value=e}};xO.RIGIDSEGMENT="RIGIDSEGMENT",xO.FLEXIBLESEGMENT="FLEXIBLESEGMENT",xO.USERDEFINED="USERDEFINED",xO.NOTDEFINED="NOTDEFINED";var __=class{constructor(e){this.value=e}};__.FLATOVAL="FLATOVAL",__.RECTANGULAR="RECTANGULAR",__.ROUND="ROUND",__.USERDEFINED="USERDEFINED",__.NOTDEFINED="NOTDEFINED";var Hs=class{constructor(e){this.value=e}};Hs.DISHWASHER="DISHWASHER",Hs.ELECTRICCOOKER="ELECTRICCOOKER",Hs.FREESTANDINGELECTRICHEATER="FREESTANDINGELECTRICHEATER",Hs.FREESTANDINGFAN="FREESTANDINGFAN",Hs.FREESTANDINGWATERHEATER="FREESTANDINGWATERHEATER",Hs.FREESTANDINGWATERCOOLER="FREESTANDINGWATERCOOLER",Hs.FREEZER="FREEZER",Hs.FRIDGE_FREEZER="FRIDGE_FREEZER",Hs.HANDDRYER="HANDDRYER",Hs.KITCHENMACHINE="KITCHENMACHINE",Hs.MICROWAVE="MICROWAVE",Hs.PHOTOCOPIER="PHOTOCOPIER",Hs.REFRIGERATOR="REFRIGERATOR",Hs.TUMBLEDRYER="TUMBLEDRYER",Hs.VENDINGMACHINE="VENDINGMACHINE",Hs.WASHINGMACHINE="WASHINGMACHINE",Hs.USERDEFINED="USERDEFINED",Hs.NOTDEFINED="NOTDEFINED";var eT=class{constructor(e){this.value=e}};eT.CONSUMERUNIT="CONSUMERUNIT",eT.DISTRIBUTIONBOARD="DISTRIBUTIONBOARD",eT.MOTORCONTROLCENTRE="MOTORCONTROLCENTRE",eT.SWITCHBOARD="SWITCHBOARD",eT.USERDEFINED="USERDEFINED",eT.NOTDEFINED="NOTDEFINED";var T0=class{constructor(e){this.value=e}};T0.BATTERY="BATTERY",T0.CAPACITORBANK="CAPACITORBANK",T0.HARMONICFILTER="HARMONICFILTER",T0.INDUCTORBANK="INDUCTORBANK",T0.UPS="UPS",T0.USERDEFINED="USERDEFINED",T0.NOTDEFINED="NOTDEFINED";var S_=class{constructor(e){this.value=e}};S_.CHP="CHP",S_.ENGINEGENERATOR="ENGINEGENERATOR",S_.STANDALONE="STANDALONE",S_.USERDEFINED="USERDEFINED",S_.NOTDEFINED="NOTDEFINED";var b0=class{constructor(e){this.value=e}};b0.DC="DC",b0.INDUCTION="INDUCTION",b0.POLYPHASE="POLYPHASE",b0.RELUCTANCESYNCHRONOUS="RELUCTANCESYNCHRONOUS",b0.SYNCHRONOUS="SYNCHRONOUS",b0.USERDEFINED="USERDEFINED",b0.NOTDEFINED="NOTDEFINED";var w_=class{constructor(e){this.value=e}};w_.TIMECLOCK="TIMECLOCK",w_.TIMEDELAY="TIMEDELAY",w_.RELAY="RELAY",w_.USERDEFINED="USERDEFINED",w_.NOTDEFINED="NOTDEFINED";var oa=class{constructor(e){this.value=e}};oa.ACCESSORY_ASSEMBLY="ACCESSORY_ASSEMBLY",oa.ARCH="ARCH",oa.BEAM_GRID="BEAM_GRID",oa.BRACED_FRAME="BRACED_FRAME",oa.GIRDER="GIRDER",oa.REINFORCEMENT_UNIT="REINFORCEMENT_UNIT",oa.RIGID_FRAME="RIGID_FRAME",oa.SLAB_FIELD="SLAB_FIELD",oa.TRUSS="TRUSS",oa.ABUTMENT="ABUTMENT",oa.PIER="PIER",oa.PYLON="PYLON",oa.CROSS_BRACING="CROSS_BRACING",oa.DECK="DECK",oa.USERDEFINED="USERDEFINED",oa.NOTDEFINED="NOTDEFINED";var x8=class{constructor(e){this.value=e}};x8.COMPLEX="COMPLEX",x8.ELEMENT="ELEMENT",x8.PARTIAL="PARTIAL";var IO=class{constructor(e){this.value=e}};IO.EXTERNALCOMBUSTION="EXTERNALCOMBUSTION",IO.INTERNALCOMBUSTION="INTERNALCOMBUSTION",IO.USERDEFINED="USERDEFINED",IO.NOTDEFINED="NOTDEFINED";var iu=class{constructor(e){this.value=e}};iu.DIRECTEVAPORATIVERANDOMMEDIAAIRCOOLER="DIRECTEVAPORATIVERANDOMMEDIAAIRCOOLER",iu.DIRECTEVAPORATIVERIGIDMEDIAAIRCOOLER="DIRECTEVAPORATIVERIGIDMEDIAAIRCOOLER",iu.DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER="DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER",iu.DIRECTEVAPORATIVEPACKAGEDROTARYAIRCOOLER="DIRECTEVAPORATIVEPACKAGEDROTARYAIRCOOLER",iu.DIRECTEVAPORATIVEAIRWASHER="DIRECTEVAPORATIVEAIRWASHER",iu.INDIRECTEVAPORATIVEPACKAGEAIRCOOLER="INDIRECTEVAPORATIVEPACKAGEAIRCOOLER",iu.INDIRECTEVAPORATIVEWETCOIL="INDIRECTEVAPORATIVEWETCOIL",iu.INDIRECTEVAPORATIVECOOLINGTOWERORCOILCOOLER="INDIRECTEVAPORATIVECOOLINGTOWERORCOILCOOLER",iu.INDIRECTDIRECTCOMBINATION="INDIRECTDIRECTCOMBINATION",iu.USERDEFINED="USERDEFINED",iu.NOTDEFINED="NOTDEFINED";var $f=class{constructor(e){this.value=e}};$f.DIRECTEXPANSION="DIRECTEXPANSION",$f.DIRECTEXPANSIONSHELLANDTUBE="DIRECTEXPANSIONSHELLANDTUBE",$f.DIRECTEXPANSIONTUBEINTUBE="DIRECTEXPANSIONTUBEINTUBE",$f.DIRECTEXPANSIONBRAZEDPLATE="DIRECTEXPANSIONBRAZEDPLATE",$f.FLOODEDSHELLANDTUBE="FLOODEDSHELLANDTUBE",$f.SHELLANDCOIL="SHELLANDCOIL",$f.USERDEFINED="USERDEFINED",$f.NOTDEFINED="NOTDEFINED";var tT=class{constructor(e){this.value=e}};tT.EVENTRULE="EVENTRULE",tT.EVENTMESSAGE="EVENTMESSAGE",tT.EVENTTIME="EVENTTIME",tT.EVENTCOMPLEX="EVENTCOMPLEX",tT.USERDEFINED="USERDEFINED",tT.NOTDEFINED="NOTDEFINED";var R_=class{constructor(e){this.value=e}};R_.STARTEVENT="STARTEVENT",R_.ENDEVENT="ENDEVENT",R_.INTERMEDIATEEVENT="INTERMEDIATEEVENT",R_.USERDEFINED="USERDEFINED",R_.NOTDEFINED="NOTDEFINED";var rT=class{constructor(e){this.value=e}};rT.EXTERNAL="EXTERNAL",rT.EXTERNAL_EARTH="EXTERNAL_EARTH",rT.EXTERNAL_WATER="EXTERNAL_WATER",rT.EXTERNAL_FIRE="EXTERNAL_FIRE",rT.USERDEFINED="USERDEFINED",rT.NOTDEFINED="NOTDEFINED";var od=class{constructor(e){this.value=e}};od.CENTRIFUGALFORWARDCURVED="CENTRIFUGALFORWARDCURVED",od.CENTRIFUGALRADIAL="CENTRIFUGALRADIAL",od.CENTRIFUGALBACKWARDINCLINEDCURVED="CENTRIFUGALBACKWARDINCLINEDCURVED",od.CENTRIFUGALAIRFOIL="CENTRIFUGALAIRFOIL",od.TUBEAXIAL="TUBEAXIAL",od.VANEAXIAL="VANEAXIAL",od.PROPELLORAXIAL="PROPELLORAXIAL",od.USERDEFINED="USERDEFINED",od.NOTDEFINED="NOTDEFINED";var M_=class{constructor(e){this.value=e}};M_.GLUE="GLUE",M_.MORTAR="MORTAR",M_.WELD="WELD",M_.USERDEFINED="USERDEFINED",M_.NOTDEFINED="NOTDEFINED";var Zf=class{constructor(e){this.value=e}};Zf.AIRPARTICLEFILTER="AIRPARTICLEFILTER",Zf.COMPRESSEDAIRFILTER="COMPRESSEDAIRFILTER",Zf.ODORFILTER="ODORFILTER",Zf.OILFILTER="OILFILTER",Zf.STRAINER="STRAINER",Zf.WATERFILTER="WATERFILTER",Zf.USERDEFINED="USERDEFINED",Zf.NOTDEFINED="NOTDEFINED";var x0=class{constructor(e){this.value=e}};x0.BREECHINGINLET="BREECHINGINLET",x0.FIREHYDRANT="FIREHYDRANT",x0.HOSEREEL="HOSEREEL",x0.SPRINKLER="SPRINKLER",x0.SPRINKLERDEFLECTOR="SPRINKLERDEFLECTOR",x0.USERDEFINED="USERDEFINED",x0.NOTDEFINED="NOTDEFINED";var _O=class{constructor(e){this.value=e}};_O.SOURCE="SOURCE",_O.SINK="SINK",_O.SOURCEANDSINK="SOURCEANDSINK",_O.NOTDEFINED="NOTDEFINED";var Ih=class{constructor(e){this.value=e}};Ih.PRESSUREGAUGE="PRESSUREGAUGE",Ih.THERMOMETER="THERMOMETER",Ih.AMMETER="AMMETER",Ih.FREQUENCYMETER="FREQUENCYMETER",Ih.POWERFACTORMETER="POWERFACTORMETER",Ih.PHASEANGLEMETER="PHASEANGLEMETER",Ih.VOLTMETER_PEAK="VOLTMETER_PEAK",Ih.VOLTMETER_RMS="VOLTMETER_RMS",Ih.USERDEFINED="USERDEFINED",Ih.NOTDEFINED="NOTDEFINED";var iT=class{constructor(e){this.value=e}};iT.ENERGYMETER="ENERGYMETER",iT.GASMETER="GASMETER",iT.OILMETER="OILMETER",iT.WATERMETER="WATERMETER",iT.USERDEFINED="USERDEFINED",iT.NOTDEFINED="NOTDEFINED";var I0=class{constructor(e){this.value=e}};I0.CAISSON_FOUNDATION="CAISSON_FOUNDATION",I0.FOOTING_BEAM="FOOTING_BEAM",I0.PAD_FOOTING="PAD_FOOTING",I0.PILE_CAP="PILE_CAP",I0.STRIP_FOOTING="STRIP_FOOTING",I0.USERDEFINED="USERDEFINED",I0.NOTDEFINED="NOTDEFINED";var ld=class{constructor(e){this.value=e}};ld.CHAIR="CHAIR",ld.TABLE="TABLE",ld.DESK="DESK",ld.BED="BED",ld.FILECABINET="FILECABINET",ld.SHELF="SHELF",ld.SOFA="SOFA",ld.USERDEFINED="USERDEFINED",ld.NOTDEFINED="NOTDEFINED";var SO=class{constructor(e){this.value=e}};SO.TERRAIN="TERRAIN",SO.SOIL_BORING_POINT="SOIL_BORING_POINT",SO.USERDEFINED="USERDEFINED",SO.NOTDEFINED="NOTDEFINED";var cd=class{constructor(e){this.value=e}};cd.GRAPH_VIEW="GRAPH_VIEW",cd.SKETCH_VIEW="SKETCH_VIEW",cd.MODEL_VIEW="MODEL_VIEW",cd.PLAN_VIEW="PLAN_VIEW",cd.REFLECTED_PLAN_VIEW="REFLECTED_PLAN_VIEW",cd.SECTION_VIEW="SECTION_VIEW",cd.ELEVATION_VIEW="ELEVATION_VIEW",cd.USERDEFINED="USERDEFINED",cd.NOTDEFINED="NOTDEFINED";var Jge=class{constructor(e){this.value=e}};Jge.GLOBAL_COORDS="GLOBAL_COORDS",Jge.LOCAL_COORDS="LOCAL_COORDS";var nT=class{constructor(e){this.value=e}};nT.RECTANGULAR="RECTANGULAR",nT.RADIAL="RADIAL",nT.TRIANGULAR="TRIANGULAR",nT.IRREGULAR="IRREGULAR",nT.USERDEFINED="USERDEFINED",nT.NOTDEFINED="NOTDEFINED";var wO=class{constructor(e){this.value=e}};wO.PLATE="PLATE",wO.SHELLANDTUBE="SHELLANDTUBE",wO.USERDEFINED="USERDEFINED",wO.NOTDEFINED="NOTDEFINED";var ja=class{constructor(e){this.value=e}};ja.STEAMINJECTION="STEAMINJECTION",ja.ADIABATICAIRWASHER="ADIABATICAIRWASHER",ja.ADIABATICPAN="ADIABATICPAN",ja.ADIABATICWETTEDELEMENT="ADIABATICWETTEDELEMENT",ja.ADIABATICATOMIZING="ADIABATICATOMIZING",ja.ADIABATICULTRASONIC="ADIABATICULTRASONIC",ja.ADIABATICRIGIDMEDIA="ADIABATICRIGIDMEDIA",ja.ADIABATICCOMPRESSEDAIRNOZZLE="ADIABATICCOMPRESSEDAIRNOZZLE",ja.ASSISTEDELECTRIC="ASSISTEDELECTRIC",ja.ASSISTEDNATURALGAS="ASSISTEDNATURALGAS",ja.ASSISTEDPROPANE="ASSISTEDPROPANE",ja.ASSISTEDBUTANE="ASSISTEDBUTANE",ja.ASSISTEDSTEAM="ASSISTEDSTEAM",ja.USERDEFINED="USERDEFINED",ja.NOTDEFINED="NOTDEFINED";var sT=class{constructor(e){this.value=e}};sT.CYCLONIC="CYCLONIC",sT.GREASE="GREASE",sT.OIL="OIL",sT.PETROL="PETROL",sT.USERDEFINED="USERDEFINED",sT.NOTDEFINED="NOTDEFINED";var aT=class{constructor(e){this.value=e}};aT.INTERNAL="INTERNAL",aT.EXTERNAL="EXTERNAL",aT.EXTERNAL_EARTH="EXTERNAL_EARTH",aT.EXTERNAL_WATER="EXTERNAL_WATER",aT.EXTERNAL_FIRE="EXTERNAL_FIRE",aT.NOTDEFINED="NOTDEFINED";var D_=class{constructor(e){this.value=e}};D_.ASSETINVENTORY="ASSETINVENTORY",D_.SPACEINVENTORY="SPACEINVENTORY",D_.FURNITUREINVENTORY="FURNITUREINVENTORY",D_.USERDEFINED="USERDEFINED",D_.NOTDEFINED="NOTDEFINED";var RO=class{constructor(e){this.value=e}};RO.DATA="DATA",RO.POWER="POWER",RO.USERDEFINED="USERDEFINED",RO.NOTDEFINED="NOTDEFINED";var MO=class{constructor(e){this.value=e}};MO.UNIFORM_KNOTS="UNIFORM_KNOTS",MO.QUASI_UNIFORM_KNOTS="QUASI_UNIFORM_KNOTS",MO.PIECEWISE_BEZIER_KNOTS="PIECEWISE_BEZIER_KNOTS",MO.UNSPECIFIED="UNSPECIFIED";var ls=class{constructor(e){this.value=e}};ls.ADMINISTRATION="ADMINISTRATION",ls.CARPENTRY="CARPENTRY",ls.CLEANING="CLEANING",ls.CONCRETE="CONCRETE",ls.DRYWALL="DRYWALL",ls.ELECTRIC="ELECTRIC",ls.FINISHING="FINISHING",ls.FLOORING="FLOORING",ls.GENERAL="GENERAL",ls.HVAC="HVAC",ls.LANDSCAPING="LANDSCAPING",ls.MASONRY="MASONRY",ls.PAINTING="PAINTING",ls.PAVING="PAVING",ls.PLUMBING="PLUMBING",ls.ROOFING="ROOFING",ls.SITEGRADING="SITEGRADING",ls.STEELWORK="STEELWORK",ls.SURVEYING="SURVEYING",ls.USERDEFINED="USERDEFINED",ls.NOTDEFINED="NOTDEFINED";var nu=class{constructor(e){this.value=e}};nu.COMPACTFLUORESCENT="COMPACTFLUORESCENT",nu.FLUORESCENT="FLUORESCENT",nu.HALOGEN="HALOGEN",nu.HIGHPRESSUREMERCURY="HIGHPRESSUREMERCURY",nu.HIGHPRESSURESODIUM="HIGHPRESSURESODIUM",nu.LED="LED",nu.METALHALIDE="METALHALIDE",nu.OLED="OLED",nu.TUNGSTENFILAMENT="TUNGSTENFILAMENT",nu.USERDEFINED="USERDEFINED",nu.NOTDEFINED="NOTDEFINED";var I8=class{constructor(e){this.value=e}};I8.AXIS1="AXIS1",I8.AXIS2="AXIS2",I8.AXIS3="AXIS3";var DO=class{constructor(e){this.value=e}};DO.TYPE_A="TYPE_A",DO.TYPE_B="TYPE_B",DO.TYPE_C="TYPE_C",DO.NOTDEFINED="NOTDEFINED";var su=class{constructor(e){this.value=e}};su.COMPACTFLUORESCENT="COMPACTFLUORESCENT",su.FLUORESCENT="FLUORESCENT",su.HIGHPRESSUREMERCURY="HIGHPRESSUREMERCURY",su.HIGHPRESSURESODIUM="HIGHPRESSURESODIUM",su.LIGHTEMITTINGDIODE="LIGHTEMITTINGDIODE",su.LOWPRESSURESODIUM="LOWPRESSURESODIUM",su.LOWVOLTAGEHALOGEN="LOWVOLTAGEHALOGEN",su.MAINVOLTAGEHALOGEN="MAINVOLTAGEHALOGEN",su.METALHALIDE="METALHALIDE",su.TUNGSTENFILAMENT="TUNGSTENFILAMENT",su.NOTDEFINED="NOTDEFINED";var C_=class{constructor(e){this.value=e}};C_.POINTSOURCE="POINTSOURCE",C_.DIRECTIONSOURCE="DIRECTIONSOURCE",C_.SECURITYLIGHTING="SECURITYLIGHTING",C_.USERDEFINED="USERDEFINED",C_.NOTDEFINED="NOTDEFINED";var A_=class{constructor(e){this.value=e}};A_.LOAD_GROUP="LOAD_GROUP",A_.LOAD_CASE="LOAD_CASE",A_.LOAD_COMBINATION="LOAD_COMBINATION",A_.USERDEFINED="USERDEFINED",A_.NOTDEFINED="NOTDEFINED";var O_=class{constructor(e){this.value=e}};O_.LOGICALAND="LOGICALAND",O_.LOGICALOR="LOGICALOR",O_.LOGICALXOR="LOGICALXOR",O_.LOGICALNOTAND="LOGICALNOTAND",O_.LOGICALNOTOR="LOGICALNOTOR";var ul=class{constructor(e){this.value=e}};ul.ANCHORBOLT="ANCHORBOLT",ul.BOLT="BOLT",ul.DOWEL="DOWEL",ul.NAIL="NAIL",ul.NAILPLATE="NAILPLATE",ul.RIVET="RIVET",ul.SCREW="SCREW",ul.SHEARCONNECTOR="SHEARCONNECTOR",ul.STAPLE="STAPLE",ul.STUDSHEARCONNECTOR="STUDSHEARCONNECTOR",ul.COUPLER="COUPLER",ul.USERDEFINED="USERDEFINED",ul.NOTDEFINED="NOTDEFINED";var _0=class{constructor(e){this.value=e}};_0.AIRSTATION="AIRSTATION",_0.FEEDAIRUNIT="FEEDAIRUNIT",_0.OXYGENGENERATOR="OXYGENGENERATOR",_0.OXYGENPLANT="OXYGENPLANT",_0.VACUUMSTATION="VACUUMSTATION",_0.USERDEFINED="USERDEFINED",_0.NOTDEFINED="NOTDEFINED";var Ss=class{constructor(e){this.value=e}};Ss.BRACE="BRACE",Ss.CHORD="CHORD",Ss.COLLAR="COLLAR",Ss.MEMBER="MEMBER",Ss.MULLION="MULLION",Ss.PLATE="PLATE",Ss.POST="POST",Ss.PURLIN="PURLIN",Ss.RAFTER="RAFTER",Ss.STRINGER="STRINGER",Ss.STRUT="STRUT",Ss.STUD="STUD",Ss.STIFFENING_RIB="STIFFENING_RIB",Ss.ARCH_SEGMENT="ARCH_SEGMENT",Ss.SUSPENSION_CABLE="SUSPENSION_CABLE",Ss.SUSPENDER="SUSPENDER",Ss.STAY_CABLE="STAY_CABLE",Ss.USERDEFINED="USERDEFINED",Ss.NOTDEFINED="NOTDEFINED";var P_=class{constructor(e){this.value=e}};P_.BELTDRIVE="BELTDRIVE",P_.COUPLING="COUPLING",P_.DIRECTDRIVE="DIRECTDRIVE",P_.USERDEFINED="USERDEFINED",P_.NOTDEFINED="NOTDEFINED";var zFt=class{constructor(e){this.value=e}};zFt.NULL="NULL";var Kf=class{constructor(e){this.value=e}};Kf.PRODUCT="PRODUCT",Kf.PROCESS="PROCESS",Kf.CONTROL="CONTROL",Kf.RESOURCE="RESOURCE",Kf.ACTOR="ACTOR",Kf.GROUP="GROUP",Kf.PROJECT="PROJECT",Kf.NOTDEFINED="NOTDEFINED";var hl=class{constructor(e){this.value=e}};hl.CODECOMPLIANCE="CODECOMPLIANCE",hl.CODEWAIVER="CODEWAIVER",hl.DESIGNINTENT="DESIGNINTENT",hl.EXTERNAL="EXTERNAL",hl.HEALTHANDSAFETY="HEALTHANDSAFETY",hl.MERGECONFLICT="MERGECONFLICT",hl.MODELVIEW="MODELVIEW",hl.PARAMETER="PARAMETER",hl.REQUIREMENT="REQUIREMENT",hl.SPECIFICATION="SPECIFICATION",hl.TRIGGERCONDITION="TRIGGERCONDITION",hl.USERDEFINED="USERDEFINED",hl.NOTDEFINED="NOTDEFINED";var ud=class{constructor(e){this.value=e}};ud.ASSIGNEE="ASSIGNEE",ud.ASSIGNOR="ASSIGNOR",ud.LESSEE="LESSEE",ud.LESSOR="LESSOR",ud.LETTINGAGENT="LETTINGAGENT",ud.OWNER="OWNER",ud.TENANT="TENANT",ud.USERDEFINED="USERDEFINED",ud.NOTDEFINED="NOTDEFINED";var CO=class{constructor(e){this.value=e}};CO.OPENING="OPENING",CO.RECESS="RECESS",CO.USERDEFINED="USERDEFINED",CO.NOTDEFINED="NOTDEFINED";var S0=class{constructor(e){this.value=e}};S0.AUDIOVISUALOUTLET="AUDIOVISUALOUTLET",S0.COMMUNICATIONSOUTLET="COMMUNICATIONSOUTLET",S0.POWEROUTLET="POWEROUTLET",S0.DATAOUTLET="DATAOUTLET",S0.TELEPHONEOUTLET="TELEPHONEOUTLET",S0.USERDEFINED="USERDEFINED",S0.NOTDEFINED="NOTDEFINED";var Qge=class{constructor(e){this.value=e}};Qge.USERDEFINED="USERDEFINED",Qge.NOTDEFINED="NOTDEFINED";var N_=class{constructor(e){this.value=e}};N_.GRILL="GRILL",N_.LOUVER="LOUVER",N_.SCREEN="SCREEN",N_.USERDEFINED="USERDEFINED",N_.NOTDEFINED="NOTDEFINED";var L_=class{constructor(e){this.value=e}};L_.ACCESS="ACCESS",L_.BUILDING="BUILDING",L_.WORK="WORK",L_.USERDEFINED="USERDEFINED",L_.NOTDEFINED="NOTDEFINED";var _8=class{constructor(e){this.value=e}};_8.PHYSICAL="PHYSICAL",_8.VIRTUAL="VIRTUAL",_8.NOTDEFINED="NOTDEFINED";var oT=class{constructor(e){this.value=e}};oT.CAST_IN_PLACE="CAST_IN_PLACE",oT.COMPOSITE="COMPOSITE",oT.PRECAST_CONCRETE="PRECAST_CONCRETE",oT.PREFAB_STEEL="PREFAB_STEEL",oT.USERDEFINED="USERDEFINED",oT.NOTDEFINED="NOTDEFINED";var Jf=class{constructor(e){this.value=e}};Jf.BORED="BORED",Jf.DRIVEN="DRIVEN",Jf.JETGROUTING="JETGROUTING",Jf.COHESION="COHESION",Jf.FRICTION="FRICTION",Jf.SUPPORT="SUPPORT",Jf.USERDEFINED="USERDEFINED",Jf.NOTDEFINED="NOTDEFINED";var hd=class{constructor(e){this.value=e}};hd.BEND="BEND",hd.CONNECTOR="CONNECTOR",hd.ENTRY="ENTRY",hd.EXIT="EXIT",hd.JUNCTION="JUNCTION",hd.OBSTRUCTION="OBSTRUCTION",hd.TRANSITION="TRANSITION",hd.USERDEFINED="USERDEFINED",hd.NOTDEFINED="NOTDEFINED";var w0=class{constructor(e){this.value=e}};w0.CULVERT="CULVERT",w0.FLEXIBLESEGMENT="FLEXIBLESEGMENT",w0.RIGIDSEGMENT="RIGIDSEGMENT",w0.GUTTER="GUTTER",w0.SPOOL="SPOOL",w0.USERDEFINED="USERDEFINED",w0.NOTDEFINED="NOTDEFINED";var au=class{constructor(e){this.value=e}};au.CURTAIN_PANEL="CURTAIN_PANEL",au.SHEET="SHEET",au.FLANGE_PLATE="FLANGE_PLATE",au.WEB_PLATE="WEB_PLATE",au.STIFFENER_PLATE="STIFFENER_PLATE",au.GUSSET_PLATE="GUSSET_PLATE",au.COVER_PLATE="COVER_PLATE",au.SPLICE_PLATE="SPLICE_PLATE",au.BASE_PLATE="BASE_PLATE",au.USERDEFINED="USERDEFINED",au.NOTDEFINED="NOTDEFINED";var S8=class{constructor(e){this.value=e}};S8.CURVE3D="CURVE3D",S8.PCURVE_S1="PCURVE_S1",S8.PCURVE_S2="PCURVE_S2";var pd=class{constructor(e){this.value=e}};pd.ADVICE_CAUTION="ADVICE_CAUTION",pd.ADVICE_NOTE="ADVICE_NOTE",pd.ADVICE_WARNING="ADVICE_WARNING",pd.CALIBRATION="CALIBRATION",pd.DIAGNOSTIC="DIAGNOSTIC",pd.SHUTDOWN="SHUTDOWN",pd.STARTUP="STARTUP",pd.USERDEFINED="USERDEFINED",pd.NOTDEFINED="NOTDEFINED";var e0e=class{constructor(e){this.value=e}};e0e.CURVE="CURVE",e0e.AREA="AREA";var R0=class{constructor(e){this.value=e}};R0.CHANGEORDER="CHANGEORDER",R0.MAINTENANCEWORKORDER="MAINTENANCEWORKORDER",R0.MOVEORDER="MOVEORDER",R0.PURCHASEORDER="PURCHASEORDER",R0.WORKORDER="WORKORDER",R0.USERDEFINED="USERDEFINED",R0.NOTDEFINED="NOTDEFINED";var t0e=class{constructor(e){this.value=e}};t0e.PROJECTED_LENGTH="PROJECTED_LENGTH",t0e.TRUE_LENGTH="TRUE_LENGTH";var AO=class{constructor(e){this.value=e}};AO.BLISTER="BLISTER",AO.DEVIATOR="DEVIATOR",AO.USERDEFINED="USERDEFINED",AO.NOTDEFINED="NOTDEFINED";var Qf=class{constructor(e){this.value=e}};Qf.PSET_TYPEDRIVENONLY="PSET_TYPEDRIVENONLY",Qf.PSET_TYPEDRIVENOVERRIDE="PSET_TYPEDRIVENOVERRIDE",Qf.PSET_OCCURRENCEDRIVEN="PSET_OCCURRENCEDRIVEN",Qf.PSET_PERFORMANCEDRIVEN="PSET_PERFORMANCEDRIVEN",Qf.QTO_TYPEDRIVENONLY="QTO_TYPEDRIVENONLY",Qf.QTO_TYPEDRIVENOVERRIDE="QTO_TYPEDRIVENOVERRIDE",Qf.QTO_OCCURRENCEDRIVEN="QTO_OCCURRENCEDRIVEN",Qf.NOTDEFINED="NOTDEFINED";var lT=class{constructor(e){this.value=e}};lT.ELECTRONIC="ELECTRONIC",lT.ELECTROMAGNETIC="ELECTROMAGNETIC",lT.RESIDUALCURRENT="RESIDUALCURRENT",lT.THERMAL="THERMAL",lT.USERDEFINED="USERDEFINED",lT.NOTDEFINED="NOTDEFINED";var dd=class{constructor(e){this.value=e}};dd.CIRCUITBREAKER="CIRCUITBREAKER",dd.EARTHLEAKAGECIRCUITBREAKER="EARTHLEAKAGECIRCUITBREAKER",dd.EARTHINGSWITCH="EARTHINGSWITCH",dd.FUSEDISCONNECTOR="FUSEDISCONNECTOR",dd.RESIDUALCURRENTCIRCUITBREAKER="RESIDUALCURRENTCIRCUITBREAKER",dd.RESIDUALCURRENTSWITCH="RESIDUALCURRENTSWITCH",dd.VARISTOR="VARISTOR",dd.USERDEFINED="USERDEFINED",dd.NOTDEFINED="NOTDEFINED";var fd=class{constructor(e){this.value=e}};fd.CIRCULATOR="CIRCULATOR",fd.ENDSUCTION="ENDSUCTION",fd.SPLITCASE="SPLITCASE",fd.SUBMERSIBLEPUMP="SUBMERSIBLEPUMP",fd.SUMPPUMP="SUMPPUMP",fd.VERTICALINLINE="VERTICALINLINE",fd.VERTICALTURBINE="VERTICALTURBINE",fd.USERDEFINED="USERDEFINED",fd.NOTDEFINED="NOTDEFINED";var F_=class{constructor(e){this.value=e}};F_.HANDRAIL="HANDRAIL",F_.GUARDRAIL="GUARDRAIL",F_.BALUSTRADE="BALUSTRADE",F_.USERDEFINED="USERDEFINED",F_.NOTDEFINED="NOTDEFINED";var OO=class{constructor(e){this.value=e}};OO.STRAIGHT="STRAIGHT",OO.SPIRAL="SPIRAL",OO.USERDEFINED="USERDEFINED",OO.NOTDEFINED="NOTDEFINED";var em=class{constructor(e){this.value=e}};em.STRAIGHT_RUN_RAMP="STRAIGHT_RUN_RAMP",em.TWO_STRAIGHT_RUN_RAMP="TWO_STRAIGHT_RUN_RAMP",em.QUARTER_TURN_RAMP="QUARTER_TURN_RAMP",em.TWO_QUARTER_TURN_RAMP="TWO_QUARTER_TURN_RAMP",em.HALF_TURN_RAMP="HALF_TURN_RAMP",em.SPIRAL_RAMP="SPIRAL_RAMP",em.USERDEFINED="USERDEFINED",em.NOTDEFINED="NOTDEFINED";var tm=class{constructor(e){this.value=e}};tm.DAILY="DAILY",tm.WEEKLY="WEEKLY",tm.MONTHLY_BY_DAY_OF_MONTH="MONTHLY_BY_DAY_OF_MONTH",tm.MONTHLY_BY_POSITION="MONTHLY_BY_POSITION",tm.BY_DAY_COUNT="BY_DAY_COUNT",tm.BY_WEEKDAY_COUNT="BY_WEEKDAY_COUNT",tm.YEARLY_BY_DAY_OF_MONTH="YEARLY_BY_DAY_OF_MONTH",tm.YEARLY_BY_POSITION="YEARLY_BY_POSITION";var H_=class{constructor(e){this.value=e}};H_.KILOPOINT="KILOPOINT",H_.MILEPOINT="MILEPOINT",H_.STATION="STATION",H_.USERDEFINED="USERDEFINED",H_.NOTDEFINED="NOTDEFINED";var _h=class{constructor(e){this.value=e}};_h.BLINN="BLINN",_h.FLAT="FLAT",_h.GLASS="GLASS",_h.MATT="MATT",_h.METAL="METAL",_h.MIRROR="MIRROR",_h.PHONG="PHONG",_h.PLASTIC="PLASTIC",_h.STRAUSS="STRAUSS",_h.NOTDEFINED="NOTDEFINED";var Sh=class{constructor(e){this.value=e}};Sh.MAIN="MAIN",Sh.SHEAR="SHEAR",Sh.LIGATURE="LIGATURE",Sh.STUD="STUD",Sh.PUNCHING="PUNCHING",Sh.EDGE="EDGE",Sh.RING="RING",Sh.ANCHORING="ANCHORING",Sh.USERDEFINED="USERDEFINED",Sh.NOTDEFINED="NOTDEFINED";var r0e=class{constructor(e){this.value=e}};r0e.PLAIN="PLAIN",r0e.TEXTURED="TEXTURED";var ou=class{constructor(e){this.value=e}};ou.ANCHORING="ANCHORING",ou.EDGE="EDGE",ou.LIGATURE="LIGATURE",ou.MAIN="MAIN",ou.PUNCHING="PUNCHING",ou.RING="RING",ou.SHEAR="SHEAR",ou.STUD="STUD",ou.SPACEBAR="SPACEBAR",ou.USERDEFINED="USERDEFINED",ou.NOTDEFINED="NOTDEFINED";var i0e=class{constructor(e){this.value=e}};i0e.USERDEFINED="USERDEFINED",i0e.NOTDEFINED="NOTDEFINED";var Gn=class{constructor(e){this.value=e}};Gn.SUPPLIER="SUPPLIER",Gn.MANUFACTURER="MANUFACTURER",Gn.CONTRACTOR="CONTRACTOR",Gn.SUBCONTRACTOR="SUBCONTRACTOR",Gn.ARCHITECT="ARCHITECT",Gn.STRUCTURALENGINEER="STRUCTURALENGINEER",Gn.COSTENGINEER="COSTENGINEER",Gn.CLIENT="CLIENT",Gn.BUILDINGOWNER="BUILDINGOWNER",Gn.BUILDINGOPERATOR="BUILDINGOPERATOR",Gn.MECHANICALENGINEER="MECHANICALENGINEER",Gn.ELECTRICALENGINEER="ELECTRICALENGINEER",Gn.PROJECTMANAGER="PROJECTMANAGER",Gn.FACILITIESMANAGER="FACILITIESMANAGER",Gn.CIVILENGINEER="CIVILENGINEER",Gn.COMMISSIONINGENGINEER="COMMISSIONINGENGINEER",Gn.ENGINEER="ENGINEER",Gn.OWNER="OWNER",Gn.CONSULTANT="CONSULTANT",Gn.CONSTRUCTIONMANAGER="CONSTRUCTIONMANAGER",Gn.FIELDCONSTRUCTIONMANAGER="FIELDCONSTRUCTIONMANAGER",Gn.RESELLER="RESELLER",Gn.USERDEFINED="USERDEFINED";var Wa=class{constructor(e){this.value=e}};Wa.FLAT_ROOF="FLAT_ROOF",Wa.SHED_ROOF="SHED_ROOF",Wa.GABLE_ROOF="GABLE_ROOF",Wa.HIP_ROOF="HIP_ROOF",Wa.HIPPED_GABLE_ROOF="HIPPED_GABLE_ROOF",Wa.GAMBREL_ROOF="GAMBREL_ROOF",Wa.MANSARD_ROOF="MANSARD_ROOF",Wa.BARREL_ROOF="BARREL_ROOF",Wa.RAINBOW_ROOF="RAINBOW_ROOF",Wa.BUTTERFLY_ROOF="BUTTERFLY_ROOF",Wa.PAVILION_ROOF="PAVILION_ROOF",Wa.DOME_ROOF="DOME_ROOF",Wa.FREEFORM="FREEFORM",Wa.USERDEFINED="USERDEFINED",Wa.NOTDEFINED="NOTDEFINED";var la=class{constructor(e){this.value=e}};la.EXA="EXA",la.PETA="PETA",la.TERA="TERA",la.GIGA="GIGA",la.MEGA="MEGA",la.KILO="KILO",la.HECTO="HECTO",la.DECA="DECA",la.DECI="DECI",la.CENTI="CENTI",la.MILLI="MILLI",la.MICRO="MICRO",la.NANO="NANO",la.PICO="PICO",la.FEMTO="FEMTO",la.ATTO="ATTO";var Ki=class{constructor(e){this.value=e}};Ki.AMPERE="AMPERE",Ki.BECQUEREL="BECQUEREL",Ki.CANDELA="CANDELA",Ki.COULOMB="COULOMB",Ki.CUBIC_METRE="CUBIC_METRE",Ki.DEGREE_CELSIUS="DEGREE_CELSIUS",Ki.FARAD="FARAD",Ki.GRAM="GRAM",Ki.GRAY="GRAY",Ki.HENRY="HENRY",Ki.HERTZ="HERTZ",Ki.JOULE="JOULE",Ki.KELVIN="KELVIN",Ki.LUMEN="LUMEN",Ki.LUX="LUX",Ki.METRE="METRE",Ki.MOLE="MOLE",Ki.NEWTON="NEWTON",Ki.OHM="OHM",Ki.PASCAL="PASCAL",Ki.RADIAN="RADIAN",Ki.SECOND="SECOND",Ki.SIEMENS="SIEMENS",Ki.SIEVERT="SIEVERT",Ki.SQUARE_METRE="SQUARE_METRE",Ki.STERADIAN="STERADIAN",Ki.TESLA="TESLA",Ki.VOLT="VOLT",Ki.WATT="WATT",Ki.WEBER="WEBER";var ic=class{constructor(e){this.value=e}};ic.BATH="BATH",ic.BIDET="BIDET",ic.CISTERN="CISTERN",ic.SHOWER="SHOWER",ic.SINK="SINK",ic.SANITARYFOUNTAIN="SANITARYFOUNTAIN",ic.TOILETPAN="TOILETPAN",ic.URINAL="URINAL",ic.WASHHANDBASIN="WASHHANDBASIN",ic.WCSEAT="WCSEAT",ic.USERDEFINED="USERDEFINED",ic.NOTDEFINED="NOTDEFINED";var n0e=class{constructor(e){this.value=e}};n0e.UNIFORM="UNIFORM",n0e.TAPERED="TAPERED";var xn=class{constructor(e){this.value=e}};xn.COSENSOR="COSENSOR",xn.CO2SENSOR="CO2SENSOR",xn.CONDUCTANCESENSOR="CONDUCTANCESENSOR",xn.CONTACTSENSOR="CONTACTSENSOR",xn.FIRESENSOR="FIRESENSOR",xn.FLOWSENSOR="FLOWSENSOR",xn.FROSTSENSOR="FROSTSENSOR",xn.GASSENSOR="GASSENSOR",xn.HEATSENSOR="HEATSENSOR",xn.HUMIDITYSENSOR="HUMIDITYSENSOR",xn.IDENTIFIERSENSOR="IDENTIFIERSENSOR",xn.IONCONCENTRATIONSENSOR="IONCONCENTRATIONSENSOR",xn.LEVELSENSOR="LEVELSENSOR",xn.LIGHTSENSOR="LIGHTSENSOR",xn.MOISTURESENSOR="MOISTURESENSOR",xn.MOVEMENTSENSOR="MOVEMENTSENSOR",xn.PHSENSOR="PHSENSOR",xn.PRESSURESENSOR="PRESSURESENSOR",xn.RADIATIONSENSOR="RADIATIONSENSOR",xn.RADIOACTIVITYSENSOR="RADIOACTIVITYSENSOR",xn.SMOKESENSOR="SMOKESENSOR",xn.SOUNDSENSOR="SOUNDSENSOR",xn.TEMPERATURESENSOR="TEMPERATURESENSOR",xn.WINDSENSOR="WINDSENSOR",xn.USERDEFINED="USERDEFINED",xn.NOTDEFINED="NOTDEFINED";var cT=class{constructor(e){this.value=e}};cT.START_START="START_START",cT.START_FINISH="START_FINISH",cT.FINISH_START="FINISH_START",cT.FINISH_FINISH="FINISH_FINISH",cT.USERDEFINED="USERDEFINED",cT.NOTDEFINED="NOTDEFINED";var U_=class{constructor(e){this.value=e}};U_.JALOUSIE="JALOUSIE",U_.SHUTTER="SHUTTER",U_.AWNING="AWNING",U_.USERDEFINED="USERDEFINED",U_.NOTDEFINED="NOTDEFINED";var nc=class{constructor(e){this.value=e}};nc.P_SINGLEVALUE="P_SINGLEVALUE",nc.P_ENUMERATEDVALUE="P_ENUMERATEDVALUE",nc.P_BOUNDEDVALUE="P_BOUNDEDVALUE",nc.P_LISTVALUE="P_LISTVALUE",nc.P_TABLEVALUE="P_TABLEVALUE",nc.P_REFERENCEVALUE="P_REFERENCEVALUE",nc.Q_LENGTH="Q_LENGTH",nc.Q_AREA="Q_AREA",nc.Q_VOLUME="Q_VOLUME",nc.Q_COUNT="Q_COUNT",nc.Q_WEIGHT="Q_WEIGHT",nc.Q_TIME="Q_TIME";var wh=class{constructor(e){this.value=e}};wh.FLOOR="FLOOR",wh.ROOF="ROOF",wh.LANDING="LANDING",wh.BASESLAB="BASESLAB",wh.APPROACH_SLAB="APPROACH_SLAB",wh.PAVING="PAVING",wh.WEARING="WEARING",wh.SIDEWALK="SIDEWALK",wh.USERDEFINED="USERDEFINED",wh.NOTDEFINED="NOTDEFINED";var PO=class{constructor(e){this.value=e}};PO.SOLARCOLLECTOR="SOLARCOLLECTOR",PO.SOLARPANEL="SOLARPANEL",PO.USERDEFINED="USERDEFINED",PO.NOTDEFINED="NOTDEFINED";var NO=class{constructor(e){this.value=e}};NO.CONVECTOR="CONVECTOR",NO.RADIATOR="RADIATOR",NO.USERDEFINED="USERDEFINED",NO.NOTDEFINED="NOTDEFINED";var M0=class{constructor(e){this.value=e}};M0.SPACE="SPACE",M0.PARKING="PARKING",M0.GFA="GFA",M0.INTERNAL="INTERNAL",M0.EXTERNAL="EXTERNAL",M0.USERDEFINED="USERDEFINED",M0.NOTDEFINED="NOTDEFINED";var Rh=class{constructor(e){this.value=e}};Rh.CONSTRUCTION="CONSTRUCTION",Rh.FIRESAFETY="FIRESAFETY",Rh.LIGHTING="LIGHTING",Rh.OCCUPANCY="OCCUPANCY",Rh.SECURITY="SECURITY",Rh.THERMAL="THERMAL",Rh.TRANSPORT="TRANSPORT",Rh.VENTILATION="VENTILATION",Rh.USERDEFINED="USERDEFINED",Rh.NOTDEFINED="NOTDEFINED";var B_=class{constructor(e){this.value=e}};B_.BIRDCAGE="BIRDCAGE",B_.COWL="COWL",B_.RAINWATERHOPPER="RAINWATERHOPPER",B_.USERDEFINED="USERDEFINED",B_.NOTDEFINED="NOTDEFINED";var D0=class{constructor(e){this.value=e}};D0.STRAIGHT="STRAIGHT",D0.WINDER="WINDER",D0.SPIRAL="SPIRAL",D0.CURVED="CURVED",D0.FREEFORM="FREEFORM",D0.USERDEFINED="USERDEFINED",D0.NOTDEFINED="NOTDEFINED";var ca=class{constructor(e){this.value=e}};ca.STRAIGHT_RUN_STAIR="STRAIGHT_RUN_STAIR",ca.TWO_STRAIGHT_RUN_STAIR="TWO_STRAIGHT_RUN_STAIR",ca.QUARTER_WINDING_STAIR="QUARTER_WINDING_STAIR",ca.QUARTER_TURN_STAIR="QUARTER_TURN_STAIR",ca.HALF_WINDING_STAIR="HALF_WINDING_STAIR",ca.HALF_TURN_STAIR="HALF_TURN_STAIR",ca.TWO_QUARTER_WINDING_STAIR="TWO_QUARTER_WINDING_STAIR",ca.TWO_QUARTER_TURN_STAIR="TWO_QUARTER_TURN_STAIR",ca.THREE_QUARTER_WINDING_STAIR="THREE_QUARTER_WINDING_STAIR",ca.THREE_QUARTER_TURN_STAIR="THREE_QUARTER_TURN_STAIR",ca.SPIRAL_STAIR="SPIRAL_STAIR",ca.DOUBLE_RETURN_STAIR="DOUBLE_RETURN_STAIR",ca.CURVED_RUN_STAIR="CURVED_RUN_STAIR",ca.TWO_CURVED_RUN_STAIR="TWO_CURVED_RUN_STAIR",ca.USERDEFINED="USERDEFINED",ca.NOTDEFINED="NOTDEFINED";var k_=class{constructor(e){this.value=e}};k_.READWRITE="READWRITE",k_.READONLY="READONLY",k_.LOCKED="LOCKED",k_.READWRITELOCKED="READWRITELOCKED",k_.READONLYLOCKED="READONLYLOCKED";var md=class{constructor(e){this.value=e}};md.CONST="CONST",md.LINEAR="LINEAR",md.POLYGONAL="POLYGONAL",md.EQUIDISTANT="EQUIDISTANT",md.SINUS="SINUS",md.PARABOLA="PARABOLA",md.DISCRETE="DISCRETE",md.USERDEFINED="USERDEFINED",md.NOTDEFINED="NOTDEFINED";var C0=class{constructor(e){this.value=e}};C0.RIGID_JOINED_MEMBER="RIGID_JOINED_MEMBER",C0.PIN_JOINED_MEMBER="PIN_JOINED_MEMBER",C0.CABLE="CABLE",C0.TENSION_MEMBER="TENSION_MEMBER",C0.COMPRESSION_MEMBER="COMPRESSION_MEMBER",C0.USERDEFINED="USERDEFINED",C0.NOTDEFINED="NOTDEFINED";var uT=class{constructor(e){this.value=e}};uT.CONST="CONST",uT.BILINEAR="BILINEAR",uT.DISCRETE="DISCRETE",uT.ISOCONTOUR="ISOCONTOUR",uT.USERDEFINED="USERDEFINED",uT.NOTDEFINED="NOTDEFINED";var G_=class{constructor(e){this.value=e}};G_.BENDING_ELEMENT="BENDING_ELEMENT",G_.MEMBRANE_ELEMENT="MEMBRANE_ELEMENT",G_.SHELL="SHELL",G_.USERDEFINED="USERDEFINED",G_.NOTDEFINED="NOTDEFINED";var LO=class{constructor(e){this.value=e}};LO.PURCHASE="PURCHASE",LO.WORK="WORK",LO.USERDEFINED="USERDEFINED",LO.NOTDEFINED="NOTDEFINED";var hT=class{constructor(e){this.value=e}};hT.MARK="MARK",hT.TAG="TAG",hT.TREATMENT="TREATMENT",hT.DEFECT="DEFECT",hT.USERDEFINED="USERDEFINED",hT.NOTDEFINED="NOTDEFINED";var w8=class{constructor(e){this.value=e}};w8.POSITIVE="POSITIVE",w8.NEGATIVE="NEGATIVE",w8.BOTH="BOTH";var lu=class{constructor(e){this.value=e}};lu.CONTACTOR="CONTACTOR",lu.DIMMERSWITCH="DIMMERSWITCH",lu.EMERGENCYSTOP="EMERGENCYSTOP",lu.KEYPAD="KEYPAD",lu.MOMENTARYSWITCH="MOMENTARYSWITCH",lu.SELECTORSWITCH="SELECTORSWITCH",lu.STARTER="STARTER",lu.SWITCHDISCONNECTOR="SWITCHDISCONNECTOR",lu.TOGGLESWITCH="TOGGLESWITCH",lu.USERDEFINED="USERDEFINED",lu.NOTDEFINED="NOTDEFINED";var FO=class{constructor(e){this.value=e}};FO.PANEL="PANEL",FO.WORKSURFACE="WORKSURFACE",FO.USERDEFINED="USERDEFINED",FO.NOTDEFINED="NOTDEFINED";var gd=class{constructor(e){this.value=e}};gd.BASIN="BASIN",gd.BREAKPRESSURE="BREAKPRESSURE",gd.EXPANSION="EXPANSION",gd.FEEDANDEXPANSION="FEEDANDEXPANSION",gd.PRESSUREVESSEL="PRESSUREVESSEL",gd.STORAGE="STORAGE",gd.VESSEL="VESSEL",gd.USERDEFINED="USERDEFINED",gd.NOTDEFINED="NOTDEFINED";var R8=class{constructor(e){this.value=e}};R8.ELAPSEDTIME="ELAPSEDTIME",R8.WORKTIME="WORKTIME",R8.NOTDEFINED="NOTDEFINED";var Mo=class{constructor(e){this.value=e}};Mo.ATTENDANCE="ATTENDANCE",Mo.CONSTRUCTION="CONSTRUCTION",Mo.DEMOLITION="DEMOLITION",Mo.DISMANTLE="DISMANTLE",Mo.DISPOSAL="DISPOSAL",Mo.INSTALLATION="INSTALLATION",Mo.LOGISTIC="LOGISTIC",Mo.MAINTENANCE="MAINTENANCE",Mo.MOVE="MOVE",Mo.OPERATION="OPERATION",Mo.REMOVAL="REMOVAL",Mo.RENOVATION="RENOVATION",Mo.USERDEFINED="USERDEFINED",Mo.NOTDEFINED="NOTDEFINED";var V_=class{constructor(e){this.value=e}};V_.COUPLER="COUPLER",V_.FIXED_END="FIXED_END",V_.TENSIONING_END="TENSIONING_END",V_.USERDEFINED="USERDEFINED",V_.NOTDEFINED="NOTDEFINED";var A0=class{constructor(e){this.value=e}};A0.DUCT="DUCT",A0.COUPLER="COUPLER",A0.GROUTING_DUCT="GROUTING_DUCT",A0.TRUMPET="TRUMPET",A0.DIABOLO="DIABOLO",A0.USERDEFINED="USERDEFINED",A0.NOTDEFINED="NOTDEFINED";var pT=class{constructor(e){this.value=e}};pT.BAR="BAR",pT.COATED="COATED",pT.STRAND="STRAND",pT.WIRE="WIRE",pT.USERDEFINED="USERDEFINED",pT.NOTDEFINED="NOTDEFINED";var HO=class{constructor(e){this.value=e}};HO.LEFT="LEFT",HO.RIGHT="RIGHT",HO.UP="UP",HO.DOWN="DOWN";var O0=class{constructor(e){this.value=e}};O0.CONTINUOUS="CONTINUOUS",O0.DISCRETE="DISCRETE",O0.DISCRETEBINARY="DISCRETEBINARY",O0.PIECEWISEBINARY="PIECEWISEBINARY",O0.PIECEWISECONSTANT="PIECEWISECONSTANT",O0.PIECEWISECONTINUOUS="PIECEWISECONTINUOUS",O0.NOTDEFINED="NOTDEFINED";var P0=class{constructor(e){this.value=e}};P0.CURRENT="CURRENT",P0.FREQUENCY="FREQUENCY",P0.INVERTER="INVERTER",P0.RECTIFIER="RECTIFIER",P0.VOLTAGE="VOLTAGE",P0.USERDEFINED="USERDEFINED",P0.NOTDEFINED="NOTDEFINED";var UO=class{constructor(e){this.value=e}};UO.DISCONTINUOUS="DISCONTINUOUS",UO.CONTINUOUS="CONTINUOUS",UO.CONTSAMEGRADIENT="CONTSAMEGRADIENT",UO.CONTSAMEGRADIENTSAMECURVATURE="CONTSAMEGRADIENTSAMECURVATURE";var dT=class{constructor(e){this.value=e}};dT.BIQUADRATICPARABOLA="BIQUADRATICPARABOLA",dT.BLOSSCURVE="BLOSSCURVE",dT.CLOTHOIDCURVE="CLOTHOIDCURVE",dT.COSINECURVE="COSINECURVE",dT.CUBICPARABOLA="CUBICPARABOLA",dT.SINECURVE="SINECURVE";var N0=class{constructor(e){this.value=e}};N0.ELEVATOR="ELEVATOR",N0.ESCALATOR="ESCALATOR",N0.MOVINGWALKWAY="MOVINGWALKWAY",N0.CRANEWAY="CRANEWAY",N0.LIFTINGGEAR="LIFTINGGEAR",N0.USERDEFINED="USERDEFINED",N0.NOTDEFINED="NOTDEFINED";var M8=class{constructor(e){this.value=e}};M8.CARTESIAN="CARTESIAN",M8.PARAMETER="PARAMETER",M8.UNSPECIFIED="UNSPECIFIED";var D8=class{constructor(e){this.value=e}};D8.FINNED="FINNED",D8.USERDEFINED="USERDEFINED",D8.NOTDEFINED="NOTDEFINED";var Ji=class{constructor(e){this.value=e}};Ji.ABSORBEDDOSEUNIT="ABSORBEDDOSEUNIT",Ji.AMOUNTOFSUBSTANCEUNIT="AMOUNTOFSUBSTANCEUNIT",Ji.AREAUNIT="AREAUNIT",Ji.DOSEEQUIVALENTUNIT="DOSEEQUIVALENTUNIT",Ji.ELECTRICCAPACITANCEUNIT="ELECTRICCAPACITANCEUNIT",Ji.ELECTRICCHARGEUNIT="ELECTRICCHARGEUNIT",Ji.ELECTRICCONDUCTANCEUNIT="ELECTRICCONDUCTANCEUNIT",Ji.ELECTRICCURRENTUNIT="ELECTRICCURRENTUNIT",Ji.ELECTRICRESISTANCEUNIT="ELECTRICRESISTANCEUNIT",Ji.ELECTRICVOLTAGEUNIT="ELECTRICVOLTAGEUNIT",Ji.ENERGYUNIT="ENERGYUNIT",Ji.FORCEUNIT="FORCEUNIT",Ji.FREQUENCYUNIT="FREQUENCYUNIT",Ji.ILLUMINANCEUNIT="ILLUMINANCEUNIT",Ji.INDUCTANCEUNIT="INDUCTANCEUNIT",Ji.LENGTHUNIT="LENGTHUNIT",Ji.LUMINOUSFLUXUNIT="LUMINOUSFLUXUNIT",Ji.LUMINOUSINTENSITYUNIT="LUMINOUSINTENSITYUNIT",Ji.MAGNETICFLUXDENSITYUNIT="MAGNETICFLUXDENSITYUNIT",Ji.MAGNETICFLUXUNIT="MAGNETICFLUXUNIT",Ji.MASSUNIT="MASSUNIT",Ji.PLANEANGLEUNIT="PLANEANGLEUNIT",Ji.POWERUNIT="POWERUNIT",Ji.PRESSUREUNIT="PRESSUREUNIT",Ji.RADIOACTIVITYUNIT="RADIOACTIVITYUNIT",Ji.SOLIDANGLEUNIT="SOLIDANGLEUNIT",Ji.THERMODYNAMICTEMPERATUREUNIT="THERMODYNAMICTEMPERATUREUNIT",Ji.TIMEUNIT="TIMEUNIT",Ji.VOLUMEUNIT="VOLUMEUNIT",Ji.USERDEFINED="USERDEFINED";var Mh=class{constructor(e){this.value=e}};Mh.ALARMPANEL="ALARMPANEL",Mh.CONTROLPANEL="CONTROLPANEL",Mh.GASDETECTIONPANEL="GASDETECTIONPANEL",Mh.INDICATORPANEL="INDICATORPANEL",Mh.MIMICPANEL="MIMICPANEL",Mh.HUMIDISTAT="HUMIDISTAT",Mh.THERMOSTAT="THERMOSTAT",Mh.WEATHERSTATION="WEATHERSTATION",Mh.USERDEFINED="USERDEFINED",Mh.NOTDEFINED="NOTDEFINED";var L0=class{constructor(e){this.value=e}};L0.AIRHANDLER="AIRHANDLER",L0.AIRCONDITIONINGUNIT="AIRCONDITIONINGUNIT",L0.DEHUMIDIFIER="DEHUMIDIFIER",L0.SPLITSYSTEM="SPLITSYSTEM",L0.ROOFTOPUNIT="ROOFTOPUNIT",L0.USERDEFINED="USERDEFINED",L0.NOTDEFINED="NOTDEFINED";var Vn=class{constructor(e){this.value=e}};Vn.AIRRELEASE="AIRRELEASE",Vn.ANTIVACUUM="ANTIVACUUM",Vn.CHANGEOVER="CHANGEOVER",Vn.CHECK="CHECK",Vn.COMMISSIONING="COMMISSIONING",Vn.DIVERTING="DIVERTING",Vn.DRAWOFFCOCK="DRAWOFFCOCK",Vn.DOUBLECHECK="DOUBLECHECK",Vn.DOUBLEREGULATING="DOUBLEREGULATING",Vn.FAUCET="FAUCET",Vn.FLUSHING="FLUSHING",Vn.GASCOCK="GASCOCK",Vn.GASTAP="GASTAP",Vn.ISOLATING="ISOLATING",Vn.MIXING="MIXING",Vn.PRESSUREREDUCING="PRESSUREREDUCING",Vn.PRESSURERELIEF="PRESSURERELIEF",Vn.REGULATING="REGULATING",Vn.SAFETYCUTOFF="SAFETYCUTOFF",Vn.STEAMTRAP="STEAMTRAP",Vn.STOPCOCK="STOPCOCK",Vn.USERDEFINED="USERDEFINED",Vn.NOTDEFINED="NOTDEFINED";var rm=class{constructor(e){this.value=e}};rm.BENDING_YIELD="BENDING_YIELD",rm.SHEAR_YIELD="SHEAR_YIELD",rm.AXIAL_YIELD="AXIAL_YIELD",rm.FRICTION="FRICTION",rm.VISCOUS="VISCOUS",rm.RUBBER="RUBBER",rm.USERDEFINED="USERDEFINED",rm.NOTDEFINED="NOTDEFINED";var z_=class{constructor(e){this.value=e}};z_.COMPRESSION="COMPRESSION",z_.SPRING="SPRING",z_.BASE="BASE",z_.USERDEFINED="USERDEFINED",z_.NOTDEFINED="NOTDEFINED";var im=class{constructor(e){this.value=e}};im.CUTOUT="CUTOUT",im.NOTCH="NOTCH",im.HOLE="HOLE",im.MITER="MITER",im.CHAMFER="CHAMFER",im.EDGE="EDGE",im.USERDEFINED="USERDEFINED",im.NOTDEFINED="NOTDEFINED";var sc=class{constructor(e){this.value=e}};sc.MOVABLE="MOVABLE",sc.PARAPET="PARAPET",sc.PARTITIONING="PARTITIONING",sc.PLUMBINGWALL="PLUMBINGWALL",sc.SHEAR="SHEAR",sc.SOLIDWALL="SOLIDWALL",sc.STANDARD="STANDARD",sc.POLYGONAL="POLYGONAL",sc.ELEMENTEDWALL="ELEMENTEDWALL",sc.RETAININGWALL="RETAININGWALL",sc.USERDEFINED="USERDEFINED",sc.NOTDEFINED="NOTDEFINED";var vd=class{constructor(e){this.value=e}};vd.FLOORTRAP="FLOORTRAP",vd.FLOORWASTE="FLOORWASTE",vd.GULLYSUMP="GULLYSUMP",vd.GULLYTRAP="GULLYTRAP",vd.ROOFDRAIN="ROOFDRAIN",vd.WASTEDISPOSALUNIT="WASTEDISPOSALUNIT",vd.WASTETRAP="WASTETRAP",vd.USERDEFINED="USERDEFINED",vd.NOTDEFINED="NOTDEFINED";var Do=class{constructor(e){this.value=e}};Do.SIDEHUNGRIGHTHAND="SIDEHUNGRIGHTHAND",Do.SIDEHUNGLEFTHAND="SIDEHUNGLEFTHAND",Do.TILTANDTURNRIGHTHAND="TILTANDTURNRIGHTHAND",Do.TILTANDTURNLEFTHAND="TILTANDTURNLEFTHAND",Do.TOPHUNG="TOPHUNG",Do.BOTTOMHUNG="BOTTOMHUNG",Do.PIVOTHORIZONTAL="PIVOTHORIZONTAL",Do.PIVOTVERTICAL="PIVOTVERTICAL",Do.SLIDINGHORIZONTAL="SLIDINGHORIZONTAL",Do.SLIDINGVERTICAL="SLIDINGVERTICAL",Do.REMOVABLECASEMENT="REMOVABLECASEMENT",Do.FIXEDCASEMENT="FIXEDCASEMENT",Do.OTHEROPERATION="OTHEROPERATION",Do.NOTDEFINED="NOTDEFINED";var fT=class{constructor(e){this.value=e}};fT.LEFT="LEFT",fT.MIDDLE="MIDDLE",fT.RIGHT="RIGHT",fT.BOTTOM="BOTTOM",fT.TOP="TOP",fT.NOTDEFINED="NOTDEFINED";var nm=class{constructor(e){this.value=e}};nm.ALUMINIUM="ALUMINIUM",nm.HIGH_GRADE_STEEL="HIGH_GRADE_STEEL",nm.STEEL="STEEL",nm.WOOD="WOOD",nm.ALUMINIUM_WOOD="ALUMINIUM_WOOD",nm.PLASTIC="PLASTIC",nm.OTHER_CONSTRUCTION="OTHER_CONSTRUCTION",nm.NOTDEFINED="NOTDEFINED";var cu=class{constructor(e){this.value=e}};cu.SINGLE_PANEL="SINGLE_PANEL",cu.DOUBLE_PANEL_VERTICAL="DOUBLE_PANEL_VERTICAL",cu.DOUBLE_PANEL_HORIZONTAL="DOUBLE_PANEL_HORIZONTAL",cu.TRIPLE_PANEL_VERTICAL="TRIPLE_PANEL_VERTICAL",cu.TRIPLE_PANEL_BOTTOM="TRIPLE_PANEL_BOTTOM",cu.TRIPLE_PANEL_TOP="TRIPLE_PANEL_TOP",cu.TRIPLE_PANEL_LEFT="TRIPLE_PANEL_LEFT",cu.TRIPLE_PANEL_RIGHT="TRIPLE_PANEL_RIGHT",cu.TRIPLE_PANEL_HORIZONTAL="TRIPLE_PANEL_HORIZONTAL",cu.USERDEFINED="USERDEFINED",cu.NOTDEFINED="NOTDEFINED";var j_=class{constructor(e){this.value=e}};j_.WINDOW="WINDOW",j_.SKYLIGHT="SKYLIGHT",j_.LIGHTDOME="LIGHTDOME",j_.USERDEFINED="USERDEFINED",j_.NOTDEFINED="NOTDEFINED";var uu=class{constructor(e){this.value=e}};uu.SINGLE_PANEL="SINGLE_PANEL",uu.DOUBLE_PANEL_VERTICAL="DOUBLE_PANEL_VERTICAL",uu.DOUBLE_PANEL_HORIZONTAL="DOUBLE_PANEL_HORIZONTAL",uu.TRIPLE_PANEL_VERTICAL="TRIPLE_PANEL_VERTICAL",uu.TRIPLE_PANEL_BOTTOM="TRIPLE_PANEL_BOTTOM",uu.TRIPLE_PANEL_TOP="TRIPLE_PANEL_TOP",uu.TRIPLE_PANEL_LEFT="TRIPLE_PANEL_LEFT",uu.TRIPLE_PANEL_RIGHT="TRIPLE_PANEL_RIGHT",uu.TRIPLE_PANEL_HORIZONTAL="TRIPLE_PANEL_HORIZONTAL",uu.USERDEFINED="USERDEFINED",uu.NOTDEFINED="NOTDEFINED";var W_=class{constructor(e){this.value=e}};W_.FIRSTSHIFT="FIRSTSHIFT",W_.SECONDSHIFT="SECONDSHIFT",W_.THIRDSHIFT="THIRDSHIFT",W_.USERDEFINED="USERDEFINED",W_.NOTDEFINED="NOTDEFINED";var q_=class{constructor(e){this.value=e}};q_.ACTUAL="ACTUAL",q_.BASELINE="BASELINE",q_.PLANNED="PLANNED",q_.USERDEFINED="USERDEFINED",q_.NOTDEFINED="NOTDEFINED";var Y_=class{constructor(e){this.value=e}};Y_.ACTUAL="ACTUAL",Y_.BASELINE="BASELINE",Y_.PLANNED="PLANNED",Y_.USERDEFINED="USERDEFINED",Y_.NOTDEFINED="NOTDEFINED";var s0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=h,this.LongDescription=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new s0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},a0e=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.TheActor=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new a0e(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheActor),e}},o0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Role=i,this.UserDefinedRole=r,this.Description=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new o0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Role),e.push(this.UserDefinedRole),e.push(this.Description),e}},l0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new l0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},c0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new c0e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},u0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Purpose=i,this.Description=r,this.UserDefinedPurpose=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new u0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e}},h0e=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Outer=i}static FromTape(e,t,i){let r=0,n=i[r++];return new h0e(e,t,n)}ToTape(){let e=[];return e.push(this.Outer),e}},p0e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Outer=i,this.Voids=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new p0e(e,t,n,s)}ToTape(){let e=[];return e.push(this.Outer),e.push(this.Voids),e}},d0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Bounds=i,this.FaceSurface=r,this.SameSense=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new d0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Bounds),e.push(this.FaceSurface),e.push(this.SameSense),e}},f0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new f0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},m0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new m0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},g0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new g0e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},v0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new v0e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},y0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new y0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},E0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new E0e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},T0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new T0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},b0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new b0e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},x0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Axis=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new x0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Axis),e.push(this.PredefinedType),e}},I0e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.StartDistAlong=i,this.Segments=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new I0e(e,t,n,s)}ToTape(){let e=[];return e.push(this.StartDistAlong),e.push(this.Segments),e}},_0e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.TangentialContinuity=i,this.StartTag=r,this.EndTag=n,this.CurveGeometry=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new _0e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.CurveGeometry),e}},S0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.TangentialContinuity=i,this.StartTag=r,this.EndTag=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new S0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e}},w0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.TangentialContinuity=i,this.StartTag=r,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l,this.Radius=h,this.IsConvex=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new w0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e.push(this.Radius),e.push(this.IsConvex),e}},R0e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.TangentialContinuity=i,this.StartTag=r,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new R0e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e}},M0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.TangentialContinuity=i,this.StartTag=r,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l,this.ParabolaConstant=h,this.IsConvex=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new M0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e.push(this.ParabolaConstant),e.push(this.IsConvex),e}},D0e=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Segments=i}static FromTape(e,t,i){let r=0,n=i[r++];return new D0e(e,t,n)}ToTape(){let e=[];return e.push(this.Segments),e}},C0e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.TangentialContinuity=i,this.StartTag=r,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new C0e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e}},A0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Horizontal=i,this.Vertical=r,this.Tag=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new A0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Horizontal),e.push(this.Vertical),e.push(this.Tag),e}},O0e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new O0e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},P0e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.OuterBoundary=i,this.InnerBoundaries=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new P0e(e,t,n,s)}ToTape(){let e=[];return e.push(this.OuterBoundary),e.push(this.InnerBoundaries),e}},N0e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ApplicationDeveloper=i,this.Version=r,this.ApplicationFullName=n,this.ApplicationIdentifier=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new N0e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ApplicationDeveloper),e.push(this.Version),e.push(this.ApplicationFullName),e.push(this.ApplicationIdentifier),e}},L0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.AppliedValue=n,this.UnitBasis=s,this.ApplicableDate=a,this.FixedUntilDate=o,this.Category=l,this.Condition=h,this.ArithmeticOperator=u,this.Components=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new L0e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AppliedValue),e.push(this.UnitBasis),e.push(this.ApplicableDate),e.push(this.FixedUntilDate),e.push(this.Category),e.push(this.Condition),e.push(this.ArithmeticOperator),e.push(this.Components),e}},F0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.Identifier=i,this.Name=r,this.Description=n,this.TimeOfApproval=s,this.Status=a,this.Level=o,this.Qualifier=l,this.RequestingApproval=h,this.GivingApproval=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new F0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.Identifier),e.push(this.Name),e.push(this.Description),e.push(this.TimeOfApproval),e.push(this.Status),e.push(this.Level),e.push(this.Qualifier),e.push(this.RequestingApproval),e.push(this.GivingApproval),e}},H0e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatingApproval=n,this.RelatedApprovals=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new H0e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingApproval),e.push(this.RelatedApprovals),e}},U0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.OuterCurve=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new U0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.OuterCurve),e}},B0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Curve=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new B0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Curve),e}},k0e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.OuterCurve=n,this.InnerCurves=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new k0e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.OuterCurve),e.push(this.InnerCurves),e}},G0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.OriginalValue=l,this.CurrentValue=h,this.TotalReplacementCost=u,this.Owner=c,this.User=p,this.ResponsiblePerson=d,this.IncorporationDate=f,this.DepreciatedValue=m}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++];return new G0e(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.OriginalValue),e.push(this.CurrentValue),e.push(this.TotalReplacementCost),e.push(this.Owner),e.push(this.User),e.push(this.ResponsiblePerson),e.push(this.IncorporationDate),e.push(this.DepreciatedValue),e}},V0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.BottomFlangeWidth=s,this.OverallDepth=a,this.WebThickness=o,this.BottomFlangeThickness=l,this.BottomFlangeFilletRadius=h,this.TopFlangeWidth=u,this.TopFlangeThickness=c,this.TopFlangeFilletRadius=p,this.BottomFlangeEdgeRadius=d,this.BottomFlangeSlope=f,this.TopFlangeEdgeRadius=m,this.TopFlangeSlope=g}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++];return new V0e(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.BottomFlangeWidth),e.push(this.OverallDepth),e.push(this.WebThickness),e.push(this.BottomFlangeThickness),e.push(this.BottomFlangeFilletRadius),e.push(this.TopFlangeWidth),e.push(this.TopFlangeThickness),e.push(this.TopFlangeFilletRadius),e.push(this.BottomFlangeEdgeRadius),e.push(this.BottomFlangeSlope),e.push(this.TopFlangeEdgeRadius),e.push(this.TopFlangeSlope),e}},z0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new z0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},j0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new j0e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},W0e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Location=i,this.Axis=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new W0e(e,t,n,s)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Axis),e}},q0e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Location=i,this.RefDirection=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new q0e(e,t,n,s)}ToTape(){let e=[];return e.push(this.Location),e.push(this.RefDirection),e}},Y0e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Location=i,this.Axis=r,this.RefDirection=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Y0e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Axis),e.push(this.RefDirection),e}},X0e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Degree=i,this.ControlPointsList=r,this.CurveForm=n,this.ClosedCurve=s,this.SelfIntersect=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new X0e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e}},$0e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Degree=i,this.ControlPointsList=r,this.CurveForm=n,this.ClosedCurve=s,this.SelfIntersect=a,this.KnotMultiplicities=o,this.Knots=l,this.KnotSpec=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new $0e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e.push(this.KnotMultiplicities),e.push(this.Knots),e.push(this.KnotSpec),e}},Z0e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.UDegree=i,this.VDegree=r,this.ControlPointsList=n,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new Z0e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e}},K0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.UDegree=i,this.VDegree=r,this.ControlPointsList=n,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l,this.UMultiplicities=h,this.VMultiplicities=u,this.UKnots=c,this.VKnots=p,this.KnotSpec=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new K0e(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e.push(this.UMultiplicities),e.push(this.VMultiplicities),e.push(this.UKnots),e.push(this.VKnots),e.push(this.KnotSpec),e}},J0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new J0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Q0e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Q0e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},eve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new eve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},tve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new tve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},rve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new rve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ive=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.RepeatS=i,this.RepeatT=r,this.Mode=n,this.TextureTransform=s,this.Parameter=a,this.RasterFormat=o,this.RasterCode=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new ive(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.RasterFormat),e.push(this.RasterCode),e}},nve=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Position=i,this.XLength=r,this.YLength=n,this.ZLength=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new nve(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Position),e.push(this.XLength),e.push(this.YLength),e.push(this.ZLength),e}},sve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new sve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},ave=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new ave(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ove=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Operator=i,this.FirstOperand=r,this.SecondOperand=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new ove(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Operator),e.push(this.FirstOperand),e.push(this.SecondOperand),e}},lve=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Operator=i,this.FirstOperand=r,this.SecondOperand=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new lve(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Operator),e.push(this.FirstOperand),e.push(this.SecondOperand),e}},cve=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new cve(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},uve=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Segments=i,this.SelfIntersect=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new uve(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},hve=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.TranslationalStiffnessByLengthX=r,this.TranslationalStiffnessByLengthY=n,this.TranslationalStiffnessByLengthZ=s,this.RotationalStiffnessByLengthX=a,this.RotationalStiffnessByLengthY=o,this.RotationalStiffnessByLengthZ=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new hve(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessByLengthX),e.push(this.TranslationalStiffnessByLengthY),e.push(this.TranslationalStiffnessByLengthZ),e.push(this.RotationalStiffnessByLengthX),e.push(this.RotationalStiffnessByLengthY),e.push(this.RotationalStiffnessByLengthZ),e}},pve=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.TranslationalStiffnessByAreaX=r,this.TranslationalStiffnessByAreaY=n,this.TranslationalStiffnessByAreaZ=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new pve(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessByAreaX),e.push(this.TranslationalStiffnessByAreaY),e.push(this.TranslationalStiffnessByAreaZ),e}},dve=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.TranslationalStiffnessX=r,this.TranslationalStiffnessY=n,this.TranslationalStiffnessZ=s,this.RotationalStiffnessX=a,this.RotationalStiffnessY=o,this.RotationalStiffnessZ=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new dve(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessX),e.push(this.TranslationalStiffnessY),e.push(this.TranslationalStiffnessZ),e.push(this.RotationalStiffnessX),e.push(this.RotationalStiffnessY),e.push(this.RotationalStiffnessZ),e}},fve=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Name=i,this.TranslationalStiffnessX=r,this.TranslationalStiffnessY=n,this.TranslationalStiffnessZ=s,this.RotationalStiffnessX=a,this.RotationalStiffnessY=o,this.RotationalStiffnessZ=l,this.WarpingStiffness=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new fve(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessX),e.push(this.TranslationalStiffnessY),e.push(this.TranslationalStiffnessZ),e.push(this.RotationalStiffnessX),e.push(this.RotationalStiffnessY),e.push(this.RotationalStiffnessZ),e.push(this.WarpingStiffness),e}},mve=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new mve(e,t)}ToTape(){return[]}},gve=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new gve(e,t)}ToTape(){return[]}},vve=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Corner=i,this.XDim=r,this.YDim=n,this.ZDim=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new vve(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Corner),e.push(this.XDim),e.push(this.YDim),e.push(this.ZDim),e}},yve=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.BaseSurface=i,this.AgreementFlag=r,this.Enclosure=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new yve(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e.push(this.Enclosure),e}},Eve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Eve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e}},Tve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Tve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e}},bve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u,this.ElevationOfRefHeight=c,this.ElevationOfTerrain=p,this.BuildingAddress=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new bve(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.ElevationOfRefHeight),e.push(this.ElevationOfTerrain),e.push(this.BuildingAddress),e}},xve=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new xve(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},Ive=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Ive(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},_ve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new _ve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Sve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Sve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},wve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new wve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Rve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Rve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},Mve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u,this.Elevation=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Mve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.Elevation),e}},Dve=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.LongName=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new Dve(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.LongName),e}},Cve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Cve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Ave=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Ave(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Ove=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.Depth=s,this.Width=a,this.WallThickness=o,this.Girth=l,this.InternalFilletRadius=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new Ove(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.Width),e.push(this.WallThickness),e.push(this.Girth),e.push(this.InternalFilletRadius),e}},Pve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Pve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Nve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Nve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Lve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Lve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Fve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Fve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Hve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Hve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Uve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Uve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Bve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Bve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},kve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new kve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Gve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Gve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Vve=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Vve(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},zve=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Coordinates=i}static FromTape(e,t,i){let r=0,n=i[r++];return new zve(e,t,n)}ToTape(){let e=[];return e.push(this.Coordinates),e}},jve=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new jve(e,t)}ToTape(){return[]}},Wve=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.CoordList=i,this.TagList=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Wve(e,t,n,s)}ToTape(){let e=[];return e.push(this.CoordList),e.push(this.TagList),e}},qve=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.CoordList=i,this.TagList=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new qve(e,t,n,s)}ToTape(){let e=[];return e.push(this.CoordList),e.push(this.TagList),e}},Yve=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Axis1=i,this.Axis2=r,this.LocalOrigin=n,this.Scale=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Yve(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e}},Xve=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Axis1=i,this.Axis2=r,this.LocalOrigin=n,this.Scale=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Xve(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e}},$ve=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Axis1=i,this.Axis2=r,this.LocalOrigin=n,this.Scale=s,this.Scale2=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new $ve(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e.push(this.Scale2),e}},Zve=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Axis1=i,this.Axis2=r,this.LocalOrigin=n,this.Scale=s,this.Axis3=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Zve(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e.push(this.Axis3),e}},Kve=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Axis1=i,this.Axis2=r,this.LocalOrigin=n,this.Scale=s,this.Axis3=a,this.Scale2=o,this.Scale3=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new Kve(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e.push(this.Axis3),e.push(this.Scale2),e.push(this.Scale3),e}},Jve=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Curve=n,this.Thickness=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Jve(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Curve),e.push(this.Thickness),e}},Qve=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Qve(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},eye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new eye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},tye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new tye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},rye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new rye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},iye=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Position=i,this.Radius=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new iye(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},nye=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.Radius=s,this.WallThickness=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new nye(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Radius),e.push(this.WallThickness),e}},sye=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.Radius=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new sye(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Radius),e}},aye=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.StartPoint=i,this.StartDirection=r,this.SegmentLength=n,this.Radius=s,this.IsCCW=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new aye(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e.push(this.Radius),e.push(this.IsCCW),e}},oye=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new oye(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},lye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new lye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},cye=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Source=i,this.Edition=r,this.EditionDate=n,this.Name=s,this.Description=a,this.Location=o,this.ReferenceTokens=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new cye(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Source),e.push(this.Edition),e.push(this.EditionDate),e.push(this.Name),e.push(this.Description),e.push(this.Location),e.push(this.ReferenceTokens),e}},uye=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Location=i,this.Identification=r,this.Name=n,this.ReferencedSource=s,this.Description=a,this.Sort=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new uye(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.ReferencedSource),e.push(this.Description),e.push(this.Sort),e}},hye=class{constructor(e,t,i){this.expressID=e,this.type=t,this.CfsFaces=i}static FromTape(e,t,i){let r=0,n=i[r++];return new hye(e,t,n)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},pye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new pye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},dye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new dye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},fye=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Red=r,this.Green=n,this.Blue=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new fye(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Red),e.push(this.Green),e.push(this.Blue),e}},mye=class{constructor(e,t,i){this.expressID=e,this.type=t,this.ColourList=i}static FromTape(e,t,i){let r=0,n=i[r++];return new mye(e,t,n)}ToTape(){let e=[];return e.push(this.ColourList),e}},gye=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new gye(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},vye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new vye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},yye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new yye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Eye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Eye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Tye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Tye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},bye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new bye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},xye=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.UsageName=n,this.HasProperties=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new xye(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.UsageName),e.push(this.HasProperties),e}},Iye=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.UsageName=a,this.TemplateType=o,this.HasPropertyTemplates=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new Iye(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.UsageName),e.push(this.TemplateType),e.push(this.HasPropertyTemplates),e}},_ye=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Segments=i,this.SelfIntersect=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new _ye(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},Sye=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Segments=i,this.SelfIntersect=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Sye(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},wye=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Transition=i,this.SameSense=r,this.ParentCurve=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new wye(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Transition),e.push(this.SameSense),e.push(this.ParentCurve),e}},Rye=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Profiles=n,this.Label=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Rye(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Profiles),e.push(this.Label),e}},Mye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Mye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Dye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Dye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Cye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Cye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Aye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Aye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Oye=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Position=i}static FromTape(e,t,i){let r=0,n=i[r++];return new Oye(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},Pye=class{constructor(e,t,i){this.expressID=e,this.type=t,this.CfsFaces=i}static FromTape(e,t,i){let r=0,n=i[r++];return new Pye(e,t,n)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},Nye=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.CurveOnRelatingElement=i,this.CurveOnRelatedElement=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Nye(e,t,n,s)}ToTape(){let e=[];return e.push(this.CurveOnRelatingElement),e.push(this.CurveOnRelatedElement),e}},Lye=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new Lye(e,t)}ToTape(){return[]}},Fye=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.PointOnRelatingElement=i,this.PointOnRelatedElement=r,this.EccentricityInX=n,this.EccentricityInY=s,this.EccentricityInZ=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Fye(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.PointOnRelatingElement),e.push(this.PointOnRelatedElement),e.push(this.EccentricityInX),e.push(this.EccentricityInY),e.push(this.EccentricityInZ),e}},Hye=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.PointOnRelatingElement=i,this.PointOnRelatedElement=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Hye(e,t,n,s)}ToTape(){let e=[];return e.push(this.PointOnRelatingElement),e.push(this.PointOnRelatedElement),e}},Uye=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.SurfaceOnRelatingElement=i,this.SurfaceOnRelatedElement=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Uye(e,t,n,s)}ToTape(){let e=[];return e.push(this.SurfaceOnRelatingElement),e.push(this.SurfaceOnRelatedElement),e}},Bye=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.VolumeOnRelatingElement=i,this.VolumeOnRelatedElement=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Bye(e,t,n,s)}ToTape(){let e=[];return e.push(this.VolumeOnRelatingElement),e.push(this.VolumeOnRelatedElement),e}},kye=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.ConstraintGrade=n,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new kye(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e}},Gye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=h,this.BaseCosts=u,this.BaseQuantity=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new Gye(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},Vye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u,this.BaseCosts=c,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new Vye(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},zye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=h,this.BaseCosts=u,this.BaseQuantity=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new zye(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},jye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u,this.BaseCosts=c,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new jye(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},Wye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=h,this.BaseCosts=u,this.BaseQuantity=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new Wye(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},qye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u,this.BaseCosts=c,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new qye(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},Yye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=h,this.BaseCosts=u,this.BaseQuantity=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Yye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e}},Xye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u,this.BaseCosts=c,this.BaseQuantity=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new Xye(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e}},$ye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=h,this.UnitsInContext=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new $ye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},Zye=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Dimensions=i,this.UnitType=r,this.Name=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Zye(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Name),e}},Kye=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new Kye(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e}},Jye=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Jye(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Qye=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Qye(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},eEe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Dimensions=i,this.UnitType=r,this.Name=n,this.ConversionFactor=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new eEe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Name),e.push(this.ConversionFactor),e}},tEe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Dimensions=i,this.UnitType=r,this.Name=n,this.ConversionFactor=s,this.ConversionOffset=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new tEe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Name),e.push(this.ConversionFactor),e.push(this.ConversionOffset),e}},rEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new rEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},iEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new iEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},nEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new nEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},sEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new sEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},aEe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.SourceCRS=i,this.TargetCRS=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new aEe(e,t,n,s)}ToTape(){let e=[];return e.push(this.SourceCRS),e.push(this.TargetCRS),e}},oEe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.GeodeticDatum=n,this.VerticalDatum=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new oEe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.GeodeticDatum),e.push(this.VerticalDatum),e}},lEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.CostValues=h,this.CostQuantities=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new lEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.CostValues),e.push(this.CostQuantities),e}},cEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=h,this.SubmittedOn=u,this.UpdateDate=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new cEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.SubmittedOn),e.push(this.UpdateDate),e}},uEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.AppliedValue=n,this.UnitBasis=s,this.ApplicableDate=a,this.FixedUntilDate=o,this.Category=l,this.Condition=h,this.ArithmeticOperator=u,this.Components=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new uEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AppliedValue),e.push(this.UnitBasis),e.push(this.ApplicableDate),e.push(this.FixedUntilDate),e.push(this.Category),e.push(this.Condition),e.push(this.ArithmeticOperator),e.push(this.Components),e}},hEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new hEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},pEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new pEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},dEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=h,this.BaseCosts=u,this.BaseQuantity=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new dEe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},fEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u,this.BaseCosts=c,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new fEe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},mEe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Position=i}static FromTape(e,t,i){let r=0,n=i[r++];return new mEe(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},gEe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.TreeRootExpression=i}static FromTape(e,t,i){let r=0,n=i[r++];return new gEe(e,t,n)}ToTape(){let e=[];return e.push(this.TreeRootExpression),e}},vEe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatingMonetaryUnit=n,this.RelatedMonetaryUnit=s,this.ExchangeRate=a,this.RateDateTime=o,this.RateSource=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new vEe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingMonetaryUnit),e.push(this.RelatedMonetaryUnit),e.push(this.ExchangeRate),e.push(this.RateDateTime),e.push(this.RateSource),e}},yEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new yEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},EEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new EEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},TEe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new TEe(e,t)}ToTape(){return[]}},bEe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.BasisSurface=i,this.OuterBoundary=r,this.InnerBoundaries=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new bEe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.OuterBoundary),e.push(this.InnerBoundaries),e}},xEe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.BasisSurface=i,this.Boundaries=r,this.ImplicitOuter=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new xEe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.Boundaries),e.push(this.ImplicitOuter),e}},IEe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.StartPoint=i,this.StartDirection=r,this.SegmentLength=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new IEe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e}},_Ee=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.CurveFont=r,this.CurveWidth=n,this.CurveColour=s,this.ModelOrDraughting=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new _Ee(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.CurveFont),e.push(this.CurveWidth),e.push(this.CurveColour),e.push(this.ModelOrDraughting),e}},SEe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Name=i,this.PatternList=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new SEe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.PatternList),e}},wEe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.CurveFont=r,this.CurveFontScaling=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new wEe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.CurveFont),e.push(this.CurveFontScaling),e}},REe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.VisibleSegmentLength=i,this.InvisibleSegmentLength=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new REe(e,t,n,s)}ToTape(){let e=[];return e.push(this.VisibleSegmentLength),e.push(this.InvisibleSegmentLength),e}},MEe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Position=i,this.Radius=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new MEe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},DEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new DEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},CEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new CEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},AEe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new AEe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},OEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new OEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},PEe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.ParentProfile=n,this.Operator=s,this.Label=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new PEe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.ParentProfile),e.push(this.Operator),e.push(this.Label),e}},NEe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Elements=i,this.UnitType=r,this.UserDefinedType=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new NEe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Elements),e.push(this.UnitType),e.push(this.UserDefinedType),e}},LEe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Unit=i,this.Exponent=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new LEe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Unit),e.push(this.Exponent),e}},FEe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.LengthExponent=i,this.MassExponent=r,this.TimeExponent=n,this.ElectricCurrentExponent=s,this.ThermodynamicTemperatureExponent=a,this.AmountOfSubstanceExponent=o,this.LuminousIntensityExponent=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new FEe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.LengthExponent),e.push(this.MassExponent),e.push(this.TimeExponent),e.push(this.ElectricCurrentExponent),e.push(this.ThermodynamicTemperatureExponent),e.push(this.AmountOfSubstanceExponent),e.push(this.LuminousIntensityExponent),e}},HEe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.DirectionRatios=i}static FromTape(e,t,i){let r=0,n=i[r++];return new HEe(e,t,n)}ToTape(){let e=[];return e.push(this.DirectionRatios),e}},UEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new UEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},BEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new BEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},kEe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.DistanceAlong=i,this.OffsetLateral=r,this.OffsetVertical=n,this.OffsetLongitudinal=s,this.AlongHorizontal=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new kEe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.DistanceAlong),e.push(this.OffsetLateral),e.push(this.OffsetVertical),e.push(this.OffsetLongitudinal),e.push(this.AlongHorizontal),e}},GEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new GEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},VEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new VEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},zEe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.PredefinedType=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new zEe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.PredefinedType),e}},jEe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new jEe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},WEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new WEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},qEe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new qEe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},YEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new YEe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},XEe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new XEe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},$Ee=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new $Ee(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},ZEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.FlowDirection=h,this.PredefinedType=u,this.SystemType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new ZEe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.FlowDirection),e.push(this.PredefinedType),e.push(this.SystemType),e}},KEe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.PredefinedType=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new KEe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.PredefinedType),e}},JEe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v){this.expressID=e,this.type=t,this.Identification=i,this.Name=r,this.Description=n,this.Location=s,this.Purpose=a,this.IntendedUse=o,this.Scope=l,this.Revision=h,this.DocumentOwner=u,this.Editors=c,this.CreationTime=p,this.LastRevisionTime=d,this.ElectronicFormat=f,this.ValidFrom=m,this.ValidUntil=g,this.Confidentiality=y,this.Status=v}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++];return new JEe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x)}ToTape(){let e=[];return e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.Location),e.push(this.Purpose),e.push(this.IntendedUse),e.push(this.Scope),e.push(this.Revision),e.push(this.DocumentOwner),e.push(this.Editors),e.push(this.CreationTime),e.push(this.LastRevisionTime),e.push(this.ElectronicFormat),e.push(this.ValidFrom),e.push(this.ValidUntil),e.push(this.Confidentiality),e.push(this.Status),e}},QEe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatingDocument=n,this.RelatedDocuments=s,this.RelationshipType=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new QEe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingDocument),e.push(this.RelatedDocuments),e.push(this.RelationshipType),e}},eTe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Location=i,this.Identification=r,this.Name=n,this.Description=s,this.ReferencedDocument=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new eTe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.ReferencedDocument),e}},tTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.OverallHeight=u,this.OverallWidth=c,this.PredefinedType=p,this.OperationType=d,this.UserDefinedOperationType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new tTe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.UserDefinedOperationType),e}},rTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.LiningDepth=a,this.LiningThickness=o,this.ThresholdDepth=l,this.ThresholdThickness=h,this.TransomThickness=u,this.TransomOffset=c,this.LiningOffset=p,this.ThresholdOffset=d,this.CasingThickness=f,this.CasingDepth=m,this.ShapeAspectStyle=g,this.LiningToPanelOffsetX=y,this.LiningToPanelOffsetY=v}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++];return new rTe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.LiningDepth),e.push(this.LiningThickness),e.push(this.ThresholdDepth),e.push(this.ThresholdThickness),e.push(this.TransomThickness),e.push(this.TransomOffset),e.push(this.LiningOffset),e.push(this.ThresholdOffset),e.push(this.CasingThickness),e.push(this.CasingDepth),e.push(this.ShapeAspectStyle),e.push(this.LiningToPanelOffsetX),e.push(this.LiningToPanelOffsetY),e}},iTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.PanelDepth=a,this.PanelOperation=o,this.PanelWidth=l,this.PanelPosition=h,this.ShapeAspectStyle=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new iTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.PanelDepth),e.push(this.PanelOperation),e.push(this.PanelWidth),e.push(this.PanelPosition),e.push(this.ShapeAspectStyle),e}},nTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.OverallHeight=u,this.OverallWidth=c,this.PredefinedType=p,this.OperationType=d,this.UserDefinedOperationType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new nTe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.UserDefinedOperationType),e}},sTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.OperationType=u,this.ConstructionType=c,this.ParameterTakesPrecedence=p,this.Sizeable=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new sTe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.OperationType),e.push(this.ConstructionType),e.push(this.ParameterTakesPrecedence),e.push(this.Sizeable),e}},aTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.OperationType=p,this.ParameterTakesPrecedence=d,this.UserDefinedOperationType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new aTe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.ParameterTakesPrecedence),e.push(this.UserDefinedOperationType),e}},oTe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new oTe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},lTe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new lTe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},cTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new cTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},uTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new uTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},hTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new hTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},pTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new pTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},dTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new dTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},fTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new fTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},mTe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.EdgeStart=i,this.EdgeEnd=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new mTe(e,t,n,s)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e}},gTe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.EdgeStart=i,this.EdgeEnd=r,this.EdgeGeometry=n,this.SameSense=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new gTe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e.push(this.EdgeGeometry),e.push(this.SameSense),e}},vTe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.EdgeList=i}static FromTape(e,t,i){let r=0,n=i[r++];return new vTe(e,t,n)}ToTape(){let e=[];return e.push(this.EdgeList),e}},yTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new yTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},ETe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new ETe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},TTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new TTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},bTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new bTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},xTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new xTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},ITe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new ITe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},_Te=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new _Te(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},STe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new STe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},wTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new wTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},RTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new RTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},MTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new MTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},DTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new DTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},CTe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new CTe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},ATe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.AssemblyPlace=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new ATe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.AssemblyPlace),e.push(this.PredefinedType),e}},OTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new OTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},PTe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new PTe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},NTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new NTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},LTe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.MethodOfMeasurement=a,this.Quantities=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new LTe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.MethodOfMeasurement),e.push(this.Quantities),e}},FTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new FTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},HTe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Position=i}static FromTape(e,t,i){let r=0,n=i[r++];return new HTe(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},UTe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Position=i,this.SemiAxis1=r,this.SemiAxis2=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new UTe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.SemiAxis1),e.push(this.SemiAxis2),e}},BTe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.SemiAxis1=s,this.SemiAxis2=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new BTe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.SemiAxis1),e.push(this.SemiAxis2),e}},kTe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new kTe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},GTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new GTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},VTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new VTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},zTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new zTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},jTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new jTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},WTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new WTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},qTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new qTe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},YTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new YTe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},XTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.PredefinedType=h,this.EventTriggerType=u,this.UserDefinedEventTriggerType=c,this.EventOccurenceTime=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new XTe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.PredefinedType),e.push(this.EventTriggerType),e.push(this.UserDefinedEventTriggerType),e.push(this.EventOccurenceTime),e}},$Te=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.DataOrigin=r,this.UserDefinedDataOrigin=n,this.ActualDate=s,this.EarlyDate=a,this.LateDate=o,this.ScheduleDate=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new $Te(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.ActualDate),e.push(this.EarlyDate),e.push(this.LateDate),e.push(this.ScheduleDate),e}},ZTe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ProcessType=u,this.PredefinedType=c,this.EventTriggerType=p,this.UserDefinedEventTriggerType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new ZTe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e.push(this.EventTriggerType),e.push(this.UserDefinedEventTriggerType),e}},KTe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Properties=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new KTe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Properties),e}},JTe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new JTe(e,t)}ToTape(){return[]}},QTe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Location=i,this.Identification=r,this.Name=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new QTe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},e1e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatingReference=n,this.RelatedResourceObjects=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new e1e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingReference),e.push(this.RelatedResourceObjects),e}},t1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new t1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.PredefinedType),e}},r1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new r1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e}},i1e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Location=i,this.Identification=r,this.Name=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new i1e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},n1e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Location=i,this.Identification=r,this.Name=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new n1e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},s1e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Location=i,this.Identification=r,this.Name=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new s1e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},a1e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.SweptArea=i,this.Position=r,this.ExtrudedDirection=n,this.Depth=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new a1e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.ExtrudedDirection),e.push(this.Depth),e}},o1e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.SweptArea=i,this.Position=r,this.ExtrudedDirection=n,this.Depth=s,this.EndSweptArea=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new o1e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.ExtrudedDirection),e.push(this.Depth),e.push(this.EndSweptArea),e}},l1e=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Bounds=i}static FromTape(e,t,i){let r=0,n=i[r++];return new l1e(e,t,n)}ToTape(){let e=[];return e.push(this.Bounds),e}},c1e=class{constructor(e,t,i){this.expressID=e,this.type=t,this.FbsmFaces=i}static FromTape(e,t,i){let r=0,n=i[r++];return new c1e(e,t,n)}ToTape(){let e=[];return e.push(this.FbsmFaces),e}},u1e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Bound=i,this.Orientation=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new u1e(e,t,n,s)}ToTape(){let e=[];return e.push(this.Bound),e.push(this.Orientation),e}},h1e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Bound=i,this.Orientation=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new h1e(e,t,n,s)}ToTape(){let e=[];return e.push(this.Bound),e.push(this.Orientation),e}},p1e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Bounds=i,this.FaceSurface=r,this.SameSense=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new p1e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Bounds),e.push(this.FaceSurface),e.push(this.SameSense),e}},d1e=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Outer=i}static FromTape(e,t,i){let r=0,n=i[r++];return new d1e(e,t,n)}ToTape(){let e=[];return e.push(this.Outer),e}},f1e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Outer=i,this.Voids=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new f1e(e,t,n,s)}ToTape(){let e=[];return e.push(this.Outer),e.push(this.Voids),e}},m1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new m1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},g1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new g1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},v1e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.TensionFailureX=r,this.TensionFailureY=n,this.TensionFailureZ=s,this.CompressionFailureX=a,this.CompressionFailureY=o,this.CompressionFailureZ=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new v1e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TensionFailureX),e.push(this.TensionFailureY),e.push(this.TensionFailureZ),e.push(this.CompressionFailureX),e.push(this.CompressionFailureY),e.push(this.CompressionFailureZ),e}},y1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new y1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},E1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new E1e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},T1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new T1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},b1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new b1e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},x1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new x1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},I1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new I1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},_1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new _1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},S1e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.FillStyles=r,this.ModelorDraughting=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new S1e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.FillStyles),e.push(this.ModelorDraughting),e}},w1e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.HatchLineAppearance=i,this.StartOfNextHatchLine=r,this.PointOfReferenceHatchLine=n,this.PatternStart=s,this.HatchLineAngle=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new w1e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.HatchLineAppearance),e.push(this.StartOfNextHatchLine),e.push(this.PointOfReferenceHatchLine),e.push(this.PatternStart),e.push(this.HatchLineAngle),e}},R1e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.TilingPattern=i,this.Tiles=r,this.TilingScale=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new R1e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.TilingPattern),e.push(this.Tiles),e.push(this.TilingScale),e}},M1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new M1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},D1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new D1e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},C1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new C1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},A1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new A1e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},O1e=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.SweptArea=i,this.Position=r,this.Directrix=n,this.StartParam=s,this.EndParam=a,this.FixedReference=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new O1e(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Directrix),e.push(this.StartParam),e.push(this.EndParam),e.push(this.FixedReference),e}},P1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new P1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},N1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new N1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},L1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new L1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},F1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new F1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},H1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new H1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},U1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new U1e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},B1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new B1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},k1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new k1e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},G1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new G1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},V1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new V1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},z1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new z1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},j1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new j1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},W1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new W1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},q1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new q1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},Y1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new Y1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},X1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new X1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},$1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new $1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},Z1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Z1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},K1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new K1e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},J1e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new J1e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Q1e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new Q1e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},ebe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new ebe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},tbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new tbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},rbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.AssemblyPlace=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new rbe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.AssemblyPlace),e.push(this.PredefinedType),e}},ibe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new ibe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},nbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new nbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},sbe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Elements=i}static FromTape(e,t,i){let r=0,n=i[r++];return new sbe(e,t,n)}ToTape(){let e=[];return e.push(this.Elements),e}},abe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.ContextIdentifier=i,this.ContextType=r,this.CoordinateSpaceDimension=n,this.Precision=s,this.WorldCoordinateSystem=a,this.TrueNorth=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new abe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e.push(this.CoordinateSpaceDimension),e.push(this.Precision),e.push(this.WorldCoordinateSystem),e.push(this.TrueNorth),e}},obe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new obe(e,t)}ToTape(){return[]}},lbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.ContextIdentifier=i,this.ContextType=r,this.CoordinateSpaceDimension=n,this.Precision=s,this.WorldCoordinateSystem=a,this.TrueNorth=o,this.ParentContext=l,this.TargetScale=h,this.TargetView=u,this.UserDefinedTargetView=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new lbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e.push(this.CoordinateSpaceDimension),e.push(this.Precision),e.push(this.WorldCoordinateSystem),e.push(this.TrueNorth),e.push(this.ParentContext),e.push(this.TargetScale),e.push(this.TargetView),e.push(this.UserDefinedTargetView),e}},cbe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Elements=i}static FromTape(e,t,i){let r=0,n=i[r++];return new cbe(e,t,n)}ToTape(){let e=[];return e.push(this.Elements),e}},ube=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.UAxes=h,this.VAxes=u,this.WAxes=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new ube(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.UAxes),e.push(this.VAxes),e.push(this.WAxes),e.push(this.PredefinedType),e}},hbe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.AxisTag=i,this.AxisCurve=r,this.SameSense=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new hbe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.AxisTag),e.push(this.AxisCurve),e.push(this.SameSense),e}},pbe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.PlacementRelTo=i,this.PlacementLocation=r,this.PlacementRefDirection=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new pbe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.PlacementLocation),e.push(this.PlacementRefDirection),e}},dbe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new dbe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e}},fbe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.BaseSurface=i,this.AgreementFlag=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new fbe(e,t,n,s)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e}},mbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new mbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},gbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new gbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},vbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new vbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},ybe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new ybe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Ebe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.OverallWidth=s,this.OverallDepth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=h,this.FlangeEdgeRadius=u,this.FlangeSlope=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Ebe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.OverallWidth),e.push(this.OverallDepth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.FlangeEdgeRadius),e.push(this.FlangeSlope),e}},Tbe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.RepeatS=i,this.RepeatT=r,this.Mode=n,this.TextureTransform=s,this.Parameter=a,this.URLReference=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new Tbe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.URLReference),e}},bbe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.MappedTo=i,this.Opacity=r,this.Colours=n,this.ColourIndex=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new bbe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.MappedTo),e.push(this.Opacity),e.push(this.Colours),e.push(this.ColourIndex),e}},xbe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Points=i,this.Segments=r,this.SelfIntersect=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new xbe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Points),e.push(this.Segments),e.push(this.SelfIntersect),e}},Ibe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.CoordIndex=i}static FromTape(e,t,i){let r=0,n=i[r++];return new Ibe(e,t,n)}ToTape(){let e=[];return e.push(this.CoordIndex),e}},_be=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.CoordIndex=i,this.InnerCoordIndices=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new _be(e,t,n,s)}ToTape(){let e=[];return e.push(this.CoordIndex),e.push(this.InnerCoordIndices),e}},Sbe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Maps=i,this.MappedTo=r,this.TexCoords=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Sbe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.MappedTo),e.push(this.TexCoords),e}},wbe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Maps=i,this.MappedTo=r,this.TexCoords=n,this.TexCoordIndex=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new wbe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.MappedTo),e.push(this.TexCoords),e.push(this.TexCoordIndex),e}},Rbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Rbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Mbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Mbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Dbe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Curve3D=i,this.AssociatedGeometry=r,this.MasterRepresentation=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Dbe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},Cbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.Jurisdiction=l,this.ResponsiblePersons=h,this.LastUpdateDate=u,this.CurrentValue=c,this.OriginalValue=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new Cbe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.Jurisdiction),e.push(this.ResponsiblePersons),e.push(this.LastUpdateDate),e.push(this.CurrentValue),e.push(this.OriginalValue),e}},Abe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.StartTime=n,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=h,this.Values=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Abe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e.push(this.Values),e}},Obe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.TimeStamp=i,this.ListValues=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Obe(e,t,n,s)}ToTape(){let e=[];return e.push(this.TimeStamp),e.push(this.ListValues),e}},Pbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Pbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Nbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Nbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Lbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.Depth=s,this.Width=a,this.Thickness=o,this.FilletRadius=l,this.EdgeRadius=h,this.LegSlope=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Lbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.Width),e.push(this.Thickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e.push(this.LegSlope),e}},Fbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=h,this.BaseCosts=u,this.BaseQuantity=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new Fbe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},Hbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u,this.BaseCosts=c,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new Hbe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},Ube=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.DataOrigin=r,this.UserDefinedDataOrigin=n,this.LagValue=s,this.DurationType=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Ube(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.LagValue),e.push(this.DurationType),e}},Bbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Bbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},kbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new kbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Gbe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Name=i,this.Version=r,this.Publisher=n,this.VersionDate=s,this.Location=a,this.Description=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new Gbe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Version),e.push(this.Publisher),e.push(this.VersionDate),e.push(this.Location),e.push(this.Description),e}},Vbe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Location=i,this.Identification=r,this.Name=n,this.Description=s,this.Language=a,this.ReferencedLibrary=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new Vbe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.Language),e.push(this.ReferencedLibrary),e}},zbe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.MainPlaneAngle=i,this.SecondaryPlaneAngle=r,this.LuminousIntensity=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new zbe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.MainPlaneAngle),e.push(this.SecondaryPlaneAngle),e.push(this.LuminousIntensity),e}},jbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new jbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Wbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Wbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},qbe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.LightDistributionCurve=i,this.DistributionData=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new qbe(e,t,n,s)}ToTape(){let e=[];return e.push(this.LightDistributionCurve),e.push(this.DistributionData),e}},Ybe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.LightColour=r,this.AmbientIntensity=n,this.Intensity=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Ybe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e}},Xbe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.LightColour=r,this.AmbientIntensity=n,this.Intensity=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Xbe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e}},$be=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.LightColour=r,this.AmbientIntensity=n,this.Intensity=s,this.Orientation=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new $be(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Orientation),e}},Zbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.Name=i,this.LightColour=r,this.AmbientIntensity=n,this.Intensity=s,this.Position=a,this.ColourAppearance=o,this.ColourTemperature=l,this.LuminousFlux=h,this.LightEmissionSource=u,this.LightDistributionDataSource=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Zbe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.ColourAppearance),e.push(this.ColourTemperature),e.push(this.LuminousFlux),e.push(this.LightEmissionSource),e.push(this.LightDistributionDataSource),e}},Kbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.Name=i,this.LightColour=r,this.AmbientIntensity=n,this.Intensity=s,this.Position=a,this.Radius=o,this.ConstantAttenuation=l,this.DistanceAttenuation=h,this.QuadricAttenuation=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Kbe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.Radius),e.push(this.ConstantAttenuation),e.push(this.DistanceAttenuation),e.push(this.QuadricAttenuation),e}},Jbe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.Name=i,this.LightColour=r,this.AmbientIntensity=n,this.Intensity=s,this.Position=a,this.Radius=o,this.ConstantAttenuation=l,this.DistanceAttenuation=h,this.QuadricAttenuation=u,this.Orientation=c,this.ConcentrationExponent=p,this.SpreadAngle=d,this.BeamWidthAngle=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new Jbe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.Radius),e.push(this.ConstantAttenuation),e.push(this.DistanceAttenuation),e.push(this.QuadricAttenuation),e.push(this.Orientation),e.push(this.ConcentrationExponent),e.push(this.SpreadAngle),e.push(this.BeamWidthAngle),e}},Qbe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Pnt=i,this.Dir=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Qbe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Pnt),e.push(this.Dir),e}},exe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.StartPoint=i,this.StartDirection=r,this.SegmentLength=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new exe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e}},txe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.PlacementRelTo=i,this.PlacementMeasuredAlong=r,this.Distance=n,this.Orientation=s,this.CartesianPosition=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new txe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.PlacementMeasuredAlong),e.push(this.Distance),e.push(this.Orientation),e.push(this.CartesianPosition),e}},rxe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Axis=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new rxe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Axis),e}},ixe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.PlacementRelTo=i,this.RelativePlacement=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new ixe(e,t,n,s)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.RelativePlacement),e}},nxe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new nxe(e,t)}ToTape(){return[]}},sxe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Outer=i}static FromTape(e,t,i){let r=0,n=i[r++];return new sxe(e,t,n)}ToTape(){let e=[];return e.push(this.Outer),e}},axe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.SourceCRS=i,this.TargetCRS=r,this.Eastings=n,this.Northings=s,this.OrthogonalHeight=a,this.XAxisAbscissa=o,this.XAxisOrdinate=l,this.Scale=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new axe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.SourceCRS),e.push(this.TargetCRS),e.push(this.Eastings),e.push(this.Northings),e.push(this.OrthogonalHeight),e.push(this.XAxisAbscissa),e.push(this.XAxisOrdinate),e.push(this.Scale),e}},oxe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.MappingSource=i,this.MappingTarget=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new oxe(e,t,n,s)}ToTape(){let e=[];return e.push(this.MappingSource),e.push(this.MappingTarget),e}},lxe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Category=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new lxe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Category),e}},cxe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.MaterialClassifications=i,this.ClassifiedMaterial=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new cxe(e,t,n,s)}ToTape(){let e=[];return e.push(this.MaterialClassifications),e.push(this.ClassifiedMaterial),e}},uxe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Material=n,this.Fraction=s,this.Category=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new uxe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Fraction),e.push(this.Category),e}},hxe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.MaterialConstituents=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new hxe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.MaterialConstituents),e}},pxe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new pxe(e,t)}ToTape(){return[]}},dxe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Representations=n,this.RepresentedMaterial=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new dxe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e.push(this.RepresentedMaterial),e}},fxe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Material=i,this.LayerThickness=r,this.IsVentilated=n,this.Name=s,this.Description=a,this.Category=o,this.Priority=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new fxe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Material),e.push(this.LayerThickness),e.push(this.IsVentilated),e.push(this.Name),e.push(this.Description),e.push(this.Category),e.push(this.Priority),e}},mxe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.MaterialLayers=i,this.LayerSetName=r,this.Description=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new mxe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.MaterialLayers),e.push(this.LayerSetName),e.push(this.Description),e}},gxe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ForLayerSet=i,this.LayerSetDirection=r,this.DirectionSense=n,this.OffsetFromReferenceLine=s,this.ReferenceExtent=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new gxe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ForLayerSet),e.push(this.LayerSetDirection),e.push(this.DirectionSense),e.push(this.OffsetFromReferenceLine),e.push(this.ReferenceExtent),e}},vxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.Material=i,this.LayerThickness=r,this.IsVentilated=n,this.Name=s,this.Description=a,this.Category=o,this.Priority=l,this.OffsetDirection=h,this.OffsetValues=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new vxe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.Material),e.push(this.LayerThickness),e.push(this.IsVentilated),e.push(this.Name),e.push(this.Description),e.push(this.Category),e.push(this.Priority),e.push(this.OffsetDirection),e.push(this.OffsetValues),e}},yxe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Materials=i}static FromTape(e,t,i){let r=0,n=i[r++];return new yxe(e,t,n)}ToTape(){let e=[];return e.push(this.Materials),e}},Exe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Material=n,this.Profile=s,this.Priority=a,this.Category=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new Exe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Profile),e.push(this.Priority),e.push(this.Category),e}},Txe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.MaterialProfiles=n,this.CompositeProfile=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Txe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.MaterialProfiles),e.push(this.CompositeProfile),e}},bxe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.ForProfileSet=i,this.CardinalPoint=r,this.ReferenceExtent=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new bxe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ForProfileSet),e.push(this.CardinalPoint),e.push(this.ReferenceExtent),e}},xxe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ForProfileSet=i,this.CardinalPoint=r,this.ReferenceExtent=n,this.ForProfileEndSet=s,this.CardinalEndPoint=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new xxe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ForProfileSet),e.push(this.CardinalPoint),e.push(this.ReferenceExtent),e.push(this.ForProfileEndSet),e.push(this.CardinalEndPoint),e}},Ixe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Material=n,this.Profile=s,this.Priority=a,this.Category=o,this.OffsetValues=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new Ixe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Profile),e.push(this.Priority),e.push(this.Category),e.push(this.OffsetValues),e}},_xe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Properties=n,this.Material=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new _xe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Properties),e.push(this.Material),e}},Sxe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatingMaterial=n,this.RelatedMaterials=s,this.Expression=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Sxe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingMaterial),e.push(this.RelatedMaterials),e.push(this.Expression),e}},wxe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new wxe(e,t)}ToTape(){return[]}},Rxe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.ValueComponent=i,this.UnitComponent=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Rxe(e,t,n,s)}ToTape(){let e=[];return e.push(this.ValueComponent),e.push(this.UnitComponent),e}},Mxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.NominalDiameter=u,this.NominalLength=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new Mxe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.NominalDiameter),e.push(this.NominalLength),e.push(this.PredefinedType),e}},Dxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.NominalDiameter=p,this.NominalLength=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new Dxe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.NominalLength),e}},Cxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Cxe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Axe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Axe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Oxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Oxe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Pxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Pxe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Nxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Nxe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Lxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.ConstraintGrade=n,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l,this.Benchmark=h,this.ValueSource=u,this.DataValue=c,this.ReferencePath=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new Lxe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e.push(this.Benchmark),e.push(this.ValueSource),e.push(this.DataValue),e.push(this.ReferencePath),e}},Fxe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.ParentProfile=n,this.Operator=s,this.Label=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Fxe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.ParentProfile),e.push(this.Operator),e.push(this.Label),e}},Hxe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Currency=i}static FromTape(e,t,i){let r=0,n=i[r++];return new Hxe(e,t,n)}ToTape(){let e=[];return e.push(this.Currency),e}},Uxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Uxe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Bxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Bxe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},kxe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Dimensions=i,this.UnitType=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new kxe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e}},Gxe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Gxe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e}},Vxe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Vxe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},zxe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.PlacementRelTo=i}static FromTape(e,t,i){let r=0,n=i[r++];return new zxe(e,t,n)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e}},jxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.ConstraintGrade=n,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l,this.BenchmarkValues=h,this.LogicalAggregator=u,this.ObjectiveQualifier=c,this.UserDefinedQualifier=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new jxe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e.push(this.BenchmarkValues),e.push(this.LogicalAggregator),e.push(this.ObjectiveQualifier),e.push(this.UserDefinedQualifier),e}},Wxe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.TheActor=o,this.PredefinedType=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new Wxe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheActor),e.push(this.PredefinedType),e}},qxe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.BasisCurve=i}static FromTape(e,t,i){let r=0,n=i[r++];return new qxe(e,t,n)}ToTape(){let e=[];return e.push(this.BasisCurve),e}},Yxe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.BasisCurve=i,this.Distance=r,this.SelfIntersect=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Yxe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.Distance),e.push(this.SelfIntersect),e}},Xxe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.BasisCurve=i,this.Distance=r,this.SelfIntersect=n,this.RefDirection=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Xxe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.Distance),e.push(this.SelfIntersect),e.push(this.RefDirection),e}},$xe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.BasisCurve=i,this.OffsetValues=r,this.Tag=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new $xe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.OffsetValues),e.push(this.Tag),e}},Zxe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.CfsFaces=i}static FromTape(e,t,i){let r=0,n=i[r++];return new Zxe(e,t,n)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},Kxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Kxe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Jxe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Jxe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Qxe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Identification=i,this.Name=r,this.Description=n,this.Roles=s,this.Addresses=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Qxe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.Roles),e.push(this.Addresses),e}},eIe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatingOrganization=n,this.RelatedOrganizations=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new eIe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingOrganization),e.push(this.RelatedOrganizations),e}},tIe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.LateralAxisDirection=i,this.VerticalAxisDirection=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new tIe(e,t,n,s)}ToTape(){let e=[];return e.push(this.LateralAxisDirection),e.push(this.VerticalAxisDirection),e}},rIe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.EdgeStart=i,this.EdgeEnd=r,this.EdgeElement=n,this.Orientation=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new rIe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e.push(this.EdgeElement),e.push(this.Orientation),e}},iIe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Segments=i,this.SelfIntersect=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new iIe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},nIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new nIe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},sIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new sIe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},aIe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.OwningUser=i,this.OwningApplication=r,this.State=n,this.ChangeAction=s,this.LastModifiedDate=a,this.LastModifyingUser=o,this.LastModifyingApplication=l,this.CreationDate=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new aIe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.OwningUser),e.push(this.OwningApplication),e.push(this.State),e.push(this.ChangeAction),e.push(this.LastModifiedDate),e.push(this.LastModifyingUser),e.push(this.LastModifyingApplication),e.push(this.CreationDate),e}},oIe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new oIe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e}},lIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.EdgeList=i}static FromTape(e,t,i){let r=0,n=i[r++];return new lIe(e,t,n)}ToTape(){let e=[];return e.push(this.EdgeList),e}},cIe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.BasisSurface=i,this.ReferenceCurve=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new cIe(e,t,n,s)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.ReferenceCurve),e}},uIe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LifeCyclePhase=l,this.PredefinedType=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new uIe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LifeCyclePhase),e.push(this.PredefinedType),e}},hIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.OperationType=a,this.PanelPosition=o,this.FrameDepth=l,this.FrameThickness=h,this.ShapeAspectStyle=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new hIe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.OperationType),e.push(this.PanelPosition),e.push(this.FrameDepth),e.push(this.FrameThickness),e.push(this.ShapeAspectStyle),e}},pIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=h,this.LongDescription=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new pIe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},dIe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Identification=i,this.FamilyName=r,this.GivenName=n,this.MiddleNames=s,this.PrefixTitles=a,this.SuffixTitles=o,this.Roles=l,this.Addresses=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new dIe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Identification),e.push(this.FamilyName),e.push(this.GivenName),e.push(this.MiddleNames),e.push(this.PrefixTitles),e.push(this.SuffixTitles),e.push(this.Roles),e.push(this.Addresses),e}},fIe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.ThePerson=i,this.TheOrganization=r,this.Roles=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new fIe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ThePerson),e.push(this.TheOrganization),e.push(this.Roles),e}},mIe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.HasQuantities=n,this.Discrimination=s,this.Quality=a,this.Usage=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new mIe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.HasQuantities),e.push(this.Discrimination),e.push(this.Quality),e.push(this.Usage),e}},gIe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Name=i,this.Description=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new gIe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},vIe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Unit=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new vIe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e}},yIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u,this.ConstructionType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new yIe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e.push(this.ConstructionType),e}},EIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new EIe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},TIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new TIe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},bIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new bIe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},xIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new xIe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new IIe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},_Ie=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.RepeatS=i,this.RepeatT=r,this.Mode=n,this.TextureTransform=s,this.Parameter=a,this.Width=o,this.Height=l,this.ColourComponents=h,this.Pixel=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new _Ie(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.Width),e.push(this.Height),e.push(this.ColourComponents),e.push(this.Pixel),e}},SIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Location=i}static FromTape(e,t,i){let r=0,n=i[r++];return new SIe(e,t,n)}ToTape(){let e=[];return e.push(this.Location),e}},wIe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.SizeInX=i,this.SizeInY=r,this.Placement=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new wIe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SizeInX),e.push(this.SizeInY),e.push(this.Placement),e}},RIe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.SizeInX=i,this.SizeInY=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new RIe(e,t,n,s)}ToTape(){let e=[];return e.push(this.SizeInX),e.push(this.SizeInY),e}},MIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Position=i}static FromTape(e,t,i){let r=0,n=i[r++];return new MIe(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},DIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new DIe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},CIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new CIe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},AIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new AIe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},OIe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new OIe(e,t)}ToTape(){return[]}},PIe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.BasisCurve=i,this.PointParameter=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new PIe(e,t,n,s)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.PointParameter),e}},NIe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.BasisSurface=i,this.PointParameterU=r,this.PointParameterV=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new NIe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.PointParameterU),e.push(this.PointParameterV),e}},LIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Polygon=i}static FromTape(e,t,i){let r=0,n=i[r++];return new LIe(e,t,n)}ToTape(){let e=[];return e.push(this.Polygon),e}},FIe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.BaseSurface=i,this.AgreementFlag=r,this.Position=n,this.PolygonalBoundary=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new FIe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e.push(this.Position),e.push(this.PolygonalBoundary),e}},HIe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Coordinates=i,this.Closed=r,this.Faces=n,this.PnIndex=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new HIe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Coordinates),e.push(this.Closed),e.push(this.Faces),e.push(this.PnIndex),e}},UIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Points=i}static FromTape(e,t,i){let r=0,n=i[r++];return new UIe(e,t,n)}ToTape(){let e=[];return e.push(this.Points),e}},BIe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new BIe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},kIe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new kIe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},GIe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.Purpose=i,this.Description=r,this.UserDefinedPurpose=n,this.InternalLocation=s,this.AddressLines=a,this.PostalBox=o,this.Town=l,this.Region=h,this.PostalCode=u,this.Country=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new GIe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e.push(this.InternalLocation),e.push(this.AddressLines),e.push(this.PostalBox),e.push(this.Town),e.push(this.Region),e.push(this.PostalCode),e.push(this.Country),e}},VIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new VIe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},zIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new zIe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},jIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new jIe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},WIe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new WIe(e,t)}ToTape(){return[]}},qIe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new qIe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},YIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new YIe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},XIe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new XIe(e,t)}ToTape(){return[]}},$Ie=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.AssignedItems=n,this.Identifier=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new $Ie(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AssignedItems),e.push(this.Identifier),e}},ZIe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.AssignedItems=n,this.Identifier=s,this.LayerOn=a,this.LayerFrozen=o,this.LayerBlocked=l,this.LayerStyles=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new ZIe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AssignedItems),e.push(this.Identifier),e.push(this.LayerOn),e.push(this.LayerFrozen),e.push(this.LayerBlocked),e.push(this.LayerStyles),e}},KIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new KIe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},JIe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Styles=i}static FromTape(e,t,i){let r=0,n=i[r++];return new JIe(e,t,n)}ToTape(){let e=[];return e.push(this.Styles),e}},QIe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.PredefinedType=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new QIe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.PredefinedType),e}},e_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ProcessType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new e_e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e}},t_e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new t_e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e}},r_e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new r_e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},i_e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Representations=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new i_e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e}},n_e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Representations=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new n_e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e}},s_e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new s_e(e,t,n,s)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e}},a_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Properties=n,this.ProfileDefinition=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new a_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Properties),e.push(this.ProfileDefinition),e}},o_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=h,this.UnitsInContext=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new o_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},l_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=h,this.UnitsInContext=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new l_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},c_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=h,this.LongDescription=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new c_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},u_e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.GeodeticDatum=n,this.VerticalDatum=s,this.MapProjection=a,this.MapZone=o,this.MapUnit=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new u_e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.GeodeticDatum),e.push(this.VerticalDatum),e.push(this.MapProjection),e.push(this.MapZone),e.push(this.MapUnit),e}},h_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new h_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},p_e=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Name=i,this.Description=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new p_e(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},d_e=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new d_e(e,t)}ToTape(){return[]}},f_e=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.UpperBoundValue=n,this.LowerBoundValue=s,this.Unit=a,this.SetPointValue=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new f_e(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.UpperBoundValue),e.push(this.LowerBoundValue),e.push(this.Unit),e.push(this.SetPointValue),e}},m_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new m_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},g_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.DependingProperty=n,this.DependantProperty=s,this.Expression=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new g_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.DependingProperty),e.push(this.DependantProperty),e.push(this.Expression),e}},v_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.EnumerationValues=n,this.EnumerationReference=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new v_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.EnumerationValues),e.push(this.EnumerationReference),e}},y_e=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.EnumerationValues=r,this.Unit=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new y_e(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.EnumerationValues),e.push(this.Unit),e}},E_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.ListValues=n,this.Unit=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new E_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ListValues),e.push(this.Unit),e}},T_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.UsageName=n,this.PropertyReference=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new T_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.UsageName),e.push(this.PropertyReference),e}},b_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.HasProperties=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new b_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.HasProperties),e}},x_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new x_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},I_e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.TemplateType=a,this.ApplicableEntity=o,this.HasPropertyTemplates=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new I_e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.TemplateType),e.push(this.ApplicableEntity),e.push(this.HasPropertyTemplates),e}},__e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.NominalValue=n,this.Unit=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new __e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.NominalValue),e.push(this.Unit),e}},S_e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.DefiningValues=n,this.DefinedValues=s,this.Expression=a,this.DefiningUnit=o,this.DefinedUnit=l,this.CurveInterpolation=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new S_e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.DefiningValues),e.push(this.DefinedValues),e.push(this.Expression),e.push(this.DefiningUnit),e.push(this.DefinedUnit),e.push(this.CurveInterpolation),e}},w_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new w_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},R_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new R_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},M_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new M_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},D_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new D_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},C_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new C_e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},A_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new A_e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},O_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.ProxyType=h,this.Tag=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new O_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.ProxyType),e.push(this.Tag),e}},P_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new P_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},N_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new N_e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},L_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Unit=n,this.AreaValue=s,this.Formula=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new L_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.AreaValue),e.push(this.Formula),e}},F_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Unit=n,this.CountValue=s,this.Formula=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new F_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.CountValue),e.push(this.Formula),e}},H_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Unit=n,this.LengthValue=s,this.Formula=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new H_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.LengthValue),e.push(this.Formula),e}},U_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new U_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},B_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Unit=n,this.TimeValue=s,this.Formula=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new B_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.TimeValue),e.push(this.Formula),e}},k_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Unit=n,this.VolumeValue=s,this.Formula=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new k_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.VolumeValue),e.push(this.Formula),e}},G_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.Unit=n,this.WeightValue=s,this.Formula=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new G_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.WeightValue),e.push(this.Formula),e}},V_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new V_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},z_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new z_e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},j_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new j_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},W_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new W_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},q_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new q_e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Y_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Y_e(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},X_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.Degree=i,this.ControlPointsList=r,this.CurveForm=n,this.ClosedCurve=s,this.SelfIntersect=a,this.KnotMultiplicities=o,this.Knots=l,this.KnotSpec=h,this.WeightsData=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new X_e(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e.push(this.KnotMultiplicities),e.push(this.Knots),e.push(this.KnotSpec),e.push(this.WeightsData),e}},$_e=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.UDegree=i,this.VDegree=r,this.ControlPointsList=n,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l,this.UMultiplicities=h,this.VMultiplicities=u,this.UKnots=c,this.VKnots=p,this.KnotSpec=d,this.WeightsData=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new $_e(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e.push(this.UMultiplicities),e.push(this.VMultiplicities),e.push(this.UKnots),e.push(this.VKnots),e.push(this.KnotSpec),e.push(this.WeightsData),e}},Z_e=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.XDim=s,this.YDim=a,this.WallThickness=o,this.InnerFilletRadius=l,this.OuterFilletRadius=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new Z_e(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e.push(this.WallThickness),e.push(this.InnerFilletRadius),e.push(this.OuterFilletRadius),e}},K_e=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.XDim=s,this.YDim=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new K_e(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e}},J_e=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Position=i,this.XLength=r,this.YLength=n,this.Height=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new J_e(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Position),e.push(this.XLength),e.push(this.YLength),e.push(this.Height),e}},Q_e=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.BasisSurface=i,this.U1=r,this.V1=n,this.U2=s,this.V2=a,this.Usense=o,this.Vsense=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new Q_e(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.U1),e.push(this.V1),e.push(this.U2),e.push(this.V2),e.push(this.Usense),e.push(this.Vsense),e}},eSe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.RecurrenceType=i,this.DayComponent=r,this.WeekdayComponent=n,this.MonthComponent=s,this.Position=a,this.Interval=o,this.Occurrences=l,this.TimePeriods=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new eSe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.RecurrenceType),e.push(this.DayComponent),e.push(this.WeekdayComponent),e.push(this.MonthComponent),e.push(this.Position),e.push(this.Interval),e.push(this.Occurrences),e.push(this.TimePeriods),e}},tSe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.TypeIdentifier=i,this.AttributeIdentifier=r,this.InstanceName=n,this.ListPositions=s,this.InnerReference=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new tSe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.TypeIdentifier),e.push(this.AttributeIdentifier),e.push(this.InstanceName),e.push(this.ListPositions),e.push(this.InnerReference),e}},rSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=h,this.RestartDistance=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new rSe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.RestartDistance),e}},iSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.StartTime=n,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=h,this.TimeStep=u,this.Values=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new iSe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e.push(this.TimeStep),e.push(this.Values),e}},nSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.TotalCrossSectionArea=i,this.SteelGrade=r,this.BarSurface=n,this.EffectiveDepth=s,this.NominalBarDiameter=a,this.BarCount=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new nSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.TotalCrossSectionArea),e.push(this.SteelGrade),e.push(this.BarSurface),e.push(this.EffectiveDepth),e.push(this.NominalBarDiameter),e.push(this.BarCount),e}},sSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.DefinitionType=a,this.ReinforcementSectionDefinitions=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new sSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.DefinitionType),e.push(this.ReinforcementSectionDefinitions),e}},aSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.SteelGrade=u,this.NominalDiameter=c,this.CrossSectionArea=p,this.BarLength=d,this.PredefinedType=f,this.BarSurface=m}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++];return new aSe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.BarLength),e.push(this.PredefinedType),e.push(this.BarSurface),e}},oSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.NominalDiameter=p,this.CrossSectionArea=d,this.BarLength=f,this.BarSurface=m,this.BendingShapeCode=g,this.BendingParameters=y}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++];return new oSe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.BarLength),e.push(this.BarSurface),e.push(this.BendingShapeCode),e.push(this.BendingParameters),e}},lSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.SteelGrade=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new lSe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e}},cSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new cSe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},uSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.SteelGrade=u,this.MeshLength=c,this.MeshWidth=p,this.LongitudinalBarNominalDiameter=d,this.TransverseBarNominalDiameter=f,this.LongitudinalBarCrossSectionArea=m,this.TransverseBarCrossSectionArea=g,this.LongitudinalBarSpacing=y,this.TransverseBarSpacing=v,this.PredefinedType=T}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++],b=i[r++];return new uSe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.MeshLength),e.push(this.MeshWidth),e.push(this.LongitudinalBarNominalDiameter),e.push(this.TransverseBarNominalDiameter),e.push(this.LongitudinalBarCrossSectionArea),e.push(this.TransverseBarCrossSectionArea),e.push(this.LongitudinalBarSpacing),e.push(this.TransverseBarSpacing),e.push(this.PredefinedType),e}},hSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.MeshLength=p,this.MeshWidth=d,this.LongitudinalBarNominalDiameter=f,this.TransverseBarNominalDiameter=m,this.LongitudinalBarCrossSectionArea=g,this.TransverseBarCrossSectionArea=y,this.LongitudinalBarSpacing=v,this.TransverseBarSpacing=T,this.BendingShapeCode=x,this.BendingParameters=b}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++],b=i[r++],E=i[r++],_=i[r++];return new hSe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b,E,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.MeshLength),e.push(this.MeshWidth),e.push(this.LongitudinalBarNominalDiameter),e.push(this.TransverseBarNominalDiameter),e.push(this.LongitudinalBarCrossSectionArea),e.push(this.TransverseBarCrossSectionArea),e.push(this.LongitudinalBarSpacing),e.push(this.TransverseBarSpacing),e.push(this.BendingShapeCode),e.push(this.BendingParameters),e}},pSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingObject=a,this.RelatedObjects=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new pSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingObject),e.push(this.RelatedObjects),e}},dSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new dSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e}},fSe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingActor=l,this.ActingRole=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new fSe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingActor),e.push(this.ActingRole),e}},mSe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingControl=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new mSe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingControl),e}},gSe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingGroup=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new gSe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingGroup),e}},vSe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingGroup=l,this.Factor=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new vSe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingGroup),e.push(this.Factor),e}},ySe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingProcess=l,this.QuantityInProcess=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new ySe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingProcess),e.push(this.QuantityInProcess),e}},ESe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingProduct=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new ESe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingProduct),e}},TSe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingResource=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new TSe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingResource),e}},bSe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new bSe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e}},xSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingApproval=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new xSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingApproval),e}},ISe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingClassification=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new ISe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingClassification),e}},_Se=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.Intent=o,this.RelatingConstraint=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new _Se(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.Intent),e.push(this.RelatingConstraint),e}},SSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingDocument=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new SSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingDocument),e}},wSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingLibrary=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new wSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingLibrary),e}},RSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingMaterial=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new RSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingMaterial),e}},MSe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new MSe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},DSe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new DSe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e}},CSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l,this.RelatingPriorities=h,this.RelatedPriorities=u,this.RelatedConnectionType=c,this.RelatingConnectionType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new CSe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.RelatingPriorities),e.push(this.RelatedPriorities),e.push(this.RelatedConnectionType),e.push(this.RelatingConnectionType),e}},ASe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingPort=a,this.RelatedElement=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new ASe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPort),e.push(this.RelatedElement),e}},OSe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingPort=a,this.RelatedPort=o,this.RealizingElement=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new OSe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPort),e.push(this.RelatedPort),e.push(this.RealizingElement),e}},PSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingElement=a,this.RelatedStructuralActivity=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new PSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedStructuralActivity),e}},NSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingStructuralMember=a,this.RelatedStructuralConnection=o,this.AppliedCondition=l,this.AdditionalConditions=h,this.SupportedLength=u,this.ConditionCoordinateSystem=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new NSe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingStructuralMember),e.push(this.RelatedStructuralConnection),e.push(this.AppliedCondition),e.push(this.AdditionalConditions),e.push(this.SupportedLength),e.push(this.ConditionCoordinateSystem),e}},LSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingStructuralMember=a,this.RelatedStructuralConnection=o,this.AppliedCondition=l,this.AdditionalConditions=h,this.SupportedLength=u,this.ConditionCoordinateSystem=c,this.ConnectionConstraint=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new LSe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingStructuralMember),e.push(this.RelatedStructuralConnection),e.push(this.AppliedCondition),e.push(this.AdditionalConditions),e.push(this.SupportedLength),e.push(this.ConditionCoordinateSystem),e.push(this.ConnectionConstraint),e}},FSe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l,this.RealizingElements=h,this.ConnectionType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new FSe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.RealizingElements),e.push(this.ConnectionType),e}},HSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedElements=a,this.RelatingStructure=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new HSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedElements),e.push(this.RelatingStructure),e}},USe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingBuildingElement=a,this.RelatedCoverings=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new USe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingBuildingElement),e.push(this.RelatedCoverings),e}},BSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedCoverings=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new BSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedCoverings),e}},kSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingContext=a,this.RelatedDefinitions=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new kSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingContext),e.push(this.RelatedDefinitions),e}},GSe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new GSe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},VSe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new VSe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},zSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingObject=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new zSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingObject),e}},jSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingPropertyDefinition=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new jSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingPropertyDefinition),e}},WSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedPropertySets=a,this.RelatingTemplate=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new WSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedPropertySets),e.push(this.RelatingTemplate),e}},qSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingType=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new qSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingType),e}},YSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingOpeningElement=a,this.RelatedBuildingElement=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new YSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingOpeningElement),e.push(this.RelatedBuildingElement),e}},XSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedControlElements=a,this.RelatingFlowElement=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new XSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedControlElements),e.push(this.RelatingFlowElement),e}},$Se=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingElement=a,this.RelatedElement=o,this.InterferenceGeometry=l,this.InterferenceType=h,this.ImpliedOrder=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new $Se(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.InterferenceGeometry),e.push(this.InterferenceType),e.push(this.ImpliedOrder),e}},ZSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingObject=a,this.RelatedObjects=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new ZSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingObject),e.push(this.RelatedObjects),e}},KSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingPositioningElement=a,this.RelatedProducts=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new KSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPositioningElement),e.push(this.RelatedProducts),e}},JSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingElement=a,this.RelatedFeatureElement=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new JSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedFeatureElement),e}},QSe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatedElements=a,this.RelatingStructure=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new QSe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedElements),e.push(this.RelatingStructure),e}},ewe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingProcess=a,this.RelatedProcess=o,this.TimeLag=l,this.SequenceType=h,this.UserDefinedSequenceType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new ewe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingProcess),e.push(this.RelatedProcess),e.push(this.TimeLag),e.push(this.SequenceType),e.push(this.UserDefinedSequenceType),e}},twe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingSystem=a,this.RelatedBuildings=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new twe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSystem),e.push(this.RelatedBuildings),e}},rwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=h,this.InternalOrExternalBoundary=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new rwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e}},iwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=h,this.InternalOrExternalBoundary=u,this.ParentBoundary=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new iwe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e.push(this.ParentBoundary),e}},nwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=h,this.InternalOrExternalBoundary=u,this.ParentBoundary=c,this.CorrespondingBoundary=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new nwe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e.push(this.ParentBoundary),e.push(this.CorrespondingBoundary),e}},swe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.RelatingBuildingElement=a,this.RelatedOpeningElement=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new swe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingBuildingElement),e.push(this.RelatedOpeningElement),e}},awe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new awe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},owe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Transition=i,this.SameSense=r,this.ParentCurve=n,this.ParamLength=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new owe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Transition),e.push(this.SameSense),e.push(this.ParentCurve),e.push(this.ParamLength),e}},lwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ContextOfItems=i,this.RepresentationIdentifier=r,this.RepresentationType=n,this.Items=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new lwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},cwe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.ContextIdentifier=i,this.ContextType=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new cwe(e,t,n,s)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e}},uwe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new uwe(e,t)}ToTape(){return[]}},hwe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.MappingOrigin=i,this.MappedRepresentation=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new hwe(e,t,n,s)}ToTape(){let e=[];return e.push(this.MappingOrigin),e.push(this.MappedRepresentation),e}},pwe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new pwe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e}},dwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatedResourceObjects=n,this.RelatingApproval=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new dwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatedResourceObjects),e.push(this.RelatingApproval),e}},fwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.RelatingConstraint=n,this.RelatedResourceObjects=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new fwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingConstraint),e.push(this.RelatedResourceObjects),e}},mwe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Name=i,this.Description=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new mwe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},gwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T){this.expressID=e,this.type=t,this.Name=i,this.DataOrigin=r,this.UserDefinedDataOrigin=n,this.ScheduleWork=s,this.ScheduleUsage=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.ScheduleContour=h,this.LevelingDelay=u,this.IsOverAllocated=c,this.StatusTime=p,this.ActualWork=d,this.ActualUsage=f,this.ActualStart=m,this.ActualFinish=g,this.RemainingWork=y,this.RemainingUsage=v,this.Completion=T}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++],b=i[r++];return new gwe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.ScheduleWork),e.push(this.ScheduleUsage),e.push(this.ScheduleStart),e.push(this.ScheduleFinish),e.push(this.ScheduleContour),e.push(this.LevelingDelay),e.push(this.IsOverAllocated),e.push(this.StatusTime),e.push(this.ActualWork),e.push(this.ActualUsage),e.push(this.ActualStart),e.push(this.ActualFinish),e.push(this.RemainingWork),e.push(this.RemainingUsage),e.push(this.Completion),e}},vwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.SweptArea=i,this.Position=r,this.Axis=n,this.Angle=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new vwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Axis),e.push(this.Angle),e}},ywe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.SweptArea=i,this.Position=r,this.Axis=n,this.Angle=s,this.EndSweptArea=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new ywe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Axis),e.push(this.Angle),e.push(this.EndSweptArea),e}},Ewe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Position=i,this.Height=r,this.BottomRadius=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Ewe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Height),e.push(this.BottomRadius),e}},Twe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Position=i,this.Height=r,this.Radius=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Twe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Height),e.push(this.Radius),e}},bwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new bwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},xwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new xwe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Iwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Iwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},_we=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.XDim=s,this.YDim=a,this.RoundingRadius=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new _we(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e.push(this.RoundingRadius),e}},Swe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Dimensions=i,this.UnitType=r,this.Prefix=n,this.Name=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Swe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Prefix),e.push(this.Name),e}},wwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new wwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Rwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Rwe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Mwe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.DataOrigin=r,this.UserDefinedDataOrigin=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Mwe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e}},Dwe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Curve3D=i,this.AssociatedGeometry=r,this.MasterRepresentation=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Dwe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},Cwe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.SectionType=i,this.StartProfile=r,this.EndProfile=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Cwe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SectionType),e.push(this.StartProfile),e.push(this.EndProfile),e}},Awe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.LongitudinalStartPosition=i,this.LongitudinalEndPosition=r,this.TransversePosition=n,this.ReinforcementRole=s,this.SectionDefinition=a,this.CrossSectionReinforcementDefinitions=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new Awe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.LongitudinalStartPosition),e.push(this.LongitudinalEndPosition),e.push(this.TransversePosition),e.push(this.ReinforcementRole),e.push(this.SectionDefinition),e.push(this.CrossSectionReinforcementDefinitions),e}},Owe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Directrix=i,this.CrossSections=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new Owe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.CrossSections),e}},Pwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Directrix=i,this.CrossSections=r,this.CrossSectionPositions=n,this.FixedAxisVertical=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Pwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.CrossSections),e.push(this.CrossSectionPositions),e.push(this.FixedAxisVertical),e}},Nwe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.SpineCurve=i,this.CrossSections=r,this.CrossSectionPositions=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new Nwe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SpineCurve),e.push(this.CrossSections),e.push(this.CrossSectionPositions),e}},Lwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Lwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Fwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Fwe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Hwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Hwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Uwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Uwe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Bwe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.ShapeRepresentations=i,this.Name=r,this.Description=n,this.ProductDefinitional=s,this.PartOfProductDefinitionShape=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new Bwe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.ShapeRepresentations),e.push(this.Name),e.push(this.Description),e.push(this.ProductDefinitional),e.push(this.PartOfProductDefinitionShape),e}},kwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ContextOfItems=i,this.RepresentationIdentifier=r,this.RepresentationType=n,this.Items=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new kwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},Gwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ContextOfItems=i,this.RepresentationIdentifier=r,this.RepresentationType=n,this.Items=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Gwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},Vwe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.SbsmBoundary=i}static FromTape(e,t,i){let r=0,n=i[r++];return new Vwe(e,t,n)}ToTape(){let e=[];return e.push(this.SbsmBoundary),e}},zwe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Name=i,this.Description=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new zwe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},jwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.TemplateType=a,this.PrimaryMeasureType=o,this.SecondaryMeasureType=l,this.Enumerators=h,this.PrimaryUnit=u,this.SecondaryUnit=c,this.Expression=p,this.AccessState=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new jwe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.TemplateType),e.push(this.PrimaryMeasureType),e.push(this.SecondaryMeasureType),e.push(this.Enumerators),e.push(this.PrimaryUnit),e.push(this.SecondaryUnit),e.push(this.Expression),e.push(this.AccessState),e}},Wwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u,this.RefLatitude=c,this.RefLongitude=p,this.RefElevation=d,this.LandTitleNumber=f,this.SiteAddress=m}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++];return new Wwe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.RefLatitude),e.push(this.RefLongitude),e.push(this.RefElevation),e.push(this.LandTitleNumber),e.push(this.SiteAddress),e}},qwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new qwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Ywe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Ywe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Xwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Xwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},$we=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new $we(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Zwe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.SlippageX=r,this.SlippageY=n,this.SlippageZ=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new Zwe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.SlippageX),e.push(this.SlippageY),e.push(this.SlippageZ),e}},Kwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new Kwe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Jwe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new Jwe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Qwe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new Qwe(e,t)}ToTape(){return[]}},eRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u,this.PredefinedType=c,this.ElevationWithFlooring=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new eRe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e.push(this.ElevationWithFlooring),e}},tRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new tRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},rRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new rRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},iRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.LongName=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new iRe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.LongName),e}},nRe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new nRe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e}},sRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new sRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},aRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.CompositionType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new aRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},oRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new oRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},lRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new lRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.PredefinedType),e}},cRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.LongName=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new cRe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.LongName),e}},uRe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Position=i,this.Radius=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new uRe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},hRe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Position=i,this.Radius=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new hRe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},pRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new pRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},dRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new dRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},fRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new fRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},mRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.NumberOfRisers=u,this.NumberOfTreads=c,this.RiserHeight=p,this.TreadLength=d,this.PredefinedType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new mRe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.NumberOfRisers),e.push(this.NumberOfTreads),e.push(this.RiserHeight),e.push(this.TreadLength),e.push(this.PredefinedType),e}},gRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new gRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},vRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new vRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},yRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.DestabilizingLoad=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new yRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e}},ERe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new ERe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},TRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.OrientationOf2DPlane=l,this.LoadedBy=h,this.HasResults=u,this.SharedPlacement=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new TRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.OrientationOf2DPlane),e.push(this.LoadedBy),e.push(this.HasResults),e.push(this.SharedPlacement),e}},bRe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new bRe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e}},xRe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new xRe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.DestabilizingLoad=c,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new IRe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},_Re=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=h,this.Axis=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new _Re(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e.push(this.Axis),e}},SRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=h,this.Axis=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new SRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Axis),e}},wRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=h,this.Axis=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new wRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Axis),e}},RRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new RRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.PredefinedType),e}},MRe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new MRe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},DRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.DestabilizingLoad=c,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new DRe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},CRe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new CRe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},ARe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.ActionType=l,this.ActionSource=h,this.Coefficient=u,this.Purpose=c,this.SelfWeightCoefficients=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new ARe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.ActionType),e.push(this.ActionSource),e.push(this.Coefficient),e.push(this.Purpose),e.push(this.SelfWeightCoefficients),e}},ORe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Values=r,this.Locations=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new ORe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Values),e.push(this.Locations),e}},PRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.ActionType=l,this.ActionSource=h,this.Coefficient=u,this.Purpose=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new PRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.ActionType),e.push(this.ActionSource),e.push(this.Coefficient),e.push(this.Purpose),e}},NRe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.LinearForceX=r,this.LinearForceY=n,this.LinearForceZ=s,this.LinearMomentX=a,this.LinearMomentY=o,this.LinearMomentZ=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new NRe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LinearForceX),e.push(this.LinearForceY),e.push(this.LinearForceZ),e.push(this.LinearMomentX),e.push(this.LinearMomentY),e.push(this.LinearMomentZ),e}},LRe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new LRe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},FRe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.PlanarForceX=r,this.PlanarForceY=n,this.PlanarForceZ=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new FRe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.PlanarForceX),e.push(this.PlanarForceY),e.push(this.PlanarForceZ),e}},HRe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.DisplacementX=r,this.DisplacementY=n,this.DisplacementZ=s,this.RotationalDisplacementRX=a,this.RotationalDisplacementRY=o,this.RotationalDisplacementRZ=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new HRe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DisplacementX),e.push(this.DisplacementY),e.push(this.DisplacementZ),e.push(this.RotationalDisplacementRX),e.push(this.RotationalDisplacementRY),e.push(this.RotationalDisplacementRZ),e}},URe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Name=i,this.DisplacementX=r,this.DisplacementY=n,this.DisplacementZ=s,this.RotationalDisplacementRX=a,this.RotationalDisplacementRY=o,this.RotationalDisplacementRZ=l,this.Distortion=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new URe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DisplacementX),e.push(this.DisplacementY),e.push(this.DisplacementZ),e.push(this.RotationalDisplacementRX),e.push(this.RotationalDisplacementRY),e.push(this.RotationalDisplacementRZ),e.push(this.Distortion),e}},BRe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=i,this.ForceX=r,this.ForceY=n,this.ForceZ=s,this.MomentX=a,this.MomentY=o,this.MomentZ=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new BRe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.ForceX),e.push(this.ForceY),e.push(this.ForceZ),e.push(this.MomentX),e.push(this.MomentY),e.push(this.MomentZ),e}},kRe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Name=i,this.ForceX=r,this.ForceY=n,this.ForceZ=s,this.MomentX=a,this.MomentY=o,this.MomentZ=l,this.WarpingMoment=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new kRe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.ForceX),e.push(this.ForceY),e.push(this.ForceZ),e.push(this.MomentX),e.push(this.MomentY),e.push(this.MomentZ),e.push(this.WarpingMoment),e}},GRe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Name=i}static FromTape(e,t,i){let r=0,n=i[r++];return new GRe(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},VRe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.DeltaTConstant=r,this.DeltaTY=n,this.DeltaTZ=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new VRe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DeltaTConstant),e.push(this.DeltaTY),e.push(this.DeltaTZ),e}},zRe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new zRe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},jRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.DestabilizingLoad=c,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new jRe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},WRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.DestabilizingLoad=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new WRe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e}},qRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=h,this.ConditionCoordinateSystem=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new qRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e.push(this.ConditionCoordinateSystem),e}},YRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new YRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},XRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new XRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},$Re=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.TheoryType=o,this.ResultForLoadGroup=l,this.IsLinear=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new $Re(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheoryType),e.push(this.ResultForLoadGroup),e.push(this.IsLinear),e}},ZRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.DestabilizingLoad=c,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new ZRe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},KRe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new KRe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e}},JRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=h,this.Thickness=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new JRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Thickness),e}},QRe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=h,this.Thickness=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new QRe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Thickness),e}},eMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=h,this.GlobalOrLocal=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new eMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.PredefinedType),e}},tMe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ContextOfItems=i,this.RepresentationIdentifier=r,this.RepresentationType=n,this.Items=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new tMe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},rMe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Item=i,this.Styles=r,this.Name=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new rMe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Item),e.push(this.Styles),e.push(this.Name),e}},iMe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ContextOfItems=i,this.RepresentationIdentifier=r,this.RepresentationType=n,this.Items=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new iMe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},nMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=h,this.BaseCosts=u,this.BaseQuantity=c,this.PredefinedType=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new nMe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},sMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u,this.BaseCosts=c,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new sMe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},aMe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.EdgeStart=i,this.EdgeEnd=r,this.ParentEdge=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new aMe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e.push(this.ParentEdge),e}},oMe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new oMe(e,t)}ToTape(){return[]}},lMe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Curve3D=i,this.AssociatedGeometry=r,this.MasterRepresentation=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new lMe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},cMe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.SweptArea=i,this.Position=r,this.Directrix=n,this.StartParam=s,this.EndParam=a,this.ReferenceSurface=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new cMe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Directrix),e.push(this.StartParam),e.push(this.EndParam),e.push(this.ReferenceSurface),e}},uMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new uMe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},hMe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.SweptCurve=i,this.Position=r,this.ExtrudedDirection=n,this.Depth=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new hMe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e.push(this.ExtrudedDirection),e.push(this.Depth),e}},pMe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.SweptCurve=i,this.Position=r,this.AxisPosition=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new pMe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e.push(this.AxisPosition),e}},dMe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.Name=i,this.SurfaceReinforcement1=r,this.SurfaceReinforcement2=n,this.ShearReinforcement=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new dMe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.SurfaceReinforcement1),e.push(this.SurfaceReinforcement2),e.push(this.ShearReinforcement),e}},fMe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Side=r,this.Styles=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new fMe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Side),e.push(this.Styles),e}},mMe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.DiffuseTransmissionColour=i,this.DiffuseReflectionColour=r,this.TransmissionColour=n,this.ReflectanceColour=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new mMe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.DiffuseTransmissionColour),e.push(this.DiffuseReflectionColour),e.push(this.TransmissionColour),e.push(this.ReflectanceColour),e}},gMe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.RefractionIndex=i,this.DispersionFactor=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new gMe(e,t,n,s)}ToTape(){let e=[];return e.push(this.RefractionIndex),e.push(this.DispersionFactor),e}},vMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.SurfaceColour=i,this.Transparency=r,this.DiffuseColour=n,this.TransmissionColour=s,this.DiffuseTransmissionColour=a,this.ReflectionColour=o,this.SpecularColour=l,this.SpecularHighlight=h,this.ReflectanceMethod=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new vMe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.SurfaceColour),e.push(this.Transparency),e.push(this.DiffuseColour),e.push(this.TransmissionColour),e.push(this.DiffuseTransmissionColour),e.push(this.ReflectionColour),e.push(this.SpecularColour),e.push(this.SpecularHighlight),e.push(this.ReflectanceMethod),e}},yMe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.SurfaceColour=i,this.Transparency=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new yMe(e,t,n,s)}ToTape(){let e=[];return e.push(this.SurfaceColour),e.push(this.Transparency),e}},EMe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Textures=i}static FromTape(e,t,i){let r=0,n=i[r++];return new EMe(e,t,n)}ToTape(){let e=[];return e.push(this.Textures),e}},TMe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.RepeatS=i,this.RepeatT=r,this.Mode=n,this.TextureTransform=s,this.Parameter=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new TMe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e}},bMe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.SweptArea=i,this.Position=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new bMe(e,t,n,s)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e}},xMe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Directrix=i,this.Radius=r,this.InnerRadius=n,this.StartParam=s,this.EndParam=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new xMe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.Radius),e.push(this.InnerRadius),e.push(this.StartParam),e.push(this.EndParam),e}},IMe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Directrix=i,this.Radius=r,this.InnerRadius=n,this.StartParam=s,this.EndParam=a,this.FilletRadius=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new IMe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.Radius),e.push(this.InnerRadius),e.push(this.StartParam),e.push(this.EndParam),e.push(this.FilletRadius),e}},_Me=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.SweptCurve=i,this.Position=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new _Me(e,t,n,s)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e}},SMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new SMe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},wMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new wMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},RMe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new RMe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e}},MMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new MMe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},DMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new DMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},CMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=h,this.FlangeEdgeRadius=u,this.WebEdgeRadius=c,this.WebSlope=p,this.FlangeSlope=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new CMe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.FlangeEdgeRadius),e.push(this.WebEdgeRadius),e.push(this.WebSlope),e.push(this.FlangeSlope),e}},AMe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Name=i,this.Rows=r,this.Columns=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new AMe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Rows),e.push(this.Columns),e}},OMe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Identifier=i,this.Name=r,this.Description=n,this.Unit=s,this.ReferencePath=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new OMe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Identifier),e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.ReferencePath),e}},PMe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.RowCells=i,this.IsHeading=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new PMe(e,t,n,s)}ToTape(){let e=[];return e.push(this.RowCells),e.push(this.IsHeading),e}},NMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new NMe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},LMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new LMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},FMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Status=h,this.WorkMethod=u,this.IsMilestone=c,this.Priority=p,this.TaskTime=d,this.PredefinedType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new FMe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Status),e.push(this.WorkMethod),e.push(this.IsMilestone),e.push(this.Priority),e.push(this.TaskTime),e.push(this.PredefinedType),e}},HMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b){this.expressID=e,this.type=t,this.Name=i,this.DataOrigin=r,this.UserDefinedDataOrigin=n,this.DurationType=s,this.ScheduleDuration=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.EarlyStart=h,this.EarlyFinish=u,this.LateStart=c,this.LateFinish=p,this.FreeFloat=d,this.TotalFloat=f,this.IsCritical=m,this.StatusTime=g,this.ActualDuration=y,this.ActualStart=v,this.ActualFinish=T,this.RemainingTime=x,this.Completion=b}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++],b=i[r++],E=i[r++],_=i[r++];return new HMe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b,E,_)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.DurationType),e.push(this.ScheduleDuration),e.push(this.ScheduleStart),e.push(this.ScheduleFinish),e.push(this.EarlyStart),e.push(this.EarlyFinish),e.push(this.LateStart),e.push(this.LateFinish),e.push(this.FreeFloat),e.push(this.TotalFloat),e.push(this.IsCritical),e.push(this.StatusTime),e.push(this.ActualDuration),e.push(this.ActualStart),e.push(this.ActualFinish),e.push(this.RemainingTime),e.push(this.Completion),e}},UMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b,E){this.expressID=e,this.type=t,this.Name=i,this.DataOrigin=r,this.UserDefinedDataOrigin=n,this.DurationType=s,this.ScheduleDuration=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.EarlyStart=h,this.EarlyFinish=u,this.LateStart=c,this.LateFinish=p,this.FreeFloat=d,this.TotalFloat=f,this.IsCritical=m,this.StatusTime=g,this.ActualDuration=y,this.ActualStart=v,this.ActualFinish=T,this.RemainingTime=x,this.Completion=b,this.Recurrence=E}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++],b=i[r++],E=i[r++],_=i[r++],w=i[r++];return new UMe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x,b,E,_,w)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.DurationType),e.push(this.ScheduleDuration),e.push(this.ScheduleStart),e.push(this.ScheduleFinish),e.push(this.EarlyStart),e.push(this.EarlyFinish),e.push(this.LateStart),e.push(this.LateFinish),e.push(this.FreeFloat),e.push(this.TotalFloat),e.push(this.IsCritical),e.push(this.StatusTime),e.push(this.ActualDuration),e.push(this.ActualStart),e.push(this.ActualFinish),e.push(this.RemainingTime),e.push(this.Completion),e.push(this.Recurrence),e}},BMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ProcessType=u,this.PredefinedType=c,this.WorkMethod=p}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++];return new BMe(e,t,n,s,a,o,l,h,u,c,p,d,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e.push(this.WorkMethod),e}},kMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.Purpose=i,this.Description=r,this.UserDefinedPurpose=n,this.TelephoneNumbers=s,this.FacsimileNumbers=a,this.PagerNumber=o,this.ElectronicMailAddresses=l,this.WWWHomePageURL=h,this.MessagingIDs=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new kMe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e.push(this.TelephoneNumbers),e.push(this.FacsimileNumbers),e.push(this.PagerNumber),e.push(this.ElectronicMailAddresses),e.push(this.WWWHomePageURL),e.push(this.MessagingIDs),e}},GMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.SteelGrade=u,this.PredefinedType=c,this.NominalDiameter=p,this.CrossSectionArea=d,this.TensionForce=f,this.PreStress=m,this.FrictionCoefficient=g,this.AnchorageSlip=y,this.MinCurvatureRadius=v}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++],x=i[r++];return new GMe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T,x)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.TensionForce),e.push(this.PreStress),e.push(this.FrictionCoefficient),e.push(this.AnchorageSlip),e.push(this.MinCurvatureRadius),e}},VMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.SteelGrade=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new VMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e}},zMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new zMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},jMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.SteelGrade=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new jMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e}},WMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new WMe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},qMe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.NominalDiameter=p,this.CrossSectionArea=d,this.SheathDiameter=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new qMe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.SheathDiameter),e}},YMe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Coordinates=i}static FromTape(e,t,i){let r=0,n=i[r++];return new YMe(e,t,n)}ToTape(){let e=[];return e.push(this.Coordinates),e}},XMe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new XMe(e,t)}ToTape(){return[]}},$Me=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Literal=i,this.Placement=r,this.Path=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new $Me(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Literal),e.push(this.Placement),e.push(this.Path),e}},ZMe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Literal=i,this.Placement=r,this.Path=n,this.Extent=s,this.BoxAlignment=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new ZMe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Literal),e.push(this.Placement),e.push(this.Path),e.push(this.Extent),e.push(this.BoxAlignment),e}},KMe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Name=i,this.TextCharacterAppearance=r,this.TextStyle=n,this.TextFontStyle=s,this.ModelOrDraughting=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new KMe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TextCharacterAppearance),e.push(this.TextStyle),e.push(this.TextFontStyle),e.push(this.ModelOrDraughting),e}},JMe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Name=i,this.FontFamily=r,this.FontStyle=n,this.FontVariant=s,this.FontWeight=a,this.FontSize=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new JMe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.FontFamily),e.push(this.FontStyle),e.push(this.FontVariant),e.push(this.FontWeight),e.push(this.FontSize),e}},QMe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Colour=i,this.BackgroundColour=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new QMe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Colour),e.push(this.BackgroundColour),e}},eDe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.TextIndent=i,this.TextAlign=r,this.TextDecoration=n,this.LetterSpacing=s,this.WordSpacing=a,this.TextTransform=o,this.LineHeight=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new eDe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.TextIndent),e.push(this.TextAlign),e.push(this.TextDecoration),e.push(this.LetterSpacing),e.push(this.WordSpacing),e.push(this.TextTransform),e.push(this.LineHeight),e}},tDe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Maps=i}static FromTape(e,t,i){let r=0,n=i[r++];return new tDe(e,t,n)}ToTape(){let e=[];return e.push(this.Maps),e}},rDe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Maps=i,this.Mode=r,this.Parameter=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new rDe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.Mode),e.push(this.Parameter),e}},iDe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Maps=i,this.Vertices=r,this.MappedTo=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new iDe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.Vertices),e.push(this.MappedTo),e}},nDe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Coordinates=i}static FromTape(e,t,i){let r=0,n=i[r++];return new nDe(e,t,n)}ToTape(){let e=[];return e.push(this.Coordinates),e}},sDe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.TexCoordsList=i}static FromTape(e,t,i){let r=0,n=i[r++];return new sDe(e,t,n)}ToTape(){let e=[];return e.push(this.TexCoordsList),e}},aDe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.StartTime=i,this.EndTime=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new aDe(e,t,n,s)}ToTape(){let e=[];return e.push(this.StartTime),e.push(this.EndTime),e}},oDe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.Name=i,this.Description=r,this.StartTime=n,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new oDe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e}},lDe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.ListValues=i}static FromTape(e,t,i){let r=0,n=i[r++];return new lDe(e,t,n)}ToTape(){let e=[];return e.push(this.ListValues),e}},cDe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new cDe(e,t)}ToTape(){return[]}},uDe=class{constructor(e,t,i,r,n,s){this.expressID=e,this.type=t,this.ContextOfItems=i,this.RepresentationIdentifier=r,this.RepresentationType=n,this.Items=s}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++];return new uDe(e,t,n,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},hDe=class{constructor(e,t,i,r,n){this.expressID=e,this.type=t,this.Position=i,this.MajorRadius=r,this.MinorRadius=n}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++];return new hDe(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.MajorRadius),e.push(this.MinorRadius),e}},pDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new pDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},dDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new dDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},fDe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.StartPoint=i,this.StartDirection=r,this.SegmentLength=n,this.StartRadius=s,this.EndRadius=a,this.IsStartRadiusCCW=o,this.IsEndRadiusCCW=l,this.TransitionCurveType=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new fDe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e.push(this.StartRadius),e.push(this.EndRadius),e.push(this.IsStartRadiusCCW),e.push(this.IsEndRadiusCCW),e.push(this.TransitionCurveType),e}},mDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new mDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},gDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new gDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},vDe=class{constructor(e,t,i,r,n,s,a,o,l){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.BottomXDim=s,this.TopXDim=a,this.YDim=o,this.TopXOffset=l}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++];return new vDe(e,t,n,s,a,o,l,h,u)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.BottomXDim),e.push(this.TopXDim),e.push(this.YDim),e.push(this.TopXOffset),e}},yDe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.Coordinates=i,this.Normals=r,this.Closed=n,this.CoordIndex=s,this.PnIndex=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new yDe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.Coordinates),e.push(this.Normals),e.push(this.Closed),e.push(this.CoordIndex),e.push(this.PnIndex),e}},EDe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Coordinates=i,this.Normals=r,this.Closed=n,this.CoordIndex=s,this.PnIndex=a,this.Flags=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new EDe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Coordinates),e.push(this.Normals),e.push(this.Closed),e.push(this.CoordIndex),e.push(this.PnIndex),e.push(this.Flags),e}},TDe=class{constructor(e,t,i,r,n,s,a){this.expressID=e,this.type=t,this.BasisCurve=i,this.Trim1=r,this.Trim2=n,this.SenseAgreement=s,this.MasterRepresentation=a}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++];return new TDe(e,t,n,s,a,o,l)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.Trim1),e.push(this.Trim2),e.push(this.SenseAgreement),e.push(this.MasterRepresentation),e}},bDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new bDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},xDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new xDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IDe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new IDe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e}},_De=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ProcessType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new _De(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e}},SDe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new SDe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e}},wDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=h,this.ResourceType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new wDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e}},RDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=h,this.EdgeRadius=u,this.FlangeSlope=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new RDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e.push(this.FlangeSlope),e}},MDe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.Units=i}static FromTape(e,t,i){let r=0,n=i[r++];return new MDe(e,t,n)}ToTape(){let e=[];return e.push(this.Units),e}},DDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new DDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},CDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new CDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ADe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new ADe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},ODe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new ODe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},PDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new PDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},NDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new NDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},LDe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.Orientation=i,this.Magnitude=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new LDe(e,t,n,s)}ToTape(){let e=[];return e.push(this.Orientation),e.push(this.Magnitude),e}},FDe=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,i){return new FDe(e,t)}ToTape(){return[]}},HDe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.LoopVertex=i}static FromTape(e,t,i){let r=0,n=i[r++];return new HDe(e,t,n)}ToTape(){let e=[];return e.push(this.LoopVertex),e}},UDe=class{constructor(e,t,i){this.expressID=e,this.type=t,this.VertexGeometry=i}static FromTape(e,t,i){let r=0,n=i[r++];return new UDe(e,t,n)}ToTape(){let e=[];return e.push(this.VertexGeometry),e}},BDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new BDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},kDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new kDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},GDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new GDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},VDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new VDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},zDe=class{constructor(e,t,i,r,n,s,a,o,l,h){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++];return new zDe(e,t,n,s,a,o,l,h,u,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},jDe=class{constructor(e,t,i,r){this.expressID=e,this.type=t,this.IntersectingAxes=i,this.OffsetDistances=r}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++];return new jDe(e,t,n,s)}ToTape(){let e=[];return e.push(this.IntersectingAxes),e.push(this.OffsetDistances),e}},WDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new WDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},qDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new qDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},YDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new YDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},XDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new XDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},$De=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new $De(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ZDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new ZDe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},KDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++];return new KDe(e,t,n,s,a,o,l,h,u,c,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},JDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.OverallHeight=u,this.OverallWidth=c,this.PredefinedType=p,this.PartitioningType=d,this.UserDefinedPartitioningType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new JDe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.UserDefinedPartitioningType),e}},QDe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m,g,y){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.LiningDepth=a,this.LiningThickness=o,this.TransomThickness=l,this.MullionThickness=h,this.FirstTransomOffset=u,this.SecondTransomOffset=c,this.FirstMullionOffset=p,this.SecondMullionOffset=d,this.ShapeAspectStyle=f,this.LiningOffset=m,this.LiningToPanelOffsetX=g,this.LiningToPanelOffsetY=y}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++],v=i[r++],T=i[r++];return new QDe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y,v,T)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.LiningDepth),e.push(this.LiningThickness),e.push(this.TransomThickness),e.push(this.MullionThickness),e.push(this.FirstTransomOffset),e.push(this.SecondTransomOffset),e.push(this.FirstMullionOffset),e.push(this.SecondMullionOffset),e.push(this.ShapeAspectStyle),e.push(this.LiningOffset),e.push(this.LiningToPanelOffsetX),e.push(this.LiningToPanelOffsetY),e}},eCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.OperationType=a,this.PanelPosition=o,this.FrameDepth=l,this.FrameThickness=h,this.ShapeAspectStyle=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new eCe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.OperationType),e.push(this.PanelPosition),e.push(this.FrameDepth),e.push(this.FrameThickness),e.push(this.ShapeAspectStyle),e}},tCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=h,this.OverallHeight=u,this.OverallWidth=c,this.PredefinedType=p,this.PartitioningType=d,this.UserDefinedPartitioningType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new tCe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.UserDefinedPartitioningType),e}},rCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ConstructionType=u,this.OperationType=c,this.ParameterTakesPrecedence=p,this.Sizeable=d}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++];return new rCe(e,t,n,s,a,o,l,h,u,c,p,d,f,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ConstructionType),e.push(this.OperationType),e.push(this.ParameterTakesPrecedence),e.push(this.Sizeable),e}},iCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=h,this.ElementType=u,this.PredefinedType=c,this.PartitioningType=p,this.ParameterTakesPrecedence=d,this.UserDefinedPartitioningType=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new iCe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.ParameterTakesPrecedence),e.push(this.UserDefinedPartitioningType),e}},nCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.WorkingTimes=l,this.ExceptionTimes=h,this.PredefinedType=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new nCe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.WorkingTimes),e.push(this.ExceptionTimes),e.push(this.PredefinedType),e}},sCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=h,this.Purpose=u,this.Duration=c,this.TotalFloat=p,this.StartTime=d,this.FinishTime=f}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++];return new sCe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e}},aCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=h,this.Purpose=u,this.Duration=c,this.TotalFloat=p,this.StartTime=d,this.FinishTime=f,this.PredefinedType=m}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++];return new aCe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e.push(this.PredefinedType),e}},oCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u,c,p,d,f,m){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=h,this.Purpose=u,this.Duration=c,this.TotalFloat=p,this.StartTime=d,this.FinishTime=f,this.PredefinedType=m}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++],d=i[r++],f=i[r++],m=i[r++],g=i[r++],y=i[r++];return new oCe(e,t,n,s,a,o,l,h,u,c,p,d,f,m,g,y)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e.push(this.PredefinedType),e}},lCe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.Name=i,this.DataOrigin=r,this.UserDefinedDataOrigin=n,this.RecurrencePattern=s,this.Start=a,this.Finish=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new lCe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.RecurrencePattern),e.push(this.Start),e.push(this.Finish),e}},cCe=class{constructor(e,t,i,r,n,s,a,o,l,h,u){this.expressID=e,this.type=t,this.ProfileType=i,this.ProfileName=r,this.Position=n,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=h,this.EdgeRadius=u}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++],u=i[r++],c=i[r++],p=i[r++];return new cCe(e,t,n,s,a,o,l,h,u,c,p)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e}},uCe=class{constructor(e,t,i,r,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=i,this.OwnerHistory=r,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o}static FromTape(e,t,i){let r=0,n=i[r++],s=i[r++],a=i[r++],o=i[r++],l=i[r++],h=i[r++];return new uCe(e,t,n,s,a,o,l,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e}},zge=VIt(),C8=class{constructor(){this.wasmModule=void 0,this.fs=void 0}Init(){return kIt(this,null,(function*(){zge?(this.wasmModule=yield zge({noInitialRun:!0}),this.fs=this.wasmModule.FS):console.error("Could not find wasm module at './web-ifc' from web-ifc-api.ts")}))}OpenModel(e,t){this.wasmModule.FS_createDataFile("/","filename",e,!0,!0,!0);let i=Vge({COORDINATE_TO_ORIGIN:!1,USE_FAST_BOOLS:!1,CIRCLE_SEGMENTS_LOW:5,CIRCLE_SEGMENTS_MEDIUM:8,CIRCLE_SEGMENTS_HIGH:12},t),r=this.wasmModule.OpenModel(i);return this.wasmModule.FS_unlink("/filename"),r}CreateModel(e){let t=Vge({COORDINATE_TO_ORIGIN:!1,USE_FAST_BOOLS:!1,CIRCLE_SEGMENTS_LOW:5,CIRCLE_SEGMENTS_MEDIUM:8,CIRCLE_SEGMENTS_HIGH:12},e);return this.wasmModule.CreateModel(t)}ExportFileAsIFC(e){this.wasmModule.ExportFileAsIFC(e);let t=this.fs.readFile("/export.ifc");return this.wasmModule.FS_unlink("/export.ifc"),t}GetGeometry(e,t){return this.wasmModule.GetGeometry(e,t)}GetLine(e,t,i=!1){let r=this.GetRawLineData(e,t),n=P[r.type](r);return i&&this.FlattenLine(e,n),n}WriteLine(e,t){Object.keys(t).forEach((i=>{let r=t[i];if(r&&void 0!==r.expressID)this.WriteLine(e,r),t[i]={type:5,value:r.expressID};else if(Array.isArray(r)&&r.length>0)for(let n=0;n<r.length;n++)void 0!==r[n].expressID&&(this.WriteLine(e,r[n]),t[i][n]={type:5,value:r[n].expressID})}));let i={ID:t.expressID,type:t.type,arguments:t.ToTape()};this.WriteRawLineData(e,i)}FlattenLine(e,t){Object.keys(t).forEach((i=>{let r=t[i];if(r&&5===r.type)t[i]=this.GetLine(e,r.value,!0);else if(Array.isArray(r)&&r.length>0&&5===r[0].type)for(let n=0;n<r.length;n++)t[i][n]=this.GetLine(e,r[n].value,!0)}))}GetRawLineData(e,t){return this.wasmModule.GetLine(e,t)}WriteRawLineData(e,t){return this.wasmModule.WriteLine(e,t.ID,t.type,t.arguments)}GetLineIDsWithType(e,t){return this.wasmModule.GetLineIDsWithType(e,t)}GetAllLines(e){return this.wasmModule.GetAllLines(e)}SetGeometryTransformation(e,t){16==t.length?this.wasmModule.SetGeometryTransformation(e,t):console.log(`Bad transformation matrix size: ${t.length}`)}GetVertexArray(e,t){return this.getSubArray(this.wasmModule.HEAPF32,e,t)}GetIndexArray(e,t){return this.getSubArray(this.wasmModule.HEAPU32,e,t)}getSubArray(e,t,i){return e.subarray(t/4,t/4+i).slice(0)}CloseModel(e){this.wasmModule.CloseModel(e)}StreamAllMeshes(e,t){this.wasmModule.StreamAllMeshes(e,t)}IsModelOpen(e){return this.wasmModule.IsModelOpen(e)}LoadAllGeometry(e){return this.wasmModule.LoadAllGeometry(e)}GetFlatMesh(e,t){return this.wasmModule.GetFlatMesh(e,t)}SetWasmPath(e){hCe=e}},hCe="",dCe="expressID",mT=(e,t=!1)=>bo(e,t),pCe=(e,t)=>new Wt(new Float32Array(e),t),jFt=(e,t)=>new Wt(new Uint32Array(e),t),A8="default",ac={aggregates:{name:m8,relating:"RelatingObject",related:"RelatedObjects",key:"children"},spatial:{name:v8,relating:"RelatingStructure",related:"RelatedElements",key:"children"},psets:{name:y8,relating:"RelatingPropertyDefinition",related:"RelatedObjects",key:"hasPsets"},materials:{name:g8,relating:"RelatingMaterial",related:"RelatedObjects",key:"hasMaterial"},type:{name:E8,relating:"RelatingType",related:"RelatedObjects",key:"hasType"}},O8=class{constructor(e,t){this.state=e,this.BVH=t,this.loadedModels=0,this.currentWebIfcID=-1,this.currentModelID=-1}parse(e){return ct(this,null,(function*(){return void 0===this.state.api.wasmModule&&(yield this.state.api.Init()),this.newIfcModel(e),this.loadedModels++,this.loadAllGeometry()}))}newIfcModel(e){let t=new Uint8Array(e);this.currentWebIfcID=this.state.api.OpenModel(t,this.state.webIfcSettings),this.currentModelID=this.state.useJSON?this.loadedModels:this.currentWebIfcID,this.state.models[this.currentModelID]={modelID:this.currentModelID,mesh:{},items:{},types:{},jsonData:{}}}loadAllGeometry(){return this.saveAllPlacedGeometriesByMaterial(),this.generateAllGeometriesByMaterial()}generateAllGeometriesByMaterial(){let{geometry:e,materials:t}=this.getGeometryAndMaterials();this.BVH.applyThreeMeshBVH(e);let i=new Je(e,t);return i.modelID=this.currentModelID,this.state.models[this.currentModelID].mesh=i,i}getGeometryAndMaterials(){let e=this.state.models[this.currentModelID].items,t=[],i=[];for(let r in e){i.push(e[r].material);let n=Object.values(e[r].geometries);t.push(mT(n))}return{geometry:mT(t,!0),materials:i}}saveAllPlacedGeometriesByMaterial(){let e=this.state.api.LoadAllGeometry(this.currentWebIfcID);for(let t=0;t<e.size();t++){let i=e.get(t),r=i.geometries;for(let e=0;e<r.size();e++)this.savePlacedGeometry(r.get(e),i.expressID)}}savePlacedGeometry(e,t){let i=this.getBufferGeometry(e);i.computeVertexNormals();let r=this.getMeshMatrix(e.flatTransformation);i.applyMatrix4(r),this.saveGeometryByMaterial(i,e,t)}getBufferGeometry(e){let t=this.state.api.GetGeometry(this.currentWebIfcID,e.geometryExpressID),i=this.getVertices(t),r=this.getIndices(t),{vertices:n,normals:s}=this.extractVertexData(i);return this.ifcGeomToBufferGeom(n,s,r)}getVertices(e){let t=e.GetVertexData(),i=e.GetVertexDataSize();return this.state.api.GetVertexArray(t,i)}getIndices(e){let t=e.GetIndexData(),i=e.GetIndexDataSize();return this.state.api.GetIndexArray(t,i)}getMeshMatrix(e){let t=new Be;return t.fromArray(e),t}ifcGeomToBufferGeom(e,t,i){let r=new ot;return r.setAttribute("position",pCe(e,3)),r.setAttribute("normal",pCe(t,3)),r.setIndex(new Wt(i,1)),r}extractVertexData(e){let t=[],i=[],r=!1;for(let n=0;n<e.length;n++)r?i.push(e[n]):t.push(e[n]),(n+1)%3==0&&(r=!r);return{vertices:t,normals:i}}saveGeometryByMaterial(e,t,i){let r=t.color,n=`${r.x}${r.y}${r.z}${r.w}`;this.storeGeometryAttribute(i,e),this.createMaterial(n,r);let s=this.state.models[this.currentModelID].items[n],a=s.geometries[i];if(!a)return s.geometries[i]=e;let o=mT([a,e]);s.geometries[i]=o}storeGeometryAttribute(e,t){let i=t.attributes.position.count,r=new Array(i).fill(e);t.setAttribute(dCe,jFt(r,1))}createMaterial(e,t){let i=this.state.models[this.currentModelID].items;if(i[e])return;let r=new Ve(t.x,t.y,t.z),n=new Bl({color:r,side:bi});n.transparent=1!==t.w,n.transparent&&(n.opacity=t.w),i[e]={material:n,geometries:{}}}},P8=class{constructor(e,t){this.selected={},this.state=e,this.BVH=t}getSubset(e,t){let i=this.matIDNoConfig(e,t);return this.selected[i]?this.selected[i].mesh:null}removeSubset(e,t,i){let r=this.matIDNoConfig(e,i);this.selected[r]&&(t&&t.remove(this.selected[r].mesh),delete this.selected[r])}createSubset(e){if(this.isConfigValid(e)&&!this.isPreviousSelection(e))return this.isEasySelection(e)?this.addToPreviousSelection(e):(this.updatePreviousSelection(e.scene,e),this.createSelectionInScene(e))}createSelectionInScene(e){let t=this.filter(e),{geomsByMaterial:i,materials:r}=this.getGeomAndMat(t),n=this.isDefaultMat(e),s=this.getMergedGeometry(i,n),a=n?r:e.material;this.BVH.applyThreeMeshBVH(s);let o=new Je(s,a);return this.selected[this.matID(e)].mesh=o,o.modelID=e.modelID,e.scene.add(o),o}getMergedGeometry(e,t){return e.length>0?mT(e,t):new ot}isConfigValid(e){return this.isValid(e.scene)&&this.isValid(e.modelID)&&this.isValid(e.ids)&&this.isValid(e.removePrevious)}isValid(e){return null!=e}getGeomAndMat(e){let t=[],i=[];for(let r in e){let n=Object.values(e[r].geometries);n.length&&(i.push(e[r].material),n.length>1?t.push(mT(n)):t.push(...n))}return{geomsByMaterial:t,materials:i}}updatePreviousSelection(e,t){let i=this.selected[this.matID(t)];if(!i)return this.newSelectionGroup(t);e.remove(i.mesh),t.removePrevious?i.ids=new Set(t.ids):t.ids.forEach((e=>i.ids.add(e)))}newSelectionGroup(e){this.selected[this.matID(e)]={ids:new Set(e.ids),mesh:{}}}isPreviousSelection(e){if(!this.selected[this.matID(e)])return!1;if(this.containsIds(e))return!0;let t=this.selected[this.matID(e)].ids;return JSON.stringify(e.ids)===JSON.stringify(t)}containsIds(e){let t=e.ids,i=Array.from(this.selected[this.matID(e)].ids);return t.every((r=0,e=>r=i.indexOf(e,r)+1));var r}addToPreviousSelection(e){let t=this.selected[this.matID(e)],i=this.filter(e),r=Object.values(i).map((e=>Object.values(e.geometries))).flat(),n=t.mesh.geometry;t.mesh.geometry=mT([n,...r]),e.ids.forEach((e=>t.ids.add(e)))}filter(e){let t=this.selected[this.matID(e)].ids,i=this.state.models[e.modelID].items,r={};for(let n in i)r[n]={material:i[n].material,geometries:this.filterGeometries(t,i[n].geometries)};return r}filterGeometries(e,t){let i=Array.from(e);return Object.keys(t).filter((e=>i.includes(parseInt(e,10)))).reduce(((e,i)=>Ln(Mr({},e),{[i]:t[i]})),{})}isEasySelection(e){let t=this.matID(e);if(!e.removePrevious&&!this.isDefaultMat(e)&&this.selected[t])return!0}isDefaultMat(e){return this.matIDNoConfig(e.modelID)===this.matID(e)}matID(e){let t;return t=e.material&&e.material.uuid||A8,t.concat(" - ").concat(e.modelID.toString())}matIDNoConfig(e,t){let i=A8;return t&&(i=t.uuid),i.concat(" - ").concat(e.toString())}},k8={103090709:"IFCPROJECT",4097777520:"IFCSITE",4031249490:"IFCBUILDING",3124254112:"IFCBUILDINGSTOREY",3856911033:"IFCSPACE",1674181508:"IFCANNOTATION",25142252:"IFCCONTROLLER",32344328:"IFCBOILER",76236018:"IFCLAMP",90941305:"IFCPUMP",177149247:"IFCAIRTERMINALBOX",182646315:"IFCFLOWINSTRUMENT",263784265:"IFCFURNISHINGELEMENT",264262732:"IFCELECTRICGENERATOR",277319702:"IFCAUDIOVISUALAPPLIANCE",310824031:"IFCPIPEFITTING",331165859:"IFCSTAIR",342316401:"IFCDUCTFITTING",377706215:"IFCMECHANICALFASTENER",395920057:"IFCDOOR",402227799:"IFCELECTRICMOTOR",413509423:"IFCSYSTEMFURNITUREELEMENT",484807127:"IFCEVAPORATOR",486154966:"IFCWINDOWSTANDARDCASE",629592764:"IFCLIGHTFIXTURE",630975310:"IFCUNITARYCONTROLELEMENT",635142910:"IFCCABLECARRIERFITTING",639361253:"IFCCOIL",647756555:"IFCFASTENER",707683696:"IFCFLOWSTORAGEDEVICE",738039164:"IFCPROTECTIVEDEVICE",753842376:"IFCBEAM",812556717:"IFCTANK",819412036:"IFCFILTER",843113511:"IFCCOLUMN",862014818:"IFCELECTRICDISTRIBUTIONBOARD",900683007:"IFCFOOTING",905975707:"IFCCOLUMNSTANDARDCASE",926996030:"IFCVOIDINGFEATURE",979691226:"IFCREINFORCINGBAR",987401354:"IFCFLOWSEGMENT",1003880860:"IFCELECTRICTIMECONTROL",1051757585:"IFCCABLEFITTING",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1073191201:"IFCMEMBER",1095909175:"IFCBUILDINGELEMENTPROXY",1156407060:"IFCPLATESTANDARDCASE",1162798199:"IFCSWITCHINGDEVICE",1329646415:"IFCSHADINGDEVICE",1335981549:"IFCDISCRETEACCESSORY",1360408905:"IFCDUCTSILENCER",1404847402:"IFCSTACKTERMINAL",1426591983:"IFCFIRESUPPRESSIONTERMINAL",1437502449:"IFCMEDICALDEVICE",1509553395:"IFCFURNITURE",1529196076:"IFCSLAB",1620046519:"IFCTRANSPORTELEMENT",1634111441:"IFCAIRTERMINAL",1658829314:"IFCENERGYCONVERSIONDEVICE",1677625105:"IFCCIVILELEMENT",1687234759:"IFCPILE",1904799276:"IFCELECTRICAPPLIANCE",1911478936:"IFCMEMBERSTANDARDCASE",1945004755:"IFCDISTRIBUTIONELEMENT",1973544240:"IFCCOVERING",1999602285:"IFCSPACEHEATER",2016517767:"IFCROOF",2056796094:"IFCAIRTOAIRHEATRECOVERY",2058353004:"IFCFLOWCONTROLLER",2068733104:"IFCHUMIDIFIER",2176052936:"IFCJUNCTIONBOX",2188021234:"IFCFLOWMETER",2223149337:"IFCFLOWTERMINAL",2262370178:"IFCRAILING",2272882330:"IFCCONDENSER",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",2320036040:"IFCREINFORCINGMESH",2347447852:"IFCTENDONANCHOR",2391383451:"IFCVIBRATIONISOLATOR",2391406946:"IFCWALL",2474470126:"IFCMOTORCONNECTION",2769231204:"IFCVIRTUALELEMENT",2814081492:"IFCENGINE",2906023776:"IFCBEAMSTANDARDCASE",2938176219:"IFCBURNER",2979338954:"IFCBUILDINGELEMENTPART",3024970846:"IFCRAMP",3026737570:"IFCTUBEBUNDLE",3027962421:"IFCSLABSTANDARDCASE",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",3053780830:"IFCSANITARYTERMINAL",3079942009:"IFCOPENINGSTANDARDCASE",3087945054:"IFCALARM",3101698114:"IFCSURFACEFEATURE",3127900445:"IFCSLABELEMENTEDCASE",3132237377:"IFCFLOWMOVINGDEVICE",3171933400:"IFCPLATE",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",3242481149:"IFCDOORSTANDARDCASE",3283111854:"IFCRAMPFLIGHT",3296154744:"IFCCHIMNEY",3304561284:"IFCWINDOW",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",3319311131:"IFCHEATEXCHANGER",3415622556:"IFCFAN",3420628829:"IFCSOLARDEVICE",3493046030:"IFCGEOGRAPHICELEMENT",3495092785:"IFCCURTAINWALL",3508470533:"IFCFLOWTREATMENTDEVICE",3512223829:"IFCWALLSTANDARDCASE",3518393246:"IFCDUCTSEGMENT",3571504051:"IFCCOMPRESSOR",3588315303:"IFCOPENINGELEMENT",3612865200:"IFCPIPESEGMENT",3640358203:"IFCCOOLINGTOWER",3651124850:"IFCPROJECTIONELEMENT",3694346114:"IFCOUTLET",3747195512:"IFCEVAPORATIVECOOLER",3758799889:"IFCCABLECARRIERSEGMENT",3824725483:"IFCTENDON",3825984169:"IFCTRANSFORMER",3902619387:"IFCCHILLER",4074379575:"IFCDAMPER",4086658281:"IFCSENSOR",4123344466:"IFCELEMENTASSEMBLY",4136498852:"IFCCOOLEDBEAM",4156078855:"IFCWALLELEMENTEDCASE",4175244083:"IFCINTERCEPTOR",4207607924:"IFCVALVE",4217484030:"IFCCABLESEGMENT",4237592921:"IFCWASTETERMINAL",4252922144:"IFCSTAIRFLIGHT",4278956645:"IFCFLOWFITTING",4288193352:"IFCACTUATOR",4292641817:"IFCUNITARYEQUIPMENT",3009204131:"IFCGRID"},WFt={3821786052:"IFCACTIONREQUEST",2296667514:"IFCACTOR",3630933823:"IFCACTORROLE",4288193352:"IFCACTUATOR",2874132201:"IFCACTUATORTYPE",618182010:"IFCADDRESS",1635779807:"IFCADVANCEDBREP",2603310189:"IFCADVANCEDBREPWITHVOIDS",3406155212:"IFCADVANCEDFACE",1634111441:"IFCAIRTERMINAL",177149247:"IFCAIRTERMINALBOX",1411407467:"IFCAIRTERMINALBOXTYPE",3352864051:"IFCAIRTERMINALTYPE",2056796094:"IFCAIRTOAIRHEATRECOVERY",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3087945054:"IFCALARM",3001207471:"IFCALARMTYPE",325726236:"IFCALIGNMENT",749761778:"IFCALIGNMENT2DHORIZONTAL",3199563722:"IFCALIGNMENT2DHORIZONTALSEGMENT",2483840362:"IFCALIGNMENT2DSEGMENT",3379348081:"IFCALIGNMENT2DVERSEGCIRCULARARC",3239324667:"IFCALIGNMENT2DVERSEGLINE",4263986512:"IFCALIGNMENT2DVERSEGPARABOLICARC",53199957:"IFCALIGNMENT2DVERTICAL",2029264950:"IFCALIGNMENT2DVERTICALSEGMENT",3512275521:"IFCALIGNMENTCURVE",1674181508:"IFCANNOTATION",669184980:"IFCANNOTATIONFILLAREA",639542469:"IFCAPPLICATION",411424972:"IFCAPPLIEDVALUE",130549933:"IFCAPPROVAL",3869604511:"IFCAPPROVALRELATIONSHIP",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",1310608509:"IFCARBITRARYOPENPROFILEDEF",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",3460190687:"IFCASSET",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",277319702:"IFCAUDIOVISUALAPPLIANCE",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4261334040:"IFCAXIS1PLACEMENT",3125803723:"IFCAXIS2PLACEMENT2D",2740243338:"IFCAXIS2PLACEMENT3D",1967976161:"IFCBSPLINECURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",167062518:"IFCBSPLINESURFACEWITHKNOTS",753842376:"IFCBEAM",2906023776:"IFCBEAMSTANDARDCASE",819618141:"IFCBEAMTYPE",4196446775:"IFCBEARING",3649138523:"IFCBEARINGTYPE",616511568:"IFCBLOBTEXTURE",1334484129:"IFCBLOCK",32344328:"IFCBOILER",231477066:"IFCBOILERTYPE",3649129432:"IFCBOOLEANCLIPPINGRESULT",2736907675:"IFCBOOLEANRESULT",4037036970:"IFCBOUNDARYCONDITION",1136057603:"IFCBOUNDARYCURVE",1560379544:"IFCBOUNDARYEDGECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1387855156:"IFCBOUNDARYNODECONDITION",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1260505505:"IFCBOUNDEDCURVE",4182860854:"IFCBOUNDEDSURFACE",2581212453:"IFCBOUNDINGBOX",2713105998:"IFCBOXEDHALFSPACE",644574406:"IFCBRIDGE",963979645:"IFCBRIDGEPART",4031249490:"IFCBUILDING",3299480353:"IFCBUILDINGELEMENT",2979338954:"IFCBUILDINGELEMENTPART",39481116:"IFCBUILDINGELEMENTPARTTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1950629157:"IFCBUILDINGELEMENTTYPE",3124254112:"IFCBUILDINGSTOREY",1177604601:"IFCBUILDINGSYSTEM",2938176219:"IFCBURNER",2188180465:"IFCBURNERTYPE",2898889636:"IFCCSHAPEPROFILEDEF",635142910:"IFCCABLECARRIERFITTING",395041908:"IFCCABLECARRIERFITTINGTYPE",3758799889:"IFCCABLECARRIERSEGMENT",3293546465:"IFCCABLECARRIERSEGMENTTYPE",1051757585:"IFCCABLEFITTING",2674252688:"IFCCABLEFITTINGTYPE",4217484030:"IFCCABLESEGMENT",1285652485:"IFCCABLESEGMENTTYPE",3999819293:"IFCCAISSONFOUNDATION",3203706013:"IFCCAISSONFOUNDATIONTYPE",1123145078:"IFCCARTESIANPOINT",574549367:"IFCCARTESIANPOINTLIST",1675464909:"IFCCARTESIANPOINTLIST2D",2059837836:"IFCCARTESIANPOINTLIST3D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3150382593:"IFCCENTERLINEPROFILEDEF",3902619387:"IFCCHILLER",2951183804:"IFCCHILLERTYPE",3296154744:"IFCCHIMNEY",2197970202:"IFCCHIMNEYTYPE",2611217952:"IFCCIRCLE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",1383045692:"IFCCIRCLEPROFILEDEF",1062206242:"IFCCIRCULARARCSEGMENT2D",1677625105:"IFCCIVILELEMENT",3893394355:"IFCCIVILELEMENTTYPE",747523909:"IFCCLASSIFICATION",647927063:"IFCCLASSIFICATIONREFERENCE",2205249479:"IFCCLOSEDSHELL",639361253:"IFCCOIL",2301859152:"IFCCOILTYPE",776857604:"IFCCOLOURRGB",3285139300:"IFCCOLOURRGBLIST",3264961684:"IFCCOLOURSPECIFICATION",843113511:"IFCCOLUMN",905975707:"IFCCOLUMNSTANDARDCASE",300633059:"IFCCOLUMNTYPE",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",2542286263:"IFCCOMPLEXPROPERTY",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3732776249:"IFCCOMPOSITECURVE",15328376:"IFCCOMPOSITECURVEONSURFACE",2485617015:"IFCCOMPOSITECURVESEGMENT",1485152156:"IFCCOMPOSITEPROFILEDEF",3571504051:"IFCCOMPRESSOR",3850581409:"IFCCOMPRESSORTYPE",2272882330:"IFCCONDENSER",2816379211:"IFCCONDENSERTYPE",2510884976:"IFCCONIC",370225590:"IFCCONNECTEDFACESET",1981873012:"IFCCONNECTIONCURVEGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",45288368:"IFCCONNECTIONPOINTECCENTRICITY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",1959218052:"IFCCONSTRAINT",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",2559216714:"IFCCONSTRUCTIONRESOURCE",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",3419103109:"IFCCONTEXT",3050246964:"IFCCONTEXTDEPENDENTUNIT",3293443760:"IFCCONTROL",25142252:"IFCCONTROLLER",578613899:"IFCCONTROLLERTYPE",2889183280:"IFCCONVERSIONBASEDUNIT",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",4136498852:"IFCCOOLEDBEAM",335055490:"IFCCOOLEDBEAMTYPE",3640358203:"IFCCOOLINGTOWER",2954562838:"IFCCOOLINGTOWERTYPE",1785450214:"IFCCOORDINATEOPERATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",3895139033:"IFCCOSTITEM",1419761937:"IFCCOSTSCHEDULE",602808272:"IFCCOSTVALUE",1973544240:"IFCCOVERING",1916426348:"IFCCOVERINGTYPE",3295246426:"IFCCREWRESOURCE",1815067380:"IFCCREWRESOURCETYPE",2506170314:"IFCCSGPRIMITIVE3D",2147822146:"IFCCSGSOLID",539742890:"IFCCURRENCYRELATIONSHIP",3495092785:"IFCCURTAINWALL",1457835157:"IFCCURTAINWALLTYPE",2601014836:"IFCCURVE",2827736869:"IFCCURVEBOUNDEDPLANE",2629017746:"IFCCURVEBOUNDEDSURFACE",1186437898:"IFCCURVESEGMENT2D",3800577675:"IFCCURVESTYLE",1105321065:"IFCCURVESTYLEFONT",2367409068:"IFCCURVESTYLEFONTANDSCALING",3510044353:"IFCCURVESTYLEFONTPATTERN",1213902940:"IFCCYLINDRICALSURFACE",4074379575:"IFCDAMPER",3961806047:"IFCDAMPERTYPE",3426335179:"IFCDEEPFOUNDATION",1306400036:"IFCDEEPFOUNDATIONTYPE",3632507154:"IFCDERIVEDPROFILEDEF",1765591967:"IFCDERIVEDUNIT",1045800335:"IFCDERIVEDUNITELEMENT",2949456006:"IFCDIMENSIONALEXPONENTS",32440307:"IFCDIRECTION",1335981549:"IFCDISCRETEACCESSORY",2635815018:"IFCDISCRETEACCESSORYTYPE",1945343521:"IFCDISTANCEEXPRESSION",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",562808652:"IFCDISTRIBUTIONCIRCUIT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1945004755:"IFCDISTRIBUTIONELEMENT",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3041715199:"IFCDISTRIBUTIONPORT",3205830791:"IFCDISTRIBUTIONSYSTEM",1154170062:"IFCDOCUMENTINFORMATION",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",3732053477:"IFCDOCUMENTREFERENCE",395920057:"IFCDOOR",2963535650:"IFCDOORLININGPROPERTIES",1714330368:"IFCDOORPANELPROPERTIES",3242481149:"IFCDOORSTANDARDCASE",526551008:"IFCDOORSTYLE",2323601079:"IFCDOORTYPE",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",342316401:"IFCDUCTFITTING",869906466:"IFCDUCTFITTINGTYPE",3518393246:"IFCDUCTSEGMENT",3760055223:"IFCDUCTSEGMENTTYPE",1360408905:"IFCDUCTSILENCER",2030761528:"IFCDUCTSILENCERTYPE",3900360178:"IFCEDGE",476780140:"IFCEDGECURVE",1472233963:"IFCEDGELOOP",1904799276:"IFCELECTRICAPPLIANCE",663422040:"IFCELECTRICAPPLIANCETYPE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",264262732:"IFCELECTRICGENERATOR",1534661035:"IFCELECTRICGENERATORTYPE",402227799:"IFCELECTRICMOTOR",1217240411:"IFCELECTRICMOTORTYPE",1003880860:"IFCELECTRICTIMECONTROL",712377611:"IFCELECTRICTIMECONTROLTYPE",1758889154:"IFCELEMENT",4123344466:"IFCELEMENTASSEMBLY",2397081782:"IFCELEMENTASSEMBLYTYPE",1623761950:"IFCELEMENTCOMPONENT",2590856083:"IFCELEMENTCOMPONENTTYPE",1883228015:"IFCELEMENTQUANTITY",339256511:"IFCELEMENTTYPE",2777663545:"IFCELEMENTARYSURFACE",1704287377:"IFCELLIPSE",2835456948:"IFCELLIPSEPROFILEDEF",1658829314:"IFCENERGYCONVERSIONDEVICE",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",2814081492:"IFCENGINE",132023988:"IFCENGINETYPE",3747195512:"IFCEVAPORATIVECOOLER",3174744832:"IFCEVAPORATIVECOOLERTYPE",484807127:"IFCEVAPORATOR",3390157468:"IFCEVAPORATORTYPE",4148101412:"IFCEVENT",211053100:"IFCEVENTTIME",4024345920:"IFCEVENTTYPE",297599258:"IFCEXTENDEDPROPERTIES",4294318154:"IFCEXTERNALINFORMATION",3200245327:"IFCEXTERNALREFERENCE",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",1209101575:"IFCEXTERNALSPATIALELEMENT",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",477187591:"IFCEXTRUDEDAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",2556980723:"IFCFACE",2047409740:"IFCFACEBASEDSURFACEMODEL",1809719519:"IFCFACEBOUND",803316827:"IFCFACEOUTERBOUND",3008276851:"IFCFACESURFACE",807026263:"IFCFACETEDBREP",3737207727:"IFCFACETEDBREPWITHVOIDS",24185140:"IFCFACILITY",1310830890:"IFCFACILITYPART",4219587988:"IFCFAILURECONNECTIONCONDITION",3415622556:"IFCFAN",346874300:"IFCFANTYPE",647756555:"IFCFASTENER",2489546625:"IFCFASTENERTYPE",2827207264:"IFCFEATUREELEMENT",2143335405:"IFCFEATUREELEMENTADDITION",1287392070:"IFCFEATUREELEMENTSUBTRACTION",738692330:"IFCFILLAREASTYLE",374418227:"IFCFILLAREASTYLEHATCHING",315944413:"IFCFILLAREASTYLETILES",819412036:"IFCFILTER",1810631287:"IFCFILTERTYPE",1426591983:"IFCFIRESUPPRESSIONTERMINAL",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2058353004:"IFCFLOWCONTROLLER",3907093117:"IFCFLOWCONTROLLERTYPE",4278956645:"IFCFLOWFITTING",3198132628:"IFCFLOWFITTINGTYPE",182646315:"IFCFLOWINSTRUMENT",4037862832:"IFCFLOWINSTRUMENTTYPE",2188021234:"IFCFLOWMETER",3815607619:"IFCFLOWMETERTYPE",3132237377:"IFCFLOWMOVINGDEVICE",1482959167:"IFCFLOWMOVINGDEVICETYPE",987401354:"IFCFLOWSEGMENT",1834744321:"IFCFLOWSEGMENTTYPE",707683696:"IFCFLOWSTORAGEDEVICE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",2223149337:"IFCFLOWTERMINAL",2297155007:"IFCFLOWTERMINALTYPE",3508470533:"IFCFLOWTREATMENTDEVICE",3009222698:"IFCFLOWTREATMENTDEVICETYPE",900683007:"IFCFOOTING",1893162501:"IFCFOOTINGTYPE",263784265:"IFCFURNISHINGELEMENT",4238390223:"IFCFURNISHINGELEMENTTYPE",1509553395:"IFCFURNITURE",1268542332:"IFCFURNITURETYPE",3493046030:"IFCGEOGRAPHICELEMENT",4095422895:"IFCGEOGRAPHICELEMENTTYPE",987898635:"IFCGEOMETRICCURVESET",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",3590301190:"IFCGEOMETRICSET",3009204131:"IFCGRID",852622518:"IFCGRIDAXIS",178086475:"IFCGRIDPLACEMENT",2706460486:"IFCGROUP",812098782:"IFCHALFSPACESOLID",3319311131:"IFCHEATEXCHANGER",1251058090:"IFCHEATEXCHANGERTYPE",2068733104:"IFCHUMIDIFIER",1806887404:"IFCHUMIDIFIERTYPE",1484403080:"IFCISHAPEPROFILEDEF",3905492369:"IFCIMAGETEXTURE",3570813810:"IFCINDEXEDCOLOURMAP",2571569899:"IFCINDEXEDPOLYCURVE",178912537:"IFCINDEXEDPOLYGONALFACE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",1437953363:"IFCINDEXEDTEXTUREMAP",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",4175244083:"IFCINTERCEPTOR",3946677679:"IFCINTERCEPTORTYPE",3113134337:"IFCINTERSECTIONCURVE",2391368822:"IFCINVENTORY",3741457305:"IFCIRREGULARTIMESERIES",3020489413:"IFCIRREGULARTIMESERIESVALUE",2176052936:"IFCJUNCTIONBOX",4288270099:"IFCJUNCTIONBOXTYPE",572779678:"IFCLSHAPEPROFILEDEF",3827777499:"IFCLABORRESOURCE",428585644:"IFCLABORRESOURCETYPE",1585845231:"IFCLAGTIME",76236018:"IFCLAMP",1051575348:"IFCLAMPTYPE",2655187982:"IFCLIBRARYINFORMATION",3452421091:"IFCLIBRARYREFERENCE",4162380809:"IFCLIGHTDISTRIBUTIONDATA",629592764:"IFCLIGHTFIXTURE",1161773419:"IFCLIGHTFIXTURETYPE",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",1402838566:"IFCLIGHTSOURCE",125510826:"IFCLIGHTSOURCEAMBIENT",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",1520743889:"IFCLIGHTSOURCEPOSITIONAL",3422422726:"IFCLIGHTSOURCESPOT",1281925730:"IFCLINE",3092502836:"IFCLINESEGMENT2D",388784114:"IFCLINEARPLACEMENT",1154579445:"IFCLINEARPOSITIONINGELEMENT",2624227202:"IFCLOCALPLACEMENT",1008929658:"IFCLOOP",1425443689:"IFCMANIFOLDSOLIDBREP",3057273783:"IFCMAPCONVERSION",2347385850:"IFCMAPPEDITEM",1838606355:"IFCMATERIAL",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",3708119e3:"IFCMATERIALCONSTITUENT",2852063980:"IFCMATERIALCONSTITUENTSET",760658860:"IFCMATERIALDEFINITION",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",248100487:"IFCMATERIALLAYER",3303938423:"IFCMATERIALLAYERSET",1303795690:"IFCMATERIALLAYERSETUSAGE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",2199411900:"IFCMATERIALLIST",2235152071:"IFCMATERIALPROFILE",164193824:"IFCMATERIALPROFILESET",3079605661:"IFCMATERIALPROFILESETUSAGE",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",552965576:"IFCMATERIALPROFILEWITHOFFSETS",3265635763:"IFCMATERIALPROPERTIES",853536259:"IFCMATERIALRELATIONSHIP",1507914824:"IFCMATERIALUSAGEDEFINITION",2597039031:"IFCMEASUREWITHUNIT",377706215:"IFCMECHANICALFASTENER",2108223431:"IFCMECHANICALFASTENERTYPE",1437502449:"IFCMEDICALDEVICE",1114901282:"IFCMEDICALDEVICETYPE",1073191201:"IFCMEMBER",1911478936:"IFCMEMBERSTANDARDCASE",3181161470:"IFCMEMBERTYPE",3368373690:"IFCMETRIC",2998442950:"IFCMIRROREDPROFILEDEF",2706619895:"IFCMONETARYUNIT",2474470126:"IFCMOTORCONNECTION",977012517:"IFCMOTORCONNECTIONTYPE",1918398963:"IFCNAMEDUNIT",3888040117:"IFCOBJECT",219451334:"IFCOBJECTDEFINITION",3701648758:"IFCOBJECTPLACEMENT",2251480897:"IFCOBJECTIVE",4143007308:"IFCOCCUPANT",590820931:"IFCOFFSETCURVE",3388369263:"IFCOFFSETCURVE2D",3505215534:"IFCOFFSETCURVE3D",2485787929:"IFCOFFSETCURVEBYDISTANCES",2665983363:"IFCOPENSHELL",3588315303:"IFCOPENINGELEMENT",3079942009:"IFCOPENINGSTANDARDCASE",4251960020:"IFCORGANIZATION",1411181986:"IFCORGANIZATIONRELATIONSHIP",643959842:"IFCORIENTATIONEXPRESSION",1029017970:"IFCORIENTEDEDGE",144952367:"IFCOUTERBOUNDARYCURVE",3694346114:"IFCOUTLET",2837617999:"IFCOUTLETTYPE",1207048766:"IFCOWNERHISTORY",2529465313:"IFCPARAMETERIZEDPROFILEDEF",2519244187:"IFCPATH",1682466193:"IFCPCURVE",2382730787:"IFCPERFORMANCEHISTORY",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3327091369:"IFCPERMIT",2077209135:"IFCPERSON",101040310:"IFCPERSONANDORGANIZATION",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2483315170:"IFCPHYSICALQUANTITY",2226359599:"IFCPHYSICALSIMPLEQUANTITY",1687234759:"IFCPILE",1158309216:"IFCPILETYPE",310824031:"IFCPIPEFITTING",804291784:"IFCPIPEFITTINGTYPE",3612865200:"IFCPIPESEGMENT",4231323485:"IFCPIPESEGMENTTYPE",597895409:"IFCPIXELTEXTURE",2004835150:"IFCPLACEMENT",603570806:"IFCPLANARBOX",1663979128:"IFCPLANAREXTENT",220341763:"IFCPLANE",3171933400:"IFCPLATE",1156407060:"IFCPLATESTANDARDCASE",4017108033:"IFCPLATETYPE",2067069095:"IFCPOINT",4022376103:"IFCPOINTONCURVE",1423911732:"IFCPOINTONSURFACE",2924175390:"IFCPOLYLOOP",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2839578677:"IFCPOLYGONALFACESET",3724593414:"IFCPOLYLINE",3740093272:"IFCPORT",1946335990:"IFCPOSITIONINGELEMENT",3355820592:"IFCPOSTALADDRESS",759155922:"IFCPREDEFINEDCOLOUR",2559016684:"IFCPREDEFINEDCURVEFONT",3727388367:"IFCPREDEFINEDITEM",3778827333:"IFCPREDEFINEDPROPERTIES",3967405729:"IFCPREDEFINEDPROPERTYSET",1775413392:"IFCPREDEFINEDTEXTFONT",677532197:"IFCPRESENTATIONITEM",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",3119450353:"IFCPRESENTATIONSTYLE",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",2744685151:"IFCPROCEDURE",569719735:"IFCPROCEDURETYPE",2945172077:"IFCPROCESS",4208778838:"IFCPRODUCT",673634403:"IFCPRODUCTDEFINITIONSHAPE",2095639259:"IFCPRODUCTREPRESENTATION",3958567839:"IFCPROFILEDEF",2802850158:"IFCPROFILEPROPERTIES",103090709:"IFCPROJECT",653396225:"IFCPROJECTLIBRARY",2904328755:"IFCPROJECTORDER",3843373140:"IFCPROJECTEDCRS",3651124850:"IFCPROJECTIONELEMENT",2598011224:"IFCPROPERTY",986844984:"IFCPROPERTYABSTRACTION",871118103:"IFCPROPERTYBOUNDEDVALUE",1680319473:"IFCPROPERTYDEFINITION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",4166981789:"IFCPROPERTYENUMERATEDVALUE",3710013099:"IFCPROPERTYENUMERATION",2752243245:"IFCPROPERTYLISTVALUE",941946838:"IFCPROPERTYREFERENCEVALUE",1451395588:"IFCPROPERTYSET",3357820518:"IFCPROPERTYSETDEFINITION",492091185:"IFCPROPERTYSETTEMPLATE",3650150729:"IFCPROPERTYSINGLEVALUE",110355661:"IFCPROPERTYTABLEVALUE",3521284610:"IFCPROPERTYTEMPLATE",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",738039164:"IFCPROTECTIVEDEVICE",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3219374653:"IFCPROXY",90941305:"IFCPUMP",2250791053:"IFCPUMPTYPE",2044713172:"IFCQUANTITYAREA",2093928680:"IFCQUANTITYCOUNT",931644368:"IFCQUANTITYLENGTH",2090586900:"IFCQUANTITYSET",3252649465:"IFCQUANTITYTIME",2405470396:"IFCQUANTITYVOLUME",825690147:"IFCQUANTITYWEIGHT",2262370178:"IFCRAILING",2893384427:"IFCRAILINGTYPE",3024970846:"IFCRAMP",3283111854:"IFCRAMPFLIGHT",2324767716:"IFCRAMPFLIGHTTYPE",1469900589:"IFCRAMPTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3615266464:"IFCRECTANGLEPROFILEDEF",2798486643:"IFCRECTANGULARPYRAMID",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",3915482550:"IFCRECURRENCEPATTERN",2433181523:"IFCREFERENCE",4021432810:"IFCREFERENT",3413951693:"IFCREGULARTIMESERIES",1580146022:"IFCREINFORCEMENTBARPROPERTIES",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",979691226:"IFCREINFORCINGBAR",2572171363:"IFCREINFORCINGBARTYPE",3027567501:"IFCREINFORCINGELEMENT",964333572:"IFCREINFORCINGELEMENTTYPE",2320036040:"IFCREINFORCINGMESH",2310774935:"IFCREINFORCINGMESHTYPE",160246688:"IFCRELAGGREGATES",3939117080:"IFCRELASSIGNS",1683148259:"IFCRELASSIGNSTOACTOR",2495723537:"IFCRELASSIGNSTOCONTROL",1307041759:"IFCRELASSIGNSTOGROUP",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",4278684876:"IFCRELASSIGNSTOPROCESS",2857406711:"IFCRELASSIGNSTOPRODUCT",205026976:"IFCRELASSIGNSTORESOURCE",1865459582:"IFCRELASSOCIATES",4095574036:"IFCRELASSOCIATESAPPROVAL",919958153:"IFCRELASSOCIATESCLASSIFICATION",2728634034:"IFCRELASSOCIATESCONSTRAINT",982818633:"IFCRELASSOCIATESDOCUMENT",3840914261:"IFCRELASSOCIATESLIBRARY",2655215786:"IFCRELASSOCIATESMATERIAL",826625072:"IFCRELCONNECTS",1204542856:"IFCRELCONNECTSELEMENTS",3945020480:"IFCRELCONNECTSPATHELEMENTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3190031847:"IFCRELCONNECTSPORTS",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",504942748:"IFCRELCONNECTSWITHECCENTRICITY",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",886880790:"IFCRELCOVERSBLDGELEMENTS",2802773753:"IFCRELCOVERSSPACES",2565941209:"IFCRELDECLARES",2551354335:"IFCRELDECOMPOSES",693640335:"IFCRELDEFINES",1462361463:"IFCRELDEFINESBYOBJECT",4186316022:"IFCRELDEFINESBYPROPERTIES",307848117:"IFCRELDEFINESBYTEMPLATE",781010003:"IFCRELDEFINESBYTYPE",3940055652:"IFCRELFILLSELEMENT",279856033:"IFCRELFLOWCONTROLELEMENTS",427948657:"IFCRELINTERFERESELEMENTS",3268803585:"IFCRELNESTS",1441486842:"IFCRELPOSITIONS",750771296:"IFCRELPROJECTSELEMENT",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",4122056220:"IFCRELSEQUENCE",366585022:"IFCRELSERVICESBUILDINGS",3451746338:"IFCRELSPACEBOUNDARY",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",1401173127:"IFCRELVOIDSELEMENT",478536968:"IFCRELATIONSHIP",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1076942058:"IFCREPRESENTATION",3377609919:"IFCREPRESENTATIONCONTEXT",3008791417:"IFCREPRESENTATIONITEM",1660063152:"IFCREPRESENTATIONMAP",2914609552:"IFCRESOURCE",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2439245199:"IFCRESOURCELEVELRELATIONSHIP",1042787934:"IFCRESOURCETIME",1856042241:"IFCREVOLVEDAREASOLID",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",4158566097:"IFCRIGHTCIRCULARCONE",3626867408:"IFCRIGHTCIRCULARCYLINDER",2016517767:"IFCROOF",2781568857:"IFCROOFTYPE",2341007311:"IFCROOT",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",448429030:"IFCSIUNIT",3053780830:"IFCSANITARYTERMINAL",1768891740:"IFCSANITARYTERMINALTYPE",1054537805:"IFCSCHEDULINGTIME",2157484638:"IFCSEAMCURVE",2042790032:"IFCSECTIONPROPERTIES",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",1862484736:"IFCSECTIONEDSOLID",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1509187699:"IFCSECTIONEDSPINE",4086658281:"IFCSENSOR",1783015770:"IFCSENSORTYPE",1329646415:"IFCSHADINGDEVICE",4074543187:"IFCSHADINGDEVICETYPE",867548509:"IFCSHAPEASPECT",3982875396:"IFCSHAPEMODEL",4240577450:"IFCSHAPEREPRESENTATION",4124623270:"IFCSHELLBASEDSURFACEMODEL",3692461612:"IFCSIMPLEPROPERTY",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",4097777520:"IFCSITE",1529196076:"IFCSLAB",3127900445:"IFCSLABELEMENTEDCASE",3027962421:"IFCSLABSTANDARDCASE",2533589738:"IFCSLABTYPE",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",3420628829:"IFCSOLARDEVICE",1072016465:"IFCSOLARDEVICETYPE",723233188:"IFCSOLIDMODEL",3856911033:"IFCSPACE",1999602285:"IFCSPACEHEATER",1305183839:"IFCSPACEHEATERTYPE",3812236995:"IFCSPACETYPE",1412071761:"IFCSPATIALELEMENT",710998568:"IFCSPATIALELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",463610769:"IFCSPATIALZONE",2481509218:"IFCSPATIALZONETYPE",451544542:"IFCSPHERE",4015995234:"IFCSPHERICALSURFACE",1404847402:"IFCSTACKTERMINAL",3112655638:"IFCSTACKTERMINALTYPE",331165859:"IFCSTAIR",4252922144:"IFCSTAIRFLIGHT",1039846685:"IFCSTAIRFLIGHTTYPE",338393293:"IFCSTAIRTYPE",682877961:"IFCSTRUCTURALACTION",3544373492:"IFCSTRUCTURALACTIVITY",2515109513:"IFCSTRUCTURALANALYSISMODEL",1179482911:"IFCSTRUCTURALCONNECTION",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",1004757350:"IFCSTRUCTURALCURVEACTION",4243806635:"IFCSTRUCTURALCURVECONNECTION",214636428:"IFCSTRUCTURALCURVEMEMBER",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",2757150158:"IFCSTRUCTURALCURVEREACTION",3136571912:"IFCSTRUCTURALITEM",1807405624:"IFCSTRUCTURALLINEARACTION",2162789131:"IFCSTRUCTURALLOAD",385403989:"IFCSTRUCTURALLOADCASE",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1252848954:"IFCSTRUCTURALLOADGROUP",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",609421318:"IFCSTRUCTURALLOADORRESULT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",2525727697:"IFCSTRUCTURALLOADSTATIC",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",530289379:"IFCSTRUCTURALMEMBER",1621171031:"IFCSTRUCTURALPLANARACTION",2082059205:"IFCSTRUCTURALPOINTACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",1235345126:"IFCSTRUCTURALPOINTREACTION",3689010777:"IFCSTRUCTURALREACTION",2986769608:"IFCSTRUCTURALRESULTGROUP",3657597509:"IFCSTRUCTURALSURFACEACTION",1975003073:"IFCSTRUCTURALSURFACECONNECTION",3979015343:"IFCSTRUCTURALSURFACEMEMBER",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",603775116:"IFCSTRUCTURALSURFACEREACTION",2830218821:"IFCSTYLEMODEL",3958052878:"IFCSTYLEDITEM",3049322572:"IFCSTYLEDREPRESENTATION",148013059:"IFCSUBCONTRACTRESOURCE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",2233826070:"IFCSUBEDGE",2513912981:"IFCSURFACE",699246055:"IFCSURFACECURVE",2028607225:"IFCSURFACECURVESWEPTAREASOLID",3101698114:"IFCSURFACEFEATURE",2809605785:"IFCSURFACEOFLINEAREXTRUSION",4124788165:"IFCSURFACEOFREVOLUTION",2934153892:"IFCSURFACEREINFORCEMENTAREA",1300840506:"IFCSURFACESTYLE",3303107099:"IFCSURFACESTYLELIGHTING",1607154358:"IFCSURFACESTYLEREFRACTION",1878645084:"IFCSURFACESTYLERENDERING",846575682:"IFCSURFACESTYLESHADING",1351298697:"IFCSURFACESTYLEWITHTEXTURES",626085974:"IFCSURFACETEXTURE",2247615214:"IFCSWEPTAREASOLID",1260650574:"IFCSWEPTDISKSOLID",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",230924584:"IFCSWEPTSURFACE",1162798199:"IFCSWITCHINGDEVICE",2315554128:"IFCSWITCHINGDEVICETYPE",2254336722:"IFCSYSTEM",413509423:"IFCSYSTEMFURNITUREELEMENT",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",3071757647:"IFCTSHAPEPROFILEDEF",985171141:"IFCTABLE",2043862942:"IFCTABLECOLUMN",531007025:"IFCTABLEROW",812556717:"IFCTANK",5716631:"IFCTANKTYPE",3473067441:"IFCTASK",1549132990:"IFCTASKTIME",2771591690:"IFCTASKTIMERECURRING",3206491090:"IFCTASKTYPE",912023232:"IFCTELECOMADDRESS",3824725483:"IFCTENDON",2347447852:"IFCTENDONANCHOR",3081323446:"IFCTENDONANCHORTYPE",3663046924:"IFCTENDONCONDUIT",2281632017:"IFCTENDONCONDUITTYPE",2415094496:"IFCTENDONTYPE",2387106220:"IFCTESSELLATEDFACESET",901063453:"IFCTESSELLATEDITEM",4282788508:"IFCTEXTLITERAL",3124975700:"IFCTEXTLITERALWITHEXTENT",1447204868:"IFCTEXTSTYLE",1983826977:"IFCTEXTSTYLEFONTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1640371178:"IFCTEXTSTYLETEXTMODEL",280115917:"IFCTEXTURECOORDINATE",1742049831:"IFCTEXTURECOORDINATEGENERATOR",2552916305:"IFCTEXTUREMAP",1210645708:"IFCTEXTUREVERTEX",3611470254:"IFCTEXTUREVERTEXLIST",1199560280:"IFCTIMEPERIOD",3101149627:"IFCTIMESERIES",581633288:"IFCTIMESERIESVALUE",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",1735638870:"IFCTOPOLOGYREPRESENTATION",1935646853:"IFCTOROIDALSURFACE",3825984169:"IFCTRANSFORMER",1692211062:"IFCTRANSFORMERTYPE",2595432518:"IFCTRANSITIONCURVESEGMENT2D",1620046519:"IFCTRANSPORTELEMENT",2097647324:"IFCTRANSPORTELEMENTTYPE",2715220739:"IFCTRAPEZIUMPROFILEDEF",2916149573:"IFCTRIANGULATEDFACESET",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3593883385:"IFCTRIMMEDCURVE",3026737570:"IFCTUBEBUNDLE",1600972822:"IFCTUBEBUNDLETYPE",1628702193:"IFCTYPEOBJECT",3736923433:"IFCTYPEPROCESS",2347495698:"IFCTYPEPRODUCT",3698973494:"IFCTYPERESOURCE",427810014:"IFCUSHAPEPROFILEDEF",180925521:"IFCUNITASSIGNMENT",630975310:"IFCUNITARYCONTROLELEMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",4292641817:"IFCUNITARYEQUIPMENT",1911125066:"IFCUNITARYEQUIPMENTTYPE",4207607924:"IFCVALVE",728799441:"IFCVALVETYPE",1417489154:"IFCVECTOR",2799835756:"IFCVERTEX",2759199220:"IFCVERTEXLOOP",1907098498:"IFCVERTEXPOINT",1530820697:"IFCVIBRATIONDAMPER",3956297820:"IFCVIBRATIONDAMPERTYPE",2391383451:"IFCVIBRATIONISOLATOR",3313531582:"IFCVIBRATIONISOLATORTYPE",2769231204:"IFCVIRTUALELEMENT",891718957:"IFCVIRTUALGRIDINTERSECTION",926996030:"IFCVOIDINGFEATURE",2391406946:"IFCWALL",4156078855:"IFCWALLELEMENTEDCASE",3512223829:"IFCWALLSTANDARDCASE",1898987631:"IFCWALLTYPE",4237592921:"IFCWASTETERMINAL",1133259667:"IFCWASTETERMINALTYPE",3304561284:"IFCWINDOW",336235671:"IFCWINDOWLININGPROPERTIES",512836454:"IFCWINDOWPANELPROPERTIES",486154966:"IFCWINDOWSTANDARDCASE",1299126871:"IFCWINDOWSTYLE",4009809668:"IFCWINDOWTYPE",4088093105:"IFCWORKCALENDAR",1028945134:"IFCWORKCONTROL",4218914973:"IFCWORKPLAN",3342526732:"IFCWORKSCHEDULE",1236880293:"IFCWORKTIME",2543172580:"IFCZSHAPEPROFILEDEF",1033361043:"IFCZONE"},N8=class{constructor(e){this.state=e}getExpressId(e,t){if(!e.index)return;let i=e.index.array;return e.attributes[dCe].getX(i[3*t])}getItemProperties(e,t,i=!1){return this.state.useJSON?Mr({},this.state.models[e].jsonData[t]):this.state.api.GetLine(e,t,i)}getAllItemsOfType(e,t,i){return this.state.useJSON?this.getAllItemsOfTypeJSON(e,t,i):this.getAllItemsOfTypeWebIfcAPI(e,t,i)}getPropertySets(e,t,i=!1){return this.state.useJSON?this.getPropertyJSON(e,t,i,ac.psets):this.getPropertyWebIfcAPI(e,t,i,ac.psets)}getTypeProperties(e,t,i=!1){return this.state.useJSON?this.getPropertyJSON(e,t,i,ac.type):this.getPropertyWebIfcAPI(e,t,i,ac.type)}getMaterialsProperties(e,t,i=!1){return this.state.useJSON?this.getPropertyJSON(e,t,i,ac.materials):this.getPropertyWebIfcAPI(e,t,i,ac.materials)}getSpatialStructure(e){return this.state.useJSON?this.getSpatialStructureJSON(e):this.getSpatialStructureWebIfcAPI(e)}getSpatialStructureJSON(e){let t=this.getSpatialTreeChunks(e),i=this.getAllItemsOfTypeJSON(e,pO,!1)[0],r=this.newIfcProject(i);return this.getSpatialNode(e,r,t),Mr({},r)}getSpatialStructureWebIfcAPI(e){let t=this.getSpatialTreeChunks(e),i=this.state.api.GetLineIDsWithType(e,pO).get(0),r=this.newIfcProject(i);return this.getSpatialNode(e,r,t),r}getAllItemsOfTypeJSON(e,t,i){let r=this.state.models[e].jsonData,n=WFt[t];if(!n)throw new Error(`Type not found: ${t}`);return this.filterJSONItemsByType(r,n,i)}filterJSONItemsByType(e,t,i){let r=[];return Object.keys(e).forEach((n=>{let s=parseInt(n);e[s].type.toUpperCase()===t&&r.push(i?Mr({},e[s]):s)})),r}getItemsByIDJSON(e,t){let i=this.state.models[e].jsonData,r=[];return t.forEach((e=>r.push(Mr({},i[e])))),r}getPropertyJSON(e,t,i=!1,r){let n=this.getAllRelatedItemsOfTypeJSON(e,t,r),s=this.getItemsByIDJSON(e,n);return i&&s.forEach((t=>this.getJSONReferencesRecursively(e,t))),s}getJSONReferencesRecursively(e,t){if(null==t)return;let i=Object.keys(t);for(let r=0;r<i.length;r++){let n=i[r];this.getJSONItem(e,t,n)}}getJSONItem(e,t,i){if(Array.isArray(t[i]))return this.getMultipleJSONItems(e,t,i);t[i]&&5===t[i].type&&(t[i]=this.getItemsByIDJSON(e,[t[i].value])[0],this.getJSONReferencesRecursively(e,t[i]))}getMultipleJSONItems(e,t,i){t[i]=t[i].map((t=>(5===t.type&&(t=this.getItemsByIDJSON(e,[t.value])[0],this.getJSONReferencesRecursively(e,t)),t)))}getPropertyWebIfcAPI(e,t,i=!1,r){return this.getAllRelatedItemsOfTypeWebIfcAPI(e,t,r).map((t=>this.state.api.GetLine(e,t,i)))}getAllItemsOfTypeWebIfcAPI(e,t,i){let r=[],n=this.state.api.GetLineIDsWithType(e,t);for(let s=0;s<n.size();s++)r.push(n.get(s));return i?r.map((t=>this.state.api.GetLine(e,t))):r}newIfcProject(e){return{expressID:e,type:"IFCPROJECT",children:[]}}getSpatialTreeChunks(e){let t={};return this.state.useJSON?(this.getChunksJSON(e,t,ac.aggregates),this.getChunksJSON(e,t,ac.spatial)):(this.getChunksWebIfcAPI(e,t,ac.aggregates),this.getChunksWebIfcAPI(e,t,ac.spatial)),t}getChunksJSON(e,t,i){this.getAllItemsOfTypeJSON(e,i.name,!0).forEach((e=>{this.saveChunk(t,i,e)}))}getChunksWebIfcAPI(e,t,i){let r=this.state.api.GetLineIDsWithType(e,i.name);for(let n=0;n<r.size();n++){let s=this.state.api.GetLine(e,r.get(n),!1);this.saveChunk(t,i,s)}}saveChunk(e,t,i){let r=i[t.relating].value,n=i[t.related].map((e=>e.value));null==e[r]?e[r]=n:e[r]=e[r].concat(n)}getSpatialNode(e,t,i){this.getChildren(e,t,i,ac.aggregates),this.getChildren(e,t,i,ac.spatial)}getChildren(e,t,i,r){let n=i[t.expressID];null!=n&&(t[r.key]=n.map((t=>{let r=this.newNode(e,t);return this.getSpatialNode(e,r,i),r})))}newNode(e,t){return{expressID:t,type:this.getNodeType(e,t),children:[]}}getNodeType(e,t){if(this.state.useJSON)return this.state.models[e].jsonData[t].type;let i=this.state.models[e].types[t];return k8[i]}getAllRelatedItemsOfTypeJSON(e,t,i){let r=this.getAllItemsOfTypeJSON(e,i.name,!0),n=[];return r.forEach((e=>{this.isRelated(t,e,i)&&this.getRelated(e,i,n)})),n}getAllRelatedItemsOfTypeWebIfcAPI(e,t,i){let r=this.state.api.GetLineIDsWithType(e,i.name),n=[];for(let s=0;s<r.size();s++){let a=this.state.api.GetLine(e,r.get(s));this.isRelated(t,a,i)&&this.getRelated(a,i,n)}return n}getRelated(e,t,i){let r=e[t.relating];Array.isArray(r)?r.forEach((e=>i.push(e.value))):i.push(r.value)}isRelated(e,t,i){let r=t[i.related];return Array.isArray(r)?r.map((e=>e.value)).includes(e):r.value===e}},L8=class{constructor(e){this.state=e}getAllTypes(){for(let e in this.state.models){let t=this.state.models[e].types;0==Object.keys(t).length&&this.getAllTypesOfModel(parseInt(e))}}getAllTypesOfModel(e){let t=Object.keys(k8).map((e=>parseInt(e))),i=this.state.models[e].types;t.forEach((t=>{let r=this.state.api.GetLineIDsWithType(e,t);for(let e=0;e<r.size();e++)i[r.get(e)]=t}))}},qFt=0,ua="IfcManager is null!",F8=class extends Je{constructor(){super(...arguments),this.modelID=qFt++,this.ifcManager=null,this.mesh=this}setIFCManager(e){this.ifcManager=e}setWasmPath(e){if(null===this.ifcManager)throw new Error(ua);this.ifcManager.setWasmPath(e)}close(e){if(null===this.ifcManager)throw new Error(ua);this.ifcManager.close(this.modelID,e)}getExpressId(e,t){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getExpressId(e,t)}getAllItemsOfType(e,t){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getAllItemsOfType(this.modelID,e,t)}getItemProperties(e,t=!1){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getItemProperties(this.modelID,e,t)}getPropertySets(e,t=!1){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getPropertySets(this.modelID,e,t)}getTypeProperties(e,t=!1){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getTypeProperties(this.modelID,e,t)}getIfcType(e){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getIfcType(this.modelID,e)}getSpatialStructure(){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getSpatialStructure(this.modelID)}getSubset(e){if(null===this.ifcManager)throw new Error(ua);return this.ifcManager.getSubset(this.modelID,e)}removeSubset(e,t){if(null===this.ifcManager)throw new Error(ua);this.ifcManager.removeSubset(this.modelID,e,t)}createSubset(e){if(null===this.ifcManager)throw new Error(ua);let t=Ln(Mr({},e),{modelID:this.modelID});return this.ifcManager.createSubset(t)}hideItems(e){if(null===this.ifcManager)throw new Error(ua);this.ifcManager.hideItems(this.modelID,e)}hideAllItems(){if(null===this.ifcManager)throw new Error(ua);this.ifcManager.hideAllItems(this.modelID)}showItems(e){if(null===this.ifcManager)throw new Error(ua);this.ifcManager.showItems(this.modelID,e)}showAllItems(){if(null===this.ifcManager)throw new Error(ua);this.ifcManager.showAllItems(this.modelID)}},H8=class{initializeMeshBVH(e,t,i){this.computeBoundsTree=e,this.disposeBoundsTree=t,this.acceleratedRaycast=i,this.setupThreeMeshBVH()}applyThreeMeshBVH(e){this.computeBoundsTree&&e.computeBoundsTree()}setupThreeMeshBVH(){!this.computeBoundsTree||!this.disposeBoundsTree||!this.acceleratedRaycast||(ot.prototype.computeBoundsTree=this.computeBoundsTree,ot.prototype.disposeBoundsTree=this.disposeBoundsTree,Je.prototype.raycast=this.acceleratedRaycast)}},U8=class{constructor(e){this.modelCoordinates={},this.expressIDCoordinatesMap={},this.state=e}processCoordinates(e){let t=this.getAttributes(e),i=Array.from(t.expressID.array);this.expressIDCoordinatesMap[e]={};for(let r=0;r<i.length;r++)this.expressIDCoordinatesMap[e][i[r]]||(this.expressIDCoordinatesMap[e][i[r]]=[]),this.expressIDCoordinatesMap[e][i[r]].push(3*r);this.initializeCoordinates(e)}hideItems(e,t){this.editCoordinates(e,t,!0)}showItems(e,t){this.editCoordinates(e,t,!1)}editCoordinates(e,t,i){let r=this.expressIDCoordinatesMap[e],n=[];t.forEach((e=>{r[e]&&n.push(...r[e])}));let s=this.getCoordinates(e),a=this.modelCoordinates[e];i?n.forEach((e=>s.set([0,0,0],e))):n.forEach((e=>s.set([a[e],a[e+1],a[e+2]],e))),this.getAttributes(e).position.needsUpdate=!0}showAllItems(e){this.modelCoordinates[e]&&(this.resetCoordinates(e),this.getAttributes(e).position.needsUpdate=!0)}hideAllItems(e){this.getCoordinates(e).fill(0),this.getAttributes(e).position.needsUpdate=!0}initializeCoordinates(e){let t=this.getCoordinates(e);this.modelCoordinates[e]||(this.modelCoordinates[e]=new Float32Array(t))}resetCoordinates(e){let t=this.modelCoordinates[e];this.getCoordinates(e).set(t)}getCoordinates(e){return this.getAttributes(e).position.array}getAttributes(e){return this.state.models[e].mesh.geometry.attributes}},B8=class{constructor(){this.state={models:[],api:new C8,useJSON:!1},this.BVH=new H8,this.parser=new O8(this.state,this.BVH),this.subsets=new P8(this.state,this.BVH),this.properties=new N8(this.state),this.types=new L8(this.state),this.hider=new U8(this.state)}parse(e){return ct(this,null,(function*(){let t=yield this.parser.parse(e);this.state.useJSON?this.disposeMemory():this.types.getAllTypes(),this.hider.processCoordinates(t.modelID);let i=new F8(t.geometry,t.material);return i.setIFCManager(this),i}))}setWasmPath(e){this.state.api.SetWasmPath(e)}applyWebIfcConfig(e){this.state.webIfcSettings=e}useJSONData(e=!0){this.state.useJSON=e,this.disposeMemory()}addModelJSONData(e,t){let i=this.state.models[e];i&&(i.jsonData=t)}disposeMemory(){this.state.api=null,this.state.api=new C8}setupThreeMeshBVH(e,t,i){this.BVH.initializeMeshBVH(e,t,i)}close(e,t){this.state.api.CloseModel(e),t&&t.remove(this.state.models[e].mesh),delete this.state.models[e]}getExpressId(e,t){return this.properties.getExpressId(e,t)}getAllItemsOfType(e,t,i){return this.properties.getAllItemsOfType(e,t,i)}getItemProperties(e,t,i=!1){return this.properties.getItemProperties(e,t,i)}getPropertySets(e,t,i=!1){return this.properties.getPropertySets(e,t,i)}getTypeProperties(e,t,i=!1){return this.properties.getTypeProperties(e,t,i)}getMaterialsProperties(e,t,i=!1){return this.properties.getMaterialsProperties(e,t,i)}getIfcType(e,t){let i=this.state.models[e].types[t];return k8[i]}getSpatialStructure(e){return this.properties.getSpatialStructure(e)}getSubset(e,t){return this.subsets.getSubset(e,t)}removeSubset(e,t,i){this.subsets.removeSubset(e,t,i)}createSubset(e){return this.subsets.createSubset(e)}hideItems(e,t){this.hider.hideItems(e,t)}hideAllItems(e){this.hider.hideAllItems(e)}showItems(e,t){this.hider.showItems(e,t)}showAllItems(e){this.hider.showAllItems(e)}},BO=class extends pi{constructor(e){super(e),this.ifcManager=new B8}load(e,t,i,r){let n=this,s=new di(n.manager);s.setPath(n.path),s.setResponseType("arraybuffer"),s.setRequestHeader(n.requestHeader),s.setWithCredentials(n.withCredentials),s.load(e,(function(i){return ct(this,null,(function*(){try{if("string"==typeof i)throw new Error("IFC files must be given as a buffer!");t(yield n.parse(i))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}))}),i,r)}parse(e){return this.ifcManager.parse(e)}},kO=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=""===this.path?qs.extractUrlBase(e):this.path,a=new di(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(i){try{t(n.parse(i,s))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){let i=e.split("\n"),r={},n=/\s+/,s={};for(let o=0;o<i.length;o++){let e=i[o];if(e=e.trim(),0===e.length||"#"===e.charAt(0))continue;let t=e.indexOf(" "),a=t>=0?e.substring(0,t):e;a=a.toLowerCase();let l=t>=0?e.substring(t+1):"";if(l=l.trim(),"newmtl"===a)r={name:l},s[l]=r;else if("ka"===a||"kd"===a||"ks"===a||"ke"===a){let e=l.split(n,3);r[a]=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])]}else r[a]=l}let a=new G8(this.resourcePath||t,this.materialOptions);return a.setCrossOrigin(this.crossOrigin),a.setManager(this.manager),a.setMaterials(s),a}},G8=class{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=void 0!==this.options.side?this.options.side:Xi,this.wrap=void 0!==this.options.wrap?this.options.wrap:yn}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;let t={};for(let i in e){let r=e[i],n={};t[i]=n;for(let e in r){let t=!0,i=r[e],s=e.toLowerCase();switch(s){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(i=[i[0]/255,i[1]/255,i[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===i[0]&&0===i[1]&&0===i[2]&&(t=!1)}t&&(n[s]=i)}}return t}preload(){for(let e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(let t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){let t=this,i=this.materialsInfo[e],r={name:e,side:this.side};function n(e,i){if(r[e])return;let n=t.getTextureParams(i,r),s=t.loadTexture(function(e,t){return"string"!=typeof t||""===t?"":/^https?:\/\//i.test(t)?t:e+t}(t.baseUrl,n.url));s.repeat.copy(n.scale),s.offset.copy(n.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,("map"===e||"emissiveMap"===e)&&(s.encoding=yr),r[e]=s}for(let s in i){let e,t=i[s];if(""!==t)switch(s.toLowerCase()){case"kd":r.color=(new Ve).fromArray(t).convertSRGBToLinear();break;case"ks":r.specular=(new Ve).fromArray(t).convertSRGBToLinear();break;case"ke":r.emissive=(new Ve).fromArray(t).convertSRGBToLinear();break;case"map_kd":n("map",t);break;case"map_ks":n("specularMap",t);break;case"map_ke":n("emissiveMap",t);break;case"norm":n("normalMap",t);break;case"map_bump":case"bump":n("bumpMap",t);break;case"map_d":n("alphaMap",t),r.transparent=!0;break;case"ns":r.shininess=parseFloat(t);break;case"d":e=parseFloat(t),e<1&&(r.opacity=e,r.transparent=!0);break;case"tr":e=parseFloat(t),this.options&&this.options.invertTrProperty&&(e=1-e),e>0&&(r.opacity=1-e,r.transparent=!0)}}return this.materials[e]=new Ws(r),this.materials[e]}getTextureParams(e,t){let i,r={scale:new ce(1,1),offset:new ce(0,0)},n=e.split(/\s+/);return i=n.indexOf("-bm"),i>=0&&(t.bumpScale=parseFloat(n[i+1]),n.splice(i,2)),i=n.indexOf("-s"),i>=0&&(r.scale.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),i=n.indexOf("-o"),i>=0&&(r.offset.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),r.url=n.join(" ").trim(),r}loadTexture(e,t,i,r,n){let s=void 0!==this.manager?this.manager:vo,a=s.getHandler(e);null===a&&(a=new gs(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin);let o=a.load(e,i,r,n);return void 0!==t&&(o.mapping=t),o}},YFt=/^[og]\s*(.+)?/,XFt=/^mtllib /,$Ft=/^usemtl /,ZFt=/^usemap /,fCe=/\s+/,mCe=new D,V8=new D,gCe=new D,vCe=new D,oc=new D,GO=new Ve;function KFt(){let e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);let i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){let i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);let r={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){let t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){let t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},i&&i.name&&"function"==typeof i.clone){let e=i.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseNormalIndex:function(e,t){let i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseUVIndex:function(e,t){let i=parseInt(e,10);return 2*(i>=0?i-1:i+t/2)},addVertex:function(e,t,i){let r=this.vertices,n=this.object.geometry.vertices;n.push(r[e+0],r[e+1],r[e+2]),n.push(r[t+0],r[t+1],r[t+2]),n.push(r[i+0],r[i+1],r[i+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,i){let r=this.normals,n=this.object.geometry.normals;n.push(r[e+0],r[e+1],r[e+2]),n.push(r[t+0],r[t+1],r[t+2]),n.push(r[i+0],r[i+1],r[i+2])},addFaceNormal:function(e,t,i){let r=this.vertices,n=this.object.geometry.normals;mCe.fromArray(r,e),V8.fromArray(r,t),gCe.fromArray(r,i),oc.subVectors(gCe,V8),vCe.subVectors(mCe,V8),oc.cross(vCe),oc.normalize(),n.push(oc.x,oc.y,oc.z),n.push(oc.x,oc.y,oc.z),n.push(oc.x,oc.y,oc.z)},addColor:function(e,t,i){let r=this.colors,n=this.object.geometry.colors;void 0!==r[e]&&n.push(r[e+0],r[e+1],r[e+2]),void 0!==r[t]&&n.push(r[t+0],r[t+1],r[t+2]),void 0!==r[i]&&n.push(r[i+0],r[i+1],r[i+2])},addUV:function(e,t,i){let r=this.uvs,n=this.object.geometry.uvs;n.push(r[e+0],r[e+1]),n.push(r[t+0],r[t+1]),n.push(r[i+0],r[i+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,i,r,n,s,a,o,l){let h=this.vertices.length,u=this.parseVertexIndex(e,h),c=this.parseVertexIndex(t,h),p=this.parseVertexIndex(i,h);if(this.addVertex(u,c,p),this.addColor(u,c,p),void 0!==a&&""!==a){let e=this.normals.length;u=this.parseNormalIndex(a,e),c=this.parseNormalIndex(o,e),p=this.parseNormalIndex(l,e),this.addNormal(u,c,p)}else this.addFaceNormal(u,c,p);if(void 0!==r&&""!==r){let e=this.uvs.length;u=this.parseUVIndex(r,e),c=this.parseUVIndex(n,e),p=this.parseUVIndex(s,e),this.addUV(u,c,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let i=0,r=e.length;i<r;i++){let r=this.parseVertexIndex(e[i],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let i=this.vertices.length,r=this.uvs.length;for(let n=0,s=e.length;n<s;n++)this.addVertexLine(this.parseVertexIndex(e[n],i));for(let n=0,s=t.length;n<s;n++)this.addUVLine(this.parseUVIndex(t[n],r))}};return e.startObject("",!1),e}var VO=class extends pi{constructor(e){super(e),this.materials=null}load(e,t,i,r){let n=this,s=new di(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(i){try{t(n.parse(i))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}setMaterials(e){return this.materials=e,this}parse(e){let t=new KFt;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));let i=e.split("\n"),r=[];for(let s=0,a=i.length;s<a;s++){let e=i[s].trimStart();if(0===e.length)continue;let n=e.charAt(0);if("#"!==n)if("v"===n){let i=e.split(fCe);switch(i[0]){case"v":t.vertices.push(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])),i.length>=7?(GO.setRGB(parseFloat(i[4]),parseFloat(i[5]),parseFloat(i[6])).convertSRGBToLinear(),t.colors.push(GO.r,GO.g,GO.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]));break;case"vt":t.uvs.push(parseFloat(i[1]),parseFloat(i[2]))}}else if("f"===n){let i=e.slice(1).trim().split(fCe),r=[];for(let e=0,t=i.length;e<t;e++){let t=i[e];if(t.length>0){let e=t.split("/");r.push(e)}}let n=r[0];for(let e=1,s=r.length-1;e<s;e++){let i=r[e],s=r[e+1];t.addFace(n[0],i[0],s[0],n[1],i[1],s[1],n[2],i[2],s[2])}}else if("l"===n){let i=e.substring(1).trim().split(" "),r=[],n=[];if(-1===e.indexOf("/"))r=i;else for(let e=0,t=i.length;e<t;e++){let t=i[e].split("/");""!==t[0]&&r.push(t[0]),""!==t[1]&&n.push(t[1])}t.addLineGeometry(r,n)}else if("p"===n){let i=e.slice(1).trim().split(" ");t.addPointGeometry(i)}else if(null!==(r=YFt.exec(e))){let e=(" "+r[0].slice(1).trim()).slice(1);t.startObject(e)}else if($Ft.test(e))t.object.startMaterial(e.substring(7).trim(),t.materialLibraries);else if(XFt.test(e))t.materialLibraries.push(e.substring(7).trim());else if(ZFt.test(e))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===n){if(r=e.split(" "),r.length>1){let e=r[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;let i=t.object.currentMaterial();i&&(i.smooth=t.object.smooth)}else{if("\0"===e)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+e+'"')}}t.finalize();let n=new ar;if(n.materialLibraries=[].concat(t.materialLibraries),1==!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let s=0,a=t.objects.length;s<a;s++){let e=t.objects[s],i=e.geometry,r=e.materials,a="Line"===i.type,o="Points"===i.type,l=!1;if(0===i.vertices.length)continue;let h=new ot;h.setAttribute("position",new dt(i.vertices,3)),i.normals.length>0&&h.setAttribute("normal",new dt(i.normals,3)),i.colors.length>0&&(l=!0,h.setAttribute("color",new dt(i.colors,3))),!0===i.hasUVIndices&&h.setAttribute("uv",new dt(i.uvs,2));let u,c=[];for(let n=0,s=r.length;n<s;n++){let e=r[n],i=e.name+"_"+e.smooth+"_"+l,s=t.materials[i];if(null!==this.materials)if(s=this.materials.create(e.name),!a||!s||s instanceof br){if(o&&s&&!(s instanceof Rn)){let e=new Rn({size:10,sizeAttenuation:!1});qr.prototype.copy.call(e,s),e.color.copy(s.color),e.map=s.map,s=e}}else{let e=new br;qr.prototype.copy.call(e,s),e.color.copy(s.color),s=e}void 0===s&&(s=a?new br:o?new Rn({size:1,sizeAttenuation:!1}):new Ws,s.name=e.name,s.flatShading=!e.smooth,s.vertexColors=l,t.materials[i]=s),c.push(s)}if(c.length>1){for(let e=0,t=r.length;e<t;e++){let t=r[e];h.addGroup(t.groupStart,t.groupCount,e)}u=a?new Kr(h,c):o?new Bi(h,c):new Je(h,c)}else u=a?new Kr(h,c[0]):o?new Bi(h,c[0]):new Je(h,c[0]);u.name=e.name,n.add(u)}else if(t.vertices.length>0){let e=new Rn({size:1,sizeAttenuation:!1}),i=new ot;i.setAttribute("position",new dt(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(i.setAttribute("color",new dt(t.colors,3)),e.vertexColors=!0);let r=new Bi(i,e);n.add(r)}return n}},zO=new Ve,jO=class extends pi{constructor(e){super(e),this.propertyNameMapping={},this.customPropertyMapping={}}load(e,t,i,r){let n=this,s=new di(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(i){try{t(n.parse(i))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}setPropertyNameMapping(e){this.propertyNameMapping=e}setCustomPropertyNameMapping(e){this.customPropertyMapping=e}parse(e){function t(e){let t="",i=0,r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/.exec(e);null!==r&&(t=r[1],i=new Blob([r[0]]).size);let n,s={comments:[],elements:[],headerLength:i,objInfo:""},a=t.split(/\r\n|\r|\n/);function o(e,t){let i={type:e[0]};return"list"===i.type?(i.name=e[3],i.countType=e[1],i.itemType=e[2]):i.name=e[1],i.name in t&&(i.name=t[i.name]),i}for(let l=0;l<a.length;l++){let e=a[l];if(e=e.trim(),""===e)continue;let t=e.split(/\s+/),i=t.shift();switch(e=t.join(" "),i){case"format":s.format=t[0],s.version=t[1];break;case"comment":s.comments.push(e);break;case"element":void 0!==n&&s.elements.push(n),n={},n.name=t[0],n.count=parseInt(t[1]),n.properties=[];break;case"property":n.properties.push(o(t,p.propertyNameMapping));break;case"obj_info":s.objInfo=e;break;default:console.log("unhandled",i,t)}}return void 0!==n&&s.elements.push(n),s}function i(e,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(e);case"float":case"double":case"float32":case"float64":return parseFloat(e)}}function r(e,t){let r=t.split(/\s+/),n={};for(let s=0;s<e.length;s++)if("list"===e[s].type){let t=[],a=i(r.shift(),e[s].countType);for(let n=0;n<a;n++)t.push(i(r.shift(),e[s].itemType));n[e[s].name]=t}else n[e[s].name]=i(r.shift(),e[s].type);return n}function n(){let e={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]};for(let t of Object.keys(p.customPropertyMapping))e[t]=[];return e}function s(e){let t=e.map((e=>e.name));function i(e){for(let i=0,r=e.length;i<r;i++){let r=e[i];if(t.includes(r))return r}return null}return{attrX:i(["x","px","posx"])||"x",attrY:i(["y","py","posy"])||"y",attrZ:i(["z","pz","posz"])||"z",attrNX:i(["nx","normalx"]),attrNY:i(["ny","normaly"]),attrNZ:i(["nz","normalz"]),attrS:i(["s","u","texture_u","tx"]),attrT:i(["t","v","texture_v","ty"]),attrR:i(["red","diffuse_red","r","diffuse_r"]),attrG:i(["green","diffuse_green","g","diffuse_g"]),attrB:i(["blue","diffuse_blue","b","diffuse_b"])}}function a(e,t){let i,a=n(),h="";null!==(i=/end_header\s([\s\S]*)$/.exec(e))&&(h=i[1]);let u=h.split(/\r\n|\r|\n/),c=0,p=0,d=t.elements[c],f=s(d.properties);for(let n=0;n<u.length;n++){let e=u[n];if(e=e.trim(),""===e)continue;p>=d.count&&(c++,p=0,d=t.elements[c],f=s(d.properties));let i=r(d.properties,e);l(a,d.name,i,f),p++}return o(a)}function o(e){let t=new ot;e.indices.length>0&&t.setIndex(e.indices),t.setAttribute("position",new dt(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new dt(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new dt(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new dt(e.colors,3)),e.faceVertexUvs.length>0&&(t=t.toNonIndexed(),t.setAttribute("uv",new dt(e.faceVertexUvs,2)));for(let i of Object.keys(p.customPropertyMapping))e[i].length>0&&t.setAttribute(i,new dt(e[i],p.customPropertyMapping[i].length));return t.computeBoundingSphere(),t}function l(e,t,i,r){if("vertex"===t){e.vertices.push(i[r.attrX],i[r.attrY],i[r.attrZ]),null!==r.attrNX&&null!==r.attrNY&&null!==r.attrNZ&&e.normals.push(i[r.attrNX],i[r.attrNY],i[r.attrNZ]),null!==r.attrS&&null!==r.attrT&&e.uvs.push(i[r.attrS],i[r.attrT]),null!==r.attrR&&null!==r.attrG&&null!==r.attrB&&(zO.setRGB(i[r.attrR]/255,i[r.attrG]/255,i[r.attrB]/255).convertSRGBToLinear(),e.colors.push(zO.r,zO.g,zO.b));for(let t of Object.keys(p.customPropertyMapping))for(let r of p.customPropertyMapping[t])e[t].push(i[r])}else if("face"===t){let t=i.vertex_indices||i.vertex_index,r=i.texcoord;3===t.length?(e.indices.push(t[0],t[1],t[2]),r&&6===r.length&&(e.faceVertexUvs.push(r[0],r[1]),e.faceVertexUvs.push(r[2],r[3]),e.faceVertexUvs.push(r[4],r[5]))):4===t.length&&(e.indices.push(t[0],t[1],t[3]),e.indices.push(t[1],t[2],t[3]))}}function h(e,t){let i={},r=0;for(let n=0;n<t.length;n++){let s=t[n],a=s.valueReader;if("list"===s.type){let t=[],n=s.countReader.read(e+r);r+=s.countReader.size;for(let i=0;i<n;i++)t.push(a.read(e+r)),r+=a.size;i[s.name]=t}else i[s.name]=a.read(e+r),r+=a.size}return[i,r]}function u(e,t,i){function r(e,t,i){switch(t){case"int8":case"char":return{read:t=>e.getInt8(t),size:1};case"uint8":case"uchar":return{read:t=>e.getUint8(t),size:1};case"int16":case"short":return{read:t=>e.getInt16(t,i),size:2};case"uint16":case"ushort":return{read:t=>e.getUint16(t,i),size:2};case"int32":case"int":return{read:t=>e.getInt32(t,i),size:4};case"uint32":case"uint":return{read:t=>e.getUint32(t,i),size:4};case"float32":case"float":return{read:t=>e.getFloat32(t,i),size:4};case"float64":case"double":return{read:t=>e.getFloat64(t,i),size:8}}}for(let n=0,s=e.length;n<s;n++){let s=e[n];"list"===s.type?(s.countReader=r(t,s.countType,i),s.valueReader=r(t,s.itemType,i)):s.valueReader=r(t,s.type,i)}}let c,p=this;if(e instanceof ArrayBuffer){let i=new Uint8Array(e),r=function(e){let t=0,i=!0,r="",n=[];do{let s=String.fromCharCode(e[t++]);"\n"!==s&&"\r"!==s?r+=s:("end_header"===r&&(i=!1),""!==r&&(n.push(r),r=""))}while(i&&t<e.length);return n.join("\r")+"\r"}(i),p=t(r);c="ascii"===p.format?a((new TextDecoder).decode(i),p):function(e,t){let i,r=n(),a="binary_little_endian"===t.format,c=new DataView(e,t.headerLength),p=0;for(let n=0;n<t.elements.length;n++){let e=t.elements[n],o=e.properties,d=s(o);u(o,c,a);for(let t=0;t<e.count;t++){i=h(p,o),p+=i[1];let t=i[0];l(r,e.name,t,d)}}return o(r)}(e,p)}else c=a(e,t(e));return c}},WO=class extends pi{constructor(e){super(e)}load(e,t,i,r){let n=this,s=new di(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(i){try{t(n.parse(i))}catch(t){r?r(t):console.error(t),n.manager.itemError(e)}}),i,r)}parse(e){function t(e,t,i){for(let r=0,n=e.length;r<n;r++)if(e[r]!==t.getUint8(i+r))return!1;return!0}let i=function(e){if("string"==typeof e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=255&e.charCodeAt(i);return t.buffer||t}return e}(e);return function(e){let i=new DataView(e);if(84+50*i.getUint32(80,!0)===i.byteLength)return!0;let r=[115,111,108,105,100];for(let n=0;n<5;n++)if(t(r,i,n))return!1;return!0}(i)?function(e){let t,i,r,n,s,a,o,l,h=new DataView(e),u=h.getUint32(80,!0),c=!1;for(let m=0;m<70;m++)1129270351==h.getUint32(m,!1)&&82==h.getUint8(m+4)&&61==h.getUint8(m+5)&&(c=!0,n=new Float32Array(3*u*3),s=h.getUint8(m+6)/255,a=h.getUint8(m+7)/255,o=h.getUint8(m+8)/255,l=h.getUint8(m+9)/255);let p=new ot,d=new Float32Array(3*u*3),f=new Float32Array(3*u*3);for(let m=0;m<u;m++){let e=84+50*m,l=h.getFloat32(e,!0),u=h.getFloat32(e+4,!0),p=h.getFloat32(e+8,!0);if(c){let n=h.getUint16(e+48,!0);32768&n?(t=s,i=a,r=o):(t=(31&n)/31,i=(n>>5&31)/31,r=(n>>10&31)/31)}for(let s=1;s<=3;s++){let a=e+12*s,o=3*m*3+3*(s-1);d[o]=h.getFloat32(a,!0),d[o+1]=h.getFloat32(a+4,!0),d[o+2]=h.getFloat32(a+8,!0),f[o]=l,f[o+1]=u,f[o+2]=p,c&&(n[o]=t,n[o+1]=i,n[o+2]=r)}}return p.setAttribute("position",new Wt(d,3)),p.setAttribute("normal",new Wt(f,3)),c&&(p.setAttribute("color",new Wt(n,3)),p.hasColors=!0,p.alpha=l),p}(i):function(e){let t,i=new ot,r=/solid([\s\S]*?)endsolid/g,n=/facet([\s\S]*?)endfacet/g,s=0,a=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,o=new RegExp("vertex"+a+a+a,"g"),l=new RegExp("normal"+a+a+a,"g"),h=[],u=[],c=new D,p=0,d=0,f=0;for(;null!==(t=r.exec(e));){d=f;let e=t[0];for(;null!==(t=n.exec(e));){let e=0,i=0,r=t[0];for(;null!==(t=l.exec(r));)c.x=parseFloat(t[1]),c.y=parseFloat(t[2]),c.z=parseFloat(t[3]),i++;for(;null!==(t=o.exec(r));)h.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),u.push(c.x,c.y,c.z),e++,f++;1!==i&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+s),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+s),s++}let r=d,a=f-d;i.addGroup(r,a,p),p++}return i.setAttribute("position",new dt(h,3)),i.setAttribute("normal",new dt(u,3)),i}("string"!=typeof(r=e)?(new TextDecoder).decode(r):r);var r}},F0=class{constructor(e){this.buffer=e,this.u8=new Uint8Array(e)}getBit(e){var t=7&e;return(this.u8[e>>3]&128>>t)>>7-t}setBit(e,t){var i=e>>3,r=this.u8[i],n=7&e;this.u8[i]=t?r|128>>n:r&~(128>>n)}getInt12(e){var t=e/8|0,i=this.u8[t],r=this.u8[t+1],n=this.u8[t+2],s=e%8,a=8-s,o=Math.min(12-a,8);return(((i&=~(255<<a))<<16)+((r&=255<<8-o)<<8)+(n&=255<<8-Math.max(12-a-o,0))>>12-s)-2048}setInt12(e,t){var i=e/8|0,r=e%8,n=(t+=2048)<<12-r,s=(16711680&n)>>16,a=(65280&n)>>8,o=255&n,l=8-r,h=Math.min(12-l,8),u=Math.max(12-l-h,0),c=255<<l;this.u8[i]=(this.u8[i]&c)+s;var p=~(255<<8-h);this.u8[i+1]=(this.u8[i+1]&p)+a;var d=~(255<<8-u);this.u8[i+2]=(this.u8[i+2]&d)+o}getInt6(e){var t=e/8|0,i=this.u8[t],r=this.u8[t+1],n=e%8,s=8-n;return(((i&=~((255<<s)+(255>>8-(2-n))))<<8)+(r&=255<<8-Math.max(6-s,0))>>10-n)-32}setInt6(e,t){var i=e/8|0,r=e%8,n=(t+=32)<<10-r,s=(65280&n)>>8,a=255&n,o=8-r,l=Math.max(6-o,0),h=(255<<o)+(255>>8-(2-r));this.u8[i]=(this.u8[i]&h)+s;var u=~(255<<8-l);this.u8[i+1]=(this.u8[i+1]&u)+a}test(){var e,t,i=new ArrayBuffer(3),r=new F0(i);for(t=0;t<12;t++)for(e=-2048;e<2048;e++)if(r.setInt12(t,e),r.getInt12(t)!=e){console.log("12-bit prob at",t,e),console.log("expected",e,"got",r.getInt12(t));break}for(t=0;t<18;t++)for(e=-32;e<32;e++)if(r.setInt6(t,e),r.getInt6(t)!=e){console.log("6-bit prob at",t,e),console.log("expected",e,"got",r.getInt6(t));break}return r}},yCe=(e=>(e[e.NULL=0]="NULL",e[e.POINT=1]="POINT",e[e.POLYLINE=3]="POLYLINE",e[e.POLYGON=5]="POLYGON",e))(yCe||{}),qO=class{parse(e){var t={},i=new DataView(e),r=0;if(t.fileCode=i.getInt32(r,!1),9994!=t.fileCode)throw new Error("Unknown file code: "+t.fileCode);for(r+=24,t.wordLength=i.getInt32(r,!1),t.byteLength=2*t.wordLength,r+=4,t.version=i.getInt32(r,!0),r+=4,t.shapeType=i.getInt32(r,!0),r+=4,t.minX=i.getFloat64(r,!0),t.minY=i.getFloat64(r+8,!0),t.maxX=i.getFloat64(r+16,!0),t.maxY=i.getFloat64(r+24,!0),t.minZ=i.getFloat64(r+32,!0),t.maxZ=i.getFloat64(r+40,!0),t.minM=i.getFloat64(r+48,!0),t.maxM=i.getFloat64(r+56,!0),r+=64,t.records=[];r<t.byteLength;){var n={};n.number=i.getInt32(r,!1),r+=4,n.length=i.getInt32(r,!1),r+=4;try{n.shape=this.parseShape(i,r,n.length)}catch(e){console.log(e,n)}r+=2*n.length,t.records.push(n)}return t}parseShape(e,t,i){var r=0,n=null,s={};switch(s.type=e.getInt32(t,!0),t+=4,s.type){case 0:break;case 1:s.content={x:e.getFloat64(t,!0),y:e.getFloat64(t+8,!0)};break;case 3:case 5:for(n=s.content={minX:e.getFloat64(t,!0),minY:e.getFloat64(t+8,!0),maxX:e.getFloat64(t+16,!0),maxY:e.getFloat64(t+24,!0),parts:new Int32Array(e.getInt32(t+32,!0)),points:new Float64Array(2*e.getInt32(t+36,!0))},t+=40,r=0;r<n.parts.length;r++)n.parts[r]=e.getInt32(t,!0),t+=4;for(r=0;r<n.points.length;r++)n.points[r]=e.getFloat64(t,!0),t+=8;break;case 8:case 11:case 13:case 15:case 18:case 21:case 23:case 25:case 28:case 31:throw new Error("Shape type not supported: "+s.type+":"+ +s.type);default:throw new Error("Unknown shape type at "+(t-4)+": "+s.type)}return s}},YO=class{constructor(){this.LINE_MATERIAL=new br({color:0,linewidth:2,opacity:.8,transparent:!0}),this.MESH_MATERIAL=new Xt({color:1926655,opacity:.8,transparent:!0})}createModel(e){for(var t=[],i=[],r=0;r<e.records.length;r++){var n=e.records[r].shape;if(3===n.type||5===n.type)for(var s=n.content.points,a=n.content.parts,o=0;o<a.length;o++){let e=[];for(var l=a[o],h=a[o+1]||s.length/2;l<h;l++){var u=s[2*l],c=s[2*l+1];e.push(new D(u,c,0))}if(5===n.type){let r=Ps.triangulateShape(e,[]),n=[];r.forEach((e=>n.push(...e)));let s=new ot;s.setFromPoints(e),s.setIndex(n),t.push(s);let a=new ot;e.length>2&&!e[0].equals(e[e.length-1])&&e.push(e[0]),a.setFromPoints(e),i.push(a)}else{let t=new ot;t.setFromPoints(e),i.push(t)}}}var p=new qt;for(r=0;r<i.length;r++)p.add(new Sr(i[r],this.LINE_MATERIAL));for(r=0;r<t.length;r++)p.add(new Je(t[r],this.MESH_MATERIAL));return console.log("parsed",t.length,i.length),p}loadCompressed(e){for(var t=this.deltaDecode6(e),i=[],r=[],n=0;n<t.length;n++){let e=[];if(-32768!==t[n]){var s=180*t[n]/32767,a=180*t[n+1]/32767;n++,e.push(new D(s,a,0))}else{for(var o=[],l=1;l<e.length;l++)e[l-1].x==e[l].x&&e[l-1].y==e[l].y||o.push(e[l]);let t=new ot;t.setFromPoints(o),i.push(t),e=[]}}var h=new qt;for(n=0;n<r.length;n++)h.add(new Sr(r[n],this.LINE_MATERIAL));for(n=0;n<i.length;n++)h.add(new Je(i[n],this.MESH_MATERIAL));return console.log("parsed compressed",i.length,r.length),h}compress(e){for(var t=[],i=0;i<e.records.length;i++){var r=e.records[i].shape;if(5===r.type)for(var n=r.content.points,s=r.content.parts,a=0;a<s.length;a++){for(var o=s[a],l=s[a+1]||n.length/2;o<l;o++){var h=n[2*o],u=n[2*o+1];t.push(h/180*32767,u/180*32767)}t.push(-32768)}}var c=new Int16Array(t);console.log("16-bit quantized byteLength",c.buffer.byteLength);var p=this.deltaEncode6(c);return console.log("delta-encoded byteLength",p.byteLength),p}deltaEncode(e){for(var t=[],i=[],r=[],n=0,s=0,a=0,o=0;o<e.length;o++)-32768!=e[o]?0==r.length?(n=e[o],s=e[o+1],r.push(n,s),a+=4,o++):Math.abs(n-e[o])>1023||Math.abs(s-e[o+1])>1023?(i.push(r),a+=1,r=[],n=e[o],s=e[o+1],r.push(n,s),a+=4,o++):(r.push((e[o]-n)/8,(e[o+1]-s)/8),n+=8*((e[o]-n)/8|0),s+=8*((e[o+1]-s)/8|0),a+=2,o++):(i.push(r),t.push(i),i=[],r=[],a+=3);return this.storeDeltas(a,t)}deltaEncode6(e){var t=[],i=[],r=[],n=0,s=0,a=0,o=0;for(a=0;a<e.length;a++)e[a]=0|e[a]/16;for(a=0;a<e.length;a++)-2048!==e[a]?0==r.length?(n=e[a],s=e[a+1],r.push(n,s),o+=4,a++):Math.abs(n-e[a])>31||Math.abs(s-e[a+1])>31?(i.push(r),o+=1,r=[],n=e[a],s=e[a+1],r.push(n,s),o+=4,a++):(r.push(e[a]-n,e[a+1]-s),n+=e[a]-n,s+=e[a+1]-s,o+=2,a++):(i.push(r),t.push(i),i=[],r=[],o+=3);return this.storeDeltas6(o,t)}storeDeltas(e,t){for(var i=new ArrayBuffer(e),r=new DataView(i),n=0,s=0;s<t.length;s++){for(var a=t[s],o=0;o<a.length;o++){var l=a[o];r.setInt16(n,l[0]),n+=2,r.setInt16(n,l[1]),n+=2;for(var h=2;h<l.length;h++)r.setInt8(n++,l[h]);r.setInt8(n,-128),n+=1}r.setInt16(n,-32768),n+=2}return i}deltaDecode(e){for(var t=new DataView(e),i=0,r=[];i<e.byteLength;){var n=t.getInt16(i);if(i+=2,-32768!==n){var s=t.getInt16(i);for(i+=2,r.push(n,s);i<e.byteLength;){var a=t.getInt8(i);if(i++,-128==a)break;var o=t.getInt8(i);i++,n+=8*a,s+=8*o,r.push(n,s)}}else r.push(-32768)}return r}storeDeltas6(e,t){for(var i=new ArrayBuffer(Math.ceil(.75*e)+4),r=new F0(i),n=32,s=0;s<t.length;s++){for(var a=t[s],o=0;o<a.length;o++){var l=a[o];r.setInt12(n,l[0]),n+=12,r.setInt12(n,l[1]),n+=12;for(var h=2;h<l.length;h++)r.setInt6(n,l[h]),n+=6;r.setInt6(n,-32),n+=6}r.setInt12(n,-2048),n+=12}return new DataView(i).setUint32(0,n),i}deltaDecode6(e){for(var t=new DataView(e).getUint32(0),i=new F0(e),r=32,n=[];r<t;){var s=i.getInt12(r);if(r+=12,-2048!==s){var a=i.getInt12(r);for(r+=12,n.push(s,a);r<t;){var o=i.getInt6(r);if(r+=6,-32===o)break;var l=i.getInt6(r);r+=6,s+=o,a+=l,n.push(s,a)}}else n.push(-2048)}for(var h=0;h<n.length;h++)n[h]*=16;return n}},XO=class{load(e,t,i,r){return ct(this,null,(function*(){this.updateProgress(i,0);let n=new XMLHttpRequest;n.responseType="arraybuffer",n.onload=()=>{this.updateProgress(i,50);let e=(new qO).parse(n.response),r=(new YO).createModel(e);this.updateProgress(i,99),t(r)},n.onerror=r,n.open("GET",e),n.send(null)}))}updateProgress(e,t){e&&e(new ProgressEvent("progress",{lengthComputable:!0,loaded:t,total:100}))}},z8=class{constructor(e){this.manager=e}loadLocalModel(e,t,i){return ct(this,null,(function*(){let r=t.toLowerCase();return r.endsWith("fbx")?this.loadFbx(e,i):r.endsWith("obj")?this.loadObj(e,i):r.endsWith("stl")?this.loadStl(e,i):r.endsWith("ifc")?this.loadIfc(e,i):r.endsWith("shp")?this.loadShp(e,i):r.endsWith("dae")?this.loadDae(e,i):r.endsWith("dxf")?this.loadDxf(e,i):r.endsWith("jpg")||r.endsWith("jpeg")||r.endsWith("png")?this.loadImage(e,i):this.loadGltf(e,i)}))}loadModel(e,t,i){return ct(this,null,(function*(){let r=e;if(!r)return Promise.resolve();let n=(null==t?void 0:t.toLowerCase())||"";if(!n){let e=r.split("?")[0].toLowerCase();if(e){let t=e.lastIndexOf(".");-1!==t&&(n=e.slice(t+1))}}return n.endsWith("fbx")?this.loadFbx(r,i):n.endsWith("obj")?this.loadObj(r,i):n.endsWith("stl")?this.loadStl(r,i):n.endsWith("ifc")?this.loadIfc(r,i):n.endsWith("shp")?this.loadShp(r,i):n.endsWith("dae")?this.loadDae(r,i):n.endsWith("dxf")?this.loadDxf(r,i):n.endsWith("jpg")||n.endsWith("jpeg")||n.endsWith("png")?this.loadImage(r,i):this.loadGltf(r,i)}))}loadGltf(e,t){return ct(this,null,(function*(){let i=this.getGltfLoader();-1!==e.indexOf("#")&&console.warn(`[LoadingHelper] '#' is not allowed in filename ${e}`),e=e.replace(/#/g,encodeURIComponent("#"));let r=yield i.loadAsync(e,t);return Promise.resolve(r.scene)}))}parseGltf(e,t,i,r){return this.getGltfLoader().parse(e,t,(e=>i(e.scene)),r)}loadFbx(e,t){return ct(this,null,(function*(){let i=yield new lO(this.manager).loadAsync(e,t);return Promise.resolve(i)}))}loadObj(e,t){return ct(this,null,(function*(){let i=new VO(this.manager),r=new kO(this.manager),n=e.replace(".obj",".mtl"),s=yield r.loadAsync(n,t);s.preload(),i.setMaterials(s);let a=yield i.loadAsync(e,t);return Promise.resolve(a)}))}loadStl(e,t){return ct(this,null,(function*(){let i=yield new WO(this.manager).loadAsync(e,t);return Promise.resolve(new Je(i))}))}loadIfc(e,t){return ct(this,null,(function*(){let i=new BO(this.manager),r=i.ifcManager;r&&"function"==typeof r.setWasmPath&&r.setWasmPath("../three/js/libs/ifc/");let n=yield i.loadAsync(e,t);return Promise.resolve(n.mesh)}))}loadShp(e,t){return ct(this,null,(function*(){let i=new XO;return new Promise(((r,n)=>{i.load(e,(e=>{r(e)}),t,(e=>{n(e)}))}))}))}loadDae(e,t){return ct(this,null,(function*(){let i=yield new nO(this.manager).loadAsync(e,t);return Promise.resolve(i.scene)}))}loadDxf(e,t){return ct(this,null,(function*(){var i;this.font||console.warn("[LoadingHelper] Should set font first!");let r=new gr(this.manager,!0,!1);r.setFont(this.font);try{this.font&&this.font.getFontData&&(yield null==(i=this.font)?void 0:i.getFontData());let n=yield r.loadAsync(e,t);return Promise.resolve(n.threejsObject)}catch(e){let i=new ErrorEvent("");return Promise.reject(i)}}))}loadPly(e,t){return ct(this,null,(function*(){let i=yield new jO(this.manager).loadAsync(e,t);return Promise.resolve(new Je(i))}))}loadImage(e,t){return ct(this,null,(function*(){let i=yield new gs(this.manager).loadAsync(e,t);if(!i)return Promise.reject("Failed to load image!");let r=i.image,n=r&&r.height||10,s=r&&r.width||10;n*=10/s,s=10;let a=new Xt({map:i,side:bi,transparent:!0}),o=new En(s,n),l=new Je(o,a);return Promise.resolve(l)}))}loadDxfData(e,t,i,r,n,s){return ct(this,null,(function*(){var a;this.font||console.warn("[LoadingHelper] Should set font first!");let o=new gr(this.manager,n,s);return o.setFont(this.font),o.manager.onLoad=()=>{r&&r()},this.font&&this.font.getFontData&&(yield null==(a=this.font)?void 0:a.getFontData()),o.load(e,t,i)}))}setFont(e){this.font=e}static setDracoDecoderPath(e){this.decoderPath=e}getGltfLoader(){if(!this.gltfLoader){this.gltfLoader=new gh(this.manager);let e=new sO(this.manager);e.setDecoderPath(z8.decoderPath),this.gltfLoader.setDRACOLoader(e)}return this.gltfLoader}},pl=z8;pl.decoderPath="three/js/libs/draco/gltf/";var $O,gT=class{constructor(e){this.running=!1,this.workers=[];let t=1;e?t=e:window.navigator&&(t=Math.max(t,window.navigator.hardwareConcurrency-1));for(let i=0;i<t;i++)this.workers[i]=new sA}isRunning(){return this.running}generate(e){return ct(this,arguments,(function*(e,t={}){if(this.running)re.warn("[BVHHelper] Already running job.");else{if(0!==this.workers.length)return this.running=!0,new Promise((i=>{let r=this.workers.length,n=e.length,s=[],a=Math.floor(n/r),o=n%r,l=0,h=0;for(let u=0;u<r;u++){let i=this.workers[u];if(u<o?(l=u*a+u,h=l+a+1):(l=u*a+o,h=l+a),l=Math.min(l,n),h=Math.min(h,n),l>=h)break;re.debug("startIndex: "+l+" endIndex: "+h),s.push(i.generate(e.slice(l,h),t))}Promise.allSettled(s).then((()=>{this.running=!1,i()}))}));re.warn("[BVHHelper] Worker has been disposed.")}}))}dispose(){for(let e=0;e<this.workers.length;e++)this.workers[e].dispose();this.workers=[]}static createMeshBvhSync(e,t={}){let i=new Set;e.forEach((e=>{e.traverse((e=>{let r=e;if(r.isMesh&&r.geometry&&Zi.isMergedMesh(r)&&!(r instanceof sn)){if(i.has(r.geometry.id))return;r.geometry.index&&t.saveOriginalIndex&&(r.geometry.userData.originalIndex=r.geometry.index.array.slice()),r.geometry.boundsTree=new Wc(r.geometry,t),i.add(r.geometry.id)}}))}))}static createMeshBvhAsync(e,t={}){let i=new Set,r=[];e.forEach((e=>{e.traverse((e=>{let t=e;if(t.isMesh&&t.geometry&&Zi.isMergedMesh(t)&&!(t instanceof sn)){if(i.has(t.geometry.id))return;r.push(t.geometry),i.add(t.geometry.id)}}))}));let n=new gT;n.generate(r,t).then((()=>{n.dispose()}))}},ECe=class{constructor(e,t,i,r,n){this.targetPixelHeight=100,this.canvasHeight=800,this.camera=e,this.object=i,this.targetPixelHeight=r,this.canvasHeight=n,this.adjustSize(),t.addEventListener("update",(()=>{this.adjustSize()}))}adjustSize(){let e=new Rt;if(this.object.updateMatrix(),e.expandByObject(this.object),!e)return;let t=e.max.x-e.min.x,i=this.camera.position.distanceTo(this.object.position),r=JFt(t,i,this.canvasHeight);if(Math.abs(r-this.targetPixelHeight)<5)return;let n=this.object.scale.x;n*=this.targetPixelHeight/r,this.object.scale.set(n,n,n),this.object.updateMatrix()}},JFt=(e,t,i=800,r=45)=>{let n=r*(Math.PI/180);return i*(e/(2*Math.tan(n/2)*t))},ha=class extends Ys{constructor(e){super(Tt.guid()),this.needsFrustumCulled=!1,this.renderOrder=1e3,this.snapType="Dot",this.snapLineVisible=!1,this.snapType=e,this.drawSnapFunctions={Dot:this.drawDot.bind(this),Square:this.drawSquare.bind(this),Triangle:this.drawTriangle.bind(this),CircleWithCross:this.drawCircleWithCross.bind(this),Cross:this.drawCross.bind(this),Perpendicular:this.drawPerpendicular.bind(this)}}setSnapLineVisible(e){this.snapLineVisible=e}draw(e,t){this.osnapInfo&&(this.snapLineVisible&&this.drawSnapLine(e,t),e.save(),e.fillStyle=ha.FILL_COLOR,e.strokeStyle=ha.LINE_COLOR,e.lineWidth=ha.LINE_WIDTH,"CircleWithCross"===this.snapType&&(e.fillStyle=ha.FILL_COLOR_NONE,e.lineWidth=ha.LINE_WIDTH_1),e.beginPath(),this.drawSnapFunctions[this.snapType](e,t),$O&&this.drawDebug(e,t),e.closePath(),e.fill(),e.stroke(),e.restore())}drawDebug(e,t){null==$O||$O.forEach((i=>{let r=this.transToScreenCoord(i.start,t),n=this.transToScreenCoord(i.end,t);e.moveTo(r.x,r.y),e.lineTo(n.x,n.y)}))}drawSelect(e,t){}isPointInPath(e){return!1}drawSnapLine(e,t){e.save(),e.strokeStyle=ha.SNAP_LINE_COLOR,e.lineWidth=ha.LINE_WIDTH;let i=this.osnapInfo.line;if(!i)return;let r=this.transToScreenCoord(i.start,t),n=this.transToScreenCoord(i.end,t);e.moveTo(r.x,r.y),e.lineTo(n.x,n.y),e.stroke(),e.restore()}drawDot(e,t){let i=this.transToScreenCoord(this.osnapInfo.point,t);e.arc(i.x,i.y,ha.SNAP_ICON_SIZE/3,0,2*Math.PI)}drawSquare(e,t){let i=this.transToScreenCoord(this.osnapInfo.point,t),r=ha.SNAP_ICON_SIZE/1.2,n=ha.SNAP_ICON_SIZE/1.2;e.rect(i.x-r/2,i.y-n/2,r,n)}drawTriangle(e,t){let i=this.transToScreenCoord(this.osnapInfo.point,t),r=ha.SNAP_ICON_SIZE/1.2/2,n=new ce(0,-r).add(i),s=new ce(-.87*r,r/2).add(i),a=new ce(.87*r,r/2).add(i);e.moveTo(n.x,n.y),e.lineTo(s.x,s.y),e.lineTo(a.x,a.y),e.closePath()}drawCircleWithCross(e,t){let i=this.transToScreenCoord(this.osnapInfo.point,t),r=ha.SNAP_ICON_SIZE/1.2;e.arc(i.x,i.y,r,0,2*Math.PI),e.moveTo(i.x-r/1.8,i.y),e.lineTo(i.x+r/1.8,i.y),e.moveTo(i.x,i.y-r/1.8),e.lineTo(i.x,i.y+r/1.8)}drawCross(e,t){let i=this.transToScreenCoord(this.osnapInfo.point,t),r=ha.SNAP_ICON_SIZE/1.2/2,n=new ce(-r,-r).add(i),s=new ce(r,r).add(i),a=new ce(r,-r).add(i),o=new ce(-r,r).add(i);e.moveTo(n.x,n.y),e.lineTo(s.x,s.y),e.moveTo(a.x,a.y),e.lineTo(o.x,o.y)}drawPerpendicular(e,t){let i=this.transToScreenCoord(this.osnapInfo.point,t),r=ha.SNAP_ICON_SIZE/1.2/2;[new ce(0,0).add(i),new ce(-r,0).add(i),new ce(0,0).add(i),new ce(0,r).add(i),new ce(r,r).add(i),new ce(-r,r).add(i),new ce(-r,r).add(i),new ce(-r,-r).add(i)].forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)}))}update(e){this.osnapInfo=e}getClassType(){return"SnapDrawable"}},pa=ha;pa.LINE_COLOR="rgba(255, 240, 0, 0.8)",pa.FILL_COLOR="rgba(135, 206, 250, 0.5)",pa.FILL_COLOR_NONE="rgba(0, 0, 0, 0)",pa.SNAP_LINE_COLOR="rgba(255, 240, 0, 0.3)",pa.LINE_WIDTH_1=.8,pa.LINE_WIDTH=2.5,pa.SNAP_ICON_SIZE=10,Rr._registerDrawableClass(pa);var QFt=(e=>(e[e.None=0]="None",e[e.PointOnLine=1]="PointOnLine",e[e.StartPoint=2]="StartPoint",e[e.EndPoint=4]="EndPoint",e[e.MiddlePoint=8]="MiddlePoint",e[e.FootOfPerpendicular=16]="FootOfPerpendicular",e[e.Intersection=32]="Intersection",e[e.CircleCenter=64]="CircleCenter",e))(QFt||{}),e5t=1e-5,ZO=class{constructor(e){var t;this.drawableList=new Xc("snap"),this.markers={},this.activeOSnapType=0,this.snapTolerance=1,this.overlayRender=e,null==(t=this.overlayRender)||t.addDrawableList(this.drawableList),this.initOSnapMarkers()}initOSnapMarkers(){let e=new pa("Dot"),t=new pa("Square"),i=new pa("Triangle"),r=new pa("CircleWithCross"),n=new pa("Cross"),s=new pa("Perpendicular");this.markers[2]=t,this.markers[4]=t,this.markers[8]=i,this.markers[1]=e,this.markers[32]=n,this.markers[64]=r,this.markers[16]=s,Object.values(this.markers).forEach((e=>{e.visible=!1,this.drawableList.addDrawable(e)}))}updateSnapTolerance(e){this.snapTolerance=e}getSnapTolerance(){return this.snapTolerance}getMarker(e){return this.markers[e]}deactivate(){this.activeOSnapType&&(this.markers[this.activeOSnapType].visible=!1),this.activeOSnapType=0}destroy(){}handleSnap(e,t,i,r){if(null==t||!t.length)return void this.activateMarker(0);let n=this.getIntersectionPointsAndLines(e,t,i);if(n){let t=this.getSnapInfo(e,n,r);return t&&0!==t.type?(this.activateMarker(t.type,i,t),t.point):void this.activateMarker(0)}this.activateMarker(0)}activateMarker(e,t=!1,i){var r;this.activeOSnapType&&(this.markers[this.activeOSnapType].visible=!1),this.activeOSnapType=e;let n=this.markers[e];n&&i&&(n.setSnapLineVisible(t),n.update(i),n.visible=!0),null==(r=this.overlayRender)||r.render()}getFootOfPerpendicular(e,t,i=e5t){let{start:r,end:n}=t,s=r.x-n.x,a=r.y-n.y,o=r.z-n.z;if(r.distanceTo(n)<i)return r.clone();let l=(e.x-r.x)*(r.x-n.x)+(e.y-r.y)*(r.y-n.y)+(e.z-r.z)*(r.z-n.z);return l/=s*s+a*a+o*o,new D(r.x+l*s,r.y+l*a,r.z+l*o)}getIntersectionPointsAndLines(e,t,i){if(!t.length)return;let r=[],n=new Rt;n.setFromCenterAndSize(e,new D(1,1,1).multiplyScalar(5*this.snapTolerance));let s=new Rt;for(let a=0;a<t.length;a++){let e=t[a],o=e.object;if(o instanceof Sr){let e=o instanceof Kr?2:1,t=o.geometry.index,a=o.geometry.attributes.position;if(t)for(let l=0,h=t.count;l<h-1;l+=e){let e=t.getX(l),h=t.getX(l+1),u=new D,c=new D;u.fromBufferAttribute(a,e),c.fromBufferAttribute(a,h),u.applyMatrix4(o.matrixWorld),c.applyMatrix4(o.matrixWorld),i||(u.setZ(0),c.setZ(0)),s.setFromPoints([u,c]),n.intersectsBox(s)&&r.push({start:u,end:c})}else for(let l=1,h=a.count;l<h;l+=e){let e=new D,t=new D;e.fromBufferAttribute(a,l-1),t.fromBufferAttribute(a,l),e.applyMatrix4(o.matrixWorld),t.applyMatrix4(o.matrixWorld),i||(e.setZ(0),t.setZ(0)),s.setFromPoints([e,t]),n.intersectsBox(s)&&r.push({start:e,end:t})}}else if(o instanceof Bi){let t=o.geometry.getAttribute("position"),i=t.array,n=t.itemSize,s=(e.index||0)*n,a=i.itemSize>2?i[s+2]:0,l=new D(i[s],i[s+1],a);l.applyMatrix4(o.matrixWorld),"CircleCenter"===o.userData.type?r.push(l):r.push({start:l,end:l})}}return r}getSnapInfo(e,t,i){let r,n=[];for(let s of t)if(s instanceof D){let t=e.distanceTo(s);t<2*this.snapTolerance&&n.push({distance:t,type:64,point:s})}else{let t=s,{start:a,end:o}=t;if(i){let r=this.getFootOfPerpendicular(i,t,this.snapTolerance),s=e.distanceTo(r);if(s<this.snapTolerance){n.push({distance:$t.floorNumber(s,7),type:16,point:r,line:t});continue}}let l=e.distanceTo(a),h=e.distanceTo(o);if(l<this.snapTolerance){n.push({distance:$t.floorNumber(l,7),type:2,point:a,line:t});continue}if(h<this.snapTolerance){n.push({distance:$t.floorNumber(h,7),type:4,point:o,line:t});continue}if(kt.isPointOnLineSegment(e,t,this.snapTolerance)){let i=o.clone().add(a).multiplyScalar(.5),s=i.distanceTo(e);if(s<this.snapTolerance){n.push({point:i,distance:$t.floorNumber(s,7),type:8,line:t});continue}if(r){let i=kt.getLineSegmentsIntersectingPoint(r,t);if(i){let s=e.distanceTo(i)/2;if(s<this.snapTolerance){n.push({point:i,distance:$t.floorNumber(s,7),type:32,line:t}),r=void 0;continue}continue}}else{let i=this.getFootOfPerpendicular(e,t,this.snapTolerance),s=e.distanceTo(i);if(s<this.snapTolerance){n.push({point:i,distance:$t.floorNumber(s,7),type:1,line:t}),r=t;continue}}}}return n=n.sort(((e,t)=>t.type-e.type)),n[0]}},j8=ps(Zc(),1),Dh=class{constructor(e,t,i){this.follow=e=>{let{x:t,y:i}=xi.getScreenPointByEvent(e,this.parentNode);this.node.style.left=t+15+"px",this.node.style.top=i-30+"px"},this.show=()=>this.node.hasAttribute("hidden")&&this.node.removeAttribute("hidden"),this.hide=()=>!this.node.hasAttribute("hidden")&&this.node.setAttribute("hidden",""),this.destroy=()=>{this.target?this.target.removeEventListener(Nf,this.follow):document.removeEventListener(Nf,this.follow),this.parentNode.removeChild(this.node)},this.node=document.createElement("div"),this.node.id=e,t&&this.node.append(t),this.childNode=document.createElement("div"),this.target=null==i?void 0:i.target,this.parentNode=(null==i?void 0:i.parentNode)||document.body,null!=i&&i.followPointer&&(this.node.classList.add("follow-tooltip"),this.target?this.target.addEventListener(Nf,this.follow):document.addEventListener(Nf,this.follow)),this.parentNode.appendChild(this.node),(null==i||!i.showOnCreate)&&this.node.setAttribute("hidden","")}setContent(e){this.node.textContent&&(this.node.textContent=null),(0,j8.forEach)(this.node.children,(e=>{this.node.removeChild(e)})),this.node.append(e),this.node.appendChild(this.childNode)}updateChildContent(e){this.childNode.textContent&&(this.childNode.textContent=null),(0,j8.forEach)(this.childNode.children,(e=>{this.childNode.removeChild(e)})),this.childNode.append(e)}},KO=class{constructor(e){this.mouseDown=!1,this.mouseMove=!1,this.mouseDownPositionX=-1,this.mouseDownPositionY=-1,this.tempEnableRotate=!1,this.actived=!1,this.isResolvedOrRejected=!1,this.mousedown=e=>{var t,i;if(0===e.button){this.mouseDown=!0;let r=new ce(e.x,e.y);this.mouseDownPositionX=r.x,this.mouseDownPositionY=r.y,null==(t=this.tooltip)||t.hide(),null==(i=this.tooltip)||i.destroy(),this.tooltip=void 0}},this.mousemove=e=>{if(!this.mouseDown)return;let t=new ce(e.x,e.y);if(this.mouseDownPositionX>=0&&this.mouseDownPositionY>=0&&(Math.abs(t.x-this.mouseDownPositionX)>=5||Math.abs(t.y-this.mouseDownPositionY)>=5)){this.mouseMove=!0;let e=new ce(Math.min(this.mouseDownPositionX,t.x),Math.min(this.mouseDownPositionY,t.y)),i=new ce(Math.max(this.mouseDownPositionX,t.x),Math.max(this.mouseDownPositionY,t.y));this.drawRect(e,i)}},this.mouseup=e=>{if(this.mouseDown&&this.mouseMove){let t=new ce(e.x,e.y),i=new ce(Math.min(this.mouseDownPositionX,t.x),Math.min(this.mouseDownPositionY,t.y)),r=new ce(Math.max(this.mouseDownPositionX,t.x),Math.max(this.mouseDownPositionY,t.y)),n=new ns(i,r);this.deactivate(),this.setRectDomVisible(!1),this.resolve&&(this.resolve(n),this.isResolvedOrRejected=!0)}this.mouseDown=!1,this.mouseMove=!1,this.mouseDownPositionX=-1,this.mouseDownPositionY=-1},this.viewer=e,this.input=e.getInputManager()}get viewerContainer(){return this.viewer.viewerContainer}isActived(){return this.actived}activate(){var e;if(this.isActived())return void(this.reject&&(this.deactivate(),this.reject("BoxSelectHelper is already actived!"),this.isResolvedOrRejected=!0));this.actived=!0,this.input.addEventListener("pointerdown",this.mousedown),this.input.addEventListener("pointermove",this.mousemove),this.input.addEventListener("pointerup",this.mouseup);let t=this.viewer.controls;this.tempKey=t.mouseButtons.left,this.tempEnableRotate=t.enableRotate,t.mouseButtons.left=et.NONE,this.tempTouch=t.touches.one,t.touches.one=et.NONE,t.enableRotate=!1;let i=this.viewer.translate;if(i){this.tooltip=new Dh("box-select-tooltip",i("Tooltip.boxSelect"),{followPointer:!0,showOnCreate:!0,parentNode:this.viewer.widgetContainer,target:this.viewerContainer});let t=document.getElementById("box-select-tooltip");t&&(t.style.pointerEvents="none");let r=i("Tooltip.boxSelect");r&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(r))}this.viewer.dispatchEvent("BoxSelectActivated")}deactivate(){var e,t;this.actived=!1,this.input.removeEventListener("pointerdown",this.mousedown),this.input.removeEventListener("pointermove",this.mousemove),this.input.removeEventListener("pointerup",this.mouseup),null==(e=this.tooltip)||e.hide(),null==(t=this.tooltip)||t.destroy(),this.tooltip=void 0,this.viewer.controls.mouseButtons.left=this.tempKey,this.viewer.controls.enableRotate=this.tempEnableRotate,this.viewer.controls.touches.one=this.tempTouch,this.viewer.dispatchEvent("BoxSelectDeactivated")}drawRect(e,t){this.rectDom||(this.rectDom=document.createElement("div"),this.rectDom.style.cssText=`position: absolute;border: ${KO.BORDER_WIDTH} solid ${KO.BORDER_COLOR};`,this.viewerContainer.appendChild(this.rectDom)),this.setRectDomVisible(!0),this.rectDom.style.left=`${e.x}px`,this.rectDom.style.top=`${e.y}px`;let i=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);this.rectDom.style.width=`${i}px`,this.rectDom.style.height=`${r}px`}setRectDomVisible(e){this.rectDom&&(this.rectDom.style.display=e?"inline-block":"none")}select(){return ct(this,null,(function*(){return new Promise(((e,t)=>{this.resolve=e,this.reject=t,this.activate()}))}))}destroy(){var e;this.deactivate(),null==(e=this.rectDom)||e.remove(),this.rectDom=void 0,this.isResolvedOrRejected||this.reject&&this.reject("BoxSelectHelper is not done for some reason!")}},sm=KO;function da(e){return(da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W8(e,t){if("object"!==da(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==da(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function X_(e){var t=W8(e,"string");return"symbol"===da(t)?t:String(t)}function TCe(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,X_(r.key),r)}}function cc(e,t,i){return t&&TCe(e.prototype,t),i&&TCe(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function hu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $_(e,t){return($_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function vT(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$_(e,t)}function H0(e,t){if(t&&("object"===da(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hu(e)}function uc(e){return(uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ch(e,t,i){return(t=X_(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function q8(e){if(Array.isArray(e))return e}function Y8(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function JO(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function X8(e,t){if(e){if("string"==typeof e)return JO(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if("Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return JO(e,t)}}function $8(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Z8(e){return q8(e)||Y8(e)||X8(e)||$8()}function bCe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function xCe(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?bCe(Object(i),!0).forEach((function(t){Ch(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):bCe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}sm.BORDER_COLOR="#fff000",sm.BORDER_WIDTH="2px";var t5t={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},r5t=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lc(this,e),this.init(t,i)}return cc(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||t5t,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,i,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(i).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,xCe(xCe({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),Oh=new r5t,om=function(){function e(){lc(this,e),this.observers={}}return cc(e,[{key:"on",value:function(e,t){var i=this;return e.split(" ").forEach((function(e){i.observers[e]=i.observers[e]||[],i.observers[e].push(t)})),this}},{key:"off",value:function(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e]=this.observers[e].filter((function(e){return e!==t}))}}},{key:"emit",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,i)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(i))}))}}]),e}();function Z_(){var e,t,i=new Promise((function(i,r){e=i,t=r}));return i.resolve=e,i.reject=t,i}function ICe(e){return null==e?"":""+e}function i5t(e,t,i){e.forEach((function(e){t[e]&&(i[e]=t[e])}))}function J8(e,t,i){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function n(){return!e||"string"==typeof e}for(var s="string"!=typeof t?[].concat(t):t.split(".");s.length>1;){if(n())return{};var a=r(s.shift());!e[a]&&i&&(e[a]=new i),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return n()?{}:{obj:e,k:r(s.shift())}}function _Ce(e,t,i){var r=J8(e,t,Object);r.obj[r.k]=i}function n5t(e,t,i,r){var n=J8(e,t,Object),s=n.obj,a=n.k;s[a]=s[a]||[],r&&(s[a]=s[a].concat(i)),r||s[a].push(i)}function t3(e,t){var i=J8(e,t),r=i.obj,n=i.k;if(r)return r[n]}function SCe(e,t,i){var r=t3(e,i);return void 0!==r?r:t3(t,i)}function HCe(e,t,i){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?i&&(e[r]=t[r]):HCe(e[r],t[r],i):e[r]=t[r]);return e}function yT(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var s5t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function a5t(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return s5t[e]})):e}var i3="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,o5t=[" ",",","?","!",";"];function l5t(e,t,i){t=t||"",i=i||"";var r=o5t.filter((function(e){return t.indexOf(e)<0&&i.indexOf(e)<0}));if(0===r.length)return!0;var n=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),s=!n.test(e);if(!s){var a=e.indexOf(i);a>0&&!n.test(e.substring(0,a))&&(s=!0)}return s}function wCe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function QO(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?wCe(Object(i),!0).forEach((function(t){Ch(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):wCe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function c5t(e){var t=u5t();return function(){var i,r=uc(e);if(t){var n=uc(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return H0(this,i)}}function u5t(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function UCe(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(i),n=e,s=0;s<r.length;++s){if(!n||"string"==typeof n[r[s]]&&s+1<r.length)return;if(void 0===n[r[s]]){for(var a=2,o=r.slice(s,s+a).join(i),l=n[o];void 0===l&&r.length>s+a;)a++,l=n[o=r.slice(s,s+a).join(i)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(o)){if("string"==typeof l)return l;if(o&&"string"==typeof l[o])return l[o]}var h=r.slice(s+a).join(i);return h?UCe(l,h,i):void 0}n=n[r[s]]}return n}}var h5t=function(e){vT(i,om);var t=c5t(i);function i(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return lc(this,i),r=t.call(this),i3&&om.call(hu(r)),r.data=e||{},r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return cc(i,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];i&&"string"!=typeof i&&(a=a.concat(i)),i&&"string"==typeof i&&(a=a.concat(n?i.split(n):i)),e.indexOf(".")>-1&&(a=e.split("."));var o=t3(this.data,a);return o||!s||"string"!=typeof i?o:UCe(this.data&&this.data[e]&&this.data[e][t],i,n)}},{key:"addResource",value:function(e,t,i,r){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var a=[e,t];i&&(a=a.concat(s?i.split(s):i)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),_Ce(this.data,a,r),n.silent||this.emit("added",e,t,i,r)}},{key:"addResources",value:function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var n in i)("string"==typeof i[n]||"[object Array]"===Object.prototype.toString.apply(i[n]))&&this.addResource(e,t,n,i[n],{silent:!0});r.silent||this.emit("added",e,t,i)}},{key:"addResourceBundle",value:function(e,t,i,r,n){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=i,i=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var o=t3(this.data,a)||{};r?HCe(o,i,n):o=QO(QO({},o),i),_Ce(this.data,a,o),s.silent||this.emit("added",e,t,i)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?QO(QO({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),i}(),BCe={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,i,r,n){var s=this;return e.forEach((function(e){s.processors[e]&&(t=s.processors[e].process(t,i,r,n))})),t}};function RCe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function qa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?RCe(Object(i),!0).forEach((function(t){Ch(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):RCe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function p5t(e){var t=d5t();return function(){var i,r=uc(e);if(t){var n=uc(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return H0(this,i)}}function d5t(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var MCe={},DCe=function(e){vT(i,om);var t=p5t(i);function i(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return lc(this,i),r=t.call(this),i3&&om.call(hu(r)),i5t(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,hu(r)),r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=Oh.create("translator"),r}return cc(i,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var i=this.resolve(e,t);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(e,t){var i=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,n=t.ns||this.options.defaultNS||[],s=i&&e.indexOf(i)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||l5t(e,i,r));if(s&&!a){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:n};var l=e.split(i);(i!==r||i===r&&this.options.ns.indexOf(l[0])>-1)&&(n=l.shift()),e=l.join(r)}return"string"==typeof n&&(n=[n]),{key:e,namespaces:n}}},{key:"translate",value:function(e,t,r){var n=this;if("object"!==da(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],t),l=o.key,h=o.namespaces,u=h[h.length-1],c=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(p){var d=t.nsSeparator||this.options.nsSeparator;return s?(f.res="".concat(u).concat(d).concat(l),f):"".concat(u).concat(d).concat(l)}return s?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,y=f&&f.exactUsedKey||l,v=Object.prototype.toString.apply(m),T=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject;if(x&&m&&"string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m&&["[object Number]","[object Function]","[object RegExp]"].indexOf(v)<0&&("string"!=typeof T||"[object Array]"!==v)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,qa(qa({},t),{},{ns:h})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return s?(f.res=b,f):b}if(a){var E="[object Array]"===v,_=E?[]:{},w=E?y:g;for(var S in m)if(Object.prototype.hasOwnProperty.call(m,S)){var M="".concat(w).concat(a).concat(S);_[S]=this.translate(M,qa(qa({},t),{joinArrays:!1,ns:h})),_[S]===M&&(_[S]=m[S])}m=_}}else if(x&&"string"==typeof T&&"[object Array]"===v)(m=m.join(T))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,D=!1,A=void 0!==t.count&&"string"!=typeof t.count,R=i.hasDefaultValue(t),C=A?this.pluralResolver.getSuffix(c,t.count,t):"",O=t["defaultValue".concat(C)]||t.defaultValue;!this.isValidLookup(m)&&R&&(I=!0,m=O),this.isValidLookup(m)||(D=!0,m=l);var P=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:m,N=R&&O!==m&&this.options.updateMissing;if(D||I||N){if(this.logger.log(N?"updateKey":"missingKey",c,u,l,N?O:m),a){var L=this.resolve(l,qa(qa({},t),{},{keySeparator:!1}));L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var k=0;k<U.length;k++)F.push(U[k]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var B=function(e,i,r){var s=R&&r!==m?r:P;n.options.missingKeyHandler?n.options.missingKeyHandler(e,u,i,s,N,t):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(e,u,i,s,N,t),n.emit("missingKey",e,u,i,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?F.forEach((function(e){n.pluralResolver.getSuffixes(e,t).forEach((function(i){B([e],l+i,t["defaultValue".concat(i)]||O)}))})):B(F,l,O))}m=this.extendTranslation(m,e,t,f,r),D&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(D||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return s?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,i,r,n){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,qa(qa({},this.options.interpolation.defaultVariables),i),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(qa(qa({},i),{interpolation:qa(qa({},this.options.interpolation),i.interpolation)}));var a,o="string"==typeof e&&(i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(o){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var h=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(h=qa(qa({},this.options.interpolation.defaultVariables),h)),e=this.interpolator.interpolate(e,h,i.lng||this.language,i),o){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(i.nest=!1)}!1!==i.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return n&&n[0]===r[0]&&!i.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):s.translate.apply(s,r.concat([t]))}),i)),i.interpolation&&this.interpolator.reset()}var c=i.postProcess||this.options.postProcess,p="string"==typeof c?[c]:c;return null!=e&&p&&p.length&&!1!==i.applyPostProcessor&&(e=BCe.handle(p,e,t,this.options&&this.options.postProcessPassResolved?qa({i18nResolved:r},i):i,this)),e}},{key:"resolve",value:function(e){var t,i,r,n,s,a=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,o),h=l.key;i=h;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var c=void 0!==o.count&&"string"!=typeof o.count,p=c&&!o.ordinal&&0===o.count&&a.pluralResolver.shouldUseIntlApi(),d=void 0!==o.context&&("string"==typeof o.context||"number"==typeof o.context)&&""!==o.context,f=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(s=e,!MCe["".concat(f[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(s)&&(MCe["".concat(f[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(i,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(i){if(!a.isValidLookup(t)){n=i;var s,l=[h];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,h,i,e,o);else{var u;c&&(u=a.pluralResolver.getSuffix(i,o.count,o));var f="".concat(a.options.pluralSeparator,"zero");if(c&&(l.push(h+u),p&&l.push(h+f)),d){var m="".concat(h).concat(a.options.contextSeparator).concat(o.context);l.push(m),c&&(l.push(m+u),p&&l.push(m+f))}}for(;s=l.pop();)a.isValidLookup(t)||(r=s,t=a.getResource(i,e,s,o))}})))}))}})),{res:t,usedKey:i,exactUsedKey:r,usedLng:n,usedNS:s}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,r):this.resourceStore.getResource(e,t,i,r)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),i}();function K8(e){return e.charAt(0).toUpperCase()+e.slice(1)}var f5t=function(){function e(t){lc(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Oh.create("languageUtils")}return cc(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],i=e.split("-");return this.options.lowerCaseLng?i=i.map((function(e){return e.toLowerCase()})):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=K8(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=K8(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=K8(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,i=this;return e?(e.forEach((function(e){if(!t){var r=i.formatLanguageCode(e);(!i.options.supportedLngs||i.isSupportedCode(r))&&(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=i.getLanguagePartFromCode(e);if(i.isSupportedCode(r))return t=r;t=i.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}},{key:"toResolveHierarchy",value:function(e,t){var i=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],s=function(e){e&&(i.isSupportedCode(e)?n.push(e):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):"string"==typeof e&&s(this.formatLanguageCode(e)),r.forEach((function(e){n.indexOf(e)<0&&s(i.formatLanguageCode(e))})),n}}]),e}(),m5t=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],g5t={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},v5t=["v1","v2","v3"],CCe={zero:0,one:1,two:2,few:3,many:4,other:5};function y5t(){var e={};return m5t.forEach((function(t){t.lngs.forEach((function(i){e[i]={numbers:t.nr,plurals:g5t[t.fc]}}))})),e}var E5t=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lc(this,e),this.languageUtils=t,this.options=i,this.logger=Oh.create("pluralResolver"),(!this.options.compatibilityJSON||"v4"===this.options.compatibilityJSON)&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=y5t()}return cc(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(e,t);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,i).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,i);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return CCe[e]-CCe[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,i)})):[]}},{key:"getSuffix",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,i);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var i=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),n=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===n?n="plural":1===n&&(n=""));var s=function(){return i.options.prepend&&n.toString()?i.options.prepend+n.toString():n.toString()};return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?"_plural_".concat(n.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!v5t.includes(this.options.compatibilityJSON)}}]),e}();function ACe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function pu(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ACe(Object(i),!0).forEach((function(t){Ch(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ACe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var T5t=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};lc(this,e),this.logger=Oh.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return cc(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:a5t,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?yT(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?yT(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?yT(t.nestingPrefix):t.nestingPrefixEscaped||yT("$t("),this.nestingSuffix=t.nestingSuffix?yT(t.nestingSuffix):t.nestingSuffixEscaped||yT(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(e,t,i,r){var n,s,a,o=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(o.formatSeparator)<0){var n=SCe(t,l,e);return o.alwaysFormat?o.format(n,void 0,i,pu(pu(pu({},r),t),{},{interpolationkey:e})):n}var s=e.split(o.formatSeparator),a=s.shift().trim(),h=s.join(o.formatSeparator).trim();return o.format(SCe(t,l,a),h,i,pu(pu(pu({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var c=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return h(e)}},{regex:this.regexp,safeValue:function(e){return o.escapeValue?h(o.escape(e)):h(e)}}].forEach((function(t){for(a=0;n=t.regex.exec(e);){var i=n[1].trim();if(void 0===(s=u(i)))if("function"==typeof c){var l=c(e,n,r);s="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(i))s="";else{if(p){s=n[0];continue}o.logger.warn("missed to pass in variable ".concat(i," for interpolating ").concat(e)),s=""}else"string"!=typeof s&&!o.useRawValueToEscape&&(s=ICe(s));var h=t.safeValue(s);if(e=e.replace(n[0],h),p?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,++a>=o.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var i,r,n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=pu({},s);function o(e,t){var i=this.nestingOptionsSeparator;if(e.indexOf(i)<0)return e;var r=e.split(new RegExp("".concat(i,"[ ]*{"))),n="{".concat(r[1]);e=r[0];var s=(n=this.interpolate(n,a)).match(/'/g),o=n.match(/"/g);(s&&s.length%2==0&&!o||o.length%2!=0)&&(n=n.replace(/'/g,'"'));try{a=JSON.parse(n),t&&(a=pu(pu({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(i).concat(n)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;i=this.nestingRegexp.exec(e);){var l=[],h=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){var u=i[1].split(this.formatSeparator).map((function(e){return e.trim()}));i[1]=u.shift(),l=u,h=!0}if((r=t(o.call(this,i[1].trim(),a),a))&&i[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=ICe(r)),r||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(e)),r=""),h&&(r=l.reduce((function(e,t){return n.format(e,t,s.lng,pu(pu({},s),{},{interpolationkey:i[1].trim()}))}),r.trim())),e=e.replace(i[0],r),this.regexp.lastIndex=0}return e}}]),e}();function OCe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function am(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?OCe(Object(i),!0).forEach((function(t){Ch(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):OCe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function b5t(e){var t=e.toLowerCase().trim(),i={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var n=r[1].substring(0,r[1].length-1);"currency"===t&&n.indexOf(":")<0?i.currency||(i.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?i.range||(i.range=n.trim()):n.split(";").forEach((function(e){if(e){var t=Z8(e.split(":")),r=t[0],n=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");i[r.trim()]||(i[r.trim()]=n),"false"===n&&(i[r.trim()]=!1),"true"===n&&(i[r.trim()]=!0),isNaN(n)||(i[r.trim()]=parseInt(n,10))}}))}return{formatName:t,formatOptions:i}}function ET(e){var t={};return function(i,r,n){var s=r+JSON.stringify(n),a=t[s];return a||(a=e(r,n),t[s]=a),a(i)}}var x5t=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};lc(this,e),this.logger=Oh.create("formatter"),this.options=t,this.formats={number:ET((function(e,t){var i=new Intl.NumberFormat(e,t);return function(e){return i.format(e)}})),currency:ET((function(e,t){var i=new Intl.NumberFormat(e,am(am({},t),{},{style:"currency"}));return function(e){return i.format(e)}})),datetime:ET((function(e,t){var i=new Intl.DateTimeFormat(e,am({},t));return function(e){return i.format(e)}})),relativetime:ET((function(e,t){var i=new Intl.RelativeTimeFormat(e,am({},t));return function(e){return i.format(e,t.range||"day")}})),list:ET((function(e,t){var i=new Intl.ListFormat(e,am({},t));return function(e){return i.format(e)}}))},this.init(t)}return cc(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=ET(t)}},{key:"format",value:function(e,t,i,r){var n=this;return t.split(this.formatSeparator).reduce((function(e,t){var s=b5t(t),a=s.formatName,o=s.formatOptions;if(n.formats[a]){var l=e;try{var h=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=h.locale||h.lng||r.locale||r.lng||i;l=n.formats[a](e,u,am(am(am({},o),r),h))}catch(e){n.logger.warn(e)}return l}return n.logger.warn("there was no format function for ".concat(a)),e}),e)}}]),e}();function PCe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function NCe(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?PCe(Object(i),!0).forEach((function(t){Ch(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):PCe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I5t(e){var t=_5t();return function(){var i,r=uc(e);if(t){var n=uc(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return H0(this,i)}}function _5t(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function S5t(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}var w5t=function(e){vT(i,om);var t=I5t(i);function i(e,r,n){var s,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return lc(this,i),s=t.call(this),i3&&om.call(hu(s)),s.backend=e,s.store=r,s.services=n,s.languageUtils=n.languageUtils,s.options=a,s.logger=Oh.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(n,a.backend,a),s}return cc(i,[{key:"queueLoad",value:function(e,t,i,r){var n=this,s={},a={},o={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var o="".concat(e,"|").concat(t);!i.reload&&n.store.hasResourceBundle(e,t)?n.state[o]=2:n.state[o]<0||(1===n.state[o]?void 0===a[o]&&(a[o]=!0):(n.state[o]=1,r=!1,void 0===a[o]&&(a[o]=!0),void 0===s[o]&&(s[o]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(o[e]=!0)})),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,i){var r=e.split("|"),n=r[0],s=r[1];t&&this.emit("failedLoading",n,s,t),i&&this.store.addResourceBundle(n,s,i),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(i){n5t(i.loaded,[n],s),S5t(i,e),t&&i.errors.push(t),0===i.pendingCount&&!i.done&&(Object.keys(i.loaded).forEach((function(e){a[e]||(a[e]={});var t=i.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,i){var r=this,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:i,tried:n,wait:s,callback:a}):(this.readingCalls++,this.backend[i](e,t,(function(o,l){if(r.readingCalls--,r.waitingReads.length>0){var h=r.waitingReads.shift();r.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}o&&l&&n<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,i,n+1,2*s,a)}),s):a(o,l)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var s=this.queueLoad(e,t,r,n);if(!s.toLoad.length)return s.pending.length||n(),null;s.toLoad.forEach((function(e){i.loadOne(e)}))}},{key:"load",value:function(e,t,i){this.prepareLoading(e,t,{},i)}},{key:"reload",value:function(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}},{key:"loadOne",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),n=r[0],s=r[1];this.read(n,s,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(i,"loading namespace ").concat(s," for language ").concat(n," failed"),r),!r&&a&&t.logger.log("".concat(i,"loaded namespace ").concat(s," for language ").concat(n),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,i,r,n){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null==i||""===i||(this.backend&&this.backend.create&&this.backend.create(e,t,i,r,null,NCe(NCe({},s),{},{isUpdate:n})),e&&e[0]&&this.store.addResource(e[0],t,i,r))}}]),i}();function R5t(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===da(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===da(e[2])||"object"===da(e[3])){var i=e[3]||e[2];Object.keys(i).forEach((function(e){t[e]=i[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,i,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function LCe(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function FCe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function Ah(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?FCe(Object(i),!0).forEach((function(t){Ch(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):FCe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function M5t(e){var t=D5t();return function(){var i,r=uc(e);if(t){var n=uc(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return H0(this,i)}}function D5t(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function e3(){}function C5t(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var r3=function(e){vT(i,om);var t=M5t(i);function i(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(lc(this,i),e=t.call(this),i3&&om.call(hu(e)),e.options=LCe(r),e.services={},e.logger=Oh,e.modules={external:[]},C5t(hu(e)),n&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,n),H0(e,hu(e));setTimeout((function(){e.init(r,n)}),0)}return e}return cc(i,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(i=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=R5t();function n(e){return e?"function"==typeof e?new e:e:null}if(this.options=Ah(Ah(Ah({},r),this.options),LCe(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Ah(Ah({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var s;this.modules.logger?Oh.init(n(this.modules.logger),this.options):Oh.init(null,this.options),this.modules.formatter?s=this.modules.formatter:"undefined"!=typeof Intl&&(s=x5t);var a=new f5t(this.options);this.store=new h5t(this.options.resources,this.options);var o=this.services;o.logger=Oh,o.resourceStore=this.store,o.languageUtils=a,o.pluralResolver=new E5t(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(o.formatter=n(s),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new T5t(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new w5t(n(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(o.languageDetector=n(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=n(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new DCe(this.services,this.options),this.translator.on("*",(function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,i||(i=e3),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var i;return(i=e.store)[t].apply(i,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var i;return(i=e.store)[t].apply(i,arguments),e}}));var h=Z_(),u=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),h.resolve(r),i(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),h}},{key:"loadResources",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e3,r="string"==typeof e?e:this.language;if("function"==typeof e&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return i();var n=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){n.indexOf(e)<0&&n.push(e)}))};r?s(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return s(e)})),this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(n,this.options.ns,(function(e){!e&&!t.resolvedLanguage&&t.language&&t.setResolvedLanguage(t.language),i(e)}))}else i(null)}},{key:"reloadResources",value:function(e,t,i){var r=Z_();return e||(e=this.languages),t||(t=this.options.ns),i||(i=e3),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),i(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&BCe.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}},{key:"changeLanguage",value:function(e,t){var i=this;this.isLanguageChangingTo=e;var r=Z_();this.emit("languageChanging",e);var n=function(e){i.language=e,i.languages=i.services.languageUtils.toResolveHierarchy(e),i.resolvedLanguage=void 0,i.setResolvedLanguage(e)},s=function(s){!e&&!s&&i.services.languageDetector&&(s=[]);var a="string"==typeof s?s:i.services.languageUtils.getBestMatchFromCodes(s);a&&(i.language||n(a),i.translator.language||i.translator.changeLanguage(a),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(a)),i.loadResources(a,(function(e){!function(e,s){s?(n(s),i.translator.changeLanguage(s),i.isLanguageChangingTo=void 0,i.emit("languageChanged",s),i.logger.log("languageChanged",s)):i.isLanguageChangingTo=void 0,r.resolve((function(){return i.t.apply(i,arguments)})),t&&t(e,(function(){return i.t.apply(i,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,i){var r=this,n=function e(t,n){var s;if("object"!==da(n)){for(var a=arguments.length,o=new Array(a>2?a-2:0),l=2;l<a;l++)o[l-2]=arguments[l];s=r.options.overloadTranslationOptionHandler([t,n].concat(o))}else s=Ah({},n);s.lng=s.lng||e.lng,s.lngs=s.lngs||e.lngs,s.ns=s.ns||e.ns,s.keyPrefix=s.keyPrefix||i||e.keyPrefix;var h=r.options.keySeparator||".",u=s.keyPrefix?"".concat(s.keyPrefix).concat(h).concat(t):t;return r.t(u,s)};return"string"==typeof e?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=i,n}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,i){var r=t.services.backendConnector.state["".concat(e,"|").concat(i)];return-1===r||2===r};if(i.precheck){var o=i.precheck(this,a);if(void 0!==o)return o}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!n||a(s,e)))}},{key:"loadNamespaces",value:function(e,t){var i=this,r=Z_();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){i.options.ns.indexOf(e)<0&&i.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var i=Z_();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],n=e.filter((function(e){return r.indexOf(e)<0}));return n.length?(this.options.preload=r.concat(n),this.loadResources((function(e){i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e3,n=Ah(Ah(Ah({},this.options),t),{isClone:!0}),s=new i(n);return(void 0!==t.debug||void 0!==t.prefix)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach((function(t){s[t]=e[t]})),s.services=Ah({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new DCe(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];s.emit.apply(s,[e].concat(i))})),s.init(n,r),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),i}();Ch(r3,"createInstance",(function(){return new r3(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var Ya=r3.createInstance();Ya.createInstance=r3.createInstance;var TAr=Ya.createInstance,bAr=Ya.init,xAr=Ya.loadResources,IAr=Ya.reloadResources,_Ar=Ya.use,SAr=Ya.changeLanguage,wAr=Ya.getFixedT,Ph=Ya.t,RAr=Ya.exists,MAr=Ya.setDefaultNamespace,DAr=Ya.hasLoadedNamespace,CAr=Ya.loadNamespaces,AAr=Ya.loadLanguages,Q8=Ya,TT=(e=>(e.BaseViewer="BaseViewer",e.BimViewer="BimViewer",e.DxfViewer="DxfViewer",e.VRViewer="VRViewer",e))(TT||{}),lm=class extends Ls{constructor(e){super(),this.name="BaseViewer",this.translate=this.initLocalization(),this.height=0,this.width=0,this.jobCount=0,this.enableOverlayRenderer=!0,this.viewerCfg=e,this.undoRedoManager=new DA,this.initLogLevel(),this.initLocalization(),xr.isBrowser&&!e.context&&(this.initViewerContainer(),this.initWidgetContainer())}initLogLevel(){let e=this.viewerCfg.logLevel;e&&Tde(e)}initLocalization(){var e;let t=(null==(e=this.viewerCfg)?void 0:e.language)||"cn";return Q8.init({lng:t,debug:!1,resources:{en:{translation:zde},cn:{translation:jde}}}),Q8.t}initViewerContainer(){let e=document.getElementById(this.viewerCfg.containerId);e||(re.error("[BaseViewer] containerId:",this.viewerCfg.containerId,"is not found in dom tree! will append to document body"),e=document.body);let t=document.createElement("div");t.classList.add("viewer-container"),t.style.cssText="display: inline-block;position: relative; overflow: hidden;",e.appendChild(t),this.width=e.clientWidth,this.height=e.clientHeight,this.viewerContainer=t}initWidgetContainer(){var e;let t=document.createElement("div");t.classList.add("widget-container"),null==(e=this.viewerContainer)||e.appendChild(t),this.widgetContainer=t}initSpinner(){var e;if(!this.viewerCfg.enableSpinner)return;let t=document.createElement("div");t.classList.add("gemini-spinner"),t.appendChild(document.createElement("span")),t.appendChild(document.createElement("span")),t.appendChild(document.createElement("span")),t.appendChild(document.createElement("span")),null==(e=this.widgetContainer)||e.appendChild(t),this.spinner=t,this.setSpinnerVisibility(this.jobCount>0)}setSpinnerVisibility(e){this.spinner&&(e?this.spinner.classList.remove("hidden"):this.spinner.classList.add("hidden"))}increaseJobCount(){this.setSpinnerVisibility(++this.jobCount>0)}decreaseJobCount(){this.setSpinnerVisibility(--this.jobCount>0)}destroy(){var e,t,i,r;null==(e=this.widgetContainer)||e.remove(),this.widgetContainer=void 0,null==(t=this.viewerContainer)||t.remove(),this.viewerContainer=void 0,null==(i=this.scene)||i.clear(),this.scene=void 0,this.requestAnimationFrameHandle&&(cancelAnimationFrame(this.requestAnimationFrameHandle),this.requestAnimationFrameHandle=void 0),this.renderer&&(this.renderer.domElement.remove(),this.renderer.clear(),this.renderer.dispose(),this.renderer.forceContextLoss(),this.renderer=void 0),this.overlayRender&&(this.overlayRender.destroy(),this.overlayRender=void 0),this.camera=void 0,this.controls&&(this.controls.dispose(),this.controls=void 0),this.groundPlane&&(this.groundPlane.geometry.dispose(),this.groundPlane.clear(),this.groundPlane=void 0),null==(r=this.undoRedoManager)||r.destroy(),this.spinner&&(this.spinner.remove(),this.spinner=void 0)}getInputManager(){return this.inputManager}getViewConfig(){return this.viewerCfg}enableRender(){}getRaycaster(){}getRaycastableObjectsByMouse(e){return[]}getBBox(){}getActiveSection(){}flyTo(e,t){}is3d(){return!0}getMeasurementManager(){}getMarkupManager(){}deactivateMeasurement(){}setMeasurementVisibility(e,t){return!1}screenshot(e){return ct(this,null,(function*(){}))}showStats(){}hideStats(){}getPixelSizeInWorldCoord(){let e=this.camera,{clientWidth:t,clientHeight:i}=this.viewerContainer,r=1;if("OrthographicCamera"===e.type){let n=e;r=Math.max(n.right-n.left,n.top-n.bottom)/n.zoom/Math.max(t,i)}else if("PerspectiveCamera"===e.type){let t=e,n=this.cameraCfg,s=n&&Tt.arrayToVector3(n.eye),a=n&&Tt.arrayToVector3(n.look);r=s.distanceTo(a)*Math.tan(t.fov/2*Math.PI/180)*2/i}return r}},bT=class{constructor(e){this.viewer=e,this.boxSelectHelper=new sm(e)}get viewerContainer(){return this.viewer.viewerContainer}get camera(){return this.viewer.camera}get raycaster(){return this.viewer.getRaycaster()}activate(){var e;null==(e=this.boxSelectHelper)||e.select().then((e=>{this.handleZoomToRect(e.min,e.max)}))}deactivate(){var e;null==(e=this.boxSelectHelper)||e.deactivate()}pickPositionByScreenPoint(e){let t=xi.screenPoint2NdcPoint(e,this.camera,this.viewerContainer);this.raycaster.layers.set(10),this.raycaster.setFromCamera(t,this.camera);let i=[];"BimViewer"===this.viewer.name?i=this.viewer.getRaycastableObjectsByMouse({x:e.x,y:e.y}):"DxfViewer"===this.viewer.name&&(i=[this.viewer.groundPlane]);let r=this.raycaster.intersectObjects(i)||[];if(r.length>0)return r[0].point}handleZoomToRect(e,t){let i=this.pickPositionByScreenPoint(e),r=this.pickPositionByScreenPoint(t);if(i&&r){let e=new D(Math.min(i.x,r.x),Math.min(i.y,r.y),Math.min(i.z,r.z)),t=new D(Math.max(i.x,r.x),Math.max(i.y,r.y),Math.max(i.z,r.z)),n=new Rt(e,t);this.viewer.zoomToBBox(n)}}destroy(){var e;null==(e=this.boxSelectHelper)||e.destroy(),this.boxSelectHelper=void 0}},n3=class extends Ys{constructor(e){super("MobileHelper"),this.needsFrustumCulled=!1,this.renderOrder=1e3,this.position=e}setPosition(e){this.position=e}isPointInPath(e,t){return!1}draw(e,t){this.drawInnerCircle(e),this.drawOuterRing(e),this.drawSnapTriangle(e)}drawInnerCircle(e){let{x:t,y:i}=this.position;e.save(),e.fillStyle="rgba(137, 137, 138, 0.8)",e.beginPath(),e.arc(t,i,25,0,2*Math.PI),e.closePath(),e.fill(),e.restore()}drawOuterRing(e){let{x:t,y:i}=this.position;e.save(),e.strokeStyle="rgba(17, 17, 19, 0.8)",e.lineWidth=10,e.beginPath(),e.arc(t,i,30,0,2*Math.PI),e.closePath(),e.stroke(),e.restore(),e.save(),e.strokeStyle="rgba(173, 173, 174, 0.8)",e.lineWidth=3,e.beginPath(),e.arc(t,i,35,0,2*Math.PI),e.closePath(),e.stroke(),e.restore()}drawSnapTriangle(e){let{x:t,y:i}=this.position;e.save(),e.fillStyle="rgba(17, 17, 19, 0.8)",e.strokeStyle="rgba(137, 137, 138, 0.8)",e.lineWidth=2,e.beginPath(),e.moveTo(t-35,i-35),e.lineTo(t-35+12,i-35),e.lineTo(t-35,i-35+12),e.closePath(),e.fill(),e.stroke(),e.restore()}translate(e,t){this.position.add(new ce(e,t))}getTouchPoint(){return{x:this.position.x-35,y:this.position.y-35}}isIntersect(e){return this.position.x-35<e.x&&this.position.y-35<e.y&&this.position.x+35>e.x&&this.position.y+35>e.y}drawSelect(e,t){}getClassType(){return"MeasureMobileHelperDrawable"}},Kn=ps(Zc(),1);function xT(e){return{all:e=e||new Map,on:function(t,i){var r=e.get(t);r?r.push(i):e.set(t,[i])},off:function(t,i){var r=e.get(t);r&&(i?r.splice(r.indexOf(i)>>>0,1):e.set(t,[]))},emit:function(t,i){var r=e.get(t);r&&r.slice().map((function(e){e(i)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,i)}))}}}var s3=(e=>(e[e.ClickEvent=1]="ClickEvent",e[e.Popup=2]="Popup",e[e.SubMenu=3]="SubMenu",e[e.Switch=4]="Switch",e))(s3||{}),K_=(e=>(e.HomeView="HomeView",e.OrthoMode="OrthoMode",e.Measure="Measure",e.MeasureDistance="MeasureDistance",e.MeasureArea="MeasureArea",e.MeasureAngle="MeasureAngle",e.MeasureCoordinate="MeasureCoordinate",e.MeasureClear="MeasureClear",e.MarkupVisibility="MarkupVisibility",e.Markup="Markup",e.MarkupArrow="Arrow",e.MarkupRect="Rect",e.MarkupCloudRect="CloudRect",e.MarkupPolyLine="PolyLine",e.MarkupCloudLine="CloudLine",e.MarkupEllipse="Ellipse",e.MarkupCircle="Circle",e.MarkupDot="Dot",e.MarkupText="Text",e.MarkupX="X",e.MarkupStrokeStyle="StrokeStyle",e.MarkupLineWidth="LineWidth",e.MarkupLineWidth2="LineWidth2",e.MarkupLineWidth5="LineWidth5",e.MarkupLineWidth10="LineWidth10",e.MarkupFontSize="FontSize",e.MarkupFontSize14="FontSize14",e.MarkupFontSize18="FontSize18",e.MarkupFontSize24="FontSize24",e.MarkupClear="MarkupClear",e.MarkupQuit="MarkupQuit",e.Section="Section",e.SectionBox="SectionBox",e.SectionPlane="SectionPlane",e.SectionAxis="SectionAxis",e.BimTree="BimTree",e.Viewpoint="Viewpoint",e.Annotation="Annotation",e.Property="Property",e.Settings="Settings",e.Compared="Compared",e.QuitCompare="QuitCompare",e.Fullscreen="FullScreen",e.SceneClear="SceneClear",e.Layers="Layers",e.ZoomToRectangle="ZoomToRectangle",e.Screenshot="GetScreenshot",e))(K_||{}),kCe=[["HomeView","OrthoMode","FullScreen","ZoomToRectangle","GetScreenshot"],["Measure","Markup","MarkupVisibility","Section"],["BimTree","Viewpoint","Annotation","Property","Compared","QuitCompare","Layers"],["Settings"]],Nh=class{constructor(e,t,i=[...kCe]){this.bimViewer=e,this.menuConfig=t,this.groupConfig=i,this.visible=!0,this.menuList=new Map,this.keydown=e=>{var t,i;if(this.visible&&"Escape"===e.code){if(null!=(t=this.bimViewer.getMeasurementManager())&&t.isMeasurementMeasuring()||null!=(i=this.bimViewer.getMarkupManager())&&i.isMarkupActive())return;this.clearActive()}},this.init(),window.addEventListener("keydown",this.keydown,!1)}init(){var e;let t=document.createElement("div");t.classList.add("toolbar"),this.groupConfig.forEach(((e,i)=>{let r=document.createElement("div");r.classList.add("toolbar-group");let n=document.createElement("div");n.classList.add("toolbar-group-division"),e.forEach((e=>{let t=(0,Kn.get)(this.menuConfig,e);if(t&&!1!==t.visible){let i=this.createToolbarMenu(this.bimViewer,e,t);r.appendChild(i.element)}})),r.hasChildNodes()&&(i&&t.appendChild(n),t.appendChild(r))})),this.element=t,null==(e=this.bimViewer.widgetContainer)||e.appendChild(t),t.oncontextmenu=e=>{e.preventDefault()}}clearActive(){if(this.activateMenuId){let e=this.menuList.get(this.activateMenuId);null==e||e.setActive(!1),this.activateMenuId=void 0}}setActive(e,t){let i=this.menuList.get(e);null==i||i.setActive(t),this.activateMenuId=t?e:void 0}createToolbarMenu(e,t,i,r){let n=new eV(e,this,t,i,r);if(this.menuList.set(t,n),i.children){let t=document.createElement("div");t.classList.add("toolbar-sub-menu");let r=document.createElement("div");r.classList.add("toolbar-sub-menu-list"),t.appendChild(r),(0,Kn.forIn)(i.children,((t,i)=>{if(t&&!1!==t.visible){let s=this.createToolbarMenu(e,i,t,n);r.appendChild(s.element)}})),n.element.appendChild(t)}return n}updateMenu(e,t){(0,Kn.assign)(this.menuConfig[e],t),this.refresh()}updateMenus(e){(0,Kn.forEach)(e,(({menuId:e,config:t})=>{(0,Kn.assign)(this.menuConfig[e],t)})),this.refresh()}addMenu(e,t,i){if((0,Kn.keys)(this.menuConfig).includes(e))re.error("[Toolbar]",e,"exists.");else{if((0,Kn.assign)(this.menuConfig,{[e]:t}),i){let[t,r]=i;if(t>this.groupConfig.length-1)this.groupConfig=(0,Kn.concat)(this.groupConfig,[[e]]);else{let i=this.groupConfig[t];this.groupConfig[t]=r>i.length-1?(0,Kn.concat)(i,e):(0,Kn.concat)((0,Kn.take)(i,r),e,(0,Kn.takeRight)(i,i.length-r))}}else this.groupConfig=(0,Kn.concat)(this.groupConfig,[[e]]);this.refresh()}}refresh(){this.element&&this.element.remove(),this.element=void 0,this.menuList.clear(),this.init()}show(){this.element&&(this.element.style.display=""),this.visible=!0}hide(){this.element&&(this.element.style.display="none"),this.visible=!1}destroy(){this.element&&this.element.remove(),this.element=void 0,this.menuList.clear(),window.removeEventListener("keydown",this.keydown,!1)}},eV=class{constructor(e,t,i,r,n){this.bimViewer=e,this.toolbar=t,this.menuId=i,this.eventBus=xT(),this.active=r.defaultActive||!1,this.element=r.customElement&&r.customElement(e,this.menuId,r)||this.createButton(e,this.menuId,r),this.eventBus.on("activeChange",(t=>{t?(this.element.classList.add("active"),(0,Kn.forEach)(r.mutexIds,(e=>{var t;let i=null==(t=this.toolbar)?void 0:t.menuList.get(e);i&&i.active&&i.setActive(!1)})),r.onActive&&r.onActive(e)):(this.element.classList.remove("active"),r.onDeactive&&r.onDeactive(e)),this.element.firstChild instanceof HTMLElement&&JC(this.element.firstChild.classList,r.icon,this.active),n&&n.setActive(t)})),xr.isMobile?(this.element.ontouchstart=t=>{switch(this.element.classList.toggle("toolbar-parent-menu-active"),this.element.classList.toggle("toolbar-menu-active"),t.stopPropagation(),r.type){case 1:r.onClick&&r.onClick(e,this.toolbar,t);break;case 4:r.onClick&&r.onClick(e,this.toolbar,t),this.active=!this.active,this.toolbar.activateMenuId=this.menuId,this.eventBus.emit("activeChange",this.active)}},this.element.addEventListener("touchend",(()=>{n&&n.element.classList.remove("toolbar-parent-menu-active")}))):(this.element.onclick=t=>{switch(t.stopPropagation(),r.type){case 1:r.onClick&&r.onClick(e,this.toolbar,t);break;case 4:r.onClick&&r.onClick(e,this.toolbar,t),this.active=!this.active,this.toolbar.activateMenuId=this.menuId,this.eventBus.emit("activeChange",this.active)}n&&n.element.classList.remove("toolbar-parent-menu-active")},this.element.addEventListener("mouseover",(()=>{this.element.classList.toggle("toolbar-parent-menu-active"),this.element.classList.add("toolbar-menu-active")})),this.element.addEventListener("mouseout",(()=>{this.element.classList.contains("toolbar-parent-menu-active")&&this.element.classList.remove("toolbar-parent-menu-active"),this.element.classList.remove("toolbar-menu-active")})))}createButton(e,t,i){let r=document.createElement("div");r.id=t,r.classList.add("toolbar-menu"),i.defaultActive&&r.classList.add("active"),i.children&&r.classList.add("toolbar-parent-menu");let{default:n="icon-new",iconFont:s=EE}=i.icon;return r.innerHTML=`<div class="icon ${s} ${n}"></div>`,r.title=Ph(i.menuName),r.innerHTML+=`<span>${r.title}</span>`,r}setActive(e){this.active=e,e?this.element.classList.add("toolbar-menu-active"):this.element.classList.remove("toolbar-menu-active"),this.eventBus.emit("activeChange",this.active)}},GCe={Arrow:{menuName:"Toolbar.markupArrow",icon:{default:"icon-arrow"},type:4,onActive:e=>{e.activateMarkup("ArrowMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","CloudRect","PolyLine","CloudLine","Ellipse","Circle","Dot","Text","X"]},Rect:{defaultActive:!1,menuName:"Toolbar.markupRect",icon:{default:"icon-rectangle"},type:4,onActive:e=>{e.activateMarkup("RectMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Arrow","CloudRect","PolyLine","CloudLine","Ellipse","Circle","Dot","Text","X"]},CloudRect:{defaultActive:!0,menuName:"Toolbar.markupCloudRect",icon:{default:"icon-cloud"},type:4,onActive:e=>{e.activateMarkup("CloudRectMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","Arrow","PolyLine","CloudLine","Ellipse","Circle","Dot","Text","X"]},PolyLine:{menuName:"Toolbar.markupPolyLine",icon:{default:"icon-polyline"},type:4,onActive:e=>{e.activateMarkup("PolylineMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","Arrow","CloudRect","CloudLine","Ellipse","Circle","Dot","Text","X"]},CloudLine:{menuName:"Toolbar.markupCloudLine",icon:{default:"icon-cloud-segment"},type:4,onActive:e=>{e.activateMarkup("CloudLineMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","CloudRect","PolyLine","Arrow","Ellipse","Circle","Dot","Text","X"]},Ellipse:{menuName:"Toolbar.markupEllipse",icon:{default:"icon-oval"},type:4,onActive:e=>{e.activateMarkup("EllipseMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","CloudRect","PolyLine","CloudLine","Arrow","Circle","Dot","Text","X"]},Circle:{menuName:"Toolbar.markupCircle",icon:{default:"icon-round"},type:4,onActive:e=>{e.activateMarkup("CircleMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","CloudRect","PolyLine","CloudLine","Ellipse","Arrow","Dot","Text","X"]},Dot:{menuName:"Toolbar.markupDot",icon:{default:"icon-round"},type:4,onActive:e=>{e.activateMarkup("DotMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","CloudRect","PolyLine","CloudLine","Ellipse","Arrow","Circle","Text","X"]},X:{menuName:"Toolbar.markupX",icon:{default:"icon-cross"},type:4,onActive:e=>{e.activateMarkup("XMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","CloudRect","PolyLine","CloudLine","Ellipse","Circle","Dot","Arrow","Text"]},Text:{menuName:"Toolbar.markupText",icon:{default:"icon-text"},type:4,onActive:e=>{e.activateMarkup("TextMarkup")},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect","CloudRect","PolyLine","CloudLine","Ellipse","Circle","Dot","Arrow","X"]},StrokeStyle:{menuName:"Toolbar.markupStroke",icon:{default:"icon-color-red"},type:1,onClick:(e,t,i)=>{let r=i.target.parentElement,n=null==r?void 0:r.firstElementChild,s=document.createElement("input");s.setAttribute("type","color"),s.value=e.getMarkupLineColor(),s.click(),s.oninput=t=>{let i=t.target.value;e.setMarkupLineColor(i),n.style.color=i}}},LineWidth:{menuName:"Toolbar.markupLineWidth",icon:{default:"icon-line"},customElement(e,t,i){let r=document.createElement("div");return r.id=t,r.classList.add("toolbar-menu"),i.children&&r.classList.add("toolbar-parent-menu"),r.title=Ph(i.menuName),r.innerHTML+=`<span>${r.title}</span>`,r},type:3,children:{LineWidth2:{defaultActive:!0,icon:{default:"icon-line-2"},onClick:e=>{e.setMarkupLineWidth(2)},type:4,menuName:"Toolbar.markupLineWidth2",mutexIds:["LineWidth5","LineWidth10"]},LineWidth5:{icon:{default:"icon-line-3"},onClick:e=>{e.setMarkupLineWidth(3)},type:4,menuName:"Toolbar.markupLineWidth5",mutexIds:["LineWidth2","LineWidth10"]},LineWidth10:{icon:{default:"icon-line-4"},onClick:e=>{e.setMarkupLineWidth(4)},type:4,menuName:"Toolbar.markupLineWidth10",mutexIds:["LineWidth2","LineWidth5"]}}},FontSize:{menuName:"Toolbar.markupFontSize",icon:{default:"icon-font"},customElement(e,t,i){let r=document.createElement("div");return r.id=t,r.classList.add("toolbar-menu"),i.children&&r.classList.add("toolbar-parent-menu"),r.title=Ph(i.menuName),r.innerHTML+=`<span>${r.title}</span>`,r},type:3,children:{FontSize14:{icon:{default:"icon-font14"},onClick:e=>{e.setMarkupFontSize(14)},type:4,menuName:"",mutexIds:["FontSize18","FontSize24"]},FontSize18:{defaultActive:!0,icon:{default:"icon-font18"},onClick:e=>{e.setMarkupFontSize(18)},type:4,menuName:"",mutexIds:["FontSize14","FontSize24"]},FontSize24:{icon:{default:"icon-font24"},onClick:e=>{e.setMarkupFontSize(24)},type:4,menuName:"",mutexIds:["FontSize14","FontSize18"]}}},MarkupClear:{icon:{default:"icon-eraser"},onClick:e=>{re.info("[Toolbar]","Clear Markup",e),e.clearMarkups()},type:1,menuName:"Toolbar.clearMarkup"},MarkupQuit:{icon:{default:""},customElement(e,t,i){let r=document.createElement("div");return r.id=t,r.classList.add("toolbar-menu"),i.children&&r.classList.add("toolbar-parent-menu"),r.title=Ph(i.menuName),r.innerHTML+=`<span>${r.title}</span>`,r},onClick:(e,t)=>{var i;e.deactivateMarkup(),t.destroy(),null==(i=e.toolbar)||i.show()},type:1,menuName:"Toolbar.quitMarkup"}},A5t=[["Arrow","Rect","CloudRect","PolyLine","Ellipse","Circle","Text","StrokeStyle","FontSize","MarkupClear","MarkupQuit"]],a3=class extends Nh{constructor(e,t,i=[...A5t]){super(e,t,i),this.keydown=()=>{}}},IT=class{constructor(e,t,i=document.body){this.container=i,this.isFollowing=!1,this.diffX=0,this.diffY=0,this.start=e=>{this.isFollowing=!0,this.diffX=e.clientX-this.element.offsetLeft,this.diffY=e.clientY-this.element.offsetTop},this.stop=()=>{this.isFollowing=!1},this.follow=e=>{if(!this.isFollowing)return;let t=e.clientX-this.diffX,i=e.clientY-this.diffY;this.element.style.left=t+"px",this.element.style.top=i+"px"},this.element=document.createElement("div"),this.element.id=e,this.element.classList.add("pop-panel");let r=document.createElement("div");r.classList.add("pop-panel-header"),r.append(t),this.element.appendChild(r),this.header=r;let n=document.createElement("div");n.classList.add("pop-panel-body"),this.element.appendChild(n),this.body=n,r.addEventListener(gk,this.start),r.addEventListener(mk,this.stop),document.body.addEventListener(Nf,this.follow),this.container.appendChild(this.element)}destroy(){document.body.removeEventListener(Nf,this.follow),this.element.removeEventListener(gk,this.start),this.element.removeEventListener(mk,this.stop),this.element.remove()}},Xa=new D(1,0,0),cm=new D(0,1,0),um=new D(0,0,1),VCe=new D(0,1,0),J_=new Be,tV=2,du=class extends ar{constructor(e=Xa){super(),this.redMaterial=new Xt({color:16711680,depthTest:!1}),this.greenMaterial=new Xt({color:65280,depthTest:!1}),this.blueMaterial=new Xt({color:255,depthTest:!1}),this.highlightMaterial=new Xt({color:16776960,depthTest:!1}),this.pickableMaterial=new Xt({color:9807270,depthTest:!1}),this.initIgnoreClipMaterial(),this.initOrUpdateByAxis(e)}initIgnoreClipMaterial(){[this.redMaterial,this.greenMaterial,this.blueMaterial,this.highlightMaterial,this.pickableMaterial].forEach((e=>{e.onBeforeCompile=function(e,t){e.fragmentShader=e.fragmentShader.replace("#include <clipping_planes_pars_fragment>","").replace("#include <clipping_planes_fragment>",""),e.vertexShader=e.vertexShader.replace("#include <clipping_planes_pars_vertex>","").replace("#include <clipping_planes_vertex>","")}}))}setDirection(e){let t=new Br;t.setFromUnitVectors(Xa,e),this.applyQuaternion(t)}initOrUpdateByAxis(e){this.clear(),[{actionType:"TranslateX",direction:Xa,material:this.redMaterial},{actionType:"TranslateY",direction:cm,material:this.greenMaterial},{actionType:"TranslateZ",direction:um,material:this.blueMaterial}].forEach((t=>{let{actionType:i,direction:r,material:n}=t,s=this.createTranslateGizmo(i,r,tV,0===r.angleTo(e)?n:this.pickableMaterial);this.add(s)})),[{actionType:"RotateX",direction:Xa,material:this.redMaterial,degree:90},{actionType:"RotateY",direction:cm,material:this.greenMaterial,degree:90},{actionType:"RotateZ",direction:um,material:this.blueMaterial,degree:90}].forEach((t=>{let{actionType:i,direction:r,material:n,degree:s}=t;if(0!==r.angleTo(e)){let e=this.createRotateGizmo(i,r,tV,n,s);this.add(e)}})),this.createSphere(1,this.pickableMaterial)}createTranslateGizmo(e,t,i,r){let n=t.angleTo(VCe),s=VCe.clone().cross(t);J_.makeRotationAxis(s,n);let a=new Hl(i/5,i/5,20*i),o=10*i;a.translate(0,o,0),a.applyMatrix4(J_);let l=new Hl(0,i,3*i),h=2*o;l.translate(0,h,0),l.applyMatrix4(J_);let u=bo([l,a]),c=new Je(u,r);return c.layers.enable(12),c.userData.actionType=e,r===this.pickableMaterial&&c.layers.disable(12),c}createRotateGizmo(e,t,i,r,n){let s=new D(0,0,1),a=t.clone().cross(s),o=t.angleTo(s);J_.makeRotationAxis(a,o);let l=new zp(12*i,i/5,8,36,fr.degToRad(n));l.applyMatrix4(J_);let h=new Je(l,r);return h.layers.enable(12),h.userData.actionType=e,h}createSphere(e,t){let i=new po(e,32,16),r=new Je(i,t);this.add(r)}setActiveAxis(e){this.initOrUpdateByAxis(e)}createHoverRotateObjectByAxis(e){let t=Xa;switch(e){case"RotateX":t=Xa;break;case"RotateY":t=cm;break;case"RotateZ":t=um}return this.createRotateGizmo("",t,tV,this.highlightMaterial,360)}setActive(e,t){var i;let r=t.userData.actionType;["RotateX","RotateY","RotateZ"].includes(r)?e?(this.hoverObject=this.createHoverRotateObjectByAxis(r),this.add(this.hoverObject),t.visible=!1):(null==(i=this.hoverObject)||i.removeFromParent(),t.visible=!0,this.hoverObject=void 0):e?(this.originalMaterial=t.material,t.material=this.highlightMaterial):this.originalMaterial&&(t.material=this.originalMaterial)}adjustSize(e){let t=new D;this.getWorldPosition(t);let i=e.position,r=1;e instanceof Ni?r=(e.top-e.bottom)/e.zoom:e instanceof Vr&&(r=t.distanceTo(i)*Math.min(1.9*Math.tan(Math.PI*e.fov/360)/e.zoom,7)),this.scale.set(1,1,1).multiplyScalar(r/180)}},hm=class{constructor(e,t){if(this.raycaster=new ka,this.mouseDown=!1,this.lastWorldPos=new D,this.mouseMoved=!1,this.dragStarted=!1,this.refrencePlane=new Ri,this.active=!1,this.isShowSectionPlane=!1,this.mousedown=e=>{0===e.button&&this.camera&&this.selectedObject&&(this.inputManager.setCursor("grabbing"),this.mouseDown=!0)},this.mousemove=e=>{if(this.dragStarted)this.updateRaycasterByMouse(e),this.inputManager.setCursor("grabbing"),this.onDragMove(e);else{this.activateSelectedObject(!1);let t=this.getIntersections(e);t?(this.inputManager.setCursor("grab"),this.selectedObject=t.object,this.activateSelectedObject(!0),this.mouseDown&&(this.dragStarted||(this.dragStarted=!0,this.onDragStart(e)))):(this.inputManager.setCursor("default"),this.selectedObject=void 0)}this.viewer.enableRender()},this.mouseup=e=>{0===e.button&&(this.activateSelectedObject(!1),this.mouseDown&&this.dragStarted&&(this.inputManager.setCursor("grab"),this.onDragEnd(e),this.dragStarted=!1),this.mouseDown=!1,this.selectedObject=void 0)},this.keydown=e=>{"Escape"===e.code&&this.deactivate()},!(e.camera&&e.renderer&&e.controls&&e.scene))throw new Error("Invalid bimViewer!");this.viewer=e,this.inputManager=t,this.scene=e.scene,this.renderer=e.renderer;let i=e.getBBox();if(!i)throw new Error("Need to set sectionBox first!");this.sectionBox=i.clone(),this.raycaster.layers.set(12)}get canvas(){var e;return null==(e=this.viewer.renderer)?void 0:e.domElement}get isActive(){return!!this.active}get camera(){return this.viewer.camera}get controls(){return this.viewer.controls}setGlobalClippingEnable(e){if(!this.clipPlanes)return;let t=e?this.clipPlanes:[];this.renderer.localClippingEnabled=e,this.renderer.clippingPlanes=t}setObjectClippingEnable(e){var t,i;if(!this.clipPlanes||null==(t=this.clippingObjetIds)||!t.length)return;this.renderer.localClippingEnabled=e;let r=e?this.clipPlanes:[];null==(i=this.clippingObjetIds)||i.forEach((e=>{let t=this.scene.getObjectById(e);t&&t.traverse((e=>{e.material&&(Array.isArray(e.material)?e.material.forEach((e=>{e.clippingPlanes=r,e.clipIntersection=!1})):e.material&&(e.material.clippingPlanes=r,e.material.clipIntersection=!1))}))}))}clearClippingObjectIds(){this.setObjectClippingEnable(!1),this.clippingObjetIds=[]}setClippingEnable(e){var t;null!=(t=this.clippingObjetIds)&&t.length?(this.setGlobalClippingEnable(!1),this.setObjectClippingEnable(e)):this.setGlobalClippingEnable(e)}activate(){this.inputManager.addEventListener("pointerdown",this.mousedown),this.inputManager.addEventListener("pointermove",this.mousemove),this.inputManager.addEventListener("pointerup",this.mouseup),this.inputManager.addEventListener("keydown",this.keydown),this.active=!0}deactivate(){var e;this.inputManager.removeEventListener("pointerdown",this.mousedown),this.inputManager.removeEventListener("pointermove",this.mousemove),this.inputManager.removeEventListener("pointerup",this.mouseup),this.inputManager.removeEventListener("keydown",this.keydown),null==(e=this.selectedObject)||e.removeFromParent(),this.selectedObject=void 0,this.dragStarted=!1,this.active=!1}getIntersections(e){if(!this.raycaster)return;this.updateRaycasterByMouse(e);let t=this.raycaster.intersectObjects(this.getIntersectObjects())||[];return t.find((e=>e.object&&e.object.parent instanceof du))||t[0]}updateRaycasterByMouse(e){if(!this.raycaster)return;let t=new ce(e.x,e.y),i=xi.screenPoint2NdcPoint(t,this.camera,this.canvas);this.raycaster.setFromCamera(i,this.camera)}destroy(){this.deactivate()}},jCe=new Rt,WCe=new Br,o3=class extends Je{constructor(e,t){super(),this.vertices=[],this.layers.enable(12),this.actionType=e,this.geometry=new ot,this.vertices=t,this.geometry.setFromPoints(t),this.geometry.setIndex([0,1,2,0,2,3]),this.material=new Xt({depthTest:!1,color:o3.normalPlaneColor,transparent:!0,opacity:.01,side:bi}),this.createIgnoreClipMateriasl(this.material),this.geometry.computeVertexNormals(),this.edge=this.createEdge(t),this.add(this.edge)}createIgnoreClipMateriasl(e){e.onBeforeCompile=function(e,t){e.fragmentShader=e.fragmentShader.replace("#include <clipping_planes_pars_fragment>","").replace("#include <clipping_planes_fragment>",""),e.vertexShader=e.vertexShader.replace("#include <clipping_planes_pars_vertex>","").replace("#include <clipping_planes_vertex>","")}}createEdge(e){let t=new ot;t.setFromPoints(e),t.setIndex([0,1,1,2,2,3,3,0]);let i=new br({color:o3.normalLineColor});return this.createIgnoreClipMateriasl(i),new Sr(t,i)}update(e){this.geometry.setFromPoints(e),this.geometry.computeBoundingSphere(),this.geometry.computeVertexNormals(),this.edge.geometry.setFromPoints(e),this.vertices=e}rotatePlane(e,t){let i=this.getPlaneCenter();WCe.setFromAxisAngle(e,t),this.vertices=this.vertices.map((e=>e.sub(i).applyQuaternion(WCe).add(i))),this.update(this.vertices)}setDirection(e){let t=new Br;t.setFromUnitVectors(Xa,e);let i=this.getPlaneCenter();this.vertices=this.vertices.map((e=>e.sub(i).applyQuaternion(t).add(i))),this.update(this.vertices)}getPlaneNormal(){let[e,t,i]=this.vertices,r=new D;return pn.getNormal(e,t,i,r),r}setActive(e){this.material.opacity=e?.1:.01}getPlaneCenter(){jCe.setFromPoints(this.vertices);let e=new D;return jCe.getCenter(e),e}},cn=o3;cn.normalPlaneColor=new Ve(0,.855,.718),cn.activePlaneColor=new Ve(1,1,0),cn.normalLineColor=16777215;var qCe=(e=>(e.X="X",e.Y="Y",e.Z="Z",e))(qCe||{}),l3=class extends hm{constructor(e,t){super(e,t),this.activeAxis="X",this.center=new D,this.sectionBox.getCenter(this.center),this.axisInfoMap={X:{normal:new D(1,0,0)},Y:{normal:new D(0,1,0)},Z:{normal:new D(0,0,1)}},this.viewer.addEventListener("AfterRender",(()=>{var e;this.isActive&&(null==(e=this.gizmo)||e.adjustSize(this.camera))}))}activate(){super.activate(),this.setActiveAxis("X")}deactivate(){var e,t;super.deactivate(),null==(e=this.planeMesh)||e.removeFromParent(),null==(t=this.gizmo)||t.removeFromParent(),this.planeMesh=void 0,this.gizmo=void 0}resetSection(){var e,t;null==(e=this.planeMesh)||e.removeFromParent(),null==(t=this.gizmo)||t.removeFromParent(),this.setClippingEnable(!1),this.planeMesh=void 0,this.gizmo=void 0,this.setActiveAxis("X")}setActiveAxis(e){this.activeAxis=e,this.initOrUpdateGizmo(),this.initOrUpdateSectionPlane(),this.initOrUpdateClipPlane(),this.setClippingEnable(!0),this.viewer.enableRender()}setSectionVisible(e){this.gizmo&&this.planeMesh&&(this.gizmo.visible=e,this.planeMesh.visible=e),this.isShowSectionPlane=e,this.viewer.enableRender()}initOrUpdateClipPlane(){switch(this.activeAxis){case"X":this.clipPlane=new Ri(new D(-1,0,0),this.center.x);break;case"Y":this.clipPlane=new Ri(new D(0,-1,0),this.center.y);break;case"Z":this.clipPlane=new Ri(new D(0,0,-1),this.center.z)}this.clipPlane&&(this.clipPlanes=[this.clipPlane])}initOrUpdateSectionPlane(){var e;let t=new D;this.sectionBox.getSize(t);let i=t.length(),r=this.center,n=(new Rt).setFromCenterAndSize(r,new D(i,i,i)),{min:s,max:a}=n;switch(null==(e=this.planeMesh)||e.removeFromParent(),this.activeAxis){case"X":this.planeMesh=new cn("X",[new D(r.x,a.y,s.z),new D(r.x,a.y,a.z),new D(r.x,s.y,a.z),new D(r.x,s.y,s.z)]);break;case"Y":this.planeMesh=new cn("Y",[new D(a.x,r.y,s.z),new D(s.x,r.y,s.z),new D(s.x,r.y,a.z),new D(a.x,r.y,a.z)]);break;case"Z":this.planeMesh=new cn("Z",[new D(a.x,a.y,r.z),new D(s.x,a.y,r.z),new D(s.x,s.y,r.z),new D(a.x,s.y,r.z)])}this.planeMesh&&this.scene.add(this.planeMesh),this.viewer.enableRender()}initOrUpdateGizmo(){var e,t;null==(e=this.gizmo)||e.removeFromParent();let i=this.axisInfoMap[this.activeAxis].normal;this.gizmo=new du,this.gizmo.setDirection(i),this.sectionBox.getCenter(this.gizmo.position),null==(t=this.scene)||t.add(this.gizmo)}onDragStart(e){var t;if(this.selectedObject instanceof cn)return;this.controls&&this.dragStarted&&this.selectedObject&&!(this.selectedObject instanceof cn)&&(this.controls.enableRotate=!1),re.info("[AxisPlaneSection] onDragStart:",e);let i=new D;this.sectionBox.getCenter(i),this.refrencePlane.setFromNormalAndCoplanarPoint(this.camera.getWorldDirection(this.refrencePlane.normal),i),null==(t=this.raycaster)||t.ray.intersectPlane(this.refrencePlane,this.lastWorldPos)}onDragMove(e){var t,i,r;if(!this.lastWorldPos||!this.selectedObject||!this.clipPlane||!this.planeMesh||!this.gizmo||this.selectedObject&&this.selectedObject instanceof cn)return;let n=new D;null==(t=this.raycaster)||t.ray.intersectPlane(this.refrencePlane,n);let s=this.selectedObject.userData.actionType,a=(new D).subVectors(this.lastWorldPos,this.center).normalize(),o=(new D).subVectors(n,this.center).normalize(),l=(new D).subVectors(n,this.lastWorldPos).projectOnVector(Xa.clone().applyQuaternion(this.gizmo.quaternion)),h=a.angleTo(o),u=(new D).crossVectors(a,o),c=new D;this.sectionBox.getSize(c);let p,d=Math.max(c.x,c.y,c.z);switch(s){case"TranslateX":case"TranslateY":case"TranslateZ":p=(new D).addVectors(this.gizmo.position,l),this.sectionBox.clone().setFromCenterAndSize(this.center,new D(d,d,d)).containsPoint(p)&&(null==(i=this.gizmo)||i.position.add(l),null==(r=this.planeMesh)||r.position.add(l));break;case"RotateX":{let e=Xa.clone().applyQuaternion(this.gizmo.quaternion);u.dot(e)<0&&(h=-h),this.gizmo.rotateX(h),this.planeMesh.rotatePlane(e,h)}break;case"RotateY":{let e=cm.clone().applyQuaternion(this.gizmo.quaternion);u.dot(e)<0&&(h=-h),this.gizmo.rotateY(h),this.planeMesh.rotatePlane(e,h)}break;case"RotateZ":{let e=um.clone().applyQuaternion(this.gizmo.quaternion);u.dot(e)<0&&(h=-h),this.gizmo.rotateZ(h),this.planeMesh.rotatePlane(e,h)}}this.clipPlane.setFromNormalAndCoplanarPoint(this.planeMesh.getPlaneNormal().negate(),this.gizmo.position),this.lastWorldPos=n}onDragEnd(e){this.selectedObject instanceof cn||(this.controls&&!this.controls.enableRotate&&(this.controls.enableRotate=!0),re.info("[AxisPlaneSection] onDragEnd:",e))}getIntersectObjects(){return this.planeMesh&&this.gizmo?[this.planeMesh,this.gizmo]:[]}activateSelectedObject(e){this.selectedObject&&(this.selectedObject instanceof cn?this.selectedObject.setActive(e):this.selectedObject.parent instanceof du&&this.selectedObject.parent.setActive(e,this.selectedObject))}},c3=class extends IT{constructor(e){super("axis-section-pop-panel","\u8f74\u5411\u5256\u5207",e.widgetContainer),this.axis="x",this.isVisible=!0,this.keydown=e=>{"Escape"===e.code&&this.destroy()},this.section=e.getActiveSection(),this.createGroupSelectLayout(),this.addGroupSelectItems(),this.createActiveSelectLayout(),this.addActiveItems(),window.addEventListener("keydown",this.keydown)}destroy(){super.destroy(),window.removeEventListener("keydown",this.keydown)}createGroupSelectLayout(){let e=document.createElement("div");e.classList.add("pop-panel-group-select"),this.body.appendChild(e),this.groupSelectNode=e}addGroupSelectItems(){let e=(e,t,i=!1)=>{let r=document.createElement("div");return r.classList.add("pop-panel-item"),r.setAttribute("itemName",e),r.append(t),i&&r.classList.add("active"),this.groupSelectNode&&this.groupSelectNode.appendChild(r),r},t=(e,t)=>s=>{s.stopPropagation(),this.activeItem!==e&&(i.classList.remove("active"),r.classList.remove("active"),n.classList.remove("active"),this.activeItem=e,t.classList.add("active"),this.section.setActiveAxis(e))},i=e("X","X",!0);i.onclick=t("X",i);let r=e("Y","Y");r.onclick=t("Y",r);let n=e("Z","Z");n.onclick=t("Z",n)}createActiveSelectLayout(){let e=document.createElement("div");e.classList.add("pop-panel-active-select"),this.body.appendChild(e),this.activeSelectNode=e}addActiveItems(){let e=(e,t)=>{let i=document.createElement("i");i.classList.add(EE),i.classList.add(t),e.innerHTML="",e.appendChild(i)},t=((t,i,r="")=>{let n=document.createElement("div");return n.classList.add("pop-panel-item"),i&&n.setAttribute("title",i),n.setAttribute("itemName",t),n.setAttribute("isActive","false"),e(n,r),n})("visible","\u9690\u85cf\u5256\u5207\u9762","icon-hidesectionplane");t.onclick=()=>{this.isVisible=!this.isVisible,this.isVisible?(e(t,"icon-hidesectionplane"),t.setAttribute("title","\u9690\u85cf\u5256\u5207\u9762")):(e(t,"icon-showsectionplane"),t.setAttribute("title","\u663e\u793a\u5256\u5207\u9762")),this.section.setSectionVisible(this.isVisible)}}},u3=class extends IT{constructor(e){super("pick-section-pop-panel","\u62fe\u53d6\u9762\u5256\u5207",e.widgetContainer),this.isVisible=!0,this.enabled=!0,this.keydown=e=>{"Escape"===e.code&&this.destroy()},this.section=e.getActiveSection(),this.createActiveSelectLayout(),this.addActiveItems(),window.addEventListener("keydown",this.keydown)}destroy(){super.destroy(),window.removeEventListener("keydown",this.keydown)}createActiveSelectLayout(){let e=document.createElement("div");e.classList.add("pop-panel-active-select"),this.body.appendChild(e),this.activeSelectNode=e}addActiveItems(){let e=(e,t)=>{let i=document.createElement("i");i.classList.add("gemini-viewer-icon"),i.classList.add(t),e.innerHTML="",e.appendChild(i)},t=(t,i,r="")=>{let n=document.createElement("div");return n.classList.add("pop-panel-item"),i&&n.setAttribute("title",i),n.setAttribute("itemName",t),n.setAttribute("isActive","false"),e(n,r),n},i=t("visible","\u9690\u85cf\u5256\u5207\u9762","icon-hidesectionplane");i.onclick=()=>{this.enabled&&(this.isVisible=!this.isVisible,this.isVisible?(e(i,"icon-hidesectionplane"),i.setAttribute("title","\u9690\u85cf\u5256\u5207\u9762")):(e(i,"icon-showsectionplane"),i.setAttribute("title","\u663e\u793a\u5256\u5207\u9762")),this.section.setSectionVisible(this.isVisible))},this.activeSelectNode&&this.activeSelectNode.appendChild(i),this.visibleNode=i;let r=t("reset","\u91cd\u7f6e","icon-reset");r.onclick=t=>{t.stopPropagation(),this.enabled&&(this.isVisible=!0,e(i,"icon-hidesectionplane"),i.setAttribute("title","\u9690\u85cf\u5256\u5207\u9762"),this.section.resetSection())},this.activeSelectNode&&this.activeSelectNode.appendChild(r),this.resetNode=r}enable(){this.enabled=!0,this.visibleNode&&this.visibleNode.classList.remove("disable")}disable(){this.enabled=!1,this.visibleNode&&this.visibleNode.classList.add("disable")}},hc=(e=>(e.Distance="Distance",e.Area="Area",e.Angle="Angle",e.Coordinate="Coordinate",e))(hc||{}),Lh=class extends Ls{constructor(e,t,i,r,n){super(),this.mouseMoved=!1,this.mouseDowned=!1,this.touchDowned=!1,this.mouseDownPositionX=-1,this.mouseDownPositionY=-1,this.tempEdgeMaterial=new br({color:16711680}),this.snapPoint=void 0,this.touchstart=e=>{this.mobileTouchHelper&&this.mobileTouchHelper.isIntersect(e)&&!this.touchDowned&&(this.viewer.controls&&(this.viewer.controls.enabled=!1),this.touchDowned=!0,this.mouseDownPositionX=e.x,this.mouseDownPositionY=e.y)},this.touchmove=e=>{if(e.pointers&&e.pointers.length>1)return;let{width:t,height:i}=this.canvas.getBoundingClientRect();if(!(e.x>t-15||e.x<35||e.y<15||e.y>i-35)&&this.touchDowned&&this.mobileTouchHelper){let t=e.x-this.mouseDownPositionX,i=e.y-this.mouseDownPositionY;this.mobileTouchHelper.translate(t,i),this.mouseDownPositionX=e.x,this.mouseDownPositionY=e.y;let r=this.mobileTouchHelper.getTouchPoint(),n=this.getIntersections(r);if(!n.length)return;let s=Date.now();if(this.handleSnap(n),re.debug(`[BaseMeasurement] this.handleSnap costs ${(Date.now()-s)/1e3}s`),!this.snapPoint)return void console.warn("[BaseMeasurement] Failed to find a snap point!");this.onMouseMove(this.snapPoint),!1===this.completed&&this.viewer.enableRender()}},this.touchend=e=>{var t;if(this.viewer.controls&&(this.viewer.controls.enabled=!0),!(e.pointers&&e.pointers.length>1))if(this.touchDowned){this.touchDowned=!1;let e=null==(t=this.mobileTouchHelper)?void 0:t.getTouchPoint();this.onMouseClick(e)}else this.selectMeasurementByEvent(e)},this.mousedown=e=>{this.mouseMoved=!1,this.mouseDowned=!0,this.mouseDownPositionX=e.x,this.mouseDownPositionY=e.y},this.mousemove=e=>{if(this.lastMoveEvent=e,this.mouseDownPositionX>=0&&this.mouseDownPositionY>=0&&(Math.abs(e.x-this.mouseDownPositionX)>5||Math.abs(e.y-this.mouseDownPositionY)>5)&&(this.mouseMoved=!0),this.mouseDowned)return;let t=this.getIntersections(e);if(!t.length)return;let i=Date.now();this.handleSnap(t),re.debug(`[BaseMeasurement] this.handleSnap costs ${(Date.now()-i)/1e3}s`),this.snapPoint?(this.onMouseMove(this.snapPoint),!1===this.completed&&this.viewer.enableRender()):console.warn("[BaseMeasurement] Failed to find a snap point!")},this.mouseup=e=>{this.mouseDowned=!1,this.mouseMoved||this.onMouseClick(e)},this.dblclick=()=>{re.info("[Measure] Double clicked")},this.keydown=e=>{if("Enter"===e.code){let e={x:0,y:0,pageX:0,pageY:0,clientX:0,clientY:0,deltaX:0,deltaY:0,button:2,movementX:0,movementY:0,deltaMode:0,pointerId:0,timestamp:0,buttons:0,pointerType:"mouse",altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1};this.onMouseClick(e)}else"Escape"===e.code&&this.cancel()},this.getIntersections=e=>{if(!this.raycaster)return[];this.raycaster.layers.set(11);let t=this.viewer.getRaycastableObjectsByMouse(e);re.debug(`[BaseMeasurement] The count of raycastable object is ${t.length}`,t);let i=Date.now(),r=this.raycaster.intersectObjects(t,!0)||[];return re.debug(`[BaseMeasurement] this.raycaster.intersectObjects costs ${(Date.now()-i)/1e3}s`),this.renderer.clippingPlanes.length>0&&(r=r.filter((e=>this.renderer.clippingPlanes.every((function(t){return t.distanceToPoint(e.point)>0}))))),r},this.type=e,this.viewer=t,this.inputManager=i,this.drawList=r,this.osnapHelper=n}get canvas(){var e;return null==(e=this.viewer.renderer)?void 0:e.domElement}get camera(){return this.viewer.camera}get renderer(){return this.viewer.renderer}get isActive(){return!!this.raycaster}get isMeasuring(){return!1===this.completed}setTouchHelper(e){this.mobileTouchHelper=e}createMobileExitButton(){let e=this.viewer.widgetContainer,t=document.createElement("button");return t.innerText="X",t.style.cssText="position: absolute;right: 5%; top: 5%;background-color: #000000;color: #ffffff;padding: 3px 10px;font-weight: bolder;",null==e||e.appendChild(t),this.exitButton=t,this.exitButton.style.display="none",t.addEventListener("touchstart",(()=>{this.exitDrawing(),this.exitButton&&(this.exitButton.style.display="none")})),this.addEventListener("FirstPointPicked",this.firstPickedListerner=()=>{this.exitButton&&(this.exitButton.style.display="inline-block")}),this.addEventListener("Completed",this.completedListerner=()=>{this.exitButton&&(this.exitButton.style.display="none")}),this.exitButton}activate(){if(xr.isMobile)this.inputManager.addEventListener("touchstart",this.touchstart),this.inputManager.addEventListener("touchmove",this.touchmove),this.inputManager.addEventListener("touchend",this.touchend);else{this.inputManager.addEventListener("pointerdown",this.mousedown),this.inputManager.addEventListener("pointermove",this.mousemove),this.inputManager.addEventListener("pointerup",this.mouseup);let e=this.viewer.translate;if(e){this.tooltip=new Dh("measure-tooltip",e("Tooltip.measure"),{followPointer:!0,showOnCreate:!0,parentNode:this.viewer.widgetContainer,target:this.canvas});let t=document.getElementById("measure-tooltip");t&&(t.style.pointerEvents="none")}this.setTooltipContent()}this.inputManager.addEventListener("dblclick",this.dblclick),this.inputManager.addEventListener("keydown",this.keydown),this.raycaster=this.viewer.getRaycaster()}deactivate(){var e,t;xr.isMobile?(this.inputManager.removeEventListener("touchstart",this.touchstart),this.inputManager.removeEventListener("touchmove",this.touchmove),this.inputManager.removeEventListener("touchend",this.touchend)):(this.inputManager.removeEventListener("pointerdown",this.mousedown),this.inputManager.removeEventListener("pointermove",this.mousemove),this.inputManager.removeEventListener("pointerup",this.mouseup)),this.inputManager.removeEventListener("dblclick",this.dblclick),this.inputManager.removeEventListener("keydown",this.keydown),null==(e=this.tooltip)||e.hide(),null==(t=this.tooltip)||t.destroy(),this.tooltip=void 0,this.raycaster=void 0,this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable),this.osnapHelper.deactivate(),this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0}removeDrawable(e){this.drawList.removeDrawable(e),this.viewer.enableRender()}clearClickedDrawable(){this.clickedOnMeasurementDrawable&&(this.clickedOnMeasurementDrawable.selected=!1,this.clickedOnMeasurementDrawable=void 0)}onMouseClick(e){if(xr.isMobile)return;let t=Date.now();this.lastClickTime&&t-this.lastClickTime<500||(this.lastClickTime=t,this.selectMeasurementByEvent(e))}selectMeasurementByEvent(e){if(this.clickedOnMeasurementDrawable&&(this.clickedOnMeasurementDrawable.selected=!1,this.clickedOnMeasurementDrawable=void 0),null==this.completed||!0===this.completed){let t=this.getIntersections(e)[0];if(t){let e=this.drawList.getDrawableByPosition(t.point,this.raycaster);e&&(this.dispatchEvent("ClickedOnMeasurement",e),this.clickedOnMeasurementDrawable=e)}}}getIntersectsIncludeOutline(e){var t;if(!this.viewer.is3d())return e.slice();let i=[];for(let s=0;s<e.length;s++){let t=e[s].object;if(t.updateWorldMatrix(!0,!1),t instanceof Je&&!kr.hasOutline(t)){let e=new Kr(new Jo(t.geometry,5),this.tempEdgeMaterial);e.layers.enableAll(),e.matrixWorld.copy(t.matrixWorld),i.push(e)}}let r=(null==(t=this.raycaster)?void 0:t.intersectObjects(i))||[];re.debug("intersects edge: ",r);let n=e.slice();return r.length>0&&(n.push(...r),n.sort(((e,t)=>e.distance-t.distance))),n}handleSnap(e){var t,i;if(!e||e.length<1)return void(this.snapPoint=void 0);let r,n=this.getIntersectsIncludeOutline(e);if(!this.viewer.is3d()){for(let e of n)if(e.point.z=0,"groundPlane"===(null==(t=e.object)?void 0:t.name)){r=e.point;continue}if(r){for(let t of n)t.distance=t.point.distanceTo(r);let e=e=>e instanceof Bi?0:e instanceof Kr?2:e instanceof Sr?1:3;n.sort(((t,i)=>{let r=e(t.object),n=e(i.object);return r!==n?r-n:t.distance-i.distance}))}}if(!r){for(let e of n)if(e.object instanceof Je){r=e.point;break}r||(re.warn("[BaseMeasurement] Potential to produce erroneous snap results"),r=n[0].point)}re.debug("[BaseMeasurement] filteredIntersections:",n),re.debug("[BaseMeasurement] mousePosition:",r),this.snapPoint=(null==(i=this.osnapHelper.handleSnap(r,n,this.viewer.is3d(),this.lastMouseDownPosition))?void 0:i.clone())||r}},fa=class extends Ys{constructor(e,t){super(e),this.type="Distance",this.labelBounds=new ns,this.drawing=!1,this.update(t)}setDrawingState(e){this.drawing=e}drawSelect(e,t){let i=this.getVertexs();this.drawPoints(e,t,i)}drawPoints(e,t,i){e.save(),e.fillStyle=fa.MAJOR_COLOR,e.strokeStyle=fa.MINOR_COLOR,e.lineWidth=fa.LINE_WIDTH,e.beginPath(),i.forEach((i=>{let r=this.transToScreenCoord(i,t);e.moveTo(r.x+fa.POINT_RADIUS,r.y),e.arc(r.x,r.y,fa.POINT_RADIUS,0,2*Math.PI)})),e.closePath(),e.fill(),e.stroke(),e.restore()}drawText(e,t){if(!this.label||!this.labelPositon)return;e.font=`${fa.LABEL_FONT_SIZE}px Arial`;let i=1.2*e.measureText(this.label).width,r=1.5*fa.LABEL_FONT_SIZE;this.labelBounds.setFromCenterAndSize(this.labelPositon,new ce(i,r)),this.drawRoundRect(e,this.labelPositon.x-i/2,this.labelPositon.y-r/2,i,r,4),e.save(),e.fillStyle=fa.MINOR_COLOR,e.textBaseline="middle",e.textAlign="center",e.fillText(this.label,this.labelPositon.x,this.labelPositon.y),e.restore()}drawRoundRect(e,t,i,r,n,s){r<2*s&&(s=r/2),n<2*s&&(s=n/2),e.save(),e.fillStyle=fa.MAJOR_COLOR,e.strokeStyle=fa.MINOR_COLOR,e.lineWidth=fa.LINE_WIDTH,e.beginPath(),e.moveTo(t+s,i),e.arcTo(t+r,i,t+r,i+n,s),e.arcTo(t+r,i+n,t,i+n,s),e.arcTo(t,i+n,t,i,s),e.arcTo(t,i,t+r,i,s),e.closePath(),e.fill(),this.selected&&e.stroke(),e.restore()}getVertexs(){return this.points}update(e){let{min:t,max:i}=(new Rt).setFromPoints(e);return this.x=t.x,this.y=t.y,this.width=Math.abs(i.x-t.x),this.height=Math.abs(i.y-t.y),this.points=e,this}getBounds(){let e=this.getVertexs();return(new Rt).setFromPoints(e)}getData(){return{id:this.id,type:this.type,points:this.points.map((e=>[e.x,e.y,e.z]))}}setData(e){super.setData(e),this.setLineColor(fa.MAJOR_COLOR),this.setFillColor(fa.AREA_FILL_COLOR),this.setLineWidth(fa.LINE_WIDTH)}isPointInPath(e,t){let i=null==t?void 0:t.ray;if(!i)return!1;let r=3*this.tolerance,n=this.transToScreenCoord(e,t.camera);if(this.labelBounds.containsPoint(n))return!0;let s=new D,a=new D,o=this.points;for(let l=0;l<o.length-1;l++){let e=o[l],t=o[l+1]||o[0];if(i.distanceSqToSegment(e,t,a,s)<r*r)return!0}return!1}getUnitString(){return"Distance"===this.type?uI("mm"):"Area"===this.type?`${uI("m",2)}`:"Angle"===this.type?"\xb0":""}},Ii=fa;Ii.MAJOR_COLOR="rgba(249, 157, 11, 0.9)",Ii.MINOR_COLOR="rgb(255, 255, 255)",Ii.AREA_FILL_COLOR="rgba(249, 157, 11, 0.3)",Ii.LINE_WIDTH=2,Ii.POINT_RADIUS=5,Ii.LABEL_FONT_SIZE=14;var Q_=class extends Ii{constructor(e,t){super(e,t),this.type="Angle",this.update(t)}draw(e,t){e.save(),e.lineWidth=Ii.LINE_WIDTH,e.strokeStyle=Ii.MAJOR_COLOR;let i=this.points;if(e.beginPath(),i.forEach(((i,r)=>{let n=this.transToScreenCoord(i,t);0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),3===this.points.length){let[i,r,n]=this.points.map((e=>this.transToScreenCoord(e,t))),s=(new ce).subVectors(i,r).normalize(),a=(new ce).subVectors(n,r).normalize(),o=Math.min(i.distanceTo(r),n.distanceTo(r)),l=s.angle(),h=a.angle();e.moveTo(r.x,r.y),e.arc(r.x,r.y,o/5,l,h,s.cross(a)<0)}if(e.stroke(),e.restore(),this.drawing){let i=1===this.points.length?this.points:this.points.slice(0,this.points.length-1);this.drawPoints(e,t,i)}this.drawText(e,t)}drawText(e,t){if(this.points.length<3)return;let[i,r,n]=this.points,s=this.getAngleBisector(i,r,n),a=this.calculateAngle(i,r,n);this.label=`${ah(a,2)} ${this.getUnitString()}`;let o=.3*Math.min(i.distanceTo(r),n.distanceTo(r));this.labelPositon=this.transToScreenCoord(r.clone().add(new D(s.x*o,s.y*o,s.z*o)),t),super.drawText(e,t)}getAngleBisector(e,t,i){let r=e,n=t,s=i,a=new D(r.x-n.x,r.y-n.y,r.z-n.z).normalize(),o=new D(s.x-n.x,s.y-n.y,s.z-n.z).normalize();return new D(a.x+o.x,a.y+o.y,a.z+o.z).normalize()}calculateAngle(e,t,i){let r=e,n=t,s=i,a=new D(r.x-n.x,r.y-n.y,r.z-n.z),o=new D(s.x-n.x,s.y-n.y,s.z-n.z);return 180*a.angleTo(o)/Math.PI}getClassType(){return"Angle"}};Rr._registerDrawableClass(Q_);var h3=class extends Lh{constructor(e,t,i,r){super("Angle",e,t,i,r)}onMouseMove(e){this.createOrUpdateAngleMeasureDrawable(e)}onMouseClick(e){var t;if(super.onMouseClick(e),this.clickedOnMeasurementDrawable)return;if(this.drawingPoints||(this.drawingPoints=[]),2===e.button)return void this.exitDrawing();let i=this.getIntersections(e)[0];if(!i)return;let r=null!=(t=this.snapPoint)?t:null==i?void 0:i.point;if(this.drawingPoints[0]&&$t.areVector3sEqual(this.drawingPoints[0],r))return;let n=this.drawingPoints;n.push(r),this.lastMouseDownPosition=r,1===n.length&&(this.dispatchEvent("FirstPointPicked"),this.completed=!1),this.createOrUpdateAngleMeasureDrawable(),n.length>=3&&this.complete()}exitDrawing(){this.drawingPoints=void 0,this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=void 0,this.lastMouseDownPosition=void 0}complete(){var e;!0!==this.completed&&(null==(e=this.currentMeasureDrawable)||e.setDrawingState(!1),this.dispatchEvent("Completed",this.currentMeasureDrawable),this.completed=!0,this.currentMeasureDrawable=void 0,this.drawingPoints=void 0,this.lastMouseDownPosition=void 0)}cancel(){let e=this.drawingPoints;if(e&&e.length>0&&(e.pop(),0===e.length&&(this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=!0),this.lastMoveEvent)){let e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}this.osnapHelper.deactivate(),this.lastMouseDownPosition=void 0}deactivate(){super.deactivate(),this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable)}setTooltipContent(){var e;let t=this.viewer.translate;if(!t)return;let i=t("Tooltip.measure");i&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(i))}createOrUpdateAngleMeasureDrawable(e){if(!this.drawingPoints||this.drawingPoints&&this.drawingPoints.length<1)return;let t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new Q_(Tt.guid(),this.drawingPoints),this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t),this.currentMeasureDrawable.setDrawingState(!0)}},eS=class extends Ii{constructor(e,t){super(e,t),this.type="Area",this.update(t)}draw(e,t){let i=this.points;if(e.save(),e.lineWidth=Ii.LINE_WIDTH,e.strokeStyle=Ii.MAJOR_COLOR,e.fillStyle=Ii.AREA_FILL_COLOR,e.beginPath(),i.forEach(((i,r)=>{let n=this.transToScreenCoord(i,t);0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.fill(),e.stroke(),e.restore(),this.drawing){let i=1===this.points.length?this.points:this.points.slice(0,this.points.length-1);this.drawPoints(e,t,i)}this.drawText(e,t)}drawText(e,t){if(this.points.length<3)return;let i=this.points,r=this.calculateArea(i);this.label=`${ah(r,2)}`,this.labelPositon=this.transToScreenCoord(this.getBarycenter(i),t),super.drawText(e,t)}calculateArea(e){let t=0,i=Ff.getFaces(e);for(let r=0;r<i.length/3;r++){let n=e[i[3*r]],s=e[i[3*r+1]],a=e[i[3*r+2]],o=s.clone().sub(n),l=a.clone().sub(n);t+=o.cross(l).length()/2}return t}getBarycenter(e){let t=e.length,i=0,r=0,n=0;return e.forEach((e=>{i+=e.x,r+=e.y,n+=e.z})),new D(i/t,r/t,n/t)}isPointInPath(e,t){let i=null==t?void 0:t.ray;if(!i)return!1;let r=this.transToScreenCoord(e,t.camera);if(this.labelBounds.containsPoint(r))return!0;let n=3*this.tolerance,s=new D,a=new D,o=this.points;for(let h=0;h<o.length;h++){let e=o[h],t=o[h+1]||o[0];if(i.distanceSqToSegment(e,t,a,s)<n*n)return!0}let l=Ff.getFaces(this.points);for(let h=0;h<l.length/3;h++){let t=this.points[l[3*h]],r=this.points[l[3*h+1]],n=this.points[l[3*h+2]];if(i.intersectTriangle(t,r,n,!1,e))return!0}return!1}getClassType(){return"Area"}};Rr._registerDrawableClass(eS);var p3=class extends Lh{constructor(e,t,i,r){super("Area",e,t,i,r)}activate(){super.activate()}deactivate(){super.deactivate(),this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable),this.exitButton&&(this.exitButton.style.display="none")}onMouseMove(e){this.createOrUpdateAreaMeasureDrawable(e)}onMouseClick(e){var t,i;if(super.onMouseClick(e),this.clickedOnMeasurementDrawable)return;this.drawingPoints||(this.drawingPoints=[]);let r=this.drawingPoints;if(2===e.button)return void this.exitDrawing();let n=this.getIntersections(e)[0];if(!n)return void re.warn("[Measure] No intersection found!");let s=null!=(i=null==(t=this.snapPoint)?void 0:t.clone())?i:null==n?void 0:n.point.clone();if(!this.drawingPoints[0]||!$t.areVector3sEqual(this.drawingPoints[0],s)){if(r.length>=3&&!Ff.arePointsCoplanar([...r,s]))return void re.warn("[Measure] The position is not coplanar with other points");r.push(s),this.lastMouseDownPosition=s,1===r.length&&(this.dispatchEvent("FirstPointPicked"),this.completed=!1),this.createOrUpdateAreaMeasureDrawable()}}exitDrawing(){let e=this.drawingPoints||[],t=!0;if(e.length<3&&(re.warn("[Measure] If the number of points is less than 3, the measurement area cannot be formed !"),t=!1),t&&Ff.isSelfIntersecting(e)&&(re.warn("[Measure] The area formed by these points intersects itself, so the correct measurement cannot be obtained !"),t=!1),!t)return this.drawingPoints=void 0,this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=void 0,void(this.lastMouseDownPosition=void 0);this.createOrUpdateAreaMeasureDrawable(),this.complete()}complete(){var e;!0!==this.completed&&(null==(e=this.currentMeasureDrawable)||e.setDrawingState(!1),this.dispatchEvent("Completed",this.currentMeasureDrawable),this.completed=!0,this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0)}cancel(){let e=this.drawingPoints;if(e&&e.length>0&&(e.pop(),0===e.length&&(this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=!0),this.lastMoveEvent)){let e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}this.osnapHelper.deactivate(),this.lastMouseDownPosition=void 0}setTooltipContent(){var e;let t=this.viewer.translate;if(t){let i=t("Tooltip.areaMeasurement");i&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(i))}}createOrUpdateAreaMeasureDrawable(e){if(!this.drawingPoints||this.drawingPoints&&this.drawingPoints.length<1)return;let t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new eS(Tt.guid(),this.drawingPoints),this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t),this.currentMeasureDrawable.setDrawingState(!0)}},tS=class extends Ii{constructor(e,t){super(e,t),this.type="Coordinate",this.update(t)}draw(e,t){this.drawText(e,t),e.save(),e.lineWidth=Ii.LINE_WIDTH,e.strokeStyle=Ii.MAJOR_COLOR,e.fillStyle=Ii.AREA_FILL_COLOR;let i=this.points;e.beginPath(),i.forEach((i=>{let r=this.transToScreenCoord(i,t);e.arc(r.x,r.y,Ii.POINT_RADIUS,0,2*Math.PI)})),e.fill(),e.stroke(),e.restore()}drawText(e,t){let i=this.points[0];$t.areNumbersEqual(i.x,0);let r=$t.areNumbersEqual(i.x,0)?0:i.x,n=$t.areNumbersEqual(i.y,0)?0:i.y,s=$t.areNumbersEqual(i.z,0)?0:i.z;this.label=`${ah(r,2)}, ${ah(n,2)}, ${ah(s,2)}`,e.font=`${Ii.LABEL_FONT_SIZE}px Arial`;let a=1.2*e.measureText(this.label).width,o=1.5*Ii.LABEL_FONT_SIZE;this.labelPositon=this.transToScreenCoord(i,t),this.labelPositon.y-=o/2,this.labelBounds.setFromCenterAndSize(this.labelPositon,new ce(a,o)),this.drawRoundRect(e,this.labelPositon.x-a/2,this.labelPositon.y-o/2,a,o,4),e.save(),e.fillStyle=Ii.MINOR_COLOR,e.textBaseline="middle",e.textAlign="center",e.fillText(this.label,this.labelPositon.x,this.labelPositon.y),e.restore()}getClassType(){return"Coordinate"}};Rr._registerDrawableClass(tS);var d3=class extends Lh{constructor(e,t,i,r){super("Coordinate",e,t,i,r)}onMouseMove(e){this.createOrUpdatePointMarker(e)}onMouseClick(e){var t;if(super.onMouseClick(e),this.clickedOnMeasurementDrawable)return;if(this.drawingPoints||(this.drawingPoints=[]),2===e.button)return void this.exitDrawing();let i=this.getIntersections(e)[0];if(!i)return;let r=null!=(t=this.snapPoint)?t:null==i?void 0:i.point,n=this.drawingPoints;n.push(r),this.lastMouseDownPosition=r,1===n.length&&(this.dispatchEvent("FirstPointPicked"),this.completed=!1),this.createOrUpdatePointMarker(r),n.length>=1&&this.complete()}exitDrawing(){this.drawingPoints=void 0,this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=void 0,this.lastMouseDownPosition=void 0}complete(){!0!==this.completed&&(this.dispatchEvent("Completed",this.currentMeasureDrawable),this.completed=!0,this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0)}cancel(){let e=this.drawingPoints;if(e&&e.length>0&&(e.pop(),0===e.length&&(this.completed=!0),this.lastMoveEvent)){let e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}this.osnapHelper.deactivate(),this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0}setTooltipContent(){var e;let t=this.viewer.translate;if(t){let i=t("Tooltip.measure");i&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(i))}}createOrUpdatePointMarker(e){if(!this.drawingPoints||this.drawingPoints&&this.drawingPoints.length<1)return;let t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new tS(Tt.guid(),this.drawingPoints),this.currentMeasureDrawable.selected=!0,this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t)}},rV=class extends Ii{constructor(e,t){super(e,t),this.type="Distance",this.update(t)}draw(e,t){let i=this.points;if(e.save(),e.lineWidth=Ii.LINE_WIDTH,e.strokeStyle=Ii.MAJOR_COLOR,e.beginPath(),i.forEach(((i,r)=>{let n=this.transToScreenCoord(i,t);0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore(),this.drawing){let i=1===this.points.length?this.points:this.points.slice(0,this.points.length-1);this.drawPoints(e,t,i)}else this.selected||this.drawVerticalLine(e,t);this.drawText(e,t)}drawText(e,t){if(this.points.length<2)return;let[i,r]=this.points,n=i.distanceTo(r);this.label=`${ah(n,2)}`,this.labelPositon=this.transToScreenCoord(i.clone().add(r).divideScalar(2),t),super.drawText(e,t)}drawVerticalLine(e,t){if(this.points.length<2)return;let[i,r]=this.points.map((e=>this.transToScreenCoord(e,t))),[n,s]=this.getShortLineBySegments(i,r),[a,o]=this.getShortLineBySegments(r,i);e.save(),e.lineWidth=Ii.LINE_WIDTH,e.strokeStyle=Ii.MAJOR_COLOR,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(s.x,s.y),e.moveTo(a.x,a.y),e.lineTo(o.x,o.y),e.stroke(),e.restore()}getShortLineBySegments(e,t){let i=(new ce).subVectors(t,e).normalize(),r=rV.SHORT_LINE_LENGTH/2,n=Math.PI/2;return[i.clone().rotateAround(new ce,n).normalize().multiplyScalar(r).add(e),i.clone().rotateAround(new ce,-n).normalize().multiplyScalar(r).add(e)]}getClassType(){return"Distance"}},ST=rV;ST.SHORT_LINE_LENGTH=12,Rr._registerDrawableClass(ST);var ma,f3=class extends Lh{constructor(e,t,i,r){super("Distance",e,t,i,r)}onMouseMove(e){this.createOrUpdateDistanceMeasureDrawable(e)}onMouseClick(e){var t;if(super.onMouseClick(e),this.clickedOnMeasurementDrawable)return;if(this.drawingPoints||(this.drawingPoints=[]),2===e.button)return void this.exitDrawing();let i=this.getIntersections(e)[0];if(!i)return;let r=null!=(t=this.snapPoint)?t:null==i?void 0:i.point;if(this.drawingPoints[0]&&$t.areVector3sEqual(this.drawingPoints[0],r))return;let n=this.drawingPoints;n.length<2&&n.push(r),this.lastMouseDownPosition=r,1===n.length&&(this.dispatchEvent("FirstPointPicked"),this.completed=!1),this.createOrUpdateDistanceMeasureDrawable(),n.length>=2&&this.complete()}exitDrawing(){this.drawingPoints=void 0,this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=void 0,this.lastMouseDownPosition=void 0}complete(){var e;!0!==this.completed&&(null==(e=this.currentMeasureDrawable)||e.setDrawingState(!1),this.dispatchEvent("Completed",this.currentMeasureDrawable),this.completed=!0,this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0)}cancel(){let e=this.drawingPoints;e&&e.length>0&&(e.pop(),0===e.length&&(this.completed=!0),this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable)),this.osnapHelper.deactivate(),this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0}deactivate(){super.deactivate(),this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable)}setTooltipContent(){var e;let t=this.viewer.translate;if(t){let i=t("Tooltip.measure");i&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(i))}}createOrUpdateDistanceMeasureDrawable(e){if(!this.drawingPoints||this.drawingPoints&&this.drawingPoints.length<1)return;let t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new ST(Tt.guid(),this.drawingPoints),this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t),this.currentMeasureDrawable.setDrawingState(!0)}},fu=class{constructor(e,t){var i,r;this.selectedMeasurementDrawable=void 0,this.drawableList=new Xc("measure"),this.drawableHelperList=new Xc("touchHelper"),this.measurements={},this.activeMeasurementType=void 0,this.keydown=e=>{var t;let i,r=this.getActiveMeasurementType();r&&(i=this.measurements[r]);let n=this.selectedMeasurementDrawable;n&&"Delete"===e.code&&(this.removeMeasurement(n),null==(t=this.viewer.undoRedoManager)||t.addCommand(new DE(this,n.getData())),this.activeMeasurementType&&this.measurements[this.activeMeasurementType].clearClickedDrawable()),e.ctrlKey&&"KeyZ"===e.code&&null!=i&&i.isMeasuring&&i.cancel(),e.ctrlKey&&"KeyY"===e.code&&null!=i&&i.isMeasuring,this.viewer.enableRender()},this.viewer=e,this.inputManager=t,this.overlayRender=this.viewer.overlayRender,null==(i=this.overlayRender)||i.addDrawableList(this.drawableHelperList),null==(r=this.overlayRender)||r.addDrawableList(this.drawableList),this.scene=new wn,this.osnapHelper=new ZO(this.overlayRender),this.measurements.Distance=new f3(this.viewer,t,this.drawableList,this.osnapHelper),this.measurements.Area=new p3(this.viewer,t,this.drawableList,this.osnapHelper),this.measurements.Angle=new h3(this.viewer,t,this.drawableList,this.osnapHelper),this.measurements.Coordinate=new d3(this.viewer,t,this.drawableList,this.osnapHelper),this.inputManager.addEventListener("wheel",(()=>{this.updateSnapTolerance()})),this.viewer.addEventListener("LayoutChanged",(()=>{this.updateSnapTolerance()})),this.initEvents()}initEvents(){Object.values(this.measurements).forEach((e=>{e.addEventListener("Completed",(e=>{var t;this.viewer.dispatchEvent("MeasurementAdded",e.getData()),null==(t=this.viewer.undoRedoManager)||t.addCommand(new fI(this,e.getData())),this.selectMeasurement(e)})),e.addEventListener("Deactivate",(()=>{this.osnapHelper.deactivate(),this.viewer.deactivateMeasurement()})),e.addEventListener("FirstPointPicked",(()=>{this.unselectMeasurement()})),e.addEventListener("ClickedOnMeasurement",(e=>{this.selectMeasurement(e)}))}))}get canvas(){var e;return null==(e=this.viewer.renderer)?void 0:e.domElement}get raycaster(){return this.viewer.getRaycaster()}addMeasurement(e,t=!0){this.drawableList.addDrawable(e),this.selectedMeasurementDrawable=e,this.viewer.enableRender(),t&&this.viewer.dispatchEvent("MeasurementAdded",e.getData())}createMeasurement(e){return Rr.createDrawable(e)}removeMeasurement(e,t=!0){this.drawableList.removeDrawable(e),this.viewer.enableRender(),t&&this.viewer.dispatchEvent("MeasurementRemoved",e.getData())}updateSnapTolerance(e=3){let t=this.viewer.getPixelSizeInWorldCoord()*e;this.osnapHelper.updateSnapTolerance(t)}activateMeasurement(e){this.activeMeasurementType&&this.deactivateMeasurement(),this.measurements[e]?(this.measurements[e].activate(),this.activeMeasurementType=e,this.updateSnapTolerance()):(this.activeMeasurementType=void 0,re.error("[Measure] Failed to activate measurement, type:",e));let{width:t,height:i}=this.canvas.getBoundingClientRect();xr.isMobile&&this.canvas&&!this.mobileTouchHelper&&(this.mobileTouchHelper=new n3(new ce(t/2,i/2)),this.drawableHelperList.addDrawable(this.mobileTouchHelper)),this.mobileTouchHelper&&(this.mobileTouchHelper.setPosition(new ce(t/2,i/2)),this.measurements[e].setTouchHelper(this.mobileTouchHelper),this.mobileTouchHelper.visible=!0),this.inputManager.addEventListener("keydown",this.keydown)}deactivateMeasurement(){this.unselectMeasurement();let e=this.activeMeasurementType;e&&this.measurements[e].deactivate(),this.activeMeasurementType=void 0,this.mobileTouchHelper&&(this.mobileTouchHelper.visible=!1),this.inputManager.removeEventListener("keydown",this.keydown)}getActiveMeasurementType(){return this.activeMeasurementType}isMeasurementActive(){let e=this.activeMeasurementType;return e?this.measurements[e].isActive:!!this.getActiveMeasurementType()}isMeasurementMeasuring(){let e=this.activeMeasurementType;return!!e&&this.measurements[e].isMeasuring}getMeasurementsData(){return this.drawableList.getDrawableDatas()}cancelMeasurement(){let e=this.activeMeasurementType;e&&this.measurements[e].exitDrawing()}setMeasurementsData(e){var t,i;null==(t=this.viewer.undoRedoManager)||t.startTransaction(),e.forEach((e=>{var t;this.measurements[e.type]?e.points.length>=2?(this.addMeasurement(Rr.createDrawable(e)),null==(t=this.viewer.undoRedoManager)||t.addCommand(new fI(this,e))):re.info("[Measure] Invalid points found in MeasurementData:",e):re.warn("[Measure] Failed to add measurement data for",e)})),null==(i=this.viewer.undoRedoManager)||i.endTransaction()}setMeasurementVisibility(e,t){let i=this.drawableList.getDrawables().get(e);return!!i&&(i.visible=t,this.viewer.enableRender(),!0)}setMeasurementsVisibility(e){this.drawableList.getDrawables().forEach((t=>t.visible=e)),this.viewer.enableRender()}clearMeasurements(){let e=this.activeMeasurementType;e&&this.measurements[e].exitDrawing(),this.drawableList.clear(),this.viewer.enableRender()}getMeasurementById(e){return this.drawableList.getDrawableById(e)}removeMeasurementById(e){let t=this.drawableList.getDrawableById(e);t&&(this.removeMeasurement(t),re.warn("[Measure] Failed to find measurement by id:",e))}selectMeasurementById(e){this.unselectMeasurement();let t=this.drawableList.getDrawableById(e);t&&(t.selected=!0,this.selectedMeasurementDrawable=t),this.viewer.enableRender()}selectMeasurement(e){this.unselectMeasurement(),e.selected=!0,this.selectedMeasurementDrawable=e,this.viewer.enableRender()}unselectMeasurement(){this.selectedMeasurementDrawable&&(this.selectedMeasurementDrawable.selected=!1,this.viewer.enableRender()),this.selectedMeasurementDrawable=void 0}destroy(){var e;this.deactivateMeasurement(),this.clearMeasurements(),this.drawableHelperList.clear(),this.measurements={},null==(e=this.osnapHelper)||e.destroy(),this.scene.clear()}},YCe={HomeView:{icon:{default:"icon-home",active:"icon-home-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.homeView",type:1,onClick:e=>{e.goToHomeView()}},OrthoMode:{icon:{default:"icon-orthomode",active:"icon-orthomode-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.orthoView",type:4,onActive:e=>{re.info("[Toolbar]","Enter OrthoMode"),e.setToOrthographicCamera(!0)},onDeactive:e=>{re.info("[Toolbar]","Exit OrthoMode"),e.setToOrthographicCamera(!1)}},Measure:{icon:{default:"icon-measure",active:"icon-measure-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.measurement",type:3,children:{MeasureDistance:{icon:{default:"icon-measure-distance"},menuName:"Toolbar.distanceMeasurement",onActive:e=>{e.deactivateSection(),e.activateMeasurement("Distance")},onDeactive:e=>{e.deactivateMeasurement()},type:4,mutexIds:["MeasureArea","MeasureAngle","MeasureCoordinate"]},MeasureArea:{icon:{default:"icon-measure-area-color"},onActive:e=>{e.deactivateSection(),e.activateMeasurement("Area")},onDeactive:e=>{e.deactivateMeasurement()},type:4,menuName:"Toolbar.areaMeasurement",mutexIds:["MeasureDistance","MeasureAngle","MeasureCoordinate"]},MeasureAngle:{menuName:"Toolbar.angleMeasurement",icon:{default:"icon-angle-measure"},type:4,onActive:e=>{e.deactivateSection(),e.activateMeasurement("Angle")},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:["MeasureDistance","MeasureArea","MeasureCoordinate"]},MeasureCoordinate:{menuName:"Toolbar.coordinateMeasurement",icon:{default:"icon-distancemeasure",iconFont:"gemini-viewer-icon"},type:4,onActive:e=>{e.deactivateSection(),e.activateMeasurement("Coordinate")},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:["MeasureDistance","MeasureArea","MeasureAngle"]},MeasureClear:{icon:{default:"icon-clear",active:"icon-clear-filled",iconFont:"gemini-viewer-icon"},onClick:e=>{re.debug("[Toolbar]","Clearing Measure",e),e.clearMeasurements()},type:1,menuName:"Toolbar.clearMeasurement"}},mutexIds:["Section","SectionAxis","SectionBox","SectionPlane"]},Section:{icon:{default:"icon-section",active:"icon-section-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.section",type:3,children:{SectionAxis:{icon:{default:"icon-sectionplane",active:"icon-sectionplane-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.axisSection",type:4,onActive:e=>{e.deactivateMeasurement(),e.getMeasurements().forEach((t=>e.setMeasurementVisibility(t.id,!1))),null==ma||ma.destroy(),e.activateSection("AxisPlaneSection"),ma=new c3(e)},onDeactive:e=>{e.getMeasurements().forEach((t=>e.setMeasurementVisibility(t.id,!0))),e.deactivateSection(),null==ma||ma.destroy(),ma=void 0},mutexIds:["SectionBox","SectionPlane"]},SectionPlane:{icon:{default:"icon-choosesectionplane",active:"icon-choosesectionplane-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.pickSectionPlane",type:4,onActive:e=>{e.deactivateMeasurement(),e.getMeasurements().forEach((t=>e.setMeasurementVisibility(t.id,!1))),null==ma||ma.destroy(),e.activateSection("PickPlaneSection"),ma=new u3(e)},onDeactive:e=>{e.getMeasurements().forEach((t=>e.setMeasurementVisibility(t.id,!0))),e.deactivateSection(),null==ma||ma.destroy(),ma=void 0},mutexIds:["SectionAxis","SectionBox"]},SectionBox:{icon:{default:"icon-sectionbox",active:"icon-sectionbox-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.sectionBox",type:4,onActive:e=>{e.deactivateMeasurement(),e.getMeasurements().forEach((t=>e.setMeasurementVisibility(t.id,!1))),e.activateSection()},onDeactive:e=>{e.getMeasurements().forEach((t=>e.setMeasurementVisibility(t.id,!0))),e.deactivateSection()},mutexIds:["SectionAxis","SectionPlane"]}},mutexIds:["Measure","MeasureDistance","MeasureArea","MeasureAngle","MeasureCoordinate"]},BimTree:{icon:{default:"icon-bimtree",active:"icon-bimtree-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.bimTree",type:4,onActive:()=>{re.info("[Toolbar]","Activate Bim Tree")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Bim Tree")}},Viewpoint:{icon:{default:"icon-viewpoint",active:"icon-viewpoint-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.viewpoint",type:4,onActive:()=>{re.info("[Toolbar]","Activate Viewpoint")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Viewpoint")},visible:!1},Annotation:{icon:{default:"icon-annotation",active:"icon-annotation-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.annotation",type:4,onActive:()=>{re.info("[Toolbar]","Activate Annotation")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Annotation")},visible:!1},Property:{icon:{default:"icon-property",active:"icon-property-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.property",type:4,onActive:()=>{re.info("[Toolbar]","Activate Property")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Property")},visible:!1},Settings:{icon:{default:"icon-settings",active:"icon-settings-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.settings",type:4,onActive:()=>{re.info("[Toolbar]","Activate Settings")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Settings")},visible:!1},FullScreen:{icon:{default:"icon-fullscreen",active:"icon-fullscreen-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.fullscreen",type:4,onClick:(e,t)=>{let i=()=>{let e=null==t?void 0:t.menuList.get("FullScreen");e&&e.setActive(Tt.isFullScreen())};Tt.isFullScreen()?(Tt.exitFullscreen(),window.removeEventListener("resize",i)):Tt.fullScreen(e.viewerContainer),window.addEventListener("resize",i)}}},XCe={SceneClear:{icon:{default:"icon-clear",active:"icon-clear-filled"},menuName:"clear",type:1,onClick:()=>{}}},$Ce={HomeView:{icon:{default:"icon-zhushitu",active:"icon-zhushitu"},menuName:"Toolbar.homeView",type:1,onClick:e=>{e.goToHomeView()}},ZoomToRectangle:{icon:{default:"icon-kuangxuanfangda",active:"icon-kuangxuanfangda"},menuName:"Toolbar.zoomToRectangle",type:4,onClick:e=>{e.deactivateZoomRect(),e.removeEventListener("BoxSelectDeactivated"),e.addEventListener("BoxSelectDeactivated",(()=>{var t;null==(t=e.toolbar)||t.setActive("ZoomToRectangle",!1)})),e.zoomToRect()},mutexIds:["GetScreenshot"]},GetScreenshot:{icon:{default:"icon-frame-clipping",active:"icon-frame-clipping"},menuName:"Toolbar.screenshot",type:4,onClick:e=>{e.removeEventListener("BoxSelectDeactivated"),e.addEventListener("BoxSelectDeactivated",(()=>{var t;null==(t=e.toolbar)||t.setActive("GetScreenshot",!1)})),e.getScreenshot().then((e=>{re.info("[Toolbar] getScreenshot() returns:",null==e?void 0:e.base64Image),null!=e&&e.base64Image||re.error("[Toolbar] Failed to get screenshot!");let t=document.createElement("a");t.href=null==e?void 0:e.base64Image,t.download="",t.click()})).catch((t=>{var i;re.error("[Toolbar] Failed to get screenshot, reason:",t),null==(i=e.toolbar)||i.setActive("GetScreenshot",!1)}))},mutexIds:["ZoomToRectangle"]},Measure:{icon:{default:"icon-celiang1",active:"icon-celiang1"},menuName:"Toolbar.measurement",type:3,children:{MeasureDistance:{icon:{default:"icon-measure-distance"},menuName:"Toolbar.distanceMeasurement",onActive:e=>{e.activateMeasurement("Distance")},onDeactive:e=>{e.deactivateMeasurement()},type:4,mutexIds:["MeasureArea","MeasureAngle","MeasureCoordinate","ZoomToRectangle","GetScreenshot"]},MeasureArea:{icon:{default:"icon-measure-area-color"},onActive:e=>{e.activateMeasurement("Area")},onDeactive:e=>{e.deactivateMeasurement()},type:4,menuName:"Toolbar.areaMeasurement",mutexIds:["MeasureDistance","MeasureAngle","MeasureCoordinate","ZoomToRectangle","GetScreenshot"]},MeasureAngle:{menuName:"Toolbar.angleMeasurement",icon:{default:"icon-angle-measure"},type:4,onActive:e=>{e.activateMeasurement("Angle")},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:["MeasureDistance","MeasureArea","MeasureCoordinate","ZoomToRectangle","GetScreenshot"]},MeasureCoordinate:{menuName:"Toolbar.coordinateMeasurement",icon:{default:"icon-distancemeasure",iconFont:"gemini-viewer-icon"},type:4,onActive:e=>{e.activateMeasurement("Coordinate")},onDeactive:e=>{e.deactivateMeasurement()},visible:!1,mutexIds:["MeasureDistance","MeasureArea","MeasureAngle","ZoomToRectangle","GetScreenshot"]},MeasureClear:{icon:{default:"icon-clear",active:"icon-clear-filled",iconFont:"gemini-viewer-icon"},onClick:e=>{re.debug("[Toolbar]","Clearing Measure",e),e.clearMeasurements()},type:1,menuName:"Toolbar.clearMeasurement"}}},Markup:{icon:{default:"icon-annotation"},menuName:"Toolbar.markup",type:1,onClick:(e,t)=>{var i,r,n;e.deactivateMeasurement(),null==(i=e.toolbar)||i.updateMenu("Measure",{defaultActive:!1}),e.deactivateZoomRect(),null==(r=e.toolbar)||r.setActive("ZoomToRectangle",!1),e.getMarkups().forEach((t=>e.setMarkupVisibility(t.id,!0))),null==(n=e.toolbar)||n.setActive("MarkupVisibility",!1),e.activateMarkup("CloudRectMarkup"),t.hide(),new a3(e,Mr({},GCe))}},MarkupVisibility:{icon:{default:"icon-annotation-show",active:"icon-annotation-hide"},menuName:"Toolbar.markupVisibility",type:4,onActive:e=>{e.getMarkups().forEach((t=>e.setMarkupVisibility(t.id,!1)))},onDeactive:e=>{e.getMarkups().forEach((t=>e.setMarkupVisibility(t.id,!0)))},visible:!0},Settings:{icon:{default:"icon-settings",active:"icon-settings-filled",iconFont:"gemini-viewer-icon"},menuName:"Toolbar.settings",type:4,onActive:()=>{re.info("[Toolbar]","Activate Settings")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Settings")},visible:!0},Compared:{icon:{default:"icon-compared"},menuName:"Toolbar.compared",type:4,onActive:()=>{re.info("[Toolbar]","Activate Compare")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Compare")},visible:!1},QuitCompare:{icon:{default:"icon-compared"},menuName:"Toolbar.quitCompare",type:4,onActive:()=>{re.info("[Toolbar]","Activate Compare")},onDeactive:()=>{re.info("[Toolbar]","Deactivate Compare")},visible:!1},Layers:{icon:{default:"icon-tucengkongzhi",active:"icon-tucengkongzhi"},menuName:"Toolbar.layers",type:4,onClick:()=>{}},FullScreen:{icon:{default:"icon-quanping",active:"icon-quanping"},menuName:"Toolbar.fullscreen",type:4,onClick:(e,t)=>{let i=()=>{let e=null==t?void 0:t.menuList.get("FullScreen");e&&e.setActive(Tt.isFullScreen())};Tt.isFullScreen()?(Tt.exitFullscreen(),window.removeEventListener("resize",i)):Tt.fullScreen(e.viewerContainer),window.addEventListener("resize",i)}}},ZCe={enableNavCube:!0,enableAxisGizmo:!0,enableToolbar:!0,enableBottomBar:!0,enableContextMenu:!0,enableSpinner:!0,containerId:"myCanvas",units:"meters"},O2r={enableNavCube:!1,enableAxisGizmo:!1,enableToolbar:!1,enableBottomBar:!1,enableContextMenu:!1,containerId:"myCanvas"},rS=class{constructor(e="uploadModelFile"){this.input=document.createElement("input"),this.input.id=e,this.input.type="file",this.input.multiple=!0,this.input.accept=this.formats().map((e=>"."+e)).join(","),this.input.style.display="none",this.input.onchange=e=>{let t=e.target.files;!t||t.length<=0?re.error("[Uploader] No files to be uploaded!"):this.uploadFiles(t)}}formats(){return re.warn("[Uploader]: Should call derived class instead!"),[]}uploadFiles(e){re.warn(`[Uploader]: Should call derived class instead! files: ${e}`)}openFileBrowserToUpload(){this.input.click()}},m3=class extends rS{constructor(e,t){super(t),this.defaultModelConfig={src:"",position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],instantiate:!1,merge:!1},this.viewer=e}formats(){return["gltf","glb","dxf","obj","stl","fbx","ifc","dae","*"]}uploadFiles(e){let t=e.length;if(0===t)return;let i,r,n,s=Mr({},this.defaultModelConfig),a=new Map;for(let h=0;h<t;h++){let t=e[h];a.set(t.name,t),t.name.match(/\.(gltf|glb)$/)&&(n=t)}let o=[],l=()=>{n&&(i=URL.createObjectURL(n),o.push(i),s.src=n.name)};if(n){l();let e=qs.extractUrlBase(i);r=new eh,r.setURLModifier((t=>{let i=decodeURI(t).replace(e,"").replace(/^(\.?\/)/,"");if(a.has(i)){let e=a.get(i),t=URL.createObjectURL(e);return o.push(t),t}return t}))}else n=e[0],l();this.viewer.loadLocalModel(i,s,r,(e=>{let t=Math.floor(100*e.loaded/e.total);re.info(`[Uploader] Loading ${null==n?void 0:n.name}, ${t}%`)})).then((()=>{re.info(`[Uploader] Loaded ${null==n?void 0:n.name}`),o.forEach(URL.revokeObjectURL)}))}},KCe=class extends rS{constructor(e,t){super(t),this.defaultModelConfig={src:"",position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],instantiate:!1,merge:!0},this.viewer=e}formats(){return["dxf"]}uploadFiles(e){let t=e=>{let t=(100*e.loaded/e.total).toFixed(1);re.info(`[Uploader] Progress: ${t}%`)},i=new eh,r=[],n=new Map;for(let a=0;a<e.length;a++){let t=e[a];n.set(t.name,t),t.name.match(/\.(dxf)$/)&&r.push(t)}let s=[];if(i.setURLModifier((e=>{let t=decodeURI(e).replace(/^(.?[\/ | \\]+)/,"");if(n.has(t)){let e=n.get(t),i=URL.createObjectURL(e);return s.push(i),i}return e})),this.viewer.setLoadingManager(i),2===r.length){let e=r[0],i=r[1],n=URL.createObjectURL(e),s=URL.createObjectURL(i);this.viewer.compare({src:n,modelId:e.name},{src:s,modelId:i.name},t).then((()=>{this.onSuccess&&this.onSuccess({compare:!0}),re.debug(`[Uploader] Compared models: ${n}, ${s}`)})).catch((e=>{re.error(`[Uploader] Failed to compare models: ${n}, ${s}. reason: ${e}`)}))}else{let i=r[0],n=URL.createObjectURL(i),s=Mr({},this.defaultModelConfig);s.src=n,s.modelId=i.name;try{this.viewer.loadModelAsync(s,t).then((()=>{this.onSuccess&&this.onSuccess({}),re.info(`[Uploader] Loaded model '${s.src}'`)}))}catch(e){re.info(e)}}}},JCe=class extends rS{constructor(e,t){super(t),this.viewer=e}formats(){return["png","jpg","jpeg"]}uploadFiles(e){let t={panoramas:[],id:"viewpoint_1",name:"",position:[0,1,0],initialDirection:[0,0,1]};if(1===e.length){let i=[];i.push(URL.createObjectURL(e[0])),t.panoramas.push({id:"panorama_1",images:i}),this.viewer.setViewpoints([t]),this.viewer.activatePanoramaById(t.id,t.panoramas[0].id)}else if(6===e.length){let i=t=>{let i="";for(let r=0;r<e.length;++r){let n=e[r].name;n=n.slice(0,n.indexOf(".")),n=n.toLowerCase();let s=!1;for(let e=0;e<t.length;++e)if(t[e]===n){s=!0;break}if(s){i=URL.createObjectURL(e[r]);break}}return i},r=[i(["right","r"]),i(["left","l"]),i(["up","top","u"]),i(["down","bottom","d"]),i(["front","f"]),i(["back","b"])];t.panoramas.push({id:"panorama_1",images:r}),this.viewer.setViewpoints([t]),this.viewer.activatePanoramaById(t.id,t.panoramas[0].id)}else re.warn(`[Uploader] Expected 1 or 6 file, bug got ${e.length}!`)}},B0=ps(Zc(),1),QCe=new D,O5t=new Br,eAe=new D,U0=class extends qt{constructor(e=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}},Fh=new Be,P5t=new Be,g3=class{constructor(e={}){let t,i,r,n,s=this,a={camera:{fov:0,style:""},objects:new WeakMap},o=void 0!==e.element?e.element:document.createElement("div");o.style.overflow="hidden",this.domElement=o;let l=document.createElement("div");function h(e){return Math.abs(e)<1e-10?0:e}function u(e){let t=e.elements;return"matrix3d("+h(t[0])+","+h(-t[1])+","+h(t[2])+","+h(t[3])+","+h(t[4])+","+h(-t[5])+","+h(t[6])+","+h(t[7])+","+h(t[8])+","+h(-t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(-t[13])+","+h(t[14])+","+h(t[15])+")"}function c(e){let t=e.elements;return"translate(-50%,-50%)matrix3d("+h(t[0])+","+h(t[1])+","+h(t[2])+","+h(t[3])+","+h(-t[4])+","+h(-t[5])+","+h(-t[6])+","+h(-t[7])+","+h(t[8])+","+h(t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(t[13])+","+h(t[14])+","+h(t[15])+")"}function p(e,t,i,r){if(e.isCSS3DObject){let r=!0===e.visible&&!0===e.layers.test(i.layers);if(e.element.style.display=!0===r?"":"none",!0===r){let r;e.onBeforeRender(s,t,i),e.isCSS3DSprite?(Fh.copy(i.matrixWorldInverse),Fh.transpose(),0!==e.rotation2D&&Fh.multiply(P5t.makeRotationZ(e.rotation2D)),e.matrixWorld.decompose(QCe,O5t,eAe),Fh.setPosition(QCe),Fh.scale(eAe),Fh.elements[3]=0,Fh.elements[7]=0,Fh.elements[11]=0,Fh.elements[15]=1,r=c(Fh)):r=c(e.matrixWorld);let n=e.element,o=a.objects.get(e);if(void 0===o||o.style!==r){n.style.transform=r;let t={style:r};a.objects.set(e,t)}n.parentNode!==l&&l.appendChild(n),e.onAfterRender(s,t,i)}}for(let n=0,s=e.children.length;n<s;n++)p(e.children[n],t,i,r)}l.style.transformStyle="preserve-3d",l.style.pointerEvents="none",o.appendChild(l),this.getSize=function(){return{width:t,height:i}},this.render=function(e,t){let i,s,c=t.projectionMatrix.elements[5]*n;a.camera.fov!==c&&(o.style.perspective=t.isPerspectiveCamera?c+"px":"",a.camera.fov=c),!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),t.isOrthographicCamera&&(i=-(t.right+t.left)/2,s=(t.top+t.bottom)/2);let d=t.isOrthographicCamera?"scale("+c+")translate("+h(i)+"px,"+h(s)+"px)"+u(t.matrixWorldInverse):"translateZ("+c+"px)"+u(t.matrixWorldInverse),f=d+"translate("+r+"px,"+n+"px)";a.camera.style!==f&&(l.style.transform=f,a.camera.style=f),p(e,e,t,d)},this.setSize=function(e,s){t=e,i=s,r=t/2,n=i/2,o.style.width=e+"px",o.style.height=s+"px",l.style.width=e+"px",l.style.height=s+"px"}}},tAe="#2C7BE5",Qi=Math.PI/2,_i=Math.PI/4,Us=([e,t,i],[r,n,s])=>({position:new D(e,t,i),rotation:new _r(r,n,s)}),N5t={Front:Ln(Mr({},Us([0,0,1],[0,0,0])),{label:"NavCube.front"}),Right:Ln(Mr({},Us([1,0,0],[0,Qi,0])),{label:"NavCube.right"}),Back:Ln(Mr({},Us([0,0,-1],[0,Math.PI,0])),{label:"NavCube.back"}),Left:Ln(Mr({},Us([-1,0,0],[0,-Qi,0])),{label:"NavCube.left"}),Top:Ln(Mr({},Us([0,1,0],[-Qi,0,0])),{label:"NavCube.top"}),Bottom:Ln(Mr({},Us([0,-1,0],[Qi,0,0])),{label:"NavCube.bottom"})},L5t=[Us([0,1,1],[-_i,0,-Qi]),Us([0,1,-1],[-3*_i,0,-Qi]),Us([0,-1,1],[_i,0,-Qi]),Us([0,-1,-1],[3*_i,0,-Qi]),Us([1,1,0],[-Qi,_i,0]),Us([1,-1,0],[-Qi,3*_i,0]),Us([-1,1,0],[-Qi,-_i,0]),Us([-1,-1,0],[-Qi,-3*_i,0]),Us([1,0,1],[0,_i,0]),Us([1,0,-1],[0,3*_i,0]),Us([-1,0,1],[0,-_i,0]),Us([-1,0,-1],[0,-3*_i,0])],F5t=[{position:new D(1,1,1),rotation:[new _r(-Qi,Qi,-_i),new _r(-Qi,0,_i),new _r(0,0,3*_i)]},{position:new D(1,1,-1),rotation:[new _r(0,Qi,3*_i),new _r(-Qi,0,3*_i),new _r(0,Math.PI,-3*_i)]},{position:new D(-1,1,-1),rotation:[new _r(Math.PI,-Qi,_i),new _r(-Qi,0,-3*_i),new _r(0,Math.PI,3*_i)]},{position:new D(-1,1,1),rotation:[new _r(0,-Qi,3*_i),new _r(-Qi,0,-_i),new _r(0,0,-3*_i)]},{position:new D(1,-1,1),rotation:[new _r(0,Qi,-_i),new _r(-Qi,Math.PI,-_i),new _r(0,0,_i)]},{position:new D(1,-1,-1),rotation:[new _r(-Qi,Qi,3*_i),new _r(Qi,0,_i),new _r(0,Math.PI,-_i)]},{position:new D(-1,-1,1),rotation:[new _r(0,-Qi,_i),new _r(Qi,0,-3*_i),new _r(0,0,-_i)]},{position:new D(-1,-1,-1),rotation:[new _r(0,-Qi,-_i),new _r(Qi,0,-_i),new _r(0,Math.PI,_i)]}],v3=class extends qt{constructor(e={}){super(),this.NAVCUBE_SIZE=100,this.clickHandler=e.onClick,(0,B0.forEach)(N5t,(e=>{this.createPlane(e)})),(0,B0.forEach)(L5t,(e=>{this.createEdge(e)})),(0,B0.forEach)(F5t,((e,t)=>{this.createCorner(e,t)}))}createPlane(e){let t=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2),{rotation:i,label:r}=e,n=document.createElement("div");n.style.width=this.NAVCUBE_SIZE+"px",n.style.height=this.NAVCUBE_SIZE+"px",n.classList.add("navcube-plane"),n.classList.add("outer");let s=document.createElement("div");s.style.width=this.NAVCUBE_SIZE-4+"px",s.style.height=this.NAVCUBE_SIZE-4+"px",s.innerHTML=Ph(r),s.classList.add("navcube-plane"),s.classList.add("inner"),n.appendChild(s);let a=new U0(n);a.position.copy(t),a.rotation.copy(i),this.add(a),n.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(t.clone().normalize(),i)}))}createEdge(e){let t=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2),i=document.createElement("div");i.style.width="4px",i.style.height=this.NAVCUBE_SIZE-40+"px",i.style.background=tAe,i.classList.add("navcube-edge");let r=new U0(i);r.position.copy(t),r.rotation.copy(e.rotation),this.add(r),i.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(t.clone().normalize(),e.rotation)}))}createCorner(e,t){let i=i=>{i.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(e.position.clone().normalize(),new _r)})),i.addEventListener("mouseenter",(()=>{let e=document.getElementsByClassName("group-"+t);(0,B0.forEach)(e,(e=>{e instanceof HTMLElement&&e.classList.add("highlight")}))})),i.addEventListener("mouseleave",(()=>{let e=document.getElementsByClassName("group-"+t);(0,B0.forEach)(e,(e=>{e instanceof HTMLElement&&e.classList.remove("highlight")}))}))},r=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2+.5),n=document.createElement("div");n.style.borderTop=14*Math.sqrt(3)+"px solid #efefef",n.style.borderLeft="14px solid transparent",n.style.borderRight="14px solid transparent",n.classList.add("navcube-corner"),n.classList.add("group-"+t);let s=new U0(n);s.position.copy(r).lerp(e.position,.14);let a=Math.atan2(r.z,r.x);s.rotateY(r.z*r.x<0?Math.PI+a:a);let o=(new _r).setFromVector3(r.clone().normalize());s.rotateX(-o.y),r.y<0&&s.rotateZ(Math.PI),this.add(s);let l=(t,n,s)=>{let a=document.createElement("div");a.style.borderTop=`13px solid ${tAe}`,a.style.borderLeft="13px solid transparent",a.style.borderRight="13px solid transparent",a.classList.add("navcube-corner-plane"),a.classList.add("group-"+n);let o=new U0(a),l=e.position.clone();l.setComponent(s,0),o.position.copy(r).sub(l),o.rotateX(t.x),o.rotateY(t.y),o.rotateZ(t.z),this.add(o),i(a)};(0,B0.forEach)(e.rotation,((e,i)=>{l(e,t,i)})),i(n)}},y3=class{constructor(e,t){this.height=150,this.width=150,this.width=e||this.width,this.height=t||this.height,this.init()}init(){this.initRenderer(),this.initScene(),this.animate()}initRenderer(){this.renderer=new g3,this.renderer.setSize(this.width,this.height),this.renderer.domElement.classList.add("css3d-navcube"),document.body.appendChild(this.renderer.domElement)}initScene(){this.scene=new wn;let e=window.innerWidth/window.innerHeight;this.camera=new Ni(200*e/-2,200*e/2,100,-100,1,1e3),this.camera.position.set(-200,200,200),this.scene.add(this.camera),this.navCube=new v3({onClick:e=>{if(!(this.camera&&e&&this.hostViewer&&this.hostViewer.camera&&this.hostViewer.controls))return;let t=this.hostViewer.controls instanceof Io?this.hostViewer.controls.getTarget(new D):this.hostViewer.controls.target,i=this.hostViewer.camera.position.distanceTo(t);this.hostViewer.flyTo(t.clone().add(e.clone().multiplyScalar(i)),t)}}),this.scene.add(this.navCube)}render(){this.renderer&&this.scene&&this.camera&&(this.update(),this.renderer.render(this.scene,this.camera))}animate(){requestAnimationFrame(this.animate.bind(this)),this.render()}setHostViewer(e){this.hostViewer=e,this.update()}update(){if(!this.hostViewer||!this.hostViewer.camera)return;let e=this.hostViewer.camera;if(e){let t=new D;e.getWorldDirection(t);let i=e.up;this.updateCameraDirection(t,i)}}updateCameraDirection(e,t){this.camera&&e&&(e.normalize(),this.camera.position.set(20*-e.x+0,20*-e.y+0,20*-e.z+0),this.camera.lookAt(0,0,0),this.camera.up=t)}dispose(){!this.scene||!this.camera||!this.navCube||(this.scene.clear(),this.hostViewer=void 0,this.camera=void 0,this.navCube=void 0,this.scene=void 0)}},H5t=new D(1,0,0),U5t=new D(0,1,0),B5t=new D(0,0,1),E3=class extends hm{constructor(e,t){super(e,t);let{min:i,max:r}=this.sectionBox;this.sectionRange={x:[i.x,r.x],y:[i.y,r.y],z:[i.z,r.z]}}activate(){super.activate(),this.initOrUpdateClipPlane(),this.initOrUpdateVertices(),this.initOrUpdateSectionPlane(),this.setClippingEnable(!0)}deactivate(){super.deactivate(),this.planesMesh&&this.scene.remove(...this.planesMesh),this.planesMesh=void 0}initOrUpdateVertices(){if(!this.sectionBox)return;let{min:e,max:t}=this.sectionBox;this.vertices=[new D(t.x,t.y,t.z),new D(e.x,t.y,t.z),new D(e.x,e.y,t.z),new D(t.x,e.y,t.z),new D(t.x,t.y,e.z),new D(e.x,t.y,e.z),new D(e.x,e.y,e.z),new D(t.x,e.y,e.z)]}initOrUpdateClipPlane(){let{min:e,max:t}=this.sectionBox;this.clipPlanes?(this.clipPlanes[0].constant=t.x,this.clipPlanes[1].constant=-e.x,this.clipPlanes[2].constant=t.y,this.clipPlanes[3].constant=-e.y,this.clipPlanes[4].constant=t.z,this.clipPlanes[5].constant=-e.z):this.clipPlanes=[new Ri(new D(-1,0,0),t.x),new Ri(new D(1,0,0),-e.x),new Ri(new D(0,-1,0),t.y),new Ri(new D(0,1,0),-e.y),new Ri(new D(0,0,-1),t.z),new Ri(new D(0,0,1),-e.z)]}initOrUpdateSectionPlane(){let e=this.vertices;if(e){if(this.planesMesh)this.planesMesh[0].update([e[4],e[0],e[3],e[7]]),this.planesMesh[1].update([e[1],e[5],e[6],e[2]]),this.planesMesh[2].update([e[4],e[5],e[1],e[0]]),this.planesMesh[3].update([e[6],e[7],e[3],e[2]]),this.planesMesh[4].update([e[0],e[1],e[2],e[3]]),this.planesMesh[5].update([e[5],e[4],e[7],e[6]]);else{let t=[new cn("Right",[e[4],e[0],e[3],e[7]]),new cn("Left",[e[1],e[5],e[6],e[2]]),new cn("Top",[e[4],e[5],e[1],e[0]]),new cn("Bottom",[e[6],e[7],e[3],e[2]]),new cn("Front",[e[0],e[1],e[2],e[3]]),new cn("Back",[e[5],e[4],e[7],e[6]])];this.planesMesh=t,this.scene.add(...t)}this.viewer.enableRender()}}activateSelectedObject(e){var t;null==(t=this.selectedObject)||t.setActive(e)}onDragStart(e){var t;this.selectedObject&&(this.controls&&this.dragStarted&&(this.controls.enableRotate=!1),re.info("[ObjectsBoxSection] onDragStart:",e),this.refrencePlane.setFromNormalAndCoplanarPoint(this.camera.getWorldDirection(this.refrencePlane.normal),this.selectedObject.getPlaneCenter()),null==(t=this.raycaster)||t.ray.intersectPlane(this.refrencePlane,this.lastWorldPos))}onDragMove(e){var t;if(!this.lastWorldPos||!this.selectedObject)return;let i=new D;null==(t=this.raycaster)||t.ray.intersectPlane(this.refrencePlane,i);let r=this.selectedObject.actionType;switch(r){case"Top":case"Bottom":this.dragTranslateSectionPlane(U5t,this.lastWorldPos,i,r);break;case"Left":case"Right":this.dragTranslateSectionPlane(H5t,this.lastWorldPos,i,r);break;case"Front":case"Back":this.dragTranslateSectionPlane(B5t,this.lastWorldPos,i,r)}this.lastWorldPos=i}onDragEnd(e){this.controls&&!this.controls.enableRotate&&(this.controls.enableRotate=!0),re.info("[ObjectsBoxSection] onDragEnd:",e)}dragTranslateSectionPlane(e,t,i,r){let n,{min:s,max:a}=this.sectionBox,o=i.clone().sub(t).projectOnVector(e);switch(r){case"Top":n=a.y+o.y,this.isInRange(n,this.sectionRange.y)&&(a.y=n);break;case"Bottom":n=s.y+o.y,this.isInRange(n,this.sectionRange.y)&&(s.y=n);break;case"Left":n=s.x+o.x,this.isInRange(n,this.sectionRange.x)&&(s.x=n);break;case"Right":n=a.x+o.x,this.isInRange(n,this.sectionRange.x)&&(a.x=n);break;case"Front":n=a.z+o.z,this.isInRange(n,this.sectionRange.z)&&(a.z=n);break;case"Back":n=s.z+o.z,this.isInRange(n,this.sectionRange.z)&&(s.z=n)}this.initOrUpdateVertices(),this.initOrUpdateSectionPlane(),this.initOrUpdateClipPlane(),this.viewer.enableRender()}isInRange(e,t){return e>t[0]&&e<t[1]}getIntersections(e){return this.raycaster?(this.updateRaycasterByMouse(e),(this.raycaster.intersectObjects(this.getIntersectObjects())||[])[0]):void 0}getIntersectObjects(){return this.planesMesh||[]}resetSection(){this.sectionBox=this.viewer.getBBox(),this.initOrUpdateVertices(),this.initOrUpdateSectionPlane(),this.initOrUpdateClipPlane(),this.viewer.enableRender()}setSectionVisible(e){var t;null==(t=this.planesMesh)||t.forEach((t=>t.visible=e)),this.isShowSectionPlane=e,this.viewer.enableRender()}},T3=class extends hm{constructor(e,t){super(e,t),this.mousedown=e=>{var t;if(0===e.button){if(!this.faceInfo){let i=this.pickFace(e);if(i&&i.face){let e=i.face.normal,r=new Ui;e.applyNormalMatrix(r.getNormalMatrix(i.object.matrixWorld)),this.faceInfo={position:i.point,normal:e.normalize()},this.setSection(),null==(t=this.tooltip)||t.hide()}return}this.camera&&this.selectedObject&&(this.mouseDown=!0)}},this.mousemove=e=>{var t,i,r;if(this.faceInfo){if(this.dragStarted)this.updateRaycasterByMouse(e),this.onDragMove(e);else{this.activateSelectedObject(!1);let t=this.getIntersections(e);t?(this.selectedObject=t.object,this.activateSelectedObject(!0),this.mouseDown&&(null==(r=this.selectedObject)?void 0:r.parent)instanceof du&&(this.dragStarted||(this.dragStarted=!0,this.onDragStart(e)))):this.selectedObject=void 0}this.viewer.enableRender()}else this.pickFace(e)?null==(t=this.tooltip)||t.show():null==(i=this.tooltip)||i.hide()},this.center=new D,this.sectionBox.getCenter(this.center),this.viewer.addEventListener("AfterRender",(()=>{var e;this.isActive&&(null==(e=this.gizmo)||e.adjustSize(this.camera))}))}activate(){super.activate(),this.tooltip=new Dh("pick-section-plane",Ph("Tooltip.section"),{parentNode:this.viewer.widgetContainer,followPointer:!0})}deactivate(){var e,t,i;super.deactivate(),null==(e=this.planeMesh)||e.removeFromParent(),null==(t=this.gizmo)||t.removeFromParent(),this.planeMesh=void 0,this.gizmo=void 0,this.faceInfo=void 0,null==(i=this.tooltip)||i.destroy(),this.tooltip=void 0}setSection(){this.initOrUpdateGizmo(),this.initOrUpdateSectionPlane(),this.initOrUpdateClipPlane(),this.setClippingEnable(!0),this.viewer.enableRender()}resetSection(){var e,t,i;null==(e=this.planeMesh)||e.removeFromParent(),null==(t=this.gizmo)||t.removeFromParent(),this.setClippingEnable(!1),this.planeMesh=void 0,this.gizmo=void 0,this.faceInfo=void 0,null==(i=this.tooltip)||i.show(),this.viewer.enableRender()}setSectionVisible(e){this.gizmo&&this.planeMesh&&(this.gizmo.visible=e,this.planeMesh.visible=e),this.isShowSectionPlane=e,this.viewer.enableRender()}initOrUpdateClipPlane(){if(!this.faceInfo)return;let{normal:e,position:t}=this.faceInfo;this.clipPlane=(new Ri).setFromNormalAndCoplanarPoint(e.clone().negate(),t),this.clipPlane&&(this.clipPlanes=[this.clipPlane])}initOrUpdateSectionPlane(){var e;if(!this.faceInfo)return;let{normal:t,position:i}=this.faceInfo,r=new D;this.sectionBox.getSize(r);let n=r.length(),s=i,a=(new Rt).setFromCenterAndSize(s,new D(n,n,n)),{min:o,max:l}=a;null==(e=this.planeMesh)||e.removeFromParent(),this.planeMesh=new cn("Plane",[new D(s.x,l.y,o.z),new D(s.x,l.y,l.z),new D(s.x,o.y,l.z),new D(s.x,o.y,o.z)]),this.planeMesh.setDirection(t),this.planeMesh&&this.scene.add(this.planeMesh),this.viewer.enableRender()}initOrUpdateGizmo(){var e,t;if(!this.faceInfo)return;null==(e=this.gizmo)||e.removeFromParent();let{normal:i,position:r}=this.faceInfo;this.gizmo=new du,this.gizmo.setDirection(i),this.gizmo.position.copy(r),null==(t=this.scene)||t.add(this.gizmo)}onDragStart(e){var t;if(!this.faceInfo||this.selectedObject instanceof cn)return;this.controls&&this.dragStarted&&this.selectedObject&&!(this.selectedObject instanceof cn)&&(this.controls.enableRotate=!1),re.info("[PickPlaneSection] onDragStart:",e);let{position:i}=this.faceInfo;this.refrencePlane.setFromNormalAndCoplanarPoint(this.camera.getWorldDirection(this.refrencePlane.normal),i),null==(t=this.raycaster)||t.ray.intersectPlane(this.refrencePlane,this.lastWorldPos)}onDragMove(e){var t,i,r;if(!this.lastWorldPos||!this.selectedObject||!this.clipPlane||!this.planeMesh||!this.gizmo||!this.faceInfo||this.selectedObject&&this.selectedObject instanceof cn)return;let n=new D;null==(t=this.raycaster)||t.ray.intersectPlane(this.refrencePlane,n);let s=this.selectedObject.userData.actionType,{position:a}=this.faceInfo,o=(new D).subVectors(this.lastWorldPos,a).normalize(),l=(new D).subVectors(n,a).normalize(),h=(new D).subVectors(n,this.lastWorldPos).projectOnVector(Xa.clone().applyQuaternion(this.gizmo.quaternion)),u=o.angleTo(l),c=(new D).crossVectors(o,l),p=new D;this.sectionBox.getSize(p);let d,f=Math.max(p.x,p.y,p.z);switch(s){case"TranslateX":case"TranslateY":case"TranslateZ":d=(new D).addVectors(this.gizmo.position,h),this.sectionBox.clone().setFromCenterAndSize(this.center,new D(f,f,f)).containsPoint(d)&&(null==(i=this.gizmo)||i.position.add(h),null==(r=this.planeMesh)||r.position.add(h));break;case"RotateX":{let e=Xa.clone().applyQuaternion(this.gizmo.quaternion);c.dot(e)<0&&(u=-u),this.gizmo.rotateX(u),this.planeMesh.rotatePlane(e,u)}break;case"RotateY":{let e=cm.clone().applyQuaternion(this.gizmo.quaternion);c.dot(e)<0&&(u=-u),this.gizmo.rotateY(u),this.planeMesh.rotatePlane(e,u)}break;case"RotateZ":{let e=um.clone().applyQuaternion(this.gizmo.quaternion);c.dot(e)<0&&(u=-u),this.gizmo.rotateZ(u),this.planeMesh.rotatePlane(e,u)}}this.clipPlane.setFromNormalAndCoplanarPoint(this.planeMesh.getPlaneNormal().negate(),this.gizmo.position),this.lastWorldPos=n}onDragEnd(e){this.selectedObject instanceof cn||(this.controls&&!this.controls.enableRotate&&(this.controls.enableRotate=!0),re.info("[PickPlaneSection] onDragEnd:",e))}getIntersectObjects(){return this.planeMesh&&this.gizmo?[this.planeMesh,this.gizmo]:[]}activateSelectedObject(e){this.selectedObject&&(this.selectedObject instanceof cn?this.selectedObject.setActive(e):this.selectedObject.parent instanceof du&&this.selectedObject.parent.setActive(e,this.selectedObject))}pickFace(e){if(!this.raycaster)return;let t=new ce(e.x,e.y),i=xi.screenPoint2NdcPoint(t,this.camera,this.canvas);this.raycaster.setFromCamera(i,this.camera);let r=[];return Object.values(this.viewer.loadedModels).forEach((e=>{let t=this.scene&&this.scene.getObjectById(e.id);t&&t.visible&&r.push(t)})),(this.raycaster.intersectObjects(this.viewer.getRaycastableObjectsByMouse(e))||[]).find((e=>{let t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof Je)}))}},b3=class{constructor(e,t){this.sections={},this.viewer=e,this.sections.ObjectsBoxSection=new E3(e,t),this.sections.AxisPlaneSection=new l3(e,t),this.sections.PickPlaneSection=new T3(e,t)}get raycaster(){return this.viewer.getRaycaster()}activateSection(e,t){this.activeSectionType&&this.deactivateSection(),this.activeSectionType=e,this.setSectionClippingObjectIds(t),this.sections[e].activate()}deactivateSection(){let e=this.activeSectionType;e&&this.sections[e].deactivate(),this.activeSectionType=void 0}resetSection(){}isSectionActive(){let e=this.activeSectionType;return e?this.sections[e].isActive:!!this.getActiveSectionType()}getActiveSectionType(){return this.activeSectionType}getActiveSection(){if(this.activeSectionType)return this.sections[this.activeSectionType]}setSectionClippingObjectIds(e){this.activeSectionType&&(this.sections[this.activeSectionType].clearClippingObjectIds(),e&&e.length&&(this.sections[this.activeSectionType].clippingObjetIds=e,this.sections[this.activeSectionType].setClippingEnable(!0)))}destroy(){this.deactivateSection(),this.activeSectionType=void 0}};function iV(e){let t;try{t=new URL(e,"http://fakehost.com/")}catch(e){return null}let i=t.pathname.split("/").pop(),r=i.lastIndexOf(".");return-1===r||r===i.length-1?null:i.substring(r+1)}function k5t(e){Promise.resolve().then(e)}var x3=class{constructor(){this.maxSize=800,this.minSize=600,this.unloadPercent=.05,this.itemSet=new Map,this.itemList=[],this.usedSet=new Set,this.callbacks=new Map,this.unloadPriorityCallback=null;let e=this.itemSet;this.defaultPriorityCallback=t=>e.get(t)}isFull(){return this.itemSet.size>=this.maxSize}add(e,t){let i=this.itemSet;if(i.has(e)||this.isFull())return!1;let r=this.usedSet,n=this.itemList,s=this.callbacks;return n.push(e),r.add(e),i.set(e,Date.now()),s.set(e,t),!0}remove(e){let t=this.usedSet,i=this.itemSet,r=this.itemList,n=this.callbacks;if(i.has(e)){n.get(e)(e);let s=r.indexOf(e);return r.splice(s,1),t.delete(e),i.delete(e),n.delete(e),!0}return!1}markUsed(e){let t=this.itemSet,i=this.usedSet;t.has(e)&&!i.has(e)&&(t.set(e,Date.now()),i.add(e))}markAllUnused(){this.usedSet.clear()}unloadUnusedContent(){let e=this.unloadPercent,t=this.minSize,i=this.itemList,r=this.itemSet,n=this.usedSet,s=this.callbacks,a=i.length-n.size,o=i.length-t,l=this.unloadPriorityCallback||this.defaultPriorityCallback;if(o>0&&a>0){i.sort(((e,t)=>{let i=n.has(e),r=n.has(t);return i&&r?0:i||r?i?1:-1:l(t)-l(e)}));let h=Math.min(o,a),u=Math.max(t*e,h*e),c=Math.min(u,a);c=Math.ceil(c);let p=i.splice(0,c);for(let e=0,t=p.length;e<t;e++){let t=p[e];s.get(t)(t),r.delete(t),s.delete(t)}}}scheduleUnload(e=!0){this.scheduled||(this.scheduled=!0,k5t((()=>{this.scheduled=!1,this.unloadUnusedContent(),e&&this.markAllUnused()})))}},iS=class{constructor(){this.maxJobs=6,this.items=[],this.callbacks=new Map,this.currJobs=0,this.scheduled=!1,this.autoUpdate=!0,this.priorityCallback=()=>{throw new Error("PriorityQueue: PriorityCallback function not defined.")},this.schedulingCallback=e=>{requestAnimationFrame(e)},this._runjobs=()=>{this.tryRunJobs(),this.scheduled=!1}}sort(){let e=this.priorityCallback;this.items.sort(e)}add(e,t){return new Promise(((i,r)=>{let n=this.items,s=this.callbacks;n.push(e),s.set(e,((...e)=>t(...e).then(i).catch(r))),this.autoUpdate&&this.scheduleJobRun()}))}remove(e){let t=this.items,i=this.callbacks,r=t.indexOf(e);-1!==r&&(t.splice(r,1),i.delete(e))}tryRunJobs(){this.sort();let e=this.items,t=this.callbacks,i=this.maxJobs,r=this.currJobs;for(;i>r&&e.length>0;){r++;let i=e.pop(),n=t.get(i);t.delete(i),n(i).then((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})).catch((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}))}this.currJobs=r}scheduleJobRun(){this.scheduled||(this.schedulingCallback(this._runjobs),this.scheduled=!0)}},G5t=.0033528106647474805,rAe=-(6378137*G5t-6378137);function sV(e){return 3===e||4===e}function k0(e,t){return e.__lastFrameVisited===t&&e.__used}function iAe(e,t){e.__lastFrameVisited!==t&&(e.__lastFrameVisited=t,e.__used=!1,e.__inFrustum=!1,e.__isLeaf=!1,e.__visible=!1,e.__active=!1,e.__error=1/0,e.__distanceFromCamera=1/0,e.__childrenWereVisible=!1,e.__allChildrenLoaded=!1)}function nAe(e,t,i){if(iAe(e,t),e.__used=!0,i.markUsed(e),e.__contentEmpty){let r=e.children;for(let e=0,n=r.length;e<n;e++)nAe(r[e],t,i)}}function sAe(e,t,i){if(!e.__contentEmpty||e.__externalTileSet&&!sV(e.__loadingState))i.requestTileContents(e);else{let r=e.children;for(let e=0,n=r.length;e<n;e++){let n=r[e];n.__depthFromRenderedParent=t,sAe(n,t,i)}}}function _3(e,t=null,i=null,r=null,n=0){if(t&&t(e,r,n))return void(i&&i(e,r,n));let s=e.children;for(let a=0,o=s.length;a<o;a++)_3(s[a],t,i,e,n+1);i&&i(e,r,n)}function aV(e,t){let i=t.stats,r=t.frameCount,n=t.errorTarget,s=t.maxDepth,a=t.loadSiblings,o=t.lruCache,l=t.stopAtEmptyTiles;if(iAe(e,r),!1===t.tileInView(e))return!1;if(e.__used=!0,o.markUsed(e),e.__inFrustum=!0,i.inFrustum++,(l||!e.__contentEmpty)&&!e.__externalTileSet&&(t.calculateError(e),e.__error<=n||t.maxDepth>0&&e.__depth+1>=s))return!0;let h=!1,u=e.children;for(let c=0,p=u.length;c<p;c++){let e=aV(u[c],t);h=h||e}if(h&&a)for(let c=0,p=u.length;c<p;c++)nAe(u[c],r,o);return!0}function oV(e,t){let i=t.stats,r=t.frameCount;if(!k0(e,r))return;i.used++;let n=e.children,s=!1;for(let a=0,o=n.length;a<o;a++){let e=n[a];s=s||k0(e,r)}if(s){let i=!1,s=!0;for(let e=0,a=n.length;e<a;e++){let a=n[e];if(oV(a,t),i=i||a.__wasSetVisible||a.__childrenWereVisible,k0(a,r)){let e=a.__allChildrenLoaded||!a.__contentEmpty&&sV(a.__loadingState)||a.__externalTileSet&&4===a.__loadingState;s=s&&e}}e.__childrenWereVisible=i,e.__allChildrenLoaded=s}else e.__isLeaf=!0}function lV(e,t){let i=t.stats,r=t.frameCount;if(!k0(e,r))return;let n=e.parent,s=n?n.__depthFromRenderedParent:-1;e.__depthFromRenderedParent=s;let a=t.lruCache;if(e.__isLeaf)return e.__depthFromRenderedParent++,void(3===e.__loadingState?(e.__inFrustum&&(e.__visible=!0,i.visible++),e.__active=!0,i.active++):!a.isFull()&&(!e.__contentEmpty||e.__externalTileSet)&&t.requestTileContents(e));let o=(t.errorTarget+1)*t.errorThreshold,l=e.__error<=o,h=l||"ADD"===e.refine,u=!e.__contentEmpty,c=u||e.__externalTileSet,p=sV(e.__loadingState)&&c,d=e.__childrenWereVisible,f=e.children,m=e.__allChildrenLoaded;if(h&&u&&e.__depthFromRenderedParent++,h&&!p&&!a.isFull()&&c&&t.requestTileContents(e),(l&&!m&&!d&&p||"ADD"===e.refine&&p)&&(e.__inFrustum&&(e.__visible=!0,i.visible++),e.__active=!0,i.active++),"ADD"!==e.refine&&l&&!m&&p)for(let g=0,y=f.length;g<y;g++){let i=f[g];k0(i,r)&&!a.isFull()&&(i.__depthFromRenderedParent=e.__depthFromRenderedParent+1,sAe(i,i.__depthFromRenderedParent,t))}else for(let g=0,y=f.length;g<y;g++){let e=f[g];k0(e,r)&&lV(e,t)}}function cV(e,t){let i=k0(e,t.frameCount);if(i||e.__usedLastFrame){let r=!1,n=!1;i&&(r=e.__active,n=t.displayActiveTiles&&e.__active||e.__visible),!e.__contentEmpty&&3===e.__loadingState&&(e.__wasSetActive!==r&&t.setTileActive(e,r),e.__wasSetVisible!==n&&t.setTileVisible(e,n)),e.__wasSetActive=r,e.__wasSetVisible=n,e.__usedLastFrame=i;let s=e.children;for(let e=0,i=s.length;e<i;e++)cV(s[e],t)}}var oAe=(e,t)=>e.__depth!==t.__depth?e.__depth>t.__depth?-1:1:e.__inFrustum!==t.__inFrustum?e.__inFrustum?1:-1:e.__used!==t.__used?e.__used?1:-1:e.__error!==t.__error?e.__error>t.__error?1:-1:e.__distanceFromCamera!==t.__distanceFromCamera?e.__distanceFromCamera>t.__distanceFromCamera?-1:1:0,V5t=e=>1/(e.__depthFromRenderedParent+1),S3=class{get rootTileSet(){let e=this.tileSets[this.rootURL];return!e||e instanceof Promise?null:e}get root(){let e=this.rootTileSet;return e?e.root:null}constructor(e){this.tileSets={},this.rootURL=e,this.fetchOptions={},this.preprocessURL=null;let t=new x3;t.unloadPriorityCallback=V5t;let i=new iS;i.maxJobs=4,i.priorityCallback=oAe;let r=new iS;r.maxJobs=1,r.priorityCallback=oAe,this.lruCache=t,this.downloadQueue=i,this.parseQueue=r,this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0,this.errorTarget=6,this.errorThreshold=1/0,this.loadSiblings=!0,this.displayActiveTiles=!1,this.maxDepth=1/0,this.stopAtEmptyTiles=!0}traverse(e,t){let i=this.tileSets[this.rootURL];!i||!i.root||_3(i.root,e,t)}update(){let e=this.stats,t=this.lruCache,i=this.tileSets,r=i[this.rootURL];if(!(this.rootURL in i))return void this.loadRootTileSet(this.rootURL);if(!r||!r.root)return;let n=r.root;e.inFrustum=0,e.used=0,e.active=0,e.visible=0,this.frameCount++,aV(n,this),oV(n,this),lV(n,this),cV(n,this),t.scheduleUnload()}parseTile(e,t,i){return null}disposeTile(e){}preprocessNode(e,t,i){if(e.content&&(!("uri"in e.content)&&"url"in e.content&&(e.content.uri=e.content.url,delete e.content.url),e.content.uri&&(e.content.uri=new URL(e.content.uri,i+"/").toString()),e.content.boundingVolume&&!("box"in e.content.boundingVolume||"sphere"in e.content.boundingVolume||"region"in e.content.boundingVolume)&&delete e.content.boundingVolume),e.parent=t,e.children=e.children||[],e.content&&e.content.uri){let t=iV(e.content.uri),i=Boolean(t&&"json"===t.toLowerCase());e.__externalTileSet=i,e.__contentEmpty=i}else e.__externalTileSet=!1,e.__contentEmpty=!0;e.__distanceFromCamera=1/0,e.__error=1/0,e.__inFrustum=!1,e.__isLeaf=!1,e.__usedLastFrame=!1,e.__used=!1,e.__wasSetVisible=!1,e.__visible=!1,e.__childrenWereVisible=!1,e.__allChildrenLoaded=!1,e.__wasSetActive=!1,e.__active=!1,e.__loadingState=0,e.__loadIndex=0,e.__loadAbort=null,e.__depthFromRenderedParent=-1,null===t?(e.__depth=0,e.refine=e.refine||"REPLACE"):(e.__depth=t.__depth+1,e.refine=e.refine||t.refine)}setTileActive(e,t){}setTileVisible(e,t){}calculateError(e){return 0}tileInView(e){return!0}resetFailedTiles(){let e=this.stats;0!==e.failed&&(this.traverse((e=>{4===e.__loadingState&&(e.__loadingState=0)})),e.failed=0)}fetchTileSet(e,t,i=null){return fetch(e,t).then((t=>{if(t.ok)return t.json();throw new Error(`TilesRenderer: Failed to load tileset "${e}" with status ${t.status} : ${t.statusText}`)})).then((t=>{let r=t.asset.version;console.assert("1.0"===r||"0.0"===r,'asset.version is expected to be a string of "1.0" or "0.0"');let n=e.replace(/\/[^\/]*\/?$/,"");return n=new URL(n,window.location.href).toString(),_3(t.root,((e,t)=>this.preprocessNode(e,t,n)),null,i,i?i.__depth:0),t}))}loadRootTileSet(e){let t=this.tileSets;if(e in t)return t[e]instanceof Error?Promise.reject(t[e]):Promise.resolve(t[e]);{let i=this.fetchTileSet(this.preprocessURL?this.preprocessURL(e):e,this.fetchOptions).then((i=>{t[e]=i}));return i.catch((i=>{console.error(i),t[e]=i})),t[e]=i,i}}requestTileContents(e){if(0!==e.__loadingState)return;let t=this.stats,i=this.lruCache,r=this.downloadQueue,n=this.parseQueue,s=e.__externalTileSet;i.add(e,(e=>{1===e.__loadingState?(e.__loadAbort.abort(),e.__loadAbort=null):s?e.children.length=0:this.disposeTile(e),1===e.__loadingState?t.downloading--:2===e.__loadingState&&t.parsing--,e.__loadingState=0,e.__loadIndex++,n.remove(e),r.remove(e)})),e.__loadIndex++;let a=e.__loadIndex,o=new AbortController,l=o.signal;t.downloading++,e.__loadAbort=o,e.__loadingState=1;let h=s=>{e.__loadIndex===a&&("AbortError"!==s.name?(n.remove(e),r.remove(e),2===e.__loadingState?t.parsing--:1===e.__loadingState&&t.downloading--,t.failed++,console.error(`TilesRenderer : Failed to load tile at url "${e.content.uri}".`),console.error(s),e.__loadingState=4):i.remove(e))};s?r.add(e,(e=>{if(e.__loadIndex!==a)return Promise.resolve();let t=this.preprocessURL?this.preprocessURL(e.content.uri):e.content.uri;return this.fetchTileSet(t,Object.assign({signal:l},this.fetchOptions),e)})).then((i=>{e.__loadIndex===a&&(t.downloading--,e.__loadAbort=null,e.__loadingState=3,e.children.push(i.root))})).catch(h):r.add(e,(e=>{if(e.__loadIndex!==a)return Promise.resolve();let t=this.preprocessURL?this.preprocessURL(e.content.uri):e.content.uri;return fetch(t,Object.assign({signal:l},this.fetchOptions))})).then((t=>{if(e.__loadIndex===a){if(t.ok)return t.arrayBuffer();throw new Error(`Failed to load model with error code ${t.status}`)}})).then((i=>{if(e.__loadIndex===a)return t.downloading--,t.parsing++,e.__loadAbort=null,e.__loadingState=2,n.add(e,(e=>{if(e.__loadIndex!==a)return Promise.resolve();let t=iV(e.content.uri);return this.parseTile(i,e,t)}))})).then((()=>{e.__loadIndex===a&&(t.parsing--,e.__loadingState=3,e.__wasSetVisible&&this.setTileVisible(e,!0),e.__wasSetActive&&this.setTileActive(e,!0))})).catch(h)}dispose(){let e=this.lruCache;this.traverse((t=>{e.remove(t)})),this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0}};function w3(e){return(new TextDecoder).decode(e)}var yd=class{constructor(e,t,i,r){this.buffer=e,this.binOffset=t+i,this.binLength=r;let n=null;if(0!==i){let r=new Uint8Array(e,t,i);n=JSON.parse(w3(r))}else n={};this.header=n}getKeys(){return Object.keys(this.header)}getData(e,t,i=null,r=null){let n=this.header;if(!(e in n))return null;let s=n[e];if(s instanceof Object){if(Array.isArray(s))return s;{let n,{buffer:a,binOffset:o,binLength:l}=this,h=s.byteOffset||0,u=s.type||r,c=s.componentType||i;if("type"in s&&r&&s.type!==r)throw new Error("FeatureTable: Specified type does not match expected type.");switch(u){case"SCALAR":n=1;break;case"VEC2":n=2;break;case"VEC3":n=3;break;case"VEC4":n=4;break;default:throw new Error(`FeatureTable : Feature type not provided for "${e}".`)}let p,d=o+h,f=t*n;switch(c){case"BYTE":p=new Int8Array(a,d,f);break;case"UNSIGNED_BYTE":p=new Uint8Array(a,d,f);break;case"SHORT":p=new Int16Array(a,d,f);break;case"UNSIGNED_SHORT":p=new Uint16Array(a,d,f);break;case"INT":p=new Int32Array(a,d,f);break;case"UNSIGNED_INT":p=new Uint32Array(a,d,f);break;case"FLOAT":p=new Float32Array(a,d,f);break;case"DOUBLE":p=new Float64Array(a,d,f);break;default:throw new Error(`FeatureTable : Feature component type not provided for "${e}".`)}if(d+f*p.BYTES_PER_ELEMENT>o+l)throw new Error("FeatureTable: Feature data read outside binary body length.");return p}}return s}},pm=class extends yd{constructor(e,t,i,r,n){super(e,i,r,n),this.batchSize=t}getData(e,t=null,i=null){return super.getData(e,this.batchSize,t,i)}},pc=class{constructor(){this.fetchOptions={},this.workingPath=""}load(e){return fetch(e,this.fetchOptions).then((t=>{if(!t.ok)throw new Error(`Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()})).then((t=>(""===this.workingPath&&(this.workingPath=this.workingPathForURL(e)),this.parse(t))))}resolveExternalURL(e){return/^[^\\/]/.test(e)?this.workingPath+"/"+e:e}workingPathForURL(e){let t=e.split(/[\\/]/g);return t.pop(),t.join("/")+"/"}parse(e){throw new Error("LoaderBase: Parse not implemented.")}};function mu(e){let t;if(t=e instanceof DataView?e:new DataView(e),"{"===String.fromCharCode(t.getUint8(0)))return null;let i="";for(let r=0;r<4;r++)i+=String.fromCharCode(t.getUint8(r));return i}var R3=class extends pc{parse(e){let t=new DataView(e),i=mu(t);console.assert("b3dm"===i);let r=t.getUint32(4,!0);console.assert(1===r);let n=t.getUint32(8,!0);console.assert(n===e.byteLength);let s=t.getUint32(12,!0),a=t.getUint32(16,!0),o=t.getUint32(20,!0),l=t.getUint32(24,!0),h=e.slice(28,28+s+a),u=new yd(h,0,s,a),c=28+s+a,p=e.slice(c,c+o+l),d=new pm(p,u.getData("BATCH_LENGTH"),0,o,l),f=c+o+l;return{version:r,featureTable:u,batchTable:d,glbBytes:new Uint8Array(e,f,n-f)}}},wT=class extends R3{constructor(e=vo){super(),this.manager=e,this.adjustmentTransform=new Be}parse(e){let t=super.parse(e),i=t.glbBytes.slice().buffer;return new Promise(((e,r)=>{let n=this.manager,s=this.fetchOptions,a=n.getHandler("path.gltf")||new gh(n);"include"===s.credentials&&"cors"===s.mode&&a.setCrossOrigin("use-credentials"),"credentials"in s&&a.setWithCredentials("include"===s.credentials),s.headers&&a.setRequestHeader(s.headers);let o=this.workingPath;!/[\\/]$/.test(o)&&o.length&&(o+="/");let l=this.adjustmentTransform;a.parse(i,o,(i=>{let{batchTable:r,featureTable:n}=t,{scene:s}=i,a=n.getData("RTC_CENTER");a&&(s.position.x+=a[0],s.position.y+=a[1],s.position.z+=a[2]),i.scene.updateMatrix(),i.scene.matrix.multiply(l),i.scene.matrix.decompose(i.scene.position,i.scene.quaternion,i.scene.scale),i.batchTable=r,i.featureTable=n,s.batchTable=r,s.featureTable=n,e(i)}),r)}))}},M3=class extends pc{parse(e){let t=new DataView(e),i=mu(t);console.assert("pnts"===i);let r=t.getUint32(4,!0);console.assert(1===r);let n=t.getUint32(8,!0);console.assert(n===e.byteLength);let s=t.getUint32(12,!0),a=t.getUint32(16,!0),o=t.getUint32(20,!0),l=t.getUint32(24,!0),h=e.slice(28,28+s+a),u=new yd(h,0,s,a),c=28+s+a,p=e.slice(c,c+o+l),d=new pm(p,u.getData("BATCH_LENGTH")||u.getData("POINTS_LENGTH"),0,o,l);return Promise.resolve({version:r,featureTable:u,batchTable:d})}},RT=class extends M3{constructor(e=vo){super(),this.manager=e}parse(e){return super.parse(e).then((e=>{let{featureTable:t}=e,i=t.getData("POINTS_LENGTH"),r=t.getData("POSITION",i,"FLOAT","VEC3"),n=t.getData("RGB",i,"UNSIGNED_BYTE","VEC3");["QUANTIZED_VOLUME_OFFSET","QUANTIZED_VOLUME_SCALE","CONSTANT_RGBA","BATCH_LENGTH","POSITION_QUANTIZED","RGBA","RGB565","NORMAL","NORMAL_OCT16P"].forEach((e=>{e in t.header&&console.warn(`PNTSLoader: Unsupported FeatureTable feature "${e}" detected.`)}));let s=new ot;s.setAttribute("position",new Wt(r,3,!1));let a=new Rn;a.size=2,a.sizeAttenuation=!1,null!==n&&(s.setAttribute("color",new Wt(n,3,!0)),a.vertexColors=!0);let o=new Bi(s,a);e.scene=o,e.scene.featureTable=t;let l=t.getData("RTC_CENTER");return l&&(e.scene.position.x+=l[0],e.scene.position.y+=l[1],e.scene.position.z+=l[2]),e}))}},D3=class extends pc{parse(e){let t=new DataView(e),i=mu(t);console.assert("i3dm"===i);let r=t.getUint32(4,!0);console.assert(1===r);let n=t.getUint32(8,!0);console.assert(n===e.byteLength);let s=t.getUint32(12,!0),a=t.getUint32(16,!0),o=t.getUint32(20,!0),l=t.getUint32(24,!0),h=t.getUint32(28,!0),u=e.slice(32,32+s+a),c=new yd(u,0,s,a),p=32+s+a,d=e.slice(p,p+o+l),f=new pm(d,c.getData("INSTANCES_LENGTH"),0,o,l),m=p+o+l,g=new Uint8Array(e,m,n-m),y=null,v=null;if(h)y=g,v=Promise.resolve();else{let e=this.resolveExternalURL(w3(g));v=fetch(e,this.fetchOptions).then((t=>{if(!t.ok)throw new Error(`I3DMLoaderBase : Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()})).then((e=>{y=new Uint8Array(e)}))}return v.then((()=>({version:r,featureTable:c,batchTable:f,glbBytes:y})))}},lAe=new D,pV=new D,dV=new D,cAe=new D,fV=new Br,C3=new D,A3=new Be,MT=class extends D3{constructor(e=vo){super(),this.manager=e,this.adjustmentTransform=new Be}resolveExternalURL(e){return this.manager.resolveURL(super.resolveExternalURL(e))}parse(e){return super.parse(e).then((e=>{let{featureTable:t,batchTable:i}=e,r=e.glbBytes.slice().buffer;return new Promise(((e,n)=>{let s=this.fetchOptions,a=this.manager,o=a.getHandler("path.gltf")||new gh(a);"include"===s.credentials&&"cors"===s.mode&&o.setCrossOrigin("use-credentials"),"credentials"in s&&o.setWithCredentials("include"===s.credentials),s.headers&&o.setRequestHeader(s.headers);let l=this.workingPath;/[\\/]$/.test(l)||(l+="/");let h=this.adjustmentTransform;o.parse(r,l,(r=>{let n=t.getData("INSTANCES_LENGTH"),s=t.getData("POSITION",n,"FLOAT","VEC3"),a=t.getData("NORMAL_UP",n,"FLOAT","VEC3"),o=t.getData("NORMAL_RIGHT",n,"FLOAT","VEC3"),l=t.getData("SCALE_NON_UNIFORM",n,"FLOAT","VEC3"),u=t.getData("SCALE",n,"FLOAT","SCALAR");["RTC_CENTER","QUANTIZED_VOLUME_OFFSET","QUANTIZED_VOLUME_SCALE","EAST_NORTH_UP","POSITION_QUANTIZED","NORMAL_UP_OCT32P","NORMAL_RIGHT_OCT32P"].forEach((e=>{e in t.header&&console.warn(`I3DMLoader: Unsupported FeatureTable feature "${e}" detected.`)}));let c=new Map,p=[];r.scene.traverse((e=>{if(e.isMesh){let{geometry:t,material:i}=e,r=new sn(t,i,n);r.position.copy(e.position),r.rotation.copy(e.rotation),r.scale.copy(e.scale),p.push(r),c.set(e,r)}}));let d=new D;for(let e=0;e<n;e++)d.x+=s[3*e+0]/n,d.y+=s[3*e+1]/n,d.z+=s[3*e+2]/n;c.forEach(((e,t)=>{let i=t.parent;i&&(i.remove(t),i.add(e),e.updateMatrixWorld(),e.position.copy(d).applyMatrix4(e.matrixWorld))}));for(let e=0;e<n;e++){cAe.set(s[3*e+0]-d.x,s[3*e+1]-d.y,s[3*e+2]-d.z),a?(pV.set(a[3*e+0],a[3*e+1],a[3*e+2]),dV.set(o[3*e+0],o[3*e+1],o[3*e+2]),lAe.crossVectors(dV,pV).normalize(),A3.makeBasis(dV,pV,lAe),fV.setFromRotationMatrix(A3)):fV.set(0,0,0,1),u?C3.setScalar(u[e]):l?C3.set(l[3*e+0],l[3*e+1],l[3*e+2]):C3.set(1,1,1),A3.compose(cAe,fV,C3).multiply(h);for(let t=0,i=p.length;t<i;t++)p[t].setMatrixAt(e,A3)}r.batchTable=i,r.featureTable=t,r.scene.batchTable=i,r.scene.featureTable=t,e(r)}),n)}))}))}},O3=class extends pc{parse(e){let t=new DataView(e),i=mu(t);console.assert("cmpt"===i,'CMPTLoader: The magic bytes equal "cmpt".');let r=t.getUint32(4,!0);console.assert(1===r,'CMPTLoader: The version listed in the header is "1".');let n=t.getUint32(8,!0);console.assert(n===e.byteLength,"CMPTLoader: The contents buffer length listed in the header matches the file.");let s=t.getUint32(12,!0),a=[],o=16;for(let l=0;l<s;l++){let t=new DataView(e,o,12),i=mu(t),r=t.getUint32(4,!0),n=t.getUint32(8,!0),s=new Uint8Array(e,o,n);a.push({type:i,buffer:s,version:r}),o+=n}return{version:r,tiles:a}}},P3=class extends O3{constructor(e=vo){super(),this.manager=e,this.adjustmentTransform=new Be}parse(e){let t=super.parse(e),i=this.manager,r=this.adjustmentTransform,n=[];for(let s in t.tiles){let{type:e,buffer:a}=t.tiles[s];switch(e){case"b3dm":{let e=a.slice(),t=new wT(i);t.workingPath=this.workingPath,t.fetchOptions=this.fetchOptions,t.adjustmentTransform.copy(r);let s=t.parse(e.buffer);n.push(s);break}case"pnts":{let e=a.slice(),t=new RT(i);t.workingPath=this.workingPath,t.fetchOptions=this.fetchOptions;let r=t.parse(e.buffer);n.push(r);break}case"i3dm":{let e=a.slice(),t=new MT(i);t.workingPath=this.workingPath,t.fetchOptions=this.fetchOptions,t.adjustmentTransform.copy(r);let s=t.parse(e.buffer);n.push(s);break}}}return Promise.all(n).then((e=>{let t=new ar;return e.forEach((e=>{t.add(e.scene)})),{tiles:e,scene:t}}))}},N3=class{constructor(){this.name="CESIUM_RTC"}afterRoot(e){if(e.parser.json.extensions&&e.parser.json.extensions.CESIUM_RTC){let{center:t}=e.parser.json.extensions.CESIUM_RTC;t&&(e.scene.position.x+=t[0],e.scene.position.y+=t[1],e.scene.position.z+=t[2])}}},L3=class extends pc{constructor(e=vo){super(),this.manager=e}parse(e){return new Promise(((t,i)=>{let r=this.manager,n=this.fetchOptions,s=r.getHandler("path.gltf")||r.getHandler("path.glb");s||(s=new gh(r),s.register((()=>new N3)),"include"===n.credentials&&"cors"===n.mode&&s.setCrossOrigin("use-credentials"),"credentials"in n&&s.setWithCredentials("include"===n.credentials),n.headers&&s.setRequestHeader(n.headers));let a=s.resourcePath||s.path||this.workingPath;!/[\\/]$/.test(a)&&a.length&&(a+="/"),s.parse(e,a,(e=>{t(e)}),i)}))}},F3=new Be,H3=class extends ar{constructor(e){super(),this.name="TilesRenderer.TilesGroup",this.tilesRenderer=e}raycast(e,t){this.tilesRenderer.optimizeRaycast&&this.tilesRenderer.raycast(e,t)}updateMatrixWorld(e){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||e){null===this.parent?F3.copy(this.matrix):F3.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1;let e=F3.elements,t=this.matrixWorld.elements,i=!1;for(let r=0;r<16;r++){let n=e[r],s=t[r];if(Math.abs(n-s)>Number.EPSILON){i=!0;break}}if(i){this.matrixWorld.copy(F3);let e=this.children;for(let t=0,i=e.length;t<i;t++)e[t].updateMatrixWorld()}}}};function uAe(e){let{x:t,y:i,z:r}=e;e.x=r,e.y=t,e.z=i}function z5t(e){return-e+Math.PI/2}var U3=new xf,nS=new D,G0=new D,B3=class{constructor(e=1,t=1,i=1){this.radius=new D(e,t,i)}getCartographicToPosition(e,t,i,r){let n=this.radius;U3.set(1,z5t(e),t),nS.setFromSpherical(U3).normalize(),uAe(nS),G0.copy(nS),G0.x*=ap(n.x,2),G0.y*=ap(n.y,2),G0.z*=ap(n.z,2);let s=Math.sqrt(nS.dot(G0));return G0.divideScalar(s),r.copy(G0).addScaledVector(nS,i)}getCartographicToNormal(e,t,i){return U3.set(1,-e+Math.PI/2,t),i.setFromSpherical(U3).normalize(),uAe(i),i}getPositionToNormal(e,t){let i=this.radius;return t.copy(e),t.x/=ap(i.x,2),t.y/=ap(i.y,2),t.z/=ap(i.z,2),t.normalize(),t}},dm=Math.PI,k3=dm/2,sS=new D,DT=new D,CT=new D,hAe=new Be,aS=0,mV=[];function j5t(e=!1){return e?(mV[aS]||(mV[aS]=new D),aS++,mV[aS-1]):new D}function pAe(){aS=0}var G3=class extends B3{constructor(e,t,i,r=-k3,n=k3,s=0,a=2*dm,o=0,l=0){super(e,t,i),this.latStart=r,this.latEnd=n,this.lonStart=s,this.lonEnd=a,this.heightStart=o,this.heightEnd=l}_getPoints(e=!1){let{latStart:t,latEnd:i,lonStart:r,lonEnd:n,heightStart:s,heightEnd:a}=this,o=fr.mapLinear(.5,0,1,t,i),l=fr.mapLinear(.5,0,1,r,n),h=Math.floor(r/k3)*k3,u=[[-dm/2,0],[dm/2,0],[0,h],[0,h+dm/2],[0,h+dm],[0,h+3*dm/2],[t,n],[i,n],[t,r],[i,r],[0,r],[0,n],[o,l],[t,l],[i,l],[o,r],[o,n]],c=[],p=u.length;for(let d=0;d<=1;d++){let o=fr.mapLinear(d,0,1,s,a);for(let s=0,a=p;s<a;s++){let[a,l]=u[s];if(a>=t&&a<=i&&l>=r&&l<=n){let t=j5t(e);c.push(t),this.getCartographicToPosition(a,l,o,t)}}}return c}getBoundingBox(e,t){pAe();let{latStart:i,latEnd:r,lonStart:n,lonEnd:s}=this;if(r-i<dm/2){let e=fr.mapLinear(.5,0,1,i,r),a=fr.mapLinear(.5,0,1,n,s);this.getCartographicToNormal(e,a,CT),DT.set(0,0,1),sS.crossVectors(DT,CT),DT.crossVectors(sS,CT),t.makeBasis(sS,DT,CT)}else sS.set(1,0,0),DT.set(0,1,0),CT.set(0,0,1),t.makeBasis(sS,DT,CT);hAe.copy(t).invert();let a=this._getPoints(!0);for(let o=0,l=a.length;o<l;o++)a[o].applyMatrix4(hAe);e.makeEmpty(),e.setFromPoints(a)}getBoundingSphere(e,t){pAe();let i=this._getPoints(!0);e.makeEmpty(),e.setFromPoints(i,t)}},OT=new $i,Ed=new Be,dAe=new D,AT=new D,V0=new Ko,dc=[];function gV(e,t){return e.distance-t.distance}function vV(e,t,i){e.traverse((e=>{Object.getPrototypeOf(e).raycast.call(e,t,i)}))}function yV(e,t,i,r){if(i.has(e)){if(vV(e.cached.scene,r,dc),dc.length>0){dc.length>1&&dc.sort(gV);let e=dc[0];return dc.length=0,e}return null}let n=[],s=e.children;for(let l=0,h=s.length;l<h;l++){let e=s[l],i=e.cached,a=t.matrixWorld;Ed.copy(a);let o=i.sphere;if(o&&(OT.copy(o),OT.applyMatrix4(Ed),!r.ray.intersectsSphere(OT)))continue;let h=i.box,u=i.boxTransform;if(h){if(Ed.multiply(u).invert(),V0.copy(r.ray),V0.applyMatrix4(Ed),!V0.intersectBox(h,dAe))continue;{AT.setFromMatrixScale(Ed);let t=AT.x;Math.abs(Math.max(AT.x-AT.y,AT.x-AT.z))>1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.");let i={distance:1/0,tile:null};n.push(i),h.containsPoint(V0.origin)?i.distance=0:i.distance=dAe.distanceToSquared(V0.origin)*t*t,i.tile=e}}}n.sort(gV);let a=1/0,o=null;for(let l=0,h=n.length;l<h;l++){let e=n[l];if(e.distance>a)break;{let n=e.tile,s=n.cached.scene,l=null;if(i.has(n)?(vV(s,r,dc),dc.length>0&&(dc.length>1&&dc.sort(gV),l=dc[0])):l=yV(n,t,i,r),l){let e=l.distance*l.distance;e<a&&(a=e,o=l),dc.length=0}}}return o}function EV(e,t,i,r,n){let s=e.cached,a=t.matrixWorld;Ed.copy(a);let o=s.sphere;if(o&&(OT.copy(o),OT.applyMatrix4(Ed),!r.ray.intersectsSphere(OT)))return;let l=s.box,h=s.boxTransform;if(l&&(Ed.multiply(h).invert(),V0.copy(r.ray).applyMatrix4(Ed),!V0.intersectsBox(l)))return;let u=s.scene;if(i.has(e))return void vV(u,r,n);let c=e.children;for(let p=0,d=c.length;p<d;p++)EV(c[p],t,i,r,n)}var gAe=Symbol("INITIAL_FRUSTUM_CULLED"),gu=new Be,TV=new Be,vu=new D,Td=new D,bd=new D,xd=new D,W5t=new D(1,0,0),q5t=new D(0,1,0);function mAe(e,t){e.traverse((e=>{e.frustumCulled=e[gAe]&&t}))}var oS=class extends S3{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(e){this._autoDisableRendererCulling!==e&&(super._autoDisableRendererCulling=e,this.forEachLoadedModel((t=>{mAe(t,!e)})))}constructor(...e){super(...e),this.group=new H3(this),this.cameras=[],this.cameraMap=new Map,this.cameraInfo=[],this.activeTiles=new Set,this.visibleTiles=new Set,this._autoDisableRendererCulling=!0,this.optimizeRaycast=!0,this.onLoadTileSet=null,this.onLoadModel=null,this.onDisposeModel=null,this.onTileVisibilityChange=null;let t=new eh;t.setURLModifier((e=>this.preprocessURL?this.preprocessURL(e):e)),this.manager=t;let i=this;this._overridenRaycast=function(e,t){i.optimizeRaycast||Object.getPrototypeOf(this).raycast.call(this,e,t)}}getBounds(e){if(!this.root)return!1;let t=this.root.cached,i=t.box,r=t.boxTransform;return!!i&&(e.copy(i),e.applyMatrix4(r),!0)}getOrientedBounds(e,t){if(!this.root)return!1;let i=this.root.cached,r=i.box,n=i.boxTransform;return!!r&&(e.copy(r),t.copy(n),!0)}getBoundingSphere(e){if(!this.root)return!1;let t=this.root.cached.sphere;return!!t&&(e.copy(t),!0)}forEachLoadedModel(e){this.traverse((t=>{let i=t.cached.scene;i&&e(i,t)}))}raycast(e,t){if(this.root)if(e.firstHitOnly){let i=yV(this.root,this.group,this.activeTiles,e);i&&t.push(i)}else EV(this.root,this.group,this.activeTiles,e,t)}hasCamera(e){return this.cameraMap.has(e)}setCamera(e){let t=this.cameras,i=this.cameraMap;return!i.has(e)&&(i.set(e,new ce),t.push(e),!0)}setResolution(e,t,i){let r=this.cameraMap;return!!r.has(e)&&(t instanceof ce?r.get(e).copy(t):r.get(e).set(t,i),!0)}setResolutionFromRenderer(e,t){let i=this.cameraMap;if(!i.has(e))return!1;let r=i.get(e);return t.getSize(r),r.multiplyScalar(t.getPixelRatio()),!0}deleteCamera(e){let t=this.cameras,i=this.cameraMap;if(i.has(e)){let r=t.indexOf(e);return t.splice(r,1),i.delete(e),!0}return!1}fetchTileSet(e,...t){let i=super.fetchTileSet(e,...t);return i.then((t=>{this.onLoadTileSet&&Promise.resolve().then((()=>{this.onLoadTileSet(t,e)}))})),i}update(){let e=this.group,t=this.cameras,i=this.cameraMap,r=this.cameraInfo;if(0===t.length)return void console.warn("TilesRenderer: no cameras defined. Cannot update 3d tiles.");for(;r.length>t.length;)r.pop();for(;r.length<t.length;)r.push({frustum:new na,isOrthographic:!1,sseDenominator:-1,position:new D,invScale:-1,pixelSize:0});TV.copy(e.matrixWorld).invert(),vu.setFromMatrixScale(TV);let n=vu.x;Math.abs(Math.max(vu.x-vu.y,vu.x-vu.z))>1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let s=0,a=r.length;s<a;s++){let a=t[s],o=r[s],l=o.frustum,h=o.position,u=i.get(a);(0===u.width||0===u.height)&&console.warn("TilesRenderer: resolution for camera error calculation is not set.");let c=a.projectionMatrix.elements;if(o.isOrthographic=1===c[15],o.isOrthographic){let e=2/c[0],t=2/c[5];o.pixelSize=Math.max(t/u.height,e/u.width)}else o.sseDenominator=2/c[5]/u.height;o.invScale=n,gu.copy(e.matrixWorld),gu.premultiply(a.matrixWorldInverse),gu.premultiply(a.projectionMatrix),l.setFromProjectionMatrix(gu),h.set(0,0,0),h.applyMatrix4(a.matrixWorld),h.applyMatrix4(TV)}super.update()}preprocessNode(e,t,i){super.preprocessNode(e,t,i);let r=new Be;if(e.transform){let t=e.transform;for(let e=0;e<16;e++)r.elements[e]=t[e]}else r.identity();t&&r.premultiply(t.cached.transform);let n=(new Be).copy(r).invert(),s=null,a=null,o=null;if("box"in e.boundingVolume){let t=e.boundingVolume.box;s=new Rt,a=new Be,o=new Be,Td.set(t[3],t[4],t[5]),bd.set(t[6],t[7],t[8]),xd.set(t[9],t[10],t[11]);let i=Td.length(),n=bd.length(),l=xd.length();Td.normalize(),bd.normalize(),xd.normalize(),0===i&&Td.crossVectors(bd,xd),0===n&&bd.crossVectors(Td,xd),0===l&&xd.crossVectors(Td,bd),a.set(Td.x,bd.x,xd.x,t[0],Td.y,bd.y,xd.y,t[1],Td.z,bd.z,xd.z,t[2],0,0,0,1),a.premultiply(r),o.copy(a).invert(),s.min.set(-i,-n,-l),s.max.set(i,n,l)}let l=null;if("sphere"in e.boundingVolume){let t=e.boundingVolume.sphere;l=new $i,l.center.set(t[0],t[1],t[2]),l.radius=t[3],l.applyMatrix4(r)}else if("box"in e.boundingVolume){let t=e.boundingVolume.box;l=new $i,s.getBoundingSphere(l),l.center.set(t[0],t[1],t[2]),l.applyMatrix4(r)}let h=null;if("region"in e.boundingVolume){let t=e.boundingVolume.region,[i,r,n,u,c,p]=t;h=new G3(6378137,6378137,rAe,r,u,i,n,c,p),null===l&&(l=new $i,h.getBoundingSphere(l)),null===s&&(s=new Rt,a=new Be,o=new Be,h.getBoundingBox(s,a),o.copy(a).invert())}e.cached={loadIndex:0,transform:r,transformInverse:n,active:!1,inFrustum:[],box:s,boxTransform:a,boxTransformInverse:o,sphere:l,region:h,scene:null,geometry:null,material:null}}parseTile(e,t,i){t._loadIndex=t._loadIndex||0,t._loadIndex++;let r=t.content.uri.split(/[\\\/]/g);r.pop();let n=r.join("/"),s=this.fetchOptions,a=this.manager,o=t._loadIndex,l=null,h=this.rootTileSet.asset&&this.rootTileSet.asset.gltfUpAxis||"y",u=t.cached,c=u.transform;switch(h.toLowerCase()){case"x":gu.makeRotationAxis(q5t,-Math.PI/2);break;case"y":gu.makeRotationAxis(W5t,Math.PI/2);break;case"z":gu.identity()}let p=mu(e)||i;switch(p){case"b3dm":{let t=new wT(a);t.workingPath=n,t.fetchOptions=s,t.adjustmentTransform.copy(gu),l=t.parse(e).then((e=>e.scene));break}case"pnts":{let t=new RT(a);t.workingPath=n,t.fetchOptions=s,l=t.parse(e).then((e=>e.scene));break}case"i3dm":{let t=new MT(a);t.workingPath=n,t.fetchOptions=s,t.adjustmentTransform.copy(gu),l=t.parse(e).then((e=>e.scene));break}case"cmpt":{let t=new P3(a);t.workingPath=n,t.fetchOptions=s,t.adjustmentTransform.copy(gu),l=t.parse(e).then((e=>e.scene));break}case"gltf":case"glb":let t=new L3(a);t.workingPath=n,t.fetchOptions=s,l=t.parse(e).then((e=>e.scene));break;default:console.warn(`TilesRenderer: Content type "${p}" not supported.`),l=Promise.resolve(null)}return l.then((e=>{if(t._loadIndex!==o)return;e.updateMatrix(),("glb"===p||"gltf"===p)&&e.matrix.multiply(gu),e.matrix.premultiply(c),e.matrix.decompose(e.position,e.quaternion,e.scale),e.traverse((e=>{e[gAe]=e.frustumCulled})),mAe(e,!this.autoDisableRendererCulling),u.scene=e,e.traverse((e=>{e.raycast=this._overridenRaycast}));let i=[],r=[],n=[];e.traverse((e=>{if(e.geometry&&r.push(e.geometry),e.material){let t=e.material;i.push(e.material);for(let e in t){let i=t[e];i&&i.isTexture&&n.push(i)}}})),u.materials=i,u.geometry=r,u.textures=n,this.onLoadModel&&this.onLoadModel(e,t)}))}disposeTile(e){let t=e.cached;if(t.scene){let i=t.materials,r=t.geometry,n=t.textures,s=t.scene.parent;for(let e=0,t=r.length;e<t;e++)r[e].dispose();for(let e=0,t=i.length;e<t;e++)i[e].dispose();for(let e=0,t=n.length;e<t;e++)n[e].dispose();s&&s.remove(t.scene),this.onDisposeModel&&this.onDisposeModel(t.scene,e),t.scene=null,t.materials=null,t.textures=null,t.geometry=null}this.activeTiles.delete(e),this.visibleTiles.delete(e),e._loadIndex++}setTileVisible(e,t){let i=e.cached.scene,r=this.visibleTiles,n=this.group;t?(n.add(i),r.add(e),i.updateMatrixWorld(!0)):(n.remove(i),r.delete(e)),this.onTileVisibilityChange&&this.onTileVisibilityChange(i,e,t)}setTileActive(e,t){let i=this.activeTiles;t?i.add(e):i.delete(e)}calculateError(e){let t=e.cached,i=t.inFrustum,r=this.cameras,n=this.cameraInfo,s=t.sphere,a=t.box,o=t.boxTransformInverse,l=t.transformInverse,h=a&&o,u=-1/0,c=1/0;for(let p=0,d=r.length;p<d;p++){if(!i[p])continue;let t,r=n[p],d=r.invScale;if(r.isOrthographic){let i=r.pixelSize;t=e.geometricError/(i*d)}else{let i;vu.copy(r.position),h?(vu.applyMatrix4(o),i=a.distanceToPoint(vu)):(vu.applyMatrix4(l),i=Math.max(s.distanceToPoint(vu),0));let n=i*d,u=r.sseDenominator;t=e.geometricError/(n*u),c=Math.min(c,n)}u=Math.max(u,t)}e.__distanceFromCamera=c,e.__error=u}tileInView(e){let t=e.cached,i=t.sphere,r=t.inFrustum;if(i){let e=this.cameraInfo,t=!1;for(let n=0,s=e.length;n<s;n++)e[n].frustum.intersectsSphere(i)?(t=!0,r[n]=!0):r[n]=!1;return t}return!0}},ym=ps(Zc(),1),lS=new D,cS=new D,vAe=new Ui,V3=class extends Kr{constructor(e,t=1,i=16711680){let r=new ot,n=e.geometry.attributes.normal.count,s=new dt(2*n*3,3);r.setAttribute("position",s),super(r,new br({color:i,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),vAe.getNormalMatrix(this.object.matrixWorld);let e=this.object.matrixWorld,t=this.geometry.attributes.position,i=this.object.geometry;if(i){let r=i.attributes.position,n=i.attributes.normal,s=0;for(let i=0,a=r.count;i<a;i++)lS.fromBufferAttribute(r,i).applyMatrix4(e),cS.fromBufferAttribute(n,i),cS.applyMatrix3(vAe).normalize().multiplyScalar(this.size).add(lS),t.setXYZ(s,lS.x,lS.y,lS.z),s+=1,t.setXYZ(s,cS.x,cS.y,cS.z),s+=1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},uS=function(){var e=0,t=document.createElement("div");function i(e){return t.appendChild(e.dom),e}function r(i){for(var r=0;r<t.children.length;r++)t.children[r].style.display=r===i?"block":"none";e=i}t.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",(function(i){i.preventDefault(),r(++e%t.children.length)}),!1);var n=(performance||Date).now(),s=n,a=0,o=i(new uS.Panel("FPS","#0ff","#002")),l=i(new uS.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=i(new uS.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:t,addPanel:i,showPanel:r,begin:function(){n=(performance||Date).now()},end:function(){a++;var e=(performance||Date).now();if(l.update(e-n,200),e>=s+1e3&&(o.update(1e3*a/(e-s),100),s=e,a=0,h)){var t=performance.memory;h.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){n=this.end()},domElement:t,setMode:r}};uS.Panel=function(e,t,i){var r=1/0,n=0,s=Math.round,a=s(window.devicePixelRatio||1),o=80*a,l=48*a,h=3*a,u=2*a,c=3*a,p=15*a,d=74*a,f=30*a,m=document.createElement("canvas");m.width=o,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,o,l),g.fillStyle=t,g.fillText(e,h,u),g.fillRect(c,p,d,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c,p,d,f),{dom:m,update:function(l,y){r=Math.min(r,l),n=Math.max(n,l),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,o,p),g.fillStyle=t,g.fillText(s(l)+" "+e+" ("+s(r)+"-"+s(n)+")",h,u),g.drawImage(m,c+a,p,d-a,f,c,p,d-a,f),g.fillRect(c+d-a,p,a,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c+d-a,p,a,s((1-l/y)*f))}}};var z3=uS,cs=class{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}},Y5t=new Ni(-1,1,1,-1,0,1),bV=new ot;bV.setAttribute("position",new dt([-1,3,0,-1,-1,0,3,-1,0],3)),bV.setAttribute("uv",new dt([0,2,0,0,2,0],2));var ga=class{constructor(e){this._mesh=new Je(bV,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,Y5t)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}},xV={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new ce(.001953125,0)},cKernel:{value:[]}},vertexShader:"\n\n\t\tuniform vec2 uImageIncrement;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float cKernel[ KERNEL_SIZE_INT ];\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec2 uImageIncrement;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec2 imageCoord = vUv;\n\t\t\tvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\n\n\t\t\tfor( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {\n\n\t\t\t\tsum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];\n\t\t\t\timageCoord += uImageIncrement;\n\n\t\t\t}\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}",buildKernel:function(e){let t=2*Math.ceil(3*e)+1;t>25&&(t=25);let i=.5*(t-1),r=new Array(t),n=0;for(let s=0;s<t;++s)r[s]=X5t(s-i,e),n+=r[s];for(let s=0;s<t;++s)r[s]/=n;return r}};function X5t(e,t){return Math.exp(-e*e/(2*t*t))}var Hh=class extends cs{constructor(e=1,t=25,i=4){super(),this.renderTargetX=new Wr,this.renderTargetX.texture.name="BloomPass.x",this.renderTargetY=new Wr,this.renderTargetY.texture.name="BloomPass.y",this.combineUniforms=dn.clone(IV.uniforms),this.combineUniforms.strength.value=e,this.materialCombine=new Zt({uniforms:this.combineUniforms,vertexShader:IV.vertexShader,fragmentShader:IV.fragmentShader,blending:Op,transparent:!0});let r=xV;this.convolutionUniforms=dn.clone(r.uniforms),this.convolutionUniforms.uImageIncrement.value=Hh.blurX,this.convolutionUniforms.cKernel.value=xV.buildKernel(i),this.materialConvolution=new Zt({uniforms:this.convolutionUniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,defines:{KERNEL_SIZE_FLOAT:t.toFixed(1),KERNEL_SIZE_INT:t.toFixed(0)}}),this.needsSwap=!1,this.fsQuad=new ga(null)}render(e,t,i,r,n){n&&e.state.buffers.stencil.setTest(!1),this.fsQuad.material=this.materialConvolution,this.convolutionUniforms.tDiffuse.value=i.texture,this.convolutionUniforms.uImageIncrement.value=Hh.blurX,e.setRenderTarget(this.renderTargetX),e.clear(),this.fsQuad.render(e),this.convolutionUniforms.tDiffuse.value=this.renderTargetX.texture,this.convolutionUniforms.uImageIncrement.value=Hh.blurY,e.setRenderTarget(this.renderTargetY),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCombine,this.combineUniforms.tDiffuse.value=this.renderTargetY.texture,n&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(i),this.clear&&e.clear(),this.fsQuad.render(e)}setSize(e,t){this.renderTargetX.setSize(e,t),this.renderTargetY.setSize(e,t)}dispose(){this.renderTargetX.dispose(),this.renderTargetY.dispose(),this.materialCombine.dispose(),this.materialConvolution.dispose(),this.fsQuad.dispose()}},IV={uniforms:{tDiffuse:{value:null},strength:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float strength;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = strength * texel;\n\n\t\t}"};Hh.blurX=new ce(.001953125,0),Hh.blurY=new ce(0,.001953125);var va={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor.a *= opacity;\n\n\n\t\t}"},PT=class extends cs{constructor(e,t){super(),this.textureID=void 0!==t?t:"tDiffuse",e instanceof Zt?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=dn.clone(e.uniforms),this.material=new Zt({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new ga(this.material)}render(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}},hS=class extends cs{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,i){let r,n,s=e.getContext(),a=e.state;a.buffers.color.setMask(!1),a.buffers.depth.setMask(!1),a.buffers.color.setLocked(!0),a.buffers.depth.setLocked(!0),this.inverse?(r=0,n=1):(r=1,n=0),a.buffers.stencil.setTest(!0),a.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),a.buffers.stencil.setFunc(s.ALWAYS,r,4294967295),a.buffers.stencil.setClear(n),a.buffers.stencil.setLocked(!0),e.setRenderTarget(i),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),a.buffers.color.setLocked(!1),a.buffers.depth.setLocked(!1),a.buffers.stencil.setLocked(!1),a.buffers.stencil.setFunc(s.EQUAL,1,4294967295),a.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),a.buffers.stencil.setLocked(!0)}},j3=class extends cs{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}},W3=class{constructor(e,t){if(this.renderer=e,void 0===t){let i=e.getSize(new ce);this._pixelRatio=e.getPixelRatio(),this._width=i.width,this._height=i.height,(t=new Wr(this._width*this._pixelRatio,this._height*this._pixelRatio)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new PT(va),this.clock=new Vl}swapBuffers(){let e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){let t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());let t=this.renderer.getRenderTarget(),i=!1;for(let r=0,n=this.passes.length;r<n;r++){let t=this.passes[r];if(!1!==t.enabled){if(t.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(r),t.render(this.renderer,this.writeBuffer,this.readBuffer,e,i),t.needsSwap){if(i){let t=this.renderer.getContext(),i=this.renderer.state.buffers.stencil;i.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),i.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==hS&&(t instanceof hS?i=!0:t instanceof j3&&(i=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){let t=this.renderer.getSize(new ce);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;let i=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(i,r),this.renderTarget2.setSize(i,r);for(let n=0;n<this.passes.length;n++)this.passes[n].setSize(i,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}},yu=class extends cs{constructor(e,t,i,r){super(),this.renderScene=t,this.renderCamera=i,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new Ve(1,1,1),this.hiddenEdgeColor=new Ve(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new Map,this.resolution=void 0!==e?new ce(e.x,e.y):new ce(256,256);let n=Math.round(this.resolution.x/this.downSampleRatio),s=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new Wr(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new Up,this.depthMaterial.side=bi,this.depthMaterial.depthPacking=Qy,this.depthMaterial.blending=zi,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=bi,this.prepareMaskMaterial.fragmentShader=function(e,t){let i=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,i+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new Wr(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new Wr(n,s),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new Wr(n,s),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new Wr(Math.round(n/2),Math.round(s/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new Wr(n,s),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new Wr(Math.round(n/2),Math.round(s/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1,this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(n,s),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(n/2),Math.round(s/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial();let a=va;this.copyUniforms=dn.clone(a.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new Zt({uniforms:this.copyUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,blending:zi,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new Ve,this.oldClearAlpha=1,this.fsQuad=new ga(null),this.tempPulseColor1=new Ve,this.tempPulseColor2=new Ve,this.textureMatrix=new Be}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose(),this.depthMaterial.dispose(),this.prepareMaskMaterial.dispose(),this.edgeDetectionMaterial.dispose(),this.separableBlurMaterial1.dispose(),this.separableBlurMaterial2.dispose(),this.overlayMaterial.dispose(),this.materialCopy.dispose(),this.fsQuad.dispose()}setSize(e,t){this.renderTargetMaskBuffer.setSize(e,t),this.renderTargetDepthBuffer.setSize(e,t);let i=Math.round(e/this.downSampleRatio),r=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(i,r),this.renderTargetBlurBuffer1.setSize(i,r),this.renderTargetEdgeBuffer1.setSize(i,r),this.separableBlurMaterial1.uniforms.texSize.value.set(i,r),i=Math.round(i/2),r=Math.round(r/2),this.renderTargetBlurBuffer2.setSize(i,r),this.renderTargetEdgeBuffer2.setSize(i,r),this.separableBlurMaterial2.uniforms.texSize.value.set(i,r)}changeVisibilityOfSelectedObjects(e){let t=this._visibilityCache;function i(i){i.isMesh&&(!0===e?i.visible=t.get(i):(t.set(i,i.visible),i.visible=e))}for(let r=0;r<this.selectedObjects.length;r++)this.selectedObjects[r].traverse(i)}changeVisibilityOfNonSelectedObjects(e){let t=this._visibilityCache,i=[];function r(e){e.isMesh&&i.push(e)}for(let n=0;n<this.selectedObjects.length;n++)this.selectedObjects[n].traverse(r);this.renderScene.traverse((function(r){if(r.isMesh||r.isSprite){let n=!1;for(let e=0;e<i.length;e++)if(i[e].id===r.id){n=!0;break}if(!1===n){let i=r.visible;(!1===e||!0===t.get(r))&&(r.visible=e),t.set(r,i)}}else(r.isPoints||r.isLine)&&(!0===e?r.visible=t.get(r):(t.set(r,r.visible),r.visible=e))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,t,i,r,n){if(this.selectedObjects.length>0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();let t=e.autoClear;e.autoClear=!1,n&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);let r=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=r,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){let e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=yu.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=yu.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=yu.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=yu.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,n&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(i),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=i.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new Zt({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new ce(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t\t#include <skinning_pars_vertex>\n\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tuniform mat4 textureMatrix;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t\t#include <skinning_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t\tvPosition = mvPosition;\n\n\t\t\t\t\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t\t\t\t\t#ifdef USE_INSTANCING\n\n\t\t\t\t\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t\t\t\t\t#endif\n\t\t\t\t\t\n\t\t\t\t\tworldPosition = modelMatrix * worldPosition;\n\n\t\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\n\t\t\t\t}",fragmentShader:"#include <packing>\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tuniform sampler2D depthTexture;\n\t\t\t\tuniform vec2 cameraNearFar;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n\t\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\n\t\t\t\t}"})}getEdgeDetectionMaterial(){return new Zt({uniforms:{maskTexture:{value:null},texSize:{value:new ce(.5,.5)},visibleEdgeColor:{value:new D(1,1,1)},hiddenEdgeColor:{value:new D(1,1,1)}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\t\tuniform vec3 hiddenEdgeColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t\t}"})}getSeperableBlurMaterial(e){return new Zt({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new ce(.5,.5)},direction:{value:new ce(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float kernelRadius;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat sigma = kernelRadius/2.0;\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, sigma);\n\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = kernelRadius * float(i) / float(MAX_RADIUS);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, sigma);\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\t\tuvOffset += delta;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t\t}"})}getOverlayMaterial(){return new Zt({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform sampler2D edgeTexture1;\n\t\t\t\tuniform sampler2D edgeTexture2;\n\t\t\t\tuniform sampler2D patternTexture;\n\t\t\t\tuniform float edgeStrength;\n\t\t\t\tuniform float edgeGlow;\n\t\t\t\tuniform bool usePatternTexture;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\t\tif(usePatternTexture)\n\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\t\tgl_FragColor = finalColor;\n\t\t\t\t}",blending:Op,depthTest:!1,depthWrite:!1,transparent:!0})}};yu.BlurDirectionX=new ce(1,0),yu.BlurDirectionY=new ce(0,1);var q3=class extends cs{constructor(e,t,i,r,n){super(),this.scene=e,this.camera=t,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Ve}render(e,t,i){let r,n,s=e.autoClear;e.autoClear=!1,void 0!==this.overrideMaterial&&(n=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),r=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:i),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,r),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=n),e.autoClear=s}},pS={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},tDiffuse:{value:null},tNormal:{value:null},size:{value:new ce(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new Be},cameraInverseProjectionMatrix:{value:new Be},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t}",fragmentShader:"\n\n\t\t#include <common>\n\n\t\tvarying vec2 vUv;\n\n\t\t#if DIFFUSE_TEXTURE == 1\n\t\tuniform sampler2D tDiffuse;\n\t\t#endif\n\n\t\tuniform sampler2D tDepth;\n\n\t\t#if NORMAL_TEXTURE == 1\n\t\tuniform sampler2D tNormal;\n\t\t#endif\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform mat4 cameraProjectionMatrix;\n\t\tuniform mat4 cameraInverseProjectionMatrix;\n\n\t\tuniform float scale;\n\t\tuniform float intensity;\n\t\tuniform float bias;\n\t\tuniform float kernelRadius;\n\t\tuniform float minResolution;\n\t\tuniform vec2 size;\n\t\tuniform float randomSeed;\n\n\t\t// RGBA depth\n\n\t\t#include <packing>\n\n\t\tvec4 getDefaultColor( const in vec2 screenPosition ) {\n\t\t\t#if DIFFUSE_TEXTURE == 1\n\t\t\treturn texture2D( tDiffuse, vUv );\n\t\t\t#else\n\t\t\treturn vec4( 1.0 );\n\t\t\t#endif\n\t\t}\n\n\t\tfloat getDepth( const in vec2 screenPosition ) {\n\t\t\t#if DEPTH_PACKING == 1\n\t\t\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );\n\t\t\t#else\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\t\t\t#endif\n\t\t}\n\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#else\n\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#endif\n\t\t}\n\n\t\tvec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n\t\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n\t\t\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );\n\t\t\tclipPosition *= clipW; // unprojection.\n\n\t\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;\n\t\t}\n\n\t\tvec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {\n\t\t\t#if NORMAL_TEXTURE == 1\n\t\t\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );\n\t\t\t#else\n\t\t\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );\n\t\t\t#endif\n\t\t}\n\n\t\tfloat scaleDividedByCameraFar;\n\t\tfloat minResolutionMultipliedByCameraFar;\n\n\t\tfloat getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {\n\t\t\tvec3 viewDelta = sampleViewPosition - centerViewPosition;\n\t\t\tfloat viewDistance = length( viewDelta );\n\t\t\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;\n\n\t\t\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );\n\t\t}\n\n\t\t// moving costly divides into consts\n\t\tconst float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );\n\t\tconst float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );\n\n\t\tfloat getAmbientOcclusion( const in vec3 centerViewPosition ) {\n\t\t\t// precompute some variables require in getOcclusion.\n\t\t\tscaleDividedByCameraFar = scale / cameraFar;\n\t\t\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;\n\t\t\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );\n\n\t\t\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/\n\t\t\tfloat angle = rand( vUv + randomSeed ) * PI2;\n\t\t\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;\n\t\t\tvec2 radiusStep = radius;\n\n\t\t\tfloat occlusionSum = 0.0;\n\t\t\tfloat weightSum = 0.0;\n\n\t\t\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {\n\t\t\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;\n\t\t\t\tradius += radiusStep;\n\t\t\t\tangle += ANGLE_STEP;\n\n\t\t\t\tfloat sampleDepth = getDepth( sampleUv );\n\t\t\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfloat sampleViewZ = getViewZ( sampleDepth );\n\t\t\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );\n\t\t\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );\n\t\t\t\tweightSum += 1.0;\n\t\t\t}\n\n\t\t\tif( weightSum == 0.0 ) discard;\n\n\t\t\treturn occlusionSum * ( intensity / weightSum );\n\t\t}\n\n\t\tvoid main() {\n\t\t\tfloat centerDepth = getDepth( vUv );\n\t\t\tif( centerDepth >= ( 1.0 - EPSILON ) ) {\n\t\t\t\tdiscard;\n\t\t\t}\n\n\t\t\tfloat centerViewZ = getViewZ( centerDepth );\n\t\t\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );\n\n\t\t\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );\n\n\t\t\tgl_FragColor = getDefaultColor( vUv );\n\t\t\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;\n\t\t}"},Id={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new ce(512,512)},sampleUvOffsets:{value:[new ce(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader:"\n\n\t\t#include <common>\n\n\t\tuniform vec2 size;\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vInvSize;\n\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tvInvSize = 1.0 / size;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t}",fragmentShader:"\n\n\t\t#include <common>\n\t\t#include <packing>\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform sampler2D tDepth;\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform float depthCutoff;\n\n\t\tuniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];\n\t\tuniform float sampleWeights[ KERNEL_RADIUS + 1 ];\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vInvSize;\n\n\t\tfloat getDepth( const in vec2 screenPosition ) {\n\t\t\t#if DEPTH_PACKING == 1\n\t\t\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );\n\t\t\t#else\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\t\t\t#endif\n\t\t}\n\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#else\n\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#endif\n\t\t}\n\n\t\tvoid main() {\n\t\t\tfloat depth = getDepth( vUv );\n\t\t\tif( depth >= ( 1.0 - EPSILON ) ) {\n\t\t\t\tdiscard;\n\t\t\t}\n\n\t\t\tfloat centerViewZ = -getViewZ( depth );\n\t\t\tbool rBreak = false, lBreak = false;\n\n\t\t\tfloat weightSum = sampleWeights[0];\n\t\t\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;\n\n\t\t\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {\n\n\t\t\t\tfloat sampleWeight = sampleWeights[i];\n\t\t\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;\n\n\t\t\t\tvec2 sampleUv = vUv + sampleUvOffset;\n\t\t\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );\n\n\t\t\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;\n\n\t\t\t\tif( ! rBreak ) {\n\t\t\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;\n\t\t\t\t\tweightSum += sampleWeight;\n\t\t\t\t}\n\n\t\t\t\tsampleUv = vUv - sampleUvOffset;\n\t\t\t\tviewZ = -getViewZ( getDepth( sampleUv ) );\n\n\t\t\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;\n\n\t\t\t\tif( ! lBreak ) {\n\t\t\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;\n\t\t\t\t\tweightSum += sampleWeight;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgl_FragColor = diffuseSum / weightSum;\n\t\t}"},dS={createSampleWeights:function(e,t){let i=[];for(let r=0;r<=e;r++)i.push($5t(r,t));return i},createSampleOffsets:function(e,t){let i=[];for(let r=0;r<=e;r++)i.push(t.clone().multiplyScalar(r));return i},configure:function(e,t,i,r){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=dS.createSampleOffsets(t,r),e.uniforms.sampleWeights.value=dS.createSampleWeights(t,i),e.needsUpdate=!0}};function $5t(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)}var Y3={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\t#include <packing>\n\n\t\tvoid main() {\n\n\t\t\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );\n\t\t\tgl_FragColor = vec4( vec3( depth ), opacity );\n\n\t\t}"},fS=class extends cs{constructor(e,t,i=!1,r=!1,n=new ce(256,256)){let s;super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=i,this.supportsNormalTexture=r,this.originalClearColor=new Ve,this._oldClearColor=new Ve,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=new ce(n.x,n.y),this.saoRenderTarget=new Wr(this.resolution.x,this.resolution.y),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new Wr(this.resolution.x,this.resolution.y,{minFilter:Oi,magFilter:Oi}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension&&(s=new gf,s.type=kx,this.beautyRenderTarget.depthTexture=s,this.beautyRenderTarget.depthBuffer=!0),this.depthMaterial=new Up,this.depthMaterial.depthPacking=Qy,this.depthMaterial.blending=zi,this.normalMaterial=new Tf,this.normalMaterial.blending=zi,this.saoMaterial=new Zt({defines:Object.assign({},pS.defines),fragmentShader:pS.fragmentShader,vertexShader:pS.vertexShader,uniforms:dn.clone(pS.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=zi,this.vBlurMaterial=new Zt({uniforms:dn.clone(Id.uniforms),defines:Object.assign({},Id.defines),vertexShader:Id.vertexShader,fragmentShader:Id.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=zi,this.hBlurMaterial=new Zt({uniforms:dn.clone(Id.uniforms),defines:Object.assign({},Id.defines),vertexShader:Id.vertexShader,fragmentShader:Id.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=zi,this.materialCopy=new Zt({uniforms:dn.clone(va.uniforms),vertexShader:va.vertexShader,fragmentShader:va.fragmentShader,blending:zi}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=Yp,this.materialCopy.blendSrc=Zy,this.materialCopy.blendDst=If,this.materialCopy.blendEquation=Na,this.materialCopy.blendSrcAlpha=$y,this.materialCopy.blendDstAlpha=If,this.materialCopy.blendEquationAlpha=Na,this.depthCopy=new Zt({uniforms:dn.clone(Y3.uniforms),vertexShader:Y3.vertexShader,fragmentShader:Y3.fragmentShader,blending:zi}),this.fsQuad=new ga(null)}render(e,t,i){if(this.renderToScreen&&(this.materialCopy.blending=zi,this.materialCopy.uniforms.tDiffuse.value=i.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1===this.params.output)return;e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();let r=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;let n=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=n,this.hBlurMaterial.uniforms.depthCutoff.value=n,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),(this.prevStdDev!==this.params.saoBlurStdDev||this.prevNumSamples!==this.params.saoBlurRadius)&&(dS.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new ce(0,1)),dS.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new ce(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));let s=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,s=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?s.blending=Yp:s.blending=zi,this.renderPass(e,s,this.renderToScreen?null:i),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=r}renderPass(e,t,i,r,n){e.getClearColor(this.originalClearColor);let s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(i),e.autoClear=!1,null!=r&&(e.setClearColor(r),e.setClearAlpha(n||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderOverride(e,t,i,r,n){e.getClearColor(this.originalClearColor);let s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(i),e.autoClear=!1,r=t.clearColor||r,n=t.clearAlpha||n,null!=r&&(e.setClearColor(r),e.setClearAlpha(n||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}setSize(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}dispose(){this.saoRenderTarget.dispose(),this.blurIntermediateRenderTarget.dispose(),this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.depthRenderTarget.dispose(),this.depthMaterial.dispose(),this.normalMaterial.dispose(),this.saoMaterial.dispose(),this.vBlurMaterial.dispose(),this.hBlurMaterial.dispose(),this.materialCopy.dispose(),this.depthCopy.dispose(),this.fsQuad.dispose()}};fS.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4};var X3=class extends cs{constructor(e,t,i,r){super(),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==i?i:0,this.clearAlpha=void 0!==r?r:0,this._oldClearColor=new Ve;let n=va;this.copyUniforms=dn.clone(n.uniforms),this.copyMaterial=new Zt({uniforms:this.copyUniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blending:Yp,blendEquation:Na,blendDst:Xy,blendDstAlpha:Xy,blendSrc:Ux,blendSrcAlpha:Xy}),this.fsQuad=new ga(this.copyMaterial)}dispose(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null),this.copyMaterial.dispose(),this.fsQuad.dispose()}setSize(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)}render(e,t,i){this.sampleRenderTarget||(this.sampleRenderTarget=new Wr(i.width,i.height),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");let r=Z5t[Math.max(0,Math.min(this.sampleLevel,5))],n=e.autoClear;e.autoClear=!1,e.getClearColor(this._oldClearColor);let s=e.getClearAlpha(),a=1/r.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;let o={fullWidth:i.width,fullHeight:i.height,offsetX:0,offsetY:0,width:i.width,height:i.height},l=Object.assign({},this.camera.view);l.enabled&&Object.assign(o,l);for(let h=0;h<r.length;h++){let i=r[h];this.camera.setViewOffset&&this.camera.setViewOffset(o.fullWidth,o.fullHeight,o.offsetX+.0625*i[0],o.offsetY+.0625*i[1],o.width,o.height);let n=a;this.unbiased&&(n+=.03125*((h+.5)/r.length-.5)),this.copyUniforms.opacity.value=n,e.setClearColor(this.clearColor,this.clearAlpha),e.setRenderTarget(this.sampleRenderTarget),e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(this.renderToScreen?null:t),0===h&&(e.setClearColor(0,0),e.clear()),this.fsQuad.render(e)}this.camera.setViewOffset&&l.enabled?this.camera.setViewOffset(l.fullWidth,l.fullHeight,l.offsetX,l.offsetY,l.width,l.height):this.camera.clearViewOffset&&this.camera.clearViewOffset(),e.autoClear=n,e.setClearColor(this._oldClearColor,s)}},Z5t=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]],$3=class{constructor(e=Math){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.grad4=[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]],this.p=[];for(let t=0;t<256;t++)this.p[t]=Math.floor(256*e.random());this.perm=[];for(let t=0;t<512;t++)this.perm[t]=this.p[255&t];this.simplex=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]}dot(e,t,i){return e[0]*t+e[1]*i}dot3(e,t,i,r){return e[0]*t+e[1]*i+e[2]*r}dot4(e,t,i,r,n){return e[0]*t+e[1]*i+e[2]*r+e[3]*n}noise(e,t){let i,r,n,s,a,o=(e+t)*(.5*(Math.sqrt(3)-1)),l=Math.floor(e+o),h=Math.floor(t+o),u=(3-Math.sqrt(3))/6,c=(l+h)*u,p=e-(l-c),d=t-(h-c);p>d?(s=1,a=0):(s=0,a=1);let f=p-s+u,m=d-a+u,g=p-1+2*u,y=d-1+2*u,v=255&l,T=255&h,x=this.perm[v+this.perm[T]]%12,b=this.perm[v+s+this.perm[T+a]]%12,E=this.perm[v+1+this.perm[T+1]]%12,_=.5-p*p-d*d;_<0?i=0:(_*=_,i=_*_*this.dot(this.grad3[x],p,d));let w=.5-f*f-m*m;w<0?r=0:(w*=w,r=w*w*this.dot(this.grad3[b],f,m));let S=.5-g*g-y*y;return S<0?n=0:(S*=S,n=S*S*this.dot(this.grad3[E],g,y)),70*(i+r+n)}noise3d(e,t,i){let r,n,s,a,o,l,h,u,c,p,d=.3333333333333333*(e+t+i),f=Math.floor(e+d),m=Math.floor(t+d),g=Math.floor(i+d),y=1/6,v=(f+m+g)*y,T=e-(f-v),x=t-(m-v),b=i-(g-v);T>=x?x>=b?(o=1,l=0,h=0,u=1,c=1,p=0):T>=b?(o=1,l=0,h=0,u=1,c=0,p=1):(o=0,l=0,h=1,u=1,c=0,p=1):x<b?(o=0,l=0,h=1,u=0,c=1,p=1):T<b?(o=0,l=1,h=0,u=0,c=1,p=1):(o=0,l=1,h=0,u=1,c=1,p=0);let E=T-o+y,_=x-l+y,w=b-h+y,S=T-u+2*y,M=x-c+2*y,I=b-p+2*y,D=T-1+.5,A=x-1+.5,R=b-1+.5,C=255&f,O=255&m,P=255&g,N=this.perm[C+this.perm[O+this.perm[P]]]%12,L=this.perm[C+o+this.perm[O+l+this.perm[P+h]]]%12,F=this.perm[C+u+this.perm[O+c+this.perm[P+p]]]%12,U=this.perm[C+1+this.perm[O+1+this.perm[P+1]]]%12,k=.6-T*T-x*x-b*b;k<0?r=0:(k*=k,r=k*k*this.dot3(this.grad3[N],T,x,b));let B=.6-E*E-_*_-w*w;B<0?n=0:(B*=B,n=B*B*this.dot3(this.grad3[L],E,_,w));let z=.6-S*S-M*M-I*I;z<0?s=0:(z*=z,s=z*z*this.dot3(this.grad3[F],S,M,I));let G=.6-D*D-A*A-R*R;return G<0?a=0:(G*=G,a=G*G*this.dot3(this.grad3[U],D,A,R)),32*(r+n+s+a)}noise4d(e,t,i,r){let n,s,a,o,l,h=this.grad4,u=this.simplex,c=this.perm,p=(Math.sqrt(5)-1)/4,d=(5-Math.sqrt(5))/20,f=(e+t+i+r)*p,m=Math.floor(e+f),g=Math.floor(t+f),y=Math.floor(i+f),v=Math.floor(r+f),T=(m+g+y+v)*d,x=e-(m-T),b=t-(g-T),E=i-(y-T),_=r-(v-T),w=(x>b?32:0)+(x>E?16:0)+(b>E?8:0)+(x>_?4:0)+(b>_?2:0)+(E>_?1:0),S=u[w][0]>=3?1:0,M=u[w][1]>=3?1:0,I=u[w][2]>=3?1:0,D=u[w][3]>=3?1:0,A=u[w][0]>=2?1:0,R=u[w][1]>=2?1:0,C=u[w][2]>=2?1:0,O=u[w][3]>=2?1:0,P=u[w][0]>=1?1:0,N=u[w][1]>=1?1:0,L=u[w][2]>=1?1:0,F=u[w][3]>=1?1:0,U=x-S+d,k=b-M+d,B=E-I+d,z=_-D+d,G=x-A+2*d,H=b-R+2*d,V=E-C+2*d,j=_-O+2*d,W=x-P+3*d,Y=b-N+3*d,X=E-L+3*d,q=_-F+3*d,Z=x-1+4*d,J=b-1+4*d,K=E-1+4*d,$=_-1+4*d,Q=255&m,ee=255&g,te=255&y,ie=255&v,re=c[Q+c[ee+c[te+c[ie]]]]%32,ne=c[Q+S+c[ee+M+c[te+I+c[ie+D]]]]%32,se=c[Q+A+c[ee+R+c[te+C+c[ie+O]]]]%32,ae=c[Q+P+c[ee+N+c[te+L+c[ie+F]]]]%32,oe=c[Q+1+c[ee+1+c[te+1+c[ie+1]]]]%32,le=.6-x*x-b*b-E*E-_*_;le<0?n=0:(le*=le,n=le*le*this.dot4(h[re],x,b,E,_));let he=.6-U*U-k*k-B*B-z*z;he<0?s=0:(he*=he,s=he*he*this.dot4(h[ne],U,k,B,z));let ue=.6-G*G-H*H-V*V-j*j;ue<0?a=0:(ue*=ue,a=ue*ue*this.dot4(h[se],G,H,V,j));let ce=.6-W*W-Y*Y-X*X-q*q;ce<0?o=0:(ce*=ce,o=ce*ce*this.dot4(h[ae],W,Y,X,q));let pe=.6-Z*Z-J*J-K*K-$*$;return pe<0?l=0:(pe*=pe,l=pe*pe*this.dot4(h[oe],Z,J,K,$)),27*(n+s+a+o+l)}},mS={defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:32},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},kernel:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new ce},cameraProjectionMatrix:{value:new Be},cameraInverseProjectionMatrix:{value:new Be},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform sampler2D tNormal;\n\t\tuniform sampler2D tDepth;\n\t\tuniform sampler2D tNoise;\n\n\t\tuniform vec3 kernel[ KERNEL_SIZE ];\n\n\t\tuniform vec2 resolution;\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform mat4 cameraProjectionMatrix;\n\t\tuniform mat4 cameraInverseProjectionMatrix;\n\n\t\tuniform float kernelRadius;\n\t\tuniform float minDistance; // avoid artifacts caused by neighbour fragments with minimal depth difference\n\t\tuniform float maxDistance; // avoid the influence of fragments which are too far away\n\n\t\tvarying vec2 vUv;\n\n\t\t#include <packing>\n\n\t\tfloat getDepth( const in vec2 screenPosition ) {\n\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t}\n\n\t\tfloat getLinearDepth( const in vec2 screenPosition ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;\n\t\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t\t#endif\n\n\t\t}\n\n\t\tfloat getViewZ( const in float depth ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\n\t\t\t#endif\n\n\t\t}\n\n\t\tvec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n\n\t\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n\n\t\t\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );\n\n\t\t\tclipPosition *= clipW; // unprojection.\n\n\t\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;\n\n\t\t}\n\n\t\tvec3 getViewNormal( const in vec2 screenPosition ) {\n\n\t\t\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tfloat depth = getDepth( vUv );\n\t\t\tfloat viewZ = getViewZ( depth );\n\n\t\t\tvec3 viewPosition = getViewPosition( vUv, depth, viewZ );\n\t\t\tvec3 viewNormal = getViewNormal( vUv );\n\n\t\t\tvec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );\n\t\t\tvec3 random = vec3( texture2D( tNoise, vUv * noiseScale ).r );\n\n\t\t\t// compute matrix used to reorient a kernel vector\n\n\t\t\tvec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );\n\t\t\tvec3 bitangent = cross( viewNormal, tangent );\n\t\t\tmat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );\n\n\t\t float occlusion = 0.0;\n\n\t\t for ( int i = 0; i < KERNEL_SIZE; i ++ ) {\n\n\t\t\t\tvec3 sampleVector = kernelMatrix * kernel[ i ]; // reorient sample vector in view space\n\t\t\t\tvec3 samplePoint = viewPosition + ( sampleVector * kernelRadius ); // calculate sample point\n\n\t\t\t\tvec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 ); // project point and calculate NDC\n\t\t\t\tsamplePointNDC /= samplePointNDC.w;\n\n\t\t\t\tvec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5; // compute uv coordinates\n\n\t\t\t\tfloat realDepth = getLinearDepth( samplePointUv ); // get linear depth from depth texture\n\t\t\t\tfloat sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar ); // compute linear depth of the sample view Z value\n\t\t\t\tfloat delta = sampleDepth - realDepth;\n\n\t\t\t\tif ( delta > minDistance && delta < maxDistance ) { // if fragment is before sample point, increase occlusion\n\n\t\t\t\t\tocclusion += 1.0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tocclusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );\n\n\t\t\tgl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );\n\n\t\t}"},gS={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:"varying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"uniform sampler2D tDepth;\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\n\t\tvarying vec2 vUv;\n\n\t\t#include <packing>\n\n\t\tfloat getLinearDepth( const in vec2 screenPosition ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;\n\t\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t\t#endif\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tfloat depth = getLinearDepth( vUv );\n\t\t\tgl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );\n\n\t\t}"},vS={uniforms:{tDiffuse:{value:null},resolution:{value:new ce}},vertexShader:"varying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"uniform sampler2D tDiffuse;\n\n\t\tuniform vec2 resolution;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec2 texelSize = ( 1.0 / resolution );\n\t\t\tfloat result = 0.0;\n\n\t\t\tfor ( int i = - 2; i <= 2; i ++ ) {\n\n\t\t\t\tfor ( int j = - 2; j <= 2; j ++ ) {\n\n\t\t\t\t\tvec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;\n\t\t\t\t\tresult += texture2D( tDiffuse, vUv + offset ).r;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );\n\n\t\t}"},fc=class extends cs{constructor(e,t,i,r){super(),this.width=void 0!==i?i:512,this.height=void 0!==r?r:512,this.clear=!0,this.camera=t,this.scene=e,this.kernelRadius=8,this.kernelSize=32,this.kernel=[],this.noiseTexture=null,this.output=0,this.minDistance=.005,this.maxDistance=.1,this._visibilityCache=new Map,this.generateSampleKernel(),this.generateRandomKernelRotations();let n=new gf;n.format=Np,n.type=Ap,this.beautyRenderTarget=new Wr(this.width,this.height),this.normalRenderTarget=new Wr(this.width,this.height,{minFilter:Oi,magFilter:Oi,depthTexture:n}),this.ssaoRenderTarget=new Wr(this.width,this.height),this.blurRenderTarget=this.ssaoRenderTarget.clone(),this.ssaoMaterial=new Zt({defines:Object.assign({},mS.defines),uniforms:dn.clone(mS.uniforms),vertexShader:mS.vertexShader,fragmentShader:mS.fragmentShader,blending:zi}),this.ssaoMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssaoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssaoMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.ssaoMaterial.uniforms.tNoise.value=this.noiseTexture,this.ssaoMaterial.uniforms.kernel.value=this.kernel,this.ssaoMaterial.uniforms.cameraNear.value=this.camera.near,this.ssaoMaterial.uniforms.cameraFar.value=this.camera.far,this.ssaoMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.normalMaterial=new Tf,this.normalMaterial.blending=zi,this.blurMaterial=new Zt({defines:Object.assign({},vS.defines),uniforms:dn.clone(vS.uniforms),vertexShader:vS.vertexShader,fragmentShader:vS.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new Zt({defines:Object.assign({},gS.defines),uniforms:dn.clone(gS.uniforms),vertexShader:gS.vertexShader,fragmentShader:gS.fragmentShader,blending:zi}),this.depthRenderMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new Zt({uniforms:dn.clone(va.uniforms),vertexShader:va.vertexShader,fragmentShader:va.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:Zy,blendDst:If,blendEquation:Na,blendSrcAlpha:$y,blendDstAlpha:If,blendEquationAlpha:Na}),this.fsQuad=new ga(null),this.originalClearColor=new Ve}dispose(){this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.ssaoRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.normalMaterial.dispose(),this.blurMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}render(e,t){switch(!1===e.capabilities.isWebGL2&&(this.noiseTexture.format=xC),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.overrideVisibility(),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.restoreVisibility(),this.ssaoMaterial.uniforms.kernelRadius.value=this.kernelRadius,this.ssaoMaterial.uniforms.minDistance.value=this.minDistance,this.ssaoMaterial.uniforms.maxDistance.value=this.maxDistance,this.renderPass(e,this.ssaoMaterial,this.ssaoRenderTarget),this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.output){case fc.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=zi,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case fc.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=zi,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case fc.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=zi,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case fc.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case fc.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=zi,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case fc.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=zi,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=Yp,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSAOPass: Unknown output type.")}}renderPass(e,t,i,r,n){e.getClearColor(this.originalClearColor);let s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(i),e.autoClear=!1,null!=r&&(e.setClearColor(r),e.setClearAlpha(n||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderOverride(e,t,i,r,n){e.getClearColor(this.originalClearColor);let s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(i),e.autoClear=!1,r=t.clearColor||r,n=t.clearAlpha||n,null!=r&&(e.setClearColor(r),e.setClearAlpha(n||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}setSize(e,t){this.width=e,this.height=t,this.beautyRenderTarget.setSize(e,t),this.ssaoRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.ssaoMaterial.uniforms.resolution.value.set(e,t),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t)}generateSampleKernel(){let e=this.kernelSize,t=this.kernel;for(let i=0;i<e;i++){let r=new D;r.x=2*Math.random()-1,r.y=2*Math.random()-1,r.z=Math.random(),r.normalize();let n=i/e;n=fr.lerp(.1,1,n*n),r.multiplyScalar(n),t.push(r)}}generateRandomKernelRotations(){let e=new $3,t=new Float32Array(16);for(let i=0;i<16;i++){let r=2*Math.random()-1,n=2*Math.random()-1,s=0;t[i]=e.noise3d(r,n,s)}this.noiseTexture=new Pl(t,4,4,IC,La),this.noiseTexture.wrapS=yn,this.noiseTexture.wrapT=yn,this.noiseTexture.needsUpdate=!0}overrideVisibility(){let e=this.scene,t=this._visibilityCache;e.traverse((function(e){t.set(e,e.visible),(e.isPoints||e.isLine)&&(e.visible=!1)}))}restoreVisibility(){let e=this.scene,t=this._visibilityCache;e.traverse((function(e){let i=t.get(e);e.visible=i})),t.clear()}};fc.OUTPUT={Default:0,SSAO:1,Blur:2,Beauty:3,Depth:4,Normal:5};var yAe={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Ve(0)},defaultOpacity:{value:0}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec3 defaultColor;\n\t\tuniform float defaultOpacity;\n\t\tuniform float luminosityThreshold;\n\t\tuniform float smoothWidth;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\n\t\t\tvec3 luma = vec3( 0.299, 0.587, 0.114 );\n\n\t\t\tfloat v = dot( texel.xyz, luma );\n\n\t\t\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n\n\t\t\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n\n\t\t\tgl_FragColor = mix( outputColor, texel, alpha );\n\n\t\t}"},_d=class extends cs{constructor(e,t,i,r){super(),this.strength=void 0!==t?t:1,this.radius=i,this.threshold=r,this.resolution=void 0!==e?new ce(e.x,e.y):new ce(256,256),this.clearColor=new Ve(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let n=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);this.renderTargetBright=new Wr(n,s),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let h=0;h<this.nMips;h++){let e=new Wr(n,s);e.texture.name="UnrealBloomPass.h"+h,e.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(e);let t=new Wr(n,s);t.texture.name="UnrealBloomPass.v"+h,t.texture.generateMipmaps=!1,this.renderTargetsVertical.push(t),n=Math.round(n/2),s=Math.round(s/2)}let a=yAe;this.highPassUniforms=dn.clone(a.uniforms),this.highPassUniforms.luminosityThreshold.value=r,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new Zt({uniforms:this.highPassUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,defines:{}}),this.separableBlurMaterials=[];let o=[3,5,7,9,11];n=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);for(let h=0;h<this.nMips;h++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(o[h])),this.separableBlurMaterials[h].uniforms.texSize.value=new ce(n,s),n=Math.round(n/2),s=Math.round(s/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0,this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new D(1,1,1),new D(1,1,1),new D(1,1,1),new D(1,1,1),new D(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;let l=va;this.copyUniforms=dn.clone(l.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new Zt({uniforms:this.copyUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,blending:Op,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new Ve,this.oldClearAlpha=1,this.basic=new Xt,this.fsQuad=new ga(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.materialCopy.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(e,t){let i=Math.round(e/2),r=Math.round(t/2);this.renderTargetBright.setSize(i,r);for(let n=0;n<this.nMips;n++)this.renderTargetsHorizontal[n].setSize(i,r),this.renderTargetsVertical[n].setSize(i,r),this.separableBlurMaterials[n].uniforms.texSize.value=new ce(i,r),i=Math.round(i/2),r=Math.round(r/2)}render(e,t,i,r,n){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();let s=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),n&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=i.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=i.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let a=this.renderTargetBright;for(let o=0;o<this.nMips;o++)this.fsQuad.material=this.separableBlurMaterials[o],this.separableBlurMaterials[o].uniforms.colorTexture.value=a.texture,this.separableBlurMaterials[o].uniforms.direction.value=_d.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[o]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[o].uniforms.colorTexture.value=this.renderTargetsHorizontal[o].texture,this.separableBlurMaterials[o].uniforms.direction.value=_d.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[o]),e.clear(),this.fsQuad.render(e),a=this.renderTargetsVertical[o];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,n&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(i),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=s}getSeperableBlurMaterial(e){return new Zt({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new ce(.5,.5)},direction:{value:new ce(.5,.5)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})}getCompositeMaterial(e){return new Zt({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}"})}};_d.BlurDirectionX=new ce(1,0),_d.BlurDirectionY=new ce(0,1);var EAe={uniforms:{tDiffuse:{value:null},resolution:{value:new ce(1/1024,1/512)}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\tprecision highp float;\n\n\tuniform sampler2D tDiffuse;\n\n\tuniform vec2 resolution;\n\n\tvarying vec2 vUv;\n\n\t// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)\n\n\t//----------------------------------------------------------------------------------\n\t// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag\n\t// SDK Version: v3.00\n\t// Email: gameworks@nvidia.com\n\t// Site: http://developer.nvidia.com/\n\t//\n\t// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n\t//\n\t// Redistribution and use in source and binary forms, with or without\n\t// modification, are permitted provided that the following conditions\n\t// are met:\n\t// * Redistributions of source code must retain the above copyright\n\t// notice, this list of conditions and the following disclaimer.\n\t// * Redistributions in binary form must reproduce the above copyright\n\t// notice, this list of conditions and the following disclaimer in the\n\t// documentation and/or other materials provided with the distribution.\n\t// * Neither the name of NVIDIA CORPORATION nor the names of its\n\t// contributors may be used to endorse or promote products derived\n\t// from this software without specific prior written permission.\n\t//\n\t// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\n\t// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\t// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\t// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n\t// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n\t// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n\t// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n\t// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n\t// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t//\n\t//----------------------------------------------------------------------------------\n\n\t#ifndef FXAA_DISCARD\n\t\t\t//\n\t\t\t// Only valid for PC OpenGL currently.\n\t\t\t// Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n\t\t\t//\n\t\t\t// 1 = Use discard on pixels which don't need AA.\n\t\t\t// For APIs which enable concurrent TEX+ROP from same surface.\n\t\t\t// 0 = Return unchanged color on pixels which don't need AA.\n\t\t\t//\n\t\t\t#define FXAA_DISCARD 0\n\t#endif\n\n\t/*--------------------------------------------------------------------------*/\n\t#define FxaaTexTop(t, p) texture2D(t, p, -100.0)\n\t#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), -100.0)\n\t/*--------------------------------------------------------------------------*/\n\n\t#define NUM_SAMPLES 5\n\n\t// assumes colors have premultipliedAlpha, so that the calculated color contrast is scaled by alpha\n\tfloat contrast( vec4 a, vec4 b ) {\n\t\t\tvec4 diff = abs( a - b );\n\t\t\treturn max( max( max( diff.r, diff.g ), diff.b ), diff.a );\n\t}\n\n\t/*============================================================================\n\n\t\t\t\t\t\t\t\t\tFXAA3 QUALITY - PC\n\n\t============================================================================*/\n\n\t/*--------------------------------------------------------------------------*/\n\tvec4 FxaaPixelShader(\n\t\t\tvec2 posM,\n\t\t\tsampler2D tex,\n\t\t\tvec2 fxaaQualityRcpFrame,\n\t\t\tfloat fxaaQualityEdgeThreshold,\n\t\t\tfloat fxaaQualityinvEdgeThreshold\n\t) {\n\t\t\tvec4 rgbaM = FxaaTexTop(tex, posM);\n\t\t\tvec4 rgbaS = FxaaTexOff(tex, posM, vec2( 0.0, 1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaE = FxaaTexOff(tex, posM, vec2( 1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaN = FxaaTexOff(tex, posM, vec2( 0.0,-1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaW = FxaaTexOff(tex, posM, vec2(-1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\t// . S .\n\t\t\t// W M E\n\t\t\t// . N .\n\n\t\t\tbool earlyExit = max( max( max(\n\t\t\t\t\tcontrast( rgbaM, rgbaN ),\n\t\t\t\t\tcontrast( rgbaM, rgbaS ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaE ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaW ) )\n\t\t\t\t\t< fxaaQualityEdgeThreshold;\n\t\t\t// . 0 .\n\t\t\t// 0 0 0\n\t\t\t// . 0 .\n\n\t\t\t#if (FXAA_DISCARD == 1)\n\t\t\t\t\tif(earlyExit) FxaaDiscard;\n\t\t\t#else\n\t\t\t\t\tif(earlyExit) return rgbaM;\n\t\t\t#endif\n\n\t\t\tfloat contrastN = contrast( rgbaM, rgbaN );\n\t\t\tfloat contrastS = contrast( rgbaM, rgbaS );\n\t\t\tfloat contrastE = contrast( rgbaM, rgbaE );\n\t\t\tfloat contrastW = contrast( rgbaM, rgbaW );\n\n\t\t\tfloat relativeVContrast = ( contrastN + contrastS ) - ( contrastE + contrastW );\n\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\tbool horzSpan = relativeVContrast > 0.;\n\t\t\t// . 1 .\n\t\t\t// 0 0 0\n\t\t\t// . 1 .\n\n\t\t\t// 45 deg edge detection and corners of objects, aka V/H contrast is too similar\n\t\t\tif( abs( relativeVContrast ) < .3 ) {\n\t\t\t\t\t// locate the edge\n\t\t\t\t\tvec2 dirToEdge;\n\t\t\t\t\tdirToEdge.x = contrastE > contrastW ? 1. : -1.;\n\t\t\t\t\tdirToEdge.y = contrastS > contrastN ? 1. : -1.;\n\t\t\t\t\t// . 2 . . 1 .\n\t\t\t\t\t// 1 0 2 ~= 0 0 1\n\t\t\t\t\t// . 1 . . 0 .\n\n\t\t\t\t\t// tap 2 pixels and see which ones are \"outside\" the edge, to\n\t\t\t\t\t// determine if the edge is vertical or horizontal\n\n\t\t\t\t\tvec4 rgbaAlongH = FxaaTexOff(tex, posM, vec2( dirToEdge.x, -dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongH = contrast( rgbaM, rgbaAlongH );\n\t\t\t\t\t// . 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 H\n\n\t\t\t\t\tvec4 rgbaAlongV = FxaaTexOff(tex, posM, vec2( -dirToEdge.x, dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongV = contrast( rgbaM, rgbaAlongV );\n\t\t\t\t\t// V 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 .\n\n\t\t\t\t\trelativeVContrast = matchAlongV - matchAlongH;\n\t\t\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\t\t\tif( abs( relativeVContrast ) < .3 ) { // 45 deg edge\n\t\t\t\t\t\t\t// 1 1 .\n\t\t\t\t\t\t\t// 0 0 1\n\t\t\t\t\t\t\t// . 0 1\n\n\t\t\t\t\t\t\t// do a simple blur\n\t\t\t\t\t\t\treturn mix(\n\t\t\t\t\t\t\t\t\trgbaM,\n\t\t\t\t\t\t\t\t\t(rgbaN + rgbaS + rgbaE + rgbaW) * .25,\n\t\t\t\t\t\t\t\t\t.4\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\thorzSpan = relativeVContrast > 0.;\n\t\t\t}\n\n\t\t\tif(!horzSpan) rgbaN = rgbaW;\n\t\t\tif(!horzSpan) rgbaS = rgbaE;\n\t\t\t// . 0 . 1\n\t\t\t// 1 0 1 -> 0\n\t\t\t// . 0 . 1\n\n\t\t\tbool pairN = contrast( rgbaM, rgbaN ) > contrast( rgbaM, rgbaS );\n\t\t\tif(!pairN) rgbaN = rgbaS;\n\n\t\t\tvec2 offNP;\n\t\t\toffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n\t\t\toffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n\n\t\t\tbool doneN = false;\n\t\t\tbool doneP = false;\n\n\t\t\tfloat nDist = 0.;\n\t\t\tfloat pDist = 0.;\n\n\t\t\tvec2 posN = posM;\n\t\t\tvec2 posP = posM;\n\n\t\t\tint iterationsUsed = 0;\n\t\t\tint iterationsUsedN = 0;\n\t\t\tint iterationsUsedP = 0;\n\t\t\tfor( int i = 0; i < NUM_SAMPLES; i++ ) {\n\t\t\t\t\titerationsUsed = i;\n\n\t\t\t\t\tfloat increment = float(i + 1);\n\n\t\t\t\t\tif(!doneN) {\n\t\t\t\t\t\t\tnDist += increment;\n\t\t\t\t\t\t\tposN = posM + offNP * nDist;\n\t\t\t\t\t\t\tvec4 rgbaEndN = FxaaTexTop(tex, posN.xy);\n\t\t\t\t\t\t\tdoneN = contrast( rgbaEndN, rgbaM ) > contrast( rgbaEndN, rgbaN );\n\t\t\t\t\t\t\titerationsUsedN = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!doneP) {\n\t\t\t\t\t\t\tpDist += increment;\n\t\t\t\t\t\t\tposP = posM - offNP * pDist;\n\t\t\t\t\t\t\tvec4 rgbaEndP = FxaaTexTop(tex, posP.xy);\n\t\t\t\t\t\t\tdoneP = contrast( rgbaEndP, rgbaM ) > contrast( rgbaEndP, rgbaN );\n\t\t\t\t\t\t\titerationsUsedP = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(doneN || doneP) break;\n\t\t\t}\n\n\n\t\t\tif ( !doneP && !doneN ) return rgbaM; // failed to find end of edge\n\n\t\t\tfloat dist = min(\n\t\t\t\t\tdoneN ? float( iterationsUsedN ) / float( NUM_SAMPLES - 1 ) : 1.,\n\t\t\t\t\tdoneP ? float( iterationsUsedP ) / float( NUM_SAMPLES - 1 ) : 1.\n\t\t\t);\n\n\t\t\t// hacky way of reduces blurriness of mostly diagonal edges\n\t\t\t// but reduces AA quality\n\t\t\tdist = pow(dist, .5);\n\n\t\t\tdist = 1. - dist;\n\n\t\t\treturn mix(\n\t\t\t\t\trgbaM,\n\t\t\t\t\trgbaN,\n\t\t\t\t\tdist * .5\n\t\t\t);\n\t}\n\n\tvoid main() {\n\t\t\tconst float edgeDetectionQuality = .2;\n\t\t\tconst float invEdgeDetectionQuality = 1. / edgeDetectionQuality;\n\n\t\t\tgl_FragColor = FxaaPixelShader(\n\t\t\t\t\tvUv,\n\t\t\t\t\ttDiffuse,\n\t\t\t\t\tresolution,\n\t\t\t\t\tedgeDetectionQuality, // [0,1] contrast needed, otherwise early discard\n\t\t\t\t\tinvEdgeDetectionQuality\n\t\t\t);\n\n\t}\n\t"},SV=ps(Zc(),1),K5t="bottomBar",J5t={"gemini-viewer-threejs-stats":{icon:{default:"icon-showsectionplane",iconFont:"gemini-viewer-icon"},mutexIds:["gemini-viewer-threejs-statistics","gemini-viewer-threejs-cameraInfo","gemini-viewer-threejs-tips"],onActive:e=>{e.viewer.showStats()},onDeactive:e=>{e.viewer.hideStats()}},"gemini-viewer-threejs-statistics":{icon:{default:"icon-info",active:"icon-info-filled",iconFont:"gemini-viewer-icon"},mutexIds:["gemini-viewer-threejs-stats","gemini-viewer-threejs-cameraInfo","gemini-viewer-threejs-tips"],onActive:e=>{let t=document.createElement("span");if(!e.viewer.scene)return void(t.textContent="Failed!");t.textContent="Comupting...";let i={components:{},points:0,faces:0,materials:{},lights:{}},r=["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"];e.viewer.scene.traverse((e=>{(e instanceof Je||e instanceof Sr||e instanceof Bi)&&!r.includes(e.name)?((e,t)=>{if(t.components[e.type]?t.components[e.type]++:t.components[e.type]=1,e.geometry){let i=e.geometry;if(e instanceof Je)if(i.index&&i.index.count){let r=Math.round(i.index.count/3);e instanceof sn&&(r*=e.count),t.faces+=r}else if(i.groups.length>0)for(let e=0;e<i.groups.length;++e)t.faces+=i.groups[e].count/3;if(i.attributes.position){let e=i.attributes.position;e.count&&e.itemSize&&(t.points+=e.count)}}let i=e=>{t.materials[e]?t.materials[e]++:t.materials[e]=1},r=e.material;r instanceof qr?i(r.id):Array.isArray(r)&&r.forEach((e=>i(e.id)))})(e,i):e instanceof kl&&(i.lights[e.type]?i.lights[e.type]++:i.lights[e.type]=1)}));let n=(e,i)=>{t.innerHTML+=`<p><span>${e}:</span>${i}</p>`};t.innerHTML="";let s=` (${(e=>{var t;let i=null==(t=e.renderer)?void 0:t.domElement;return null==i?void 0:i.dataset.engine})(e.viewer)})`;n("Version",`${JI}${s}`),n("Components",JSON.stringify(i.components)),n("Points",i.points),n("Faces",i.faces),n("Materials",Object.keys(i.materials).length),n("Lights",JSON.stringify(i.lights)),"DxfViewer"===e.viewer.name&&n("Entities",e.viewer.getEntitiesCount()),e.tooltip.setContent(t),e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()},onUpdate:e=>{let t=e.viewer.renderer,i=document.createElement("span"),r=(e,t)=>{i.innerHTML+=`<p><span>${e}:</span>${t}</p>`};i.innerHTML="<p>-- Renderer Info --</p>";let n=null==t?void 0:t.info;r("Drawcalls",JSON.stringify(null==n?void 0:n.render.calls)),r("Points",JSON.stringify(null==n?void 0:n.render.points)),r("Lines",JSON.stringify(null==n?void 0:n.render.lines)),r("Triangles",JSON.stringify(null==n?void 0:n.render.triangles)),r("Geometries",JSON.stringify(null==n?void 0:n.memory.geometries)),r("Textures",JSON.stringify(null==n?void 0:n.memory.textures)),e.tooltip.updateChildContent(i)}},"gemini-viewer-threejs-cameraInfo":{icon:{default:"icon-view",active:"icon-view-filled",iconFont:"gemini-viewer-icon"},mutexIds:["gemini-viewer-threejs-stats","gemini-viewer-threejs-statistics","gemini-viewer-threejs-tips"],onActive:e=>{let t=()=>{if(!e.viewer||!e.viewer.camera||!e.viewer.controls)return;let i=e.viewer.camera,r=e.viewer.controls,n=e=>Tt.numberToString(e),s=e=>Tt.vectorToString(e),a=i.position,o=r instanceof Io?r.getTarget(new D):r.target;if(a){let t=document.createElement("span");t.innerHTML=`\n <p><span>Camera position:</span>${s(a)}</p>\n <p><span>Camera target:</span>${s(o)}</p>`,i instanceof Ni&&(t.innerHTML+=`\n <p>top: ${n(i.top)}, bottom: ${n(i.bottom)}, left: ${n(i.left)}, right: ${n(i.right)}</p>\n <p>zoom: ${n(i.zoom)}</p>`),e.tooltip.setContent(t)}e.active||window.removeEventListener("mouseup",t)};if(t(),window.addEventListener("mouseup",t),"BimViewer"===e.viewer.name){let i=e.viewer.controls;null==i||i.addEventListener("update",t)}else e.viewer.controls.addEventListener("change",t);e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()}},"gemini-viewer-threejs-tips":{icon:{default:"icon-more",iconFont:"gemini-viewer-icon"},mutexIds:["gemini-viewer-threejs-stats","gemini-viewer-threejs-cameraInfo","gemini-viewer-threejs-cameraInfo"],onActive:e=>{let t=document.createElement("span");"BimViewer"===e.viewer.name?t.innerHTML="\n <p><span>W: </span>Move forward</p>\n <p><span>A: </span>Move backward</p>\n <p><span>S: </span>Move left</p>\n <p><span>D: </span>Move right</p>\n <p><span>Q: </span>Rise up</p>\n <p><span>E: </span>Lower down</p>\n <p><span>\u2191: </span>Rotate up</p>\n <p><span>\u2193: </span>Rotate down</p>\n <p><span>\u2190: </span>Rotate to left</p>\n <p><span>\u2192: </span>Rotate to right</p>\n ":"DxfViewer"===e.viewer.name?t.innerHTML="\n <p><span>\u2191: </span>Move up</p>\n <p><span>\u2193: </span>Move down</p>\n <p><span>\u2190: </span>Move to left</p>\n <p><span>\u2192: </span>Move to right</p>\n ":"VRViewer"===e.viewer.name?t.innerHTML="\n <p><span>\u2191: </span>Rotate up</p>\n <p><span>\u2193: </span>Rotate down</p>\n <p><span>\u2190: </span>Rotate to left</p>\n <p><span>\u2192: </span>Rotate to right</p>\n ":t.innerHTML="\n <p>Nothing to show</p>\n ",e.tooltip.setContent(t),e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()}}},fm=class{constructor(e){this.viewer=e,this.itemList=new Map,this.init()}update(){this.itemList.forEach((e=>{e.update()}))}init(){var e;let t=document.createElement("div");t.id=K5t,t.classList.add("bottom-bar"),(0,SV.forEach)(J5t,((e,i)=>{let r=this.createItem(this.viewer,i,e);t.appendChild(r.element)})),this.element=t,null==(e=this.viewer.widgetContainer)||e.appendChild(this.element)}createItem(e,t,i){let r=new _V(e,this,t,i);return this.itemList.set(t,r),r}},_V=class{constructor(e,t,i,r){this.viewer=e,this.bottomBar=t,this.menuId=i,this.cfg=r,this.eventBus=xT(),this.active=!1,this.itemconfig=r,this.element=this.createButton(this.menuId,r),this.tooltip=new Dh(i+"-tooltip",null,{parentNode:e.widgetContainer}),this.eventBus.on("activeChange",(e=>{e?(this.element.classList.add("active"),(0,SV.forEach)(r.mutexIds,(e=>{var t;let i=null==(t=this.bottomBar)?void 0:t.itemList.get(e);i&&i.active&&i.setActive(!1)})),r.onActive&&r.onActive(this)):(this.element.classList.remove("active"),r.onDeactive&&r.onDeactive(this)),this.element instanceof HTMLElement&&JC(this.element.classList,r.icon,this.active)}))}createButton(e,t){let i=document.createElement("i");i.id=e;let{default:r="icon-new",iconFont:n=EE}=t.icon;return i.classList.add("icon"),i.classList.add(n),i.classList.add(r),i.onclick=()=>{this.active=!this.active,t.onClick&&t.onClick(this),this.eventBus.emit("activeChange",this.active)},i}setActive(e){this.active=e,this.eventBus.emit("activeChange",this.active)}update(){this.active&&this.itemconfig.onUpdate&&this.itemconfig.onUpdate(this)}},yS=ps(Zc(),1),Q5t="gemini-context-menu",Z3=class{constructor(e){this.itemList=[],this.id=e.id||Q5t,this.container=e.container||document.body,this.context=e.context||{},this.element=this.createMenuUI(e.items||[]),this.handleClick=()=>{this.hide()},!1!==e.hideOnMouseDown&&document.addEventListener("click",this.handleClick),this.hide()}isEnable(e){return e.getEnabled?e.getEnabled(this.context):void 0===e.enabled||e.enabled}isShown(e){return e.getShown?e.getShown(this.context):void 0===e.shown||e.shown}getTitle(e){return e.title||e.getTitle&&e.getTitle(this.context)||""}createMenuUI(e){let t=document.createElement("div");t.id=this.id,t.classList.add("context-menu");let i=this.createMenuGroup(e);return t.append(...i),this.container.appendChild(t),t}createMenuGroup(e){return(0,yS.map)(e,(e=>{let t=document.createElement("ul");return(0,yS.forEach)(e,(e=>{let i=this.createMenuItem(e);t.append(i)})),t}))}createMenuItem(e){let t=document.createElement("li");return t.innerHTML=this.getTitle(e),t.onclick=()=>e.doAction&&e.doAction(this.context),this.isEnable(e)?t.classList.remove("disabled"):t.classList.add("disabled"),this.isShown(e)?t.removeAttribute("hidden"):t.setAttribute("hidden",""),this.itemList.push([e,t]),t}updateMenuItems(){(0,yS.forEach)(this.itemList,(([e,t])=>{this.isEnable(e)?t.classList.remove("disabled"):t.classList.add("disabled"),this.isShown(e)?t.removeAttribute("hidden"):t.setAttribute("hidden",""),t.innerHTML=this.getTitle(e)}))}showMenuElement(e,t){let i=this.element.offsetHeight,r=this.element.offsetWidth;t+i>window.innerHeight&&(t=window.innerHeight-i-5),e+r>window.innerWidth&&(e=window.innerWidth-r-5),this.element.style.left=e+"px",this.element.style.top=t+"px"}show(e,t){this.updateMenuItems(),this.element.removeAttribute("hidden"),this.showMenuElement(e,t)}hide(){this.element.setAttribute("hidden","")}destroy(){document.removeEventListener("click",this.handleClick),this.container.removeChild(this.element)}},Co=e=>({bimViewer:t})=>t.translate(`ContextMenu.${e}`),bAe=e=>{var t;let i=0;return null==(t=e.scene)||t.traverseVisible((e=>{e instanceof Je&&i++})),i>0},e6t=e=>{var t,i;let r=0;return null==(t=e.scene)||t.traverse((e=>{e instanceof Je&&r++})),null==(i=e.scene)||i.traverseVisible((e=>{e instanceof Je&&r--})),r>0},wV=e=>e.hasTransparentObject(),K3=e=>!1!==e.userData.selectable,TAe=(e,t,i,r)=>{let n=e.selectedObject;return!(!n||!t||n.id!==t.id)&&(null!=i&&n.isInstancedMesh?i===n.userData.instanceId:null==r||!Zi.isMergedMesh(n)||r===n.userData.batchId)},t6t={getTitle:Co("viewFitEntity"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.flyToObject(t)}},r6t={getTitle:Co("viewFitAll"),getEnabled:({bimViewer:e})=>bAe(e),doAction:({bimViewer:e})=>e.viewFitAll()},i6t={getTitle:Co("hideEntity"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{K3(t)&&(t.visible=!1,e.enableRender())}},n6t={getTitle:Co("hideOthers"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{var i;null==(i=e.scene)||i.traverse((e=>{e instanceof Je&&K3(e)&&(e.visible=!1)})),t.visible=!0,e.enableRender()}},s6t={getTitle:Co("hideAll"),getEnabled:({bimViewer:e})=>bAe(e),doAction:({bimViewer:e})=>{var t;null==(t=e.scene)||t.traverse((e=>{e instanceof Je&&K3(e)&&(e.visible=!1)})),e.enableRender()}},a6t={getTitle:Co("showAll"),getEnabled:({bimViewer:e})=>e6t(e),doAction:({bimViewer:e})=>{var t;null==(t=e.scene)||t.traverse((e=>{e instanceof Je&&K3(e)&&(e.visible=!0)})),e.enableRender()}},o6t={getTitle:({hit:e,bimViewer:t,instanceId:i,batchId:r})=>TAe(t,e,i,r)?Co("deselect")({bimViewer:t}):Co("select")({bimViewer:t}),getShown:({hit:e})=>e,doAction:({hit:e,bimViewer:t,instanceId:i,batchId:r})=>{!1!==e.userData.selectable?TAe(t,e,i,r)?t.clearSelection():t.selectObject(e,e.instanceId,r):re.debug(`[ContextMenu] object(type: ${e.type}, name: ${e.name}) not selectable!`)}},l6t={getTitle:Co("selectNone"),getEnabled:({bimViewer:e})=>e.selectedObject,doAction:({bimViewer:e})=>e.clearSelection()},c6t={getTitle:Co("xRayAll"),getShown:({bimViewer:e})=>!wV(e),doAction:({bimViewer:e})=>{e.addOrRemoveObjectOpacity(!0),e.enableRender()}},u6t={getTitle:Co("xRayNone"),getEnabled:({bimViewer:e})=>wV(e),doAction:({bimViewer:e})=>{wV(e)&&(e.addOrRemoveObjectOpacity(!1),e.enableRender())}},h6t={getTitle:Co("xRayEntity"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.addOrRemoveObjectOpacity(!0,void 0,[t.id],void 0)}},p6t={getTitle:Co("xRayOthers"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.addOrRemoveObjectOpacity(!0,.1,void 0,[t.id]),e.enableRender()}},d6t={getTitle:({bimViewer:e})=>{let t="";switch(e.sectionType){case"PickPlaneSection":t="*showSectionPlane";break;case"AxisPlaneSection":t="showAxisSection";break;case"ObjectsBoxSection":t="*showSectionBox"}return e.translate(`ContextMenu.${t}`)},getShown:({bimViewer:e,section:t})=>("PickPlaneSection"===e.sectionType||"AxisPlaneSection"===e.sectionType)&&!!t&&!t.isShowSectionPlane,doAction:({bimViewer:e,section:t})=>{("PickPlaneSection"===e.sectionType||"AxisPlaneSection"===e.sectionType)&&(null==t||t.setSectionVisible(!0))}},f6t={getTitle:({bimViewer:e})=>{let t="";switch(e.sectionType){case"PickPlaneSection":t="hideSectionPlane";break;case"AxisPlaneSection":t="hideAxisSection";break;case"ObjectsBoxSection":t="hideSectionBox"}return e.translate(`ContextMenu.${t}`)},getShown:e=>xAe(e),doAction:({bimViewer:e,section:t})=>{("PickPlaneSection"===e.sectionType||"AxisPlaneSection"===e.sectionType)&&(null==t||t.setSectionVisible(!1))}},m6t={getTitle:Co("undoSection"),getShown:e=>xAe(e),doAction:({bimViewer:e,toolbar:t})=>{if("PickPlaneSection"===e.sectionType){let e=null==t?void 0:t.menuList.get("SectionPlane");null==e||e.setActive(!1)}else if("AxisPlaneSection"===e.sectionType){let e=null==t?void 0:t.menuList.get("SectionAxis");null==e||e.setActive(!1)}else if("ObjectsBoxSection"===e.sectionType){let e=null==t?void 0:t.menuList.get("SectionBox");null==e||e.setActive(!1)}}},xAe=({bimViewer:e,hit:t,section:i})=>("PickPlaneSection"===e.sectionType||"AxisPlaneSection"===e.sectionType)&&!!i&&i.isShowSectionPlane&&(null==t?void 0:t.name)===vk,IAe=[[d6t],[f6t,m6t],[t6t,r6t],[i6t,n6t,s6t,a6t],[h6t,p6t,c6t,u6t],[o6t,l6t]];function g6t(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}function FT(e,t){var i=e.__state.conversionName.toString(),r=Math.round(e.r),n=Math.round(e.g),s=Math.round(e.b),a=e.a,o=Math.round(e.h),l=e.s.toFixed(1),h=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===i||"SIX_CHAR_HEX"===i){for(var u=e.hex.toString(16);u.length<6;)u="0"+u;return"#"+u}return"CSS_RGB"===i?"rgb("+r+","+n+","+s+")":"CSS_RGBA"===i?"rgba("+r+","+n+","+s+","+a+")":"HEX"===i?"0x"+e.hex.toString(16):"RGB_ARRAY"===i?"["+r+","+n+","+s+"]":"RGBA_ARRAY"===i?"["+r+","+n+","+s+","+a+"]":"RGB_OBJ"===i?"{r:"+r+",g:"+n+",b:"+s+"}":"RGBA_OBJ"===i?"{r:"+r+",g:"+n+",b:"+s+",a:"+a+"}":"HSV_OBJ"===i?"{h:"+o+",s:"+l+",v:"+h+"}":"HSVA_OBJ"===i?"{h:"+o+",s:"+l+",v:"+h+",a:"+a+"}":"unknown format"}var _Ae=Array.prototype.forEach,ES=Array.prototype.slice,gt={BREAK:{},extend:function(e){return this.each(ES.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(i){this.isUndefined(t[i])||(e[i]=t[i])}.bind(this))}),this),e},defaults:function(e){return this.each(ES.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(i){this.isUndefined(e[i])&&(e[i]=t[i])}.bind(this))}),this),e},compose:function(){var e=ES.call(arguments);return function(){for(var t=ES.call(arguments),i=e.length-1;i>=0;i--)t=[e[i].apply(this,t)];return t[0]}},each:function(e,t,i){if(e)if(_Ae&&e.forEach&&e.forEach===_Ae)e.forEach(t,i);else if(e.length===e.length+0){var r,n=void 0;for(n=0,r=e.length;n<r;n++)if(n in e&&t.call(i,e[n],n)===this.BREAK)return}else for(var s in e)if(t.call(i,e[s],s)===this.BREAK)return},defer:function(e){setTimeout(e,0)},debounce:function(e,t,i){var r=void 0;return function(){var n=this,s=arguments,a=i||!r;clearTimeout(r),r=setTimeout((function(){r=null,i||e.apply(n,s)}),t),a&&e.apply(n,s)}},toArray:function(e){return e.toArray?e.toArray():ES.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return isNaN(e)})),isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return!1===e||!0===e},isFunction:function(e){return e instanceof Function}},v6t=[{litmus:gt.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:FT},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:FT},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:FT},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:FT}}},{litmus:gt.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:gt.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:gt.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(gt.isNumber(e.r)&>.isNumber(e.g)&>.isNumber(e.b)&>.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(gt.isNumber(e.r)&>.isNumber(e.g)&>.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(gt.isNumber(e.h)&>.isNumber(e.s)&>.isNumber(e.v)&>.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(gt.isNumber(e.h)&>.isNumber(e.s)&>.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],TS=void 0,J3=void 0,MV=function(){J3=!1;var e=arguments.length>1?gt.toArray(arguments):arguments[0];return gt.each(v6t,(function(t){if(t.litmus(e))return gt.each(t.conversions,(function(t,i){if(TS=t.read(e),!1===J3&&!1!==TS)return J3=TS,TS.conversionName=i,TS.conversion=t,gt.BREAK})),gt.BREAK})),J3},SAe=void 0,eP={hsv_to_rgb:function(e,t,i){var r=Math.floor(e/60)%6,n=e/60-Math.floor(e/60),s=i*(1-t),a=i*(1-n*t),o=i*(1-(1-n)*t),l=[[i,o,s],[a,i,s],[s,i,o],[s,a,i],[o,s,i],[i,s,a]][r];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,i){var r=Math.min(e,t,i),n=Math.max(e,t,i),s=n-r,a=void 0;return 0===n?{h:NaN,s:0,v:0}:(a=e===n?(t-i)/s:t===n?2+(i-e)/s:4+(e-t)/s,(a/=6)<0&&(a+=1),{h:360*a,s:s/n,v:n/255})},rgb_to_hex:function(e,t,i){var r=this.hex_with_component(0,2,e);return r=this.hex_with_component(r,1,t),this.hex_with_component(r,0,i)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,i){return i<<(SAe=8*t)|e&~(255<<SAe)}},y6t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Tu=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),mm=function e(t,i,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,i);if(void 0===n){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,i,r)}if("value"in n)return n.value;var a=n.get;return void 0===a?void 0:a.call(r)},gm=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},vm=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Bs=function(){function e(){if(Eu(this,e),this.__state=MV.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return Tu(e,[{key:"toString",value:function(){return FT(this)}},{key:"toHexString",value:function(){return FT(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),e}();function NV(e,t,i){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space||Bs.recalculateRGB(this,t,i),this.__state[t]},set:function(e){"RGB"!==this.__state.space&&(Bs.recalculateRGB(this,t,i),this.__state.space="RGB"),this.__state[t]=e}})}function LV(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space||Bs.recalculateHSV(this),this.__state[t]},set:function(e){"HSV"!==this.__state.space&&(Bs.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}Bs.recalculateRGB=function(e,t,i){if("HEX"===e.__state.space)e.__state[t]=eP.component_from_hex(e.__state.hex,i);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");gt.extend(e.__state,eP.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},Bs.recalculateHSV=function(e){var t=eP.rgb_to_hsv(e.r,e.g,e.b);gt.extend(e.__state,{s:t.s,v:t.v}),gt.isNaN(t.h)?gt.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},Bs.COMPONENTS=["r","g","b","h","s","v","hex","a"],NV(Bs.prototype,"r",2),NV(Bs.prototype,"g",1),NV(Bs.prototype,"b",0),LV(Bs.prototype,"h"),LV(Bs.prototype,"s"),LV(Bs.prototype,"v"),Object.defineProperty(Bs.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(Bs.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=eP.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}});var z0=function(){function e(t,i){Eu(this,e),this.initialValue=t[i],this.domElement=document.createElement("div"),this.object=t,this.property=i,this.__onChange=void 0,this.__onFinishChange=void 0}return Tu(e,[{key:"onChange",value:function(e){return this.__onChange=e,this}},{key:"onFinishChange",value:function(e){return this.__onFinishChange=e,this}},{key:"setValue",value:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),e}(),E6t={HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},LAe={};gt.each(E6t,(function(e,t){gt.each(e,(function(e){LAe[e]=t}))}));var T6t=/(\d+(\.\d+)?)px/;function Uh(e){if("0"===e||gt.isUndefined(e))return 0;var t=e.match(T6t);return gt.isNull(t)?0:parseFloat(t[1])}var Ye={makeSelectable:function(e,t){void 0===e||void 0===e.style||(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,i){var r=i,n=t;gt.isUndefined(n)&&(n=!0),gt.isUndefined(r)&&(r=!0),e.style.position="absolute",n&&(e.style.left=0,e.style.right=0),r&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,i,r){var n=i||{},s=LAe[t];if(!s)throw new Error("Event type "+t+" not supported.");var a=document.createEvent(s);switch(s){case"MouseEvents":var o=n.x||n.clientX||0,l=n.y||n.clientY||0;a.initMouseEvent(t,n.bubbles||!1,n.cancelable||!0,window,n.clickCount||1,0,0,o,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var h=a.initKeyboardEvent||a.initKeyEvent;gt.defaults(n,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),h(t,n.bubbles||!1,n.cancelable,window,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.keyCode,n.charCode);break;default:a.initEvent(t,n.bubbles||!1,n.cancelable||!0)}gt.defaults(a,r),e.dispatchEvent(a)},bind:function(e,t,i,r){var n=r||!1;return e.addEventListener?e.addEventListener(t,i,n):e.attachEvent&&e.attachEvent("on"+t,i),Ye},unbind:function(e,t,i,r){var n=r||!1;return e.removeEventListener?e.removeEventListener(t,i,n):e.detachEvent&&e.detachEvent("on"+t,i),Ye},addClass:function(e,t){if(void 0===e.className)e.className=t;else if(e.className!==t){var i=e.className.split(/ +/);-1===i.indexOf(t)&&(i.push(t),e.className=i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return Ye},removeClass:function(e,t){if(t)if(e.className===t)e.removeAttribute("class");else{var i=e.className.split(/ +/),r=i.indexOf(t);-1!==r&&(i.splice(r,1),e.className=i.join(" "))}else e.className=void 0;return Ye},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return Uh(t["border-left-width"])+Uh(t["border-right-width"])+Uh(t["padding-left"])+Uh(t["padding-right"])+Uh(t.width)},getHeight:function(e){var t=getComputedStyle(e);return Uh(t["border-top-width"])+Uh(t["border-bottom-width"])+Uh(t["padding-top"])+Uh(t["padding-bottom"])+Uh(t.height)},getOffset:function(e){var t=e,i={left:0,top:0};if(t.offsetParent)do{i.left+=t.offsetLeft,i.top+=t.offsetTop,t=t.offsetParent}while(t);return i},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}},FAe=function(e){function t(e,i){Eu(this,t);var r=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),n=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),Ye.bind(r.__checkbox,"change",(function(){n.setValue(!n.__prev)}),!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return gm(t,z0),Tu(t,[{key:"setValue",value:function(e){var i=mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),i}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(),b6t=function(e){function t(e,i,r){Eu(this,t);var n=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=r,a=n;if(n.__select=document.createElement("select"),gt.isArray(s)){var o={};gt.each(s,(function(e){o[e]=e})),s=o}return gt.each(s,(function(e,t){var i=document.createElement("option");i.innerHTML=t,i.setAttribute("value",e),a.__select.appendChild(i)})),n.updateDisplay(),Ye.bind(n.__select,"change",(function(){var e=this.options[this.selectedIndex].value;a.setValue(e)})),n.domElement.appendChild(n.__select),n}return gm(t,z0),Tu(t,[{key:"setValue",value:function(e){var i=mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),i}},{key:"updateDisplay",value:function(){return Ye.isActive(this.__select)?this:(this.__select.value=this.getValue(),mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this))}}]),t}(),x6t=function(e){function t(e,i){Eu(this,t);var r=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),n=r;function s(){n.setValue(n.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),Ye.bind(r.__input,"keyup",s),Ye.bind(r.__input,"change",s),Ye.bind(r.__input,"blur",(function(){n.__onFinishChange&&n.__onFinishChange.call(n,n.getValue())})),Ye.bind(r.__input,"keydown",(function(e){13===e.keyCode&&this.blur()})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return gm(t,z0),Tu(t,[{key:"updateDisplay",value:function(){return Ye.isActive(this.__input)||(this.__input.value=this.getValue()),mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}();function wAe(e){var t=e.toString();return t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0}var HAe=function(e){function t(e,i,r){Eu(this,t);var n=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=r||{};return n.__min=s.min,n.__max=s.max,n.__step=s.step,gt.isUndefined(n.__step)?0===n.initialValue?n.__impliedStep=1:n.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(n.initialValue))/Math.LN10))/10:n.__impliedStep=n.__step,n.__precision=wAe(n.__impliedStep),n}return gm(t,z0),Tu(t,[{key:"setValue",value:function(e){var i=e;return void 0!==this.__min&&i<this.__min?i=this.__min:void 0!==this.__max&&i>this.__max&&(i=this.__max),void 0!==this.__step&&i%this.__step!=0&&(i=Math.round(i/this.__step)*this.__step),mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,i)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=wAe(e),this}}]),t}();function I6t(e,t){var i=Math.pow(10,t);return Math.round(e*i)/i}var tP=function(e){function t(e,i,r){Eu(this,t);var n=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i,r));n.__truncationSuspended=!1;var s=n,a=void 0;function o(){s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function l(e){var t=a-e.clientY;s.setValue(s.getValue()+t*s.__impliedStep),a=e.clientY}function h(){Ye.unbind(window,"mousemove",l),Ye.unbind(window,"mouseup",h),o()}return n.__input=document.createElement("input"),n.__input.setAttribute("type","text"),Ye.bind(n.__input,"change",(function(){var e=parseFloat(s.__input.value);gt.isNaN(e)||s.setValue(e)})),Ye.bind(n.__input,"blur",(function(){o()})),Ye.bind(n.__input,"mousedown",(function(e){Ye.bind(window,"mousemove",l),Ye.bind(window,"mouseup",h),a=e.clientY})),Ye.bind(n.__input,"keydown",(function(e){13===e.keyCode&&(s.__truncationSuspended=!0,this.blur(),s.__truncationSuspended=!1,o())})),n.updateDisplay(),n.domElement.appendChild(n.__input),n}return gm(t,HAe),Tu(t,[{key:"updateDisplay",value:function(){return this.__input.value=this.__truncationSuspended?this.getValue():I6t(this.getValue(),this.__precision),mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}();function RAe(e,t,i,r,n){return r+(e-t)/(i-t)*(n-r)}var DV=function(e){function t(e,i,r,n,s){Eu(this,t);var a=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i,{min:r,max:n,step:s})),o=a;function l(e){e.preventDefault();var t=o.__background.getBoundingClientRect();return o.setValue(RAe(e.clientX,t.left,t.right,o.__min,o.__max)),!1}function h(){Ye.unbind(window,"mousemove",l),Ye.unbind(window,"mouseup",h),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=e.touches[0].clientX,i=o.__background.getBoundingClientRect();o.setValue(RAe(t,i.left,i.right,o.__min,o.__max))}function c(){Ye.unbind(window,"touchmove",u),Ye.unbind(window,"touchend",c),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),Ye.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),Ye.bind(window,"mousemove",l),Ye.bind(window,"mouseup",h),l(e)})),Ye.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(Ye.bind(window,"touchmove",u),Ye.bind(window,"touchend",c),u(e))})),Ye.addClass(a.__background,"slider"),Ye.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return gm(t,HAe),Tu(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",mm(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(),UAe=function(e){function t(e,i,r){Eu(this,t);var n=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=n;return n.__button=document.createElement("div"),n.__button.innerHTML=void 0===r?"Fire":r,Ye.bind(n.__button,"click",(function(e){return e.preventDefault(),s.fire(),!1})),Ye.addClass(n.__button,"button"),n.domElement.appendChild(n.__button),n}return gm(t,z0),Tu(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(),CV=function(e){function t(e,i){Eu(this,t);var r=vm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));r.__color=new Bs(r.getValue()),r.__temp=new Bs(0);var n=r;r.domElement=document.createElement("div"),Ye.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",Ye.bind(r.__input,"keydown",(function(e){13===e.keyCode&&u.call(this)})),Ye.bind(r.__input,"blur",u),Ye.bind(r.__selector,"mousedown",(function(){Ye.addClass(this,"drag").bind(window,"mouseup",(function(){Ye.removeClass(n.__selector,"drag")}))})),Ye.bind(r.__selector,"touchstart",(function(){Ye.addClass(this,"drag").bind(window,"touchend",(function(){Ye.removeClass(n.__selector,"drag")}))}));var s=document.createElement("div");function a(e){p(e),Ye.bind(window,"mousemove",p),Ye.bind(window,"touchmove",p),Ye.bind(window,"mouseup",l),Ye.bind(window,"touchend",l)}function o(e){d(e),Ye.bind(window,"mousemove",d),Ye.bind(window,"touchmove",d),Ye.bind(window,"mouseup",h),Ye.bind(window,"touchend",h)}function l(){Ye.unbind(window,"mousemove",p),Ye.unbind(window,"touchmove",p),Ye.unbind(window,"mouseup",l),Ye.unbind(window,"touchend",l),c()}function h(){Ye.unbind(window,"mousemove",d),Ye.unbind(window,"touchmove",d),Ye.unbind(window,"mouseup",h),Ye.unbind(window,"touchend",h),c()}function u(){var e=MV(this.value);!1!==e?(n.__color.__state=e,n.setValue(n.__color.toOriginal())):this.value=n.__color.toString()}function c(){n.__onFinishChange&&n.__onFinishChange.call(n,n.__color.toOriginal())}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=n.__saturation_field.getBoundingClientRect(),i=e.touches&&e.touches[0]||e,r=i.clientX,s=i.clientY,a=(r-t.left)/(t.right-t.left),o=1-(s-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),a>1?a=1:a<0&&(a=0),n.__color.v=o,n.__color.s=a,n.setValue(n.__color.toOriginal()),!1}function d(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=n.__hue_field.getBoundingClientRect(),i=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return i>1?i=1:i<0&&(i=0),n.__color.h=360*i,n.setValue(n.__color.toOriginal()),!1}return gt.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),gt.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),gt.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),gt.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),gt.extend(s.style,{width:"100%",height:"100%",background:"none"}),MAe(s,"top","rgba(0,0,0,0)","#000"),gt.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),S6t(r.__hue_field),gt.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),Ye.bind(r.__saturation_field,"mousedown",a),Ye.bind(r.__saturation_field,"touchstart",a),Ye.bind(r.__field_knob,"mousedown",a),Ye.bind(r.__field_knob,"touchstart",a),Ye.bind(r.__hue_field,"mousedown",o),Ye.bind(r.__hue_field,"touchstart",o),r.__saturation_field.appendChild(s),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return gm(t,z0),Tu(t,[{key:"updateDisplay",value:function(){var e=MV(this.getValue());if(!1!==e){var t=!1;gt.each(Bs.COMPONENTS,(function(i){if(!gt.isUndefined(e[i])&&!gt.isUndefined(this.__color.__state[i])&&e[i]!==this.__color.__state[i])return t=!0,{}}),this),t&>.extend(this.__color.__state,e)}gt.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var i=this.__color.v<.5||this.__color.s>.5?255:0,r=255-i;gt.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+i+","+i+","+i+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,MAe(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),gt.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+i+","+i+","+i+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(),_6t=["-moz-","-o-","-webkit-","-ms-",""];function MAe(e,t,i,r){e.style.background="",gt.each(_6t,(function(n){e.style.cssText+="background: "+n+"linear-gradient("+t+", "+i+" 0%, "+r+" 100%); "}))}function S6t(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var w6t={load:function(e,t){var i=t||document,r=i.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,i.getElementsByTagName("head")[0].appendChild(r)},inject:function(e,t){var i=t||document,r=document.createElement("style");r.type="text/css",r.innerHTML=e;var n=i.getElementsByTagName("head")[0];try{n.appendChild(r)}catch(e){}}},R6t='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',M6t=function(e,t){var i=e[t];return gt.isArray(arguments[2])||gt.isObject(arguments[2])?new b6t(e,t,arguments[2]):gt.isNumber(i)?gt.isNumber(arguments[2])&>.isNumber(arguments[3])?gt.isNumber(arguments[4])?new DV(e,t,arguments[2],arguments[3],arguments[4]):new DV(e,t,arguments[2],arguments[3]):gt.isNumber(arguments[4])?new tP(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new tP(e,t,{min:arguments[2],max:arguments[3]}):gt.isString(i)?new x6t(e,t):gt.isFunction(i)?new UAe(e,t,""):gt.isBoolean(i)?new FAe(e,t):null};function D6t(e){setTimeout(e,1e3/60)}var C6t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||D6t,A6t=function(){function e(){Eu(this,e),this.backgroundElement=document.createElement("div"),gt.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),Ye.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),gt.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;Ye.bind(this.backgroundElement,"click",(function(){t.hide()}))}return Tu(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),gt.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",Ye.unbind(e.domElement,"webkitTransitionEnd",t),Ye.unbind(e.domElement,"transitionend",t),Ye.unbind(e.domElement,"oTransitionEnd",t)};Ye.bind(this.domElement,"webkitTransitionEnd",t),Ye.bind(this.domElement,"transitionend",t),Ye.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-Ye.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-Ye.getHeight(this.domElement)/2+"px"}}]),e}(),O6t=g6t(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n");w6t.inject(O6t);var DAe="dg",CAe=72,AAe=20,_S="Default",bS=function(){try{return!!window.localStorage}catch(e){return!1}}(),xS=void 0,OAe=!0,NT=void 0,RV=!1,BAe=[],In=function e(t){var i=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),Ye.addClass(this.domElement,DAe),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=gt.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=gt.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),gt.isUndefined(r.load)?r.load={preset:_S}:r.preset&&(r.load.preset=r.preset),gt.isUndefined(r.parent)&&r.hideable&&BAe.push(this),r.resizable=gt.isUndefined(r.parent)&&r.resizable,r.autoPlace&>.isUndefined(r.scrollable)&&(r.scrollable=!0);var n,s=bS&&"true"===localStorage.getItem(LT(this,"isLocal")),a=void 0,o=void 0;if(Object.defineProperties(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return i.parent?i.getRoot().preset:r.load.preset},set:function(e){i.parent?i.getRoot().preset=e:r.load.preset=e,F6t(this),i.revert()}},width:{get:function(){return r.width},set:function(e){r.width=e,PV(i,e)}},name:{get:function(){return r.name},set:function(e){r.name=e,o&&(o.innerHTML=r.name)}},closed:{get:function(){return r.closed},set:function(t){r.closed=t,r.closed?Ye.addClass(i.__ul,e.CLASS_CLOSED):Ye.removeClass(i.__ul,e.CLASS_CLOSED),this.onResize(),i.__closeButton&&(i.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return r.load}},useLocalStorage:{get:function(){return s},set:function(e){bS&&(s=e,e?Ye.bind(window,"unload",a):Ye.unbind(window,"unload",a),localStorage.setItem(LT(i,"isLocal"),e))}}}),gt.isUndefined(r.parent)){if(this.closed=r.closed||!1,Ye.addClass(this.domElement,e.CLASS_MAIN),Ye.makeSelectable(this.domElement,!1),bS&&s){i.useLocalStorage=!0;var l=localStorage.getItem(LT(this,"gui"));l&&(r.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,Ye.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),r.closeOnTop?(Ye.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(Ye.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),Ye.bind(this.__closeButton,"click",(function(){i.closed=!i.closed}))}else{void 0===r.closed&&(r.closed=!0);var h=document.createTextNode(r.name);Ye.addClass(h,"controller-name"),o=FV(i,h),Ye.addClass(this.__ul,e.CLASS_CLOSED),Ye.addClass(o,"title"),Ye.bind(o,"click",(function(e){return e.preventDefault(),i.closed=!i.closed,!1})),r.closed||(this.closed=!1)}r.autoPlace&&(gt.isUndefined(r.parent)&&(OAe&&(NT=document.createElement("div"),Ye.addClass(NT,DAe),Ye.addClass(NT,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(NT),OAe=!1),NT.appendChild(this.domElement),Ye.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||PV(i,r.width)),this.__resizeHandler=function(){i.onResizeDebounced()},Ye.bind(window,"resize",this.__resizeHandler),Ye.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),Ye.bind(this.__ul,"transitionend",this.__resizeHandler),Ye.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),r.resizable&&L6t(this),a=function(){bS&&"true"===localStorage.getItem(LT(i,"isLocal"))&&localStorage.setItem(LT(i,"gui"),JSON.stringify(i.getSaveObject()))},this.saveToLocalStorageIfPossible=a,r.parent||((n=i.getRoot()).width+=1,gt.defer((function(){n.width-=1})))};function FV(e,t,i){var r=document.createElement("li");return t&&r.appendChild(t),i?e.__ul.insertBefore(r,i):e.__ul.appendChild(r),e.onResize(),r}function PAe(e){Ye.unbind(window,"resize",e.__resizeHandler),e.saveToLocalStorageIfPossible&&Ye.unbind(window,"unload",e.saveToLocalStorageIfPossible)}function AV(e,t){var i=e.__preset_select[e.__preset_select.selectedIndex];i.innerHTML=t?i.value+"*":i.value}function P6t(e,t,i){if(i.__li=t,i.__gui=e,gt.extend(i,{options:function(t){if(arguments.length>1){var r=i.__li.nextElementSibling;return i.remove(),IS(e,i.object,i.property,{before:r,factoryArgs:[gt.toArray(arguments)]})}if(gt.isArray(t)||gt.isObject(t)){var n=i.__li.nextElementSibling;return i.remove(),IS(e,i.object,i.property,{before:n,factoryArgs:[t]})}},name:function(e){return i.__li.firstElementChild.firstElementChild.innerHTML=e,i},listen:function(){return i.__gui.listen(i),i},remove:function(){return i.__gui.remove(i),i}}),i instanceof DV){var r=new tP(i.object,i.property,{min:i.__min,max:i.__max,step:i.__step});gt.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=i[e],n=r[e];i[e]=r[e]=function(){var e=Array.prototype.slice.call(arguments);return n.apply(r,e),t.apply(i,e)}})),Ye.addClass(t,"has-slider"),i.domElement.insertBefore(r.domElement,i.domElement.firstElementChild)}else if(i instanceof tP){var n=function(t){if(gt.isNumber(i.__min)&>.isNumber(i.__max)){var r=i.__li.firstElementChild.firstElementChild.innerHTML,n=i.__gui.__listening.indexOf(i)>-1;i.remove();var s=IS(e,i.object,i.property,{before:i.__li.nextElementSibling,factoryArgs:[i.__min,i.__max,i.__step]});return s.name(r),n&&s.listen(),s}return t};i.min=gt.compose(n,i.min),i.max=gt.compose(n,i.max)}else i instanceof FAe?(Ye.bind(t,"click",(function(){Ye.fakeEvent(i.__checkbox,"click")})),Ye.bind(i.__checkbox,"click",(function(e){e.stopPropagation()}))):i instanceof UAe?(Ye.bind(t,"click",(function(){Ye.fakeEvent(i.__button,"click")})),Ye.bind(t,"mouseover",(function(){Ye.addClass(i.__button,"hover")})),Ye.bind(t,"mouseout",(function(){Ye.removeClass(i.__button,"hover")}))):i instanceof CV&&(Ye.addClass(t,"color"),i.updateDisplay=gt.compose((function(e){return t.style.borderLeftColor=i.__color.toString(),e}),i.updateDisplay),i.updateDisplay());i.setValue=gt.compose((function(t){return e.getRoot().__preset_select&&i.isModified()&&AV(e.getRoot(),!0),t}),i.setValue)}function kAe(e,t){var i=e.getRoot(),r=i.__rememberedObjects.indexOf(t.object);if(-1!==r){var n=i.__rememberedObjectIndecesToControllers[r];if(void 0===n&&(n={},i.__rememberedObjectIndecesToControllers[r]=n),n[t.property]=t,i.load&&i.load.remembered){var s=i.load.remembered,a=void 0;if(s[e.preset])a=s[e.preset];else{if(!s[_S])return;a=s[_S]}if(a[r]&&void 0!==a[r][t.property]){var o=a[r][t.property];t.initialValue=o,t.setValue(o)}}}}function IS(e,t,i,r){if(void 0===t[i])throw new Error('Object "'+t+'" has no property "'+i+'"');var n=void 0;if(r.color)n=new CV(t,i);else{var s=[t,i].concat(r.factoryArgs);n=M6t.apply(e,s)}r.before instanceof z0&&(r.before=r.before.__li),kAe(e,n),Ye.addClass(n.domElement,"c");var a=document.createElement("span");Ye.addClass(a,"property-name"),a.innerHTML=n.property;var o=document.createElement("div");o.appendChild(a),o.appendChild(n.domElement);var l=FV(e,o,r.before);return Ye.addClass(l,In.CLASS_CONTROLLER_ROW),n instanceof CV?Ye.addClass(l,"color"):Ye.addClass(l,y6t(n.getValue())),P6t(e,l,n),e.__controllers.push(n),n}function LT(e,t){return document.location.href+"."+t}function OV(e,t,i){var r=document.createElement("option");r.innerHTML=t,r.value=t,e.__preset_select.appendChild(r),i&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function NAe(e,t){t.style.display=e.useLocalStorage?"block":"none"}function N6t(e){var t=e.__save_row=document.createElement("li");Ye.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),Ye.addClass(t,"save-row");var i=document.createElement("span");i.innerHTML=" ",Ye.addClass(i,"button gears");var r=document.createElement("span");r.innerHTML="Save",Ye.addClass(r,"button"),Ye.addClass(r,"save");var n=document.createElement("span");n.innerHTML="New",Ye.addClass(n,"button"),Ye.addClass(n,"save-as");var s=document.createElement("span");s.innerHTML="Revert",Ye.addClass(s,"button"),Ye.addClass(s,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?gt.each(e.load.remembered,(function(t,i){OV(e,i,i===e.preset)})):OV(e,_S,!1),Ye.bind(a,"change",(function(){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].innerHTML=e.__preset_select[t].value;e.preset=this.value})),t.appendChild(a),t.appendChild(i),t.appendChild(r),t.appendChild(n),t.appendChild(s),bS){var o=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(LT(e,"isLocal"))&&l.setAttribute("checked","checked"),NAe(e,o),Ye.bind(l,"change",(function(){e.useLocalStorage=!e.useLocalStorage,NAe(e,o)}))}var h=document.getElementById("dg-new-constructor");Ye.bind(h,"keydown",(function(e){e.metaKey&&(67===e.which||67===e.keyCode)&&xS.hide()})),Ye.bind(i,"click",(function(){h.innerHTML=JSON.stringify(e.getSaveObject(),void 0,2),xS.show(),h.focus(),h.select()})),Ye.bind(r,"click",(function(){e.save()})),Ye.bind(n,"click",(function(){var t=prompt("Enter a new preset name.");t&&e.saveAs(t)})),Ye.bind(s,"click",(function(){e.revert()}))}function L6t(e){var t=void 0;function i(i){return i.preventDefault(),e.width+=t-i.clientX,e.onResize(),t=i.clientX,!1}function r(){Ye.removeClass(e.__closeButton,In.CLASS_DRAG),Ye.unbind(window,"mousemove",i),Ye.unbind(window,"mouseup",r)}function n(n){return n.preventDefault(),t=n.clientX,Ye.addClass(e.__closeButton,In.CLASS_DRAG),Ye.bind(window,"mousemove",i),Ye.bind(window,"mouseup",r),!1}e.__resize_handle=document.createElement("div"),gt.extend(e.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),Ye.bind(e.__resize_handle,"mousedown",n),Ye.bind(e.__closeButton,"mousedown",n),e.domElement.insertBefore(e.__resize_handle,e.domElement.firstElementChild)}function PV(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function Q3(e,t){var i={};return gt.each(e.__rememberedObjects,(function(r,n){var s={},a=e.__rememberedObjectIndecesToControllers[n];gt.each(a,(function(e,i){s[i]=t?e.initialValue:e.getValue()})),i[n]=s})),i}function F6t(e){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].value===e.preset&&(e.__preset_select.selectedIndex=t)}function GAe(e){0!==e.length&&C6t.call(window,(function(){GAe(e)})),gt.each(e,(function(e){e.updateDisplay()}))}In.toggleHide=function(){RV=!RV,gt.each(BAe,(function(e){e.domElement.style.display=RV?"none":""}))},In.CLASS_AUTO_PLACE="a",In.CLASS_AUTO_PLACE_CONTAINER="ac",In.CLASS_MAIN="main",In.CLASS_CONTROLLER_ROW="cr",In.CLASS_TOO_TALL="taller-than-window",In.CLASS_CLOSED="closed",In.CLASS_CLOSE_BUTTON="close-button",In.CLASS_CLOSE_TOP="close-top",In.CLASS_CLOSE_BOTTOM="close-bottom",In.CLASS_DRAG="drag",In.DEFAULT_WIDTH=245,In.TEXT_CLOSED="Close Controls",In.TEXT_OPEN="Open Controls",In._keydownHandler=function(e){"text"!==document.activeElement.type&&(e.which===CAe||e.keyCode===CAe)&&In.toggleHide()},Ye.bind(window,"keydown",In._keydownHandler,!1),gt.extend(In.prototype,{add:function(e,t){return IS(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return IS(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;gt.defer((function(){t.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&NT.removeChild(this.domElement);var e=this;gt.each(this.__folders,(function(t){e.removeFolder(t)})),Ye.unbind(window,"keydown",In._keydownHandler,!1),PAe(this)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var i=new In(t);this.__folders[e]=i;var r=FV(this,i.domElement);return Ye.addClass(r,"folder"),i},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],PAe(e);var t=this;gt.each(e.__folders,(function(t){e.removeFolder(t)})),gt.defer((function(){t.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=Ye.getOffset(e.__ul).top,i=0;gt.each(e.__ul.childNodes,(function(t){e.autoPlace&&t===e.__save_row||(i+=Ye.getHeight(t))})),window.innerHeight-t-AAe<i?(Ye.addClass(e.domElement,In.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-AAe+"px"):(Ye.removeClass(e.domElement,In.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&>.defer((function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"})),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},onResizeDebounced:gt.debounce((function(){this.onResize()}),50),remember:function(){if(gt.isUndefined(xS)&&((xS=new A6t).domElement.innerHTML=R6t),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;gt.each(Array.prototype.slice.call(arguments),(function(t){0===e.__rememberedObjects.length&&N6t(e),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)})),this.autoPlace&&PV(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=Q3(this)),e.folders={},gt.each(this.__folders,(function(t,i){e.folders[i]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=Q3(this),AV(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[_S]=Q3(this,!0)),this.load.remembered[e]=Q3(this),this.preset=e,OV(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){gt.each(this.__controllers,(function(t){this.getRoot().load.remembered?kAe(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),gt.each(this.__folders,(function(e){e.revert(e)})),e||AV(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&GAe(this.__listening)},updateDisplay:function(){gt.each(this.__controllers,(function(e){e.updateDisplay()})),gt.each(this.__folders,(function(e){e.updateDisplay()}))}});var VAe=In,zAe=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Sd=(()=>{if("undefined"==typeof document)return!1;let e=zAe[0],t={};for(let i of zAe)if((null==i?void 0:i[1])in document){for(let[r,n]of i.entries())t[e[r]]=n;return t}return!1})(),jAe={change:Sd.fullscreenchange,error:Sd.fullscreenerror},dl={request:(e=document.documentElement,t)=>new Promise(((i,r)=>{let n=()=>{dl.off("change",n),i()};dl.on("change",n);let s=e[Sd.requestFullscreen](t);s instanceof Promise&&s.then(n).catch(r)})),exit:()=>new Promise(((e,t)=>{if(!dl.isFullscreen)return void e();let i=()=>{dl.off("change",i),e()};dl.on("change",i);let r=document[Sd.exitFullscreen]();r instanceof Promise&&r.then(i).catch(t)})),toggle:(e,t)=>dl.isFullscreen?dl.exit():dl.request(e,t),onchange(e){dl.on("change",e)},onerror(e){dl.on("error",e)},on(e,t){let i=jAe[e];i&&document.addEventListener(i,t,!1)},off(e,t){let i=jAe[e];i&&document.removeEventListener(i,t,!1)},raw:Sd};Object.defineProperties(dl,{isFullscreen:{get:()=>Boolean(document[Sd.fullscreenElement])},element:{enumerable:!0,get:()=>{var e;return null!=(e=document[Sd.fullscreenElement])?e:void 0}},isEnabled:{enumerable:!0,get:()=>Boolean(document[Sd.fullscreenEnabled])}}),Sd||(dl={isEnabled:!1});var rP=dl;function WAe(e,t,i,r,n,s,a){let o=e.addFolder(t);o.add(i,"x",n,s,a).onChange(r),o.add(i,"y",n,s,a).onChange(r),o.add(i,"z",n,s,a).onChange(r)}var iP=class{constructor(e){this.exploderDict={},this.controls={showGroundGrid:!1,showGrassGround:!1,skyMode:["None","Black Background","White Background","Gradient ramp","Cloudy"],environments:["None","Default (City Streat 64x32)","Venice Sunset","Footprint Court (HDR Labs)","City Street"],homeView:()=>console.log("[DGH] Go to home view"),views:["Top","Bottom","Front","Back","Left","Right"],OrthographicCamera:!1,viewpoints:!1,annotations:!1,takeSnapshot:()=>console.log("[DGH] Taking snapshot..."),fullScreen:()=>console.log("[DGH] Full screen..."),webcam:!1,uploadFile:()=>console.log("[DGH] Upload file..."),showBimTree:!1,showPropertyPanel:!1,transparentMode:!1,showVertexNormals:!1,sectionMode:["No section","Box section","Plane section"],alVisible:!0,alColor:"#cccccc",alIntensity:1,dlColor:"#dddddd",showDlHelper:!1,hlVisible:!0,hlIntensity:1,hlColor:[255,255,255,.6],hlGroundColor:[200,255,200,.6],fogEnabled:!1,fogColor:14540253,fogNearDistance:1,fogFarDistance:1e3,composerEnabled:!1,renderPassEnabled:!1,fxaaEnabled:!1,saoEnabled:!1,ssaoEnabled:!1,outlineEnabled:!1,ssaaEnabled:!1,bloomEnabled:!1,unrealBloomEnabled:!1},this.viewer=e,this.init()}init(){if(!this.viewer||!this.viewer.renderer||!this.viewer.scene)throw new Error("Need to initialize renderer, scene first!");let e=this.viewer,t=this.viewer.scene,i=this.controls;this.gui=new VAe({name:"controls",autoPlace:!0,width:300,closed:!0}),this.gui.domElement.style.opacity="0.6";let r=this.gui.addFolder("Common settings");r.add(i,"showGroundGrid").name("Show ground grid").onChange((i=>{e.groundGrid?e.groundGrid.visible=i:i&&(e.groundGrid=aa.createGroundGrid(),t.add(e.groundGrid),e.enableRender()),e.enableRender()})),r.add(i,"showGrassGround").name("Show grass ground").onChange((i=>{e.grassGround?e.grassGround.visible=i:i&&ct(this,null,(function*(){e.grassGround=yield aa.createGrassGround(),t.add(e.grassGround),e.enableRender()})),e.enableRender()}));let n=r.add(i,"skyMode",i.skyMode).name("Sky mode");n.onChange((i=>{if(e.skyOfGradientRamp&&(e.skyOfGradientRamp.visible="Gradient ramp"===i),"Black Background"===i)t.background=new Ve(0);else if("White Background"===i)t.background=new Ve(16777215);else if("Gradient ramp"===i)e.skyOfGradientRamp||(e.skyOfGradientRamp=il.createSkyOfGradientRamp(),t.add(e.skyOfGradientRamp)),e.skyOfGradientRamp.visible=!0;else if("Cloudy"===i){let e=["right.jpg","left.jpg","top.jpg","bottom.jpg","front.jpg","back.jpg"];e=e.map((e=>`${window.location.origin}/images/skybox/cloudy/${e}`)),il.createSkyFromTextures(e).then((e=>{t.background=e}))}else t.background=e.sceneBackgroundColor;e.enableRender()})),n.setValue("Gradient ramp"),r.add(i,"environments",i.environments).name("Environments").onChange((i=>{let r="";if("Default (City Streat 64x32)"===i){if(e.pmremGenerator)return qc.createEnvTextureFromDataArray(e.pmremGenerator).then((e=>{t.environment=e})),void e.enableRender()}else"Venice Sunset"===i?r="venice_sunset_1k.hdr":"Footprint Court (HDR Labs)"===i?r="footprint_court_2k.hdr":"City Street"===i&&(r="city_street_256.hdr");""===r?t.environment=null:(r=`${window.location.origin}/images/envmap/${r}`,qc.createEnvTexture(e.pmremGenerator,r).then((e=>{t.environment=e}))),e.enableRender()})),r.add(i,"homeView").name("Go to home view").onChange((()=>{e.goToHomeView()})),r.add(i,"views",i.views).name("Views").onChange((i=>{var r;let n=new D,s=new D,a=Tn.getVisibleObjectBoundingBox(t),o=Va.getCameraDirectionByView(i);Va.getCameraPositionByBboxAndDirection(a,n,s,null==(r=e.camera)?void 0:r.projectionMatrix,o),e.flyTo(n,s)})),r.add(i,"OrthographicCamera").name("Orth Camera").onChange((t=>{e.setToOrthographicCamera(t)})),r.add(i,"takeSnapshot").name("Take snapshot").onChange((()=>{})),r.add(i,"fullScreen").name("Full screen").onChange((()=>{rP&&rP.isEnabled&&rP.request(),e.enableRender()})),r.add(i,"uploadFile").name("Upload file").onChange((()=>{new m3(e).openFileBrowserToUpload()}));let s=this.gui.addFolder("Model operations");s.add(i,"transparentMode",i.transparentMode).name("Transparent mode").onChange((t=>{e.addOrRemoveObjectOpacity(t),e.enableRender()})),s.add(i,"showVertexNormals",i.showVertexNormals).name("Show Vertex Normals").onChange((t=>{e.showVertexNormals(t),e.enableRender()})),s.add(i,"sectionMode",i.sectionMode).name("Section mode").onChange((t=>{"No section"===t?e.deactivateSection():"Box section"===t?e.activateSection("ObjectsBoxSection"):"Plane section"===t&&e.activateSection("PickPlaneSection"),e.enableRender()}));let a=this.viewer.ambientLight,o=this.gui.addFolder("Ambient light");o.add(i,"alVisible",i.alVisible).name("visible").onChange((t=>{a&&(a.visible=t),e.enableRender()})),o.addColor(i,"alColor").name("color").onChange((t=>{a&&(a.color=new Ve(t)),e.enableRender()})),o.add(i,"alIntensity",0,5).name("intensity").onChange((t=>{a&&(a.intensity=t),e.enableRender()}));let l=this.viewer.directionalLight;if(l){let t=this.gui.addFolder("Directional light");t.add(l,"visible").name("visible").onChange((t=>{l&&(l.visible=t),e.enableRender()})),t.addColor(i,"dlColor").name("color").onChange((t=>{l&&(l.color=new Ve(t)),e.enableRender()})),t.add(l,"intensity",0,5).name("intensity").onChange((t=>{l&&(l.intensity=t),e.enableRender()})),t.add(l,"castShadow").name("castShadow").onChange((t=>{l&&(l.castShadow=t),e.enableRender()})),t.add(i,"showDlHelper").name("showDlHelper").onChange((t=>{e.showDirectionalLightHelper(t),e.enableRender()}));let r=()=>{e.updateDirectionalLight(),e.enableRender()};WAe(t,"position",l.position,r),WAe(t,"target",l.target.position,r);let n=t.addFolder("shadow");n.add(l.shadow.camera,"near").name("near").onChange(r),n.add(l.shadow.camera,"far").name("far").onChange(r),n.add(l.shadow.camera,"zoom").name("zoom").onChange(r)}let h=this.viewer.hemisphereLight,u=this.gui.addFolder("Hemisphere Light");u.add(i,"hlVisible",i.hlVisible).name("visible").onChange((t=>{h&&(h.visible=t),e.enableRender()})),u.add(i,"hlIntensity",0,5).name("intensity").onChange((t=>{h&&(h.intensity=t),e.enableRender()})),u.addColor(i,"hlColor").name("color").onChange((t=>{h&&(h.color=new Ve(t)),e.enableRender()})),u.addColor(i,"hlGroundColor").name("groundColor").onChange((t=>{h&&(h.groundColor=new Ve(t)),e.enableRender()}));let c=this.gui.addFolder("Fog");c.add(i,"fogEnabled",i.fogEnabled).name("Enabled").onChange((r=>{t.fog=r?new Zu(i.fogColor,i.fogNearDistance,i.fogFarDistance):null,e.enableRender()})),c.add(i,"fogNearDistance",0,100).name("Near").onChange((r=>{i.fogEnabled&&t&&(t.fog=new Zu(i.fogColor,r,i.fogFarDistance)),e.enableRender()})),c.add(i,"fogFarDistance",100,2e3).name("Far").onChange((r=>{i.fogEnabled&&t&&(t.fog=new Zu(i.fogColor,i.fogNearDistance,r)),e.enableRender()}));let p=this.gui.addFolder("Composer");p.add(i,"composerEnabled",i.composerEnabled).name("Composer Enabled").onChange((t=>{e.enableComposer(t)})),p.add(i,"renderPassEnabled",i.renderPassEnabled).name("RenderPass Enabled").onChange((t=>{e.enableRenderPass(t)})),p.add(i,"fxaaEnabled",i.fxaaEnabled).name("Effect FXAA Enabled").onChange((t=>{e.enableFxaaPass(t)})),p.add(i,"saoEnabled",i.saoEnabled).name("SAO Enabled").onChange((t=>{e.enableSaoPass(t)})),p.add(i,"ssaoEnabled",i.ssaoEnabled).name("SSAO Enabled").onChange((t=>{e.enableSsaoPass(t)})),p.add(i,"outlineEnabled",i.outlineEnabled).name("OutlinePass Enabled").onChange((t=>{e.enableOutlinePass(t)})),p.add(i,"ssaaEnabled",i.ssaaEnabled).name("SSAA Enabled").onChange((t=>{e.enableSsaaPass(t)})),p.add(i,"bloomEnabled",i.bloomEnabled).name("Bloom Enabled").onChange((t=>{e.enableBloomPass(t)})),p.add(i,"unrealBloomEnabled",i.unrealBloomEnabled).name("Unreal Bloom Enabled").onChange((t=>{e.enableUnrealBloomPass(t)}))}setExplodeMode(e,t=!1){!this.viewer||!this.viewer.scene||!this.viewer.loadedModels||!this.exploderDict||(e?Tn.explodeObjects(this.viewer.scene,this.exploderDict,Object.values(this.viewer.loadedModels).map((e=>e.id)),t):Tn.unexplodeObjects(this.viewer.scene,this.exploderDict||{}))}open(){this.gui&&this.gui.open()}close(){this.gui&&this.gui.close()}beforeDestroy(){this.viewer=void 0,this.gui&&this.gui.destroy(),this.gui=void 0,this.exploderDict=[]}},nP=class{constructor(e){this.width=0,this.height=0,this.raycaster=new ka,this.cfg=e,this.init(),this.animate()}init(){xr.isBrowser&&!this.cfg.context&&this.initDom(),this.initScene(),this.initRenderer(),this.initCamera(),this.initLights()}initDom(){let e=document.getElementById(this.cfg.containerId);e||(re.error("[ViewCubePlugin] containerId:",this.cfg.containerId,"is not found in dom tree! will append to document body"),e=document.body),this.width=e.clientWidth,this.height=e.clientHeight,this.container=e}initScene(){let e=new wn;e.matrixAutoUpdate=!1,this.scene=e}initCamera(){if(!this.scene)return;let e=new Ni(-this.width/2,this.width/2,this.height/2,-this.height/2,.1,1e5);e.position.set(300,300,300),e.lookAt(0,0,0),e.zoom=10,e.updateProjectionMatrix(),this.scene.add(e),this.camera=e}initRenderer(){var e;this.renderer=new go({antialias:!0,preserveDrawingBuffer:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.renderer.setClearColor(11119017,0),this.renderer.shadowMap.enabled=!0,null==(e=this.container)||e.appendChild(this.renderer.domElement)}initLights(){if(!this.scene)return;let e=new Ns(16777215,1.5);e.name="sun",e.castShadow=!0,e.position.set(-2,2,4),e.shadow.autoUpdate=!1,e.shadow.mapSize.width=1024,e.shadow.mapSize.height=1024,this.directionalLight=e,this.scene.add(e),this.scene.add(e.target)}getNdcPointByPointerEvent(e){if(!this.container||!this.camera)return;let t=xi.getScreenPointByEvent(e,this.container);return xi.screenPoint2NdcPoint(t,this.camera,this.container)}getIntersects(e){return this.scene&&this.camera?(this.camera.updateMatrixWorld(),this.raycaster.layers.set(12),this.raycaster.setFromCamera(e,this.camera),this.raycaster&&this.raycaster.intersectObjects(this.scene.children,!0)||[]):void 0}zoomToBbox(e){if(!this.camera)return;let t=this.camera.right-this.camera.left,i=this.camera.top-this.camera.bottom,r=new D;e.getSize(r);let n=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)+Math.pow(r.z,2)),s=Math.min(t/n,i/n);this.camera.position.set(r.x/2,r.y/2,r.z/2),this.camera.zoom=s,this.camera.updateProjectionMatrix()}animate(){var e,t,i;if(this.requestAnimationFrameHandle=requestAnimationFrame(this.animate.bind(this)),this.scene&&this.camera&&(null==(e=this.renderer)||e.render(this.scene,this.camera),!xr.isBrowser)){let e=null==(t=this.renderer)?void 0:t.getContext();e&&e.endFrameEXP&&(e.flush(),e.endFrameEXP())}null==(i=this.update)||i.call(this)}destroy(){var e,t,i;this.requestAnimationFrameHandle&&(cancelAnimationFrame(this.requestAnimationFrameHandle),this.requestAnimationFrameHandle=void 0),this.renderer&&(this.renderer.domElement.remove(),this.renderer.clear(),this.renderer.dispose(),this.renderer.forceContextLoss(),this.renderer=void 0),null==(e=this.container)||e.remove(),this.container=void 0,null==(t=this.scene)||t.clear(),this.scene=void 0,null==(i=this.directionalLight)||i.dispose(),this.directionalLight=void 0,this.update=void 0}};function U6t(e,t,i,r,n){let s=document.createElement("span");return s.style.font="1px serif",s.style.fontFamily=e,s.style.fontSize=`${t}px`,s.style.fontStyle=i,s.style.fontVariant=r,s.style.fontWeight=n,s.style.font}var B6t=Object.freeze({text:"",color:"#fff",alignment:"center",backgroundColor:0,fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineGap:1/4,padding:.5,strokeColor:"#000",strokeWidth:0}),sP=class extends Pi{constructor(e,t=document.createElement("canvas")){super(t),this.canvas=t,this.isTextTexture=!0,this.needsRedraw=!0,this.contentOffset=0,this.lineOffset=0,this.width=0,this.height=0,this.pixelRatio=Math.max(window.devicePixelRatio||1),this.computeOptimalPixelRatio=()=>{let e=new D,t=new ce,i=new D,r=new D,n=new ce;return(s,a,o)=>{var l,h;if(n.set(this.width,this.height),n.x&&n.y){s.getWorldPosition(i),o.getWorldPosition(e);let u=i.distanceTo(e);if(o.isPerspectiveCamera&&(u*=2*Math.tan(fr.degToRad(o.fov)/2)),(o.isPerspectiveCamera||o.isOrthographicCamera)&&(u/=o.zoom),u){s.getWorldScale(r);let e=null!=(h=null==(l=a.capabilities)?void 0:l.maxTextureSize)?h:1/0;return a.getDrawingBufferSize(t),Math.min(Math.max(r.x/u*(t.x/n.x),r.y/u*(t.y/n.y)),e/n.x,e/n.y)}}return 0}},this.cfg=Mr(Mr({},B6t),e)}get lines(){let{text:e}=this.cfg;return e?e.split("\n"):[]}get font(){let{fontFamily:e,fontSize:t,fontStyle:i,fontVariant:r,fontWeight:n}=this.cfg;return U6t(e,t,i,r,n)}getContentWidth(){let{font:e,lines:t}=this,i=document.createElement("canvas").getContext("2d");return i.font=e,Math.max(...t.map((e=>i.measureText(e).width)))}initDraw(){let{lineGap:e,padding:t,strokeWidth:i}=this.cfg;t*=this.cfg.fontSize,e*=this.cfg.fontSize,i*=this.cfg.fontSize;let r=this.lines.length,n=this.cfg.fontSize+e,s=t+i/2,a=(r?this.getContentWidth():0)+2*s,o=(r?this.cfg.fontSize+n*(r-1):0)+2*s;this.width=a,this.height=o,this.contentOffset=s,this.lineOffset=n}getDrawPosition(e){let t=this.contentOffset+this.cfg.fontSize/2;switch(e){case"left":return{x:this.contentOffset,y:t};case"right":return{x:this.width-this.contentOffset,y:t}}return{x:this.width/2,y:t}}draw(){let e=this.canvas.getContext("2d"),{alignment:t,backgroundColor:i,color:r,strokeColor:n,strokeWidth:s}=this.cfg;e.fillStyle="#"+i.toString(16),e.fillRect(0,0,e.canvas.width,e.canvas.height),Object.assign(e,{fillStyle:r,font:this.font,lineWidth:s,miterLimit:1,strokeStyle:n,textAlign:t,textBaseline:"middle"});let{x:a,y:o}=this.getDrawPosition(t),l=o;this.lines.forEach((t=>{e.fillText(t,a,l),s&&e.strokeText(t,a,l),l+=this.lineOffset}))}getDrawingBufferWidth(){return fr.ceilPowerOfTwo(this.width*this.pixelRatio)}getDrawingBufferHeight(){return fr.ceilPowerOfTwo(this.height*this.pixelRatio)}redrew(){if(this.needsRedraw){this.initDraw();let e=this.canvas,t=e.getContext("2d");t.clearRect(0,0,e.width,e.height),e.width=this.getDrawingBufferWidth(),e.height=this.getDrawingBufferHeight(),e.width&&e.height?(t.save(),t.scale(e.width/this.width,e.height/this.height),this.draw(),t.restore()):e.width=e.height=1,this.needsRedraw=!1,this.needsUpdate=!0}}setPixelRatio(e){if(this.pixelRatio!==e){let t=this.getDrawingBufferWidth(),i=this.getDrawingBufferHeight();this.pixelRatio=e;let r=this.getDrawingBufferWidth(),n=this.getDrawingBufferHeight();(r!==t||n!==i)&&(this.needsRedraw=!0)}}setOptimalPixelRatio(e,t,i){let r=this.computeOptimalPixelRatio();this.setPixelRatio(r(e,t,i))}updateConfig(e){this.cfg=Mr(Mr({},this.cfg),e),this.needsRedraw=!0}};function HV(e,t,i){let r=new Ve(e),n=new Ve(t);return r.lerp(n,i).getHex()}var gi=(e=>(e[e.Rotate0=0]="Rotate0",e[e.Rotate90=Math.PI/2]="Rotate90",e[e.Rotate180=Math.PI]="Rotate180",e[e.Rotate270=1.5*Math.PI]="Rotate270",e))(gi||{}),Bh=new D(1,0,0),ya=new D(0,1,0),Es=new D(0,0,1),aP=class{constructor(e){this.name="ViewCube",this.viewCubeFaces={right:{text:"\u53f3",name:"RightFace",position:new D(50,0,0),rotation:{axis:ya,rad:gi.Rotate90}},left:{text:"\u5de6",name:"LeftFace",position:new D(-50,0,0),rotation:{axis:ya,rad:gi.Rotate270}},top:{text:"\u4e0a",name:"TopFace",position:new D(0,50,0),rotation:{axis:Bh,rad:gi.Rotate270}},bottom:{text:"\u4e0b",name:"BottomFace",position:new D(0,-50,0),rotation:{axis:Bh,rad:gi.Rotate90}},front:{text:"\u524d",name:"FrontFace",position:new D(0,0,50),rotation:{axis:ya,rad:0}},back:{text:"\u540e",name:"BackFace",position:new D(0,0,-50),rotation:{axis:ya,rad:gi.Rotate180}}},this.AXIS_LENGTH=130,this.AXIS_COLOR_X=16711680,this.AXIS_COLOR_Y=65280,this.AXIS_COLOR_Z=255,this.FACE_BACKGROUND_COLOR=16777215,this.FACE_HOVER_BACKGROUND_COLOR=8618481,this.EDGE_COLOUR=13290452,this.EDGE_OPACITY=.1,this.EDGE_SIZE=new ce(70,12),this.CORNER_WIDTH=12,this.CORNER_COLOR=13290452,this.CORNER_OPACITY=1,this.faces=[],this.onPointerDown=e=>{let t=this.plugin.getNdcPointByPointerEvent(e);if(!t)return;let i=this.plugin.getIntersects(t);if(this.lastCoords=t,!i||0===i.length)return;let r,n=i[0].object.name;if(n){switch(n){case"TopFace":r=new D(0,1,0);break;case"BottomFace":r=new D(0,-1,0);break;case"FrontFace":r=new D(0,0,1);break;case"BackFace":r=new D(0,0,-1);break;case"LeftFace":r=new D(-1,0,0);break;case"RightFace":r=new D(1,0,0);break;case"TopFrontEdge":r=new D(0,1,1);break;case"TopRightEdge":r=new D(1,1,0);break;case"TopBackEdge":r=new D(0,1,-1);break;case"TopLeftEdge":r=new D(-1,1,0);break;case"BottomFrontEdge":r=new D(0,-1,1);break;case"BottomRightEdge":r=new D(1,-1,0);break;case"BottomBackEdge":r=new D(0,-1,-1);break;case"BottomLeftEdge":r=new D(-1,-1,0);break;case"FrontLeftEdge":r=new D(-1,0,1);break;case"FrontRightEdge":r=new D(1,0,1);break;case"BackRightEdge":r=new D(1,0,-1);break;case"BackLeftEdge":r=new D(-1,0,-1);break;case"TopFrontLeftCorner":r=new D(-1,1,1);break;case"TopFrontRightCorner":r=new D(1,1,1);break;case"TopBackRightCorner":r=new D(1,1,-1);break;case"TopBackLeftCorner":r=new D(-1,1,-1);break;case"BottomFrontLeftCorner":r=new D(-1,-1,1);break;case"BottomFrontRightCorner":r=new D(1,-1,1);break;case"BottomBackRightCorner":r=new D(1,-1,-1);break;case"BottomBackLeftCorner":r=new D(-1,-1,-1)}r&&this.updateHostViewerCamera(r)}},this.onPointerMove=e=>{let t=this.plugin.getNdcPointByPointerEvent(e);t&&(this.updateActivateMaterial(t),this.lastCoords=t)},this.onPointerleave=()=>{this.lastCoords=void 0,this.activateMeshName&&(this.activateMeshName=void 0)},this.cfg=e,this.showAxes=e.showAxes||!1,this.lineColor=e.lineColor||9343125,this.plugin=new nP(this.cfg),this.plugin.update=this.update.bind(this),this.init(),this.initEvent()}init(){var e;this.group=new ar,this.group.name="ViewCube",this.showAxes&&this.group.add(this.createAxes()),this.group.add(this.createViewCubeFaces()),this.group.add(this.createViewCubeEdges()),this.group.add(this.createViewCubeCorners()),null==(e=this.plugin.scene)||e.add(this.group);let t=(new Rt).setFromObject(this.group);this.plugin.zoomToBbox(t)}createAxes(){let e=new qt,t=new D(-50,-50,-50),i=new D(1,0,0),r=new D(0,1,0),n=new D(0,0,1),s=this.AXIS_LENGTH/15,a=this.AXIS_LENGTH/20,o=new jc(i,t,this.AXIS_LENGTH,this.AXIS_COLOR_X,s,a),l=new jc(r,t,this.AXIS_LENGTH,this.AXIS_COLOR_Y,s,a),h=new jc(n,t,this.AXIS_LENGTH,this.AXIS_COLOR_Z,s,a);return e.add(o,l,h),e}createViewCubeFaces(){let e=new qt,t=[],i=new Xt({color:this.FACE_BACKGROUND_COLOR,opacity:0,transparent:!0});Object.keys(this.viewCubeFaces).forEach((e=>{let r=this.viewCubeFaces[e],n=new sP({text:r.text,fontSize:100,color:"#cccccc",backgroundColor:this.FACE_BACKGROUND_COLOR,padding:.8,fontWeight:"bold"});n.redrew();let s=new Xt({map:n,opacity:1,transparent:!0});t.push(s);let a=this.createViewCubeFace(r.name,i,r.position,r.rotation);a.layers.enableAll(),a.userData={textTexture:n,tick:0,translateTick:0},this.faces.push(a)})),e.add(...this.faces);let r=new js(76,76,76),n=new Je(r,t);this.innerViewCubeMesh=n,e.add(n);let s=new Jo(new js(100,100,100)),a=new Xt({color:this.lineColor}),o=new Kr(s,a);return e.add(o),e.position.set(0,0,0),e}createViewCubeFace(e,t,i,r){let n=new En(76,76),s=new Je(n,t);return s.name=e,s.rotateOnAxis(r.axis,r.rad),s.position.copy(i),s}createViewCubeEdges(){let e=new qt,t=this.createEdge("TopFrontEdge",new D(0,51,51),[{axis:Es,rad:gi.Rotate180}]),i=this.createEdge("TopRightEdge",new D(51,51,0),[{axis:Bh,rad:gi.Rotate180},{axis:ya,rad:gi.Rotate90},{axis:Es,rad:0}]),r=this.createEdge("TopBackEdge",new D(0,51,-51),[{axis:Es,rad:gi.Rotate180},{axis:ya,rad:gi.Rotate180}]),n=this.createEdge("TopLeftEdge",new D(-51,51,0),[{axis:Bh,rad:gi.Rotate90},{axis:ya,rad:gi.Rotate180},{axis:Es,rad:gi.Rotate90}]),s=this.createEdge("BottomFrontEdge",new D(0,-51,51),[{axis:Es,rad:0}]),a=this.createEdge("BottomRightEdge",new D(51,-51,0),[{axis:Bh,rad:gi.Rotate90},{axis:ya,rad:0},{axis:Es,rad:gi.Rotate90}]),o=this.createEdge("BottomBackEdge",new D(0,-51,-51),[{axis:Es,rad:0},{axis:ya,rad:gi.Rotate180}]),l=this.createEdge("BottomLeftEdge",new D(-51,-51,0),[{axis:Bh,rad:gi.Rotate90},{axis:ya,rad:gi.Rotate270},{axis:Es,rad:gi.Rotate90}]),h=this.createEdge("FrontRightEdge",new D(51,0,51),[{axis:Es,rad:gi.Rotate90}]),u=this.createEdge("BackRightEdge",new D(51,0,-51),[{axis:Es,rad:gi.Rotate90},{axis:ya,rad:gi.Rotate180}]),c=this.createEdge("BackLeftEdge",new D(-51,0,-51),[{axis:Es,rad:gi.Rotate270},{axis:ya,rad:gi.Rotate180}]),p=this.createEdge("FrontLeftEdge",new D(-51,0,51),[{axis:Es,rad:gi.Rotate270}]);return e.add(t),e.add(i),e.add(r),e.add(n),e.add(s),e.add(a),e.add(o),e.add(l),e.add(h),e.add(u),e.add(c),e.add(p),e}createEdge(e,t,i){let r=new qt,n=new En(this.EDGE_SIZE.x,this.EDGE_SIZE.y),s=new Xt({color:this.EDGE_COLOUR,opacity:this.EDGE_OPACITY,transparent:!0}),a={tick:1},o=new Je(n,s);o.name=e,o.userData=a,o.position.setY(this.EDGE_SIZE.y/2),o.layers.enableAll();let l=new Je(n,s);return l.name=e,l.userData=a,l.position.setZ(-this.EDGE_SIZE.y/2),l.rotateOnAxis(new D(1,0,0),Math.PI/2),l.layers.enableAll(),r.add(o),r.add(l),r.position.copy(t),i.forEach((e=>{r.rotateOnAxis(e.axis,e.rad)})),r}createViewCubeCorners(){let e=new qt,t=this.createCorner("TopFrontLeftCorner",new D(-51,51,51),[{axis:Es,rad:gi.Rotate270}]),i=this.createCorner("TopFrontRightCorner",new D(51,51,51),[{axis:Es,rad:gi.Rotate180}]),r=this.createCorner("TopBackRightCorner",new D(51,51,-51),[{axis:Bh,rad:gi.Rotate90},{axis:ya,rad:gi.Rotate180},{axis:Es,rad:0}]),n=this.createCorner("TopBackLeftCorner",new D(-51,51,-51),[{axis:Bh,rad:gi.Rotate90},{axis:ya,rad:gi.Rotate180},{axis:Es,rad:gi.Rotate90}]),s=this.createCorner("BottomFrontLeftCorner",new D(-51,-51,51),[{axis:Es,rad:0}]),a=this.createCorner("BottomFrontRightCorner",new D(51,-51,51),[{axis:Es,rad:gi.Rotate90}]),o=this.createCorner("BottomBackRightCorner",new D(51,-51,-51),[{axis:Bh,rad:0},{axis:ya,rad:gi.Rotate180},{axis:Es,rad:0}]),l=this.createCorner("BottomBackLeftCorner",new D(-51,-51,-51),[{axis:Bh,rad:0},{axis:ya,rad:gi.Rotate180},{axis:Es,rad:gi.Rotate90}]);return e.add(t),e.add(i),e.add(r),e.add(n),e.add(s),e.add(a),e.add(o),e.add(l),e}createCorner(e,t,i){let r=new qt,n=new En(this.CORNER_WIDTH,this.CORNER_WIDTH),s=new Xt({color:this.CORNER_COLOR,opacity:this.CORNER_OPACITY,transparent:!0}),a={tick:1},o=new Je(n,s);o.name=e,o.userData=a,o.position.set(this.CORNER_WIDTH/2,this.CORNER_WIDTH/2,0),o.layers.enableAll();let l=new Je(n,s);l.name=e,l.userData=a,l.position.set(this.CORNER_WIDTH/2,0,-this.CORNER_WIDTH/2),l.rotateOnAxis(new D(1,0,0),Math.PI/2),l.layers.enableAll();let h=new Je(n,s);return h.name=e,h.userData=a,h.position.set(0,this.CORNER_WIDTH/2,-this.CORNER_WIDTH/2),h.rotateOnAxis(new D(0,1,0),-Math.PI/2),h.layers.enableAll(),r.add(o),r.add(l),r.add(h),r.position.copy(t),i.forEach((e=>{r.rotateOnAxis(e.axis,e.rad)})),r}updateActivateMaterial(e){let t=this.plugin.getIntersects(e);if(this.activateMeshName&&(this.activateMeshName=void 0),!t||0===t.length)return;let i=t[0].object;this.activateMeshName=i.name}initEvent(){this.plugin.container&&(this.plugin.container.addEventListener("pointerdown",this.onPointerDown),this.plugin.container.addEventListener("pointermove",this.onPointerMove),this.plugin.container.addEventListener("pointerleave",this.onPointerleave))}update(){var e;if(!this.hostViewer||!this.hostViewer.camera)return;let t=this.hostViewer.camera;if(t){let e=new D;t.getWorldDirection(e);let i=t.up;this.updateCameraDirection(e,i)}this.lastCoords&&this.updateActivateMaterial(this.lastCoords),null==(e=this.plugin.scene)||e.traverse((e=>{e instanceof Je&&this.updateViewCube(e)}))}updateViewCube(e){if(this.updateMeshTick(e),e.name.indexOf("Face")>-1){let t=e.userData.textTexture;if(t){let i=HV(this.FACE_BACKGROUND_COLOR,this.FACE_HOVER_BACKGROUND_COLOR,e.userData.tick);t.updateConfig({backgroundColor:i}),t.redrew()}if(this.innerViewCubeMesh){this.updateMeshTick(e,"translateTick",5);let t=e.position.clone().normalize(),i=Math.max(2*e.userData.translateTick-5,0);t.multiplyScalar(3*i),i>0&&this.innerViewCubeMesh.position.copy(t)}}else if(e.name.indexOf("Edge")>-1){let t=e.material,i=HV(this.EDGE_COLOUR,this.FACE_HOVER_BACKGROUND_COLOR,e.userData.tick);t.color.set(i),t.opacity=e.userData.tick}else if(e.name.indexOf("Corner")>-1){let t=e.material,i=HV(this.CORNER_COLOR,this.FACE_HOVER_BACKGROUND_COLOR,e.userData.tick);t.color.set(i);let r=1+.3*e.userData.tick;e.parent&&e.parent.scale.set(r,r,r)}}updateMeshTick(e,t="tick",i=1){void 0!==e.userData[t]&&(e.name===this.activateMeshName&&e.userData[t]<i?e.userData[t]+=.05:e.name!==this.activateMeshName&&e.userData[t]>0&&(e.userData[t]-=.05),e.userData[t]=Math.min(Math.max(e.userData[t],0),i))}updateHostViewerCamera(e){var t,i;if(null==(t=this.hostViewer)||!t.camera||null==(i=this.hostViewer)||!i.controls)return;e.normalize();let r=this.hostViewer.controls instanceof Io?this.hostViewer.getBBox().getCenter(new D):this.hostViewer.controls.target,n=this.hostViewer.camera.position.distanceTo(r);this.hostViewer.flyTo(r.clone().add(e.clone().multiplyScalar(n)),r)}updateCameraDirection(e,t){this.plugin.camera&&e&&(e.normalize(),this.plugin.camera.position.set(200*-e.x+0,200*-e.y+0,200*-e.z+0),this.plugin.camera.lookAt(0,0,0),this.plugin.camera.up=t,this.plugin.camera.updateMatrixWorld())}setHostViewer(e){this.hostViewer=e}destroy(){var e,t,i;null==(e=this.plugin.container)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.plugin.container)||t.removeEventListener("pointermove",this.onPointerMove),null==(i=this.plugin.container)||i.removeEventListener("pointerleave",this.onPointerleave),this.plugin.destroy(),this.hostViewer=void 0,this.activateMeshName=void 0}},oP=class{constructor(){this.vertexShader="\n varying vec2 vUv;\n void main( void ) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);\n }",this.fragmentShader="\n uniform vec3 keyColor;\n uniform float similarity;\n uniform float smoothness;\n varying vec2 vUv;\n uniform sampler2D map;\n void main() {\n vec4 videoColor = texture2D(map, vUv);\n\n float Y1 = 0.299 * keyColor.r + 0.587 * keyColor.g + 0.114 * keyColor.b;\n float Cr1 = keyColor.r - Y1;\n float Cb1 = keyColor.b - Y1;\n \n float Y2 = 0.299 * videoColor.r + 0.587 * videoColor.g + 0.114 * videoColor.b;\n float Cr2 = videoColor.r - Y2; \n float Cb2 = videoColor.b - Y2; \n \n float blend = smoothstep(similarity, similarity + smoothness, distance(vec2(Cr2, Cb2), vec2(Cr1, Cb1)));\n gl_FragColor = vec4(videoColor.rgb, videoColor.a * blend); \n }";let e=document.createElement("video");this.webcam=e,navigator.mediaDevices.getUserMedia({video:{width:600,height:400}}).then((t=>{e.srcObject=t,e.onloadedmetadata=()=>{e.setAttribute("autoplay","true"),e.setAttribute("playsinline","true"),e.play()}})).catch((function(e){alert(e.name+": "+e.message)})),this.webcamCanvas=document.createElement("canvas");let t=this.webcamCanvas.getContext("2d");this.canvasCtx=t,t.fillStyle="#000000",t.fillRect(0,0,this.webcamCanvas.width,this.webcamCanvas.height);let i=new Pi(this.webcamCanvas);this.webcamTexture=i,i.minFilter=hi,i.magFilter=hi,this.shaderMaterial=new Zt({transparent:!0,uniforms:{map:{value:i},keyColor:{value:[0,1,0]},similarity:{value:.3},smoothness:{value:0}},vertexShader:this.vertexShader,fragmentShader:this.fragmentShader})}getShaderMaterial(){return this.shaderMaterial}createWebCamPlane(e=5,t=4){let i=new En(e,t);return new Je(i,this.shaderMaterial)}animate(){this.webcam.readyState===this.webcam.HAVE_ENOUGH_DATA&&(this.canvasCtx.drawImage(this.webcam,0,0,this.webcamCanvas.width,this.webcamCanvas.height),this.webcamTexture.needsUpdate=!0)}},qAe=new D,YAe=new $i,XAe=class extends lm{constructor(e,t){var i;super(e),this.name="BimViewer",this.timer=Date.now(),this.selectedObject=void 0,this.sceneBackgroundColor=new Ve(15463159),this.loadedModels={},this.loaded3dTiles={},this.composerRenderEnabled=!0,this.composerEnabled=!1,this.savedMaterialsForOpacity=[],this.raf=new VE,this.clock=new Vl,this.renderEnabled=!0,this.isFrustumInsectChecking=!1,this.lastFrameExecuteTime=Date.now(),this.maxFps=60,this.settings=gE,this.twoDModelCount=0,this.bbox=new Rt,this.onResize=()=>{this.viewerContainer&&this.viewerContainer.parentElement&&this.resize(this.viewerContainer.parentElement.clientWidth,this.viewerContainer.parentElement.clientHeight)},this.onKeyDown=e=>{let t=this.camera,i=this.controls;if(!t||!i)return;let r=this.settings.keyboard.sensitivity||3,n=i.getPosition(new D),s=i.getTarget(new D),a=s.clone();if("ArrowLeft"===e.code||"ArrowRight"===e.code){let t=Math.PI*r/180;"ArrowLeft"===e.code&&(t=-t),a.x=(s.x-n.x)*Math.cos(t)-(s.z-n.z)*Math.sin(t)+n.x,a.z=(s.z-n.z)*Math.cos(t)+(s.x-n.x)*Math.sin(t)+n.z,i.setTarget(a.x,a.y,a.z)}else if("ArrowUp"===e.code||"ArrowDown"===e.code){let t=Math.PI*r/180,o=new D(s.x-n.x,s.y-n.y,s.z-n.z).length(),l=s.y-n.y;"ArrowDown"===e.code&&(t=-t);let h=Math.asin(l/o)+t;if(h<-Math.PI/2||h>Math.PI/2)return;let u=Math.sin(h)*o;a.y=s.y+(u-l),i.setTarget(a.x,a.y,a.z)}else if("KeyW"===e.code){let e=.01*r,a=n.distanceTo(s);if(a<10*t.near){let e=i.getTarget(new D).lerp(n,-t.near/a);i.setTarget(e.x,e.y,e.z)}n.lerp(s,e),i.setLookAt(n.x,n.y,n.z,s.x,s.y,s.z)}else if("KeyS"===e.code){let e=.01*r;n.lerp(s,-e),i.setLookAt(n.x,n.y,n.z,s.x,s.y,s.z,!1)}else if("KeyF"===e.code)this.flyToSelectedObject();else if("KeyT"===e.code){this.raycaster&&this.raycaster.layers.set(10);let e=this.getIntersections();if(e.length>0){let r=e.find((e=>{let t=e.object;return t.visible&&t instanceof Je}));if(r&&r.point&&this.camera&&this.controls){let e=this.camera.position,n=r.point,s=i.getTarget(new D),a=e.distanceTo(n);if(a>t.near&&a<t.far){let t=e.distanceTo(s),r=e.clone().lerp(s,a/t);i.setTarget(r.x,r.y,r.z)}}}}else"KeyY"===e.code&&this.flyTo(n,s.clone().setY(n.y));this.enableRender()},this.enableRender=(e=1e3)=>{this.renderEnabled=!0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.timeoutSymbol=this.raf.setTimeout((()=>{this.renderEnabled=!1,this.composerRenderEnabled=!0}),e))},this.applyOptionsAndAddToScene=(e,t,i)=>{re.info(`[BimViewer] '${e}' is loaded in ${(Date.now()-this.timer)/1e3}s, adding to scene...`),this.timer=Date.now();let r=i.src&&i.src.toLowerCase();if(r&&r.endsWith("dxf")&&this.twoDModelCount++,i.matrix&&16===i.matrix.length){let e=new Be;e.elements=i.matrix,t.applyMatrix4(e)}else{let e=i.position||[0,0,0],r=i.rotation||[0,0,0],n=i.scale||[1,1,1];t.position.set(e[0],e[1],e[2]),t.rotation.set(r[0]*Math.PI/180,r[1]*Math.PI/180,r[2]*Math.PI/180),t.scale.set(n[0],n[1],n[2])}t.matrixAutoUpdate=!1,t.updateMatrix(),t.traverse((e=>{e.matrixAutoUpdate&&(e.matrixAutoUpdate=!1,e.updateMatrix())}));let n=i.instantiate,s=i.merge;n?setTimeout((()=>{this.instantiate(t),setTimeout((()=>{s&&this.merge(t),this.addLoadedModelToScene(t,i)}),0)}),0):s?setTimeout((()=>{this.merge(t),setTimeout((()=>this.addLoadedModelToScene(t,i)),0)}),0):this.addLoadedModelToScene(t,i)},this.onAnchorPointerDown=e=>{var t,i;null==(t=this.controls)||!t.enableRotate||!this.renderer||null!=(i=this.sectionManager)&&i.isSectionActive()||this.setOrbitPoint(e)},this.onAnchorPointerUp=()=>{this.anchor&&(this.anchor.className="anchor"),!this.viewerContainer||!this.camera||this.controls},this.viewerCfg=Mr(Mr({},ZCe),e),re.info("[BimViewer]","viewerCfg:",this.viewerCfg),this.settings=gE,this.cameraCfg=t,this.cameraCfg&&this.cameraCfg.near&&(this.settings.camera.near=this.cameraCfg.near),this.cameraCfg&&this.cameraCfg.far&&(this.settings.camera.far=this.cameraCfg.far),this.increaseJobCount(),this.init(),this.animate(),this.renderer&&(null==(i=this.viewerContainer)||i.append(this.renderer.domElement)),this.decreaseJobCount(),re.info(`[BimViewer] Initialized in ${(Date.now()-this.timer)/1e3}s`)}init(){let e=this.viewerCfg;this.initThree(),xr.isBrowser&&!e.context&&this.initDom(),this.initEvents(),this.initControls()}initThree(){this.initScene(),this.initRenderer(),this.initCamera(),this.initLights()}initDom(){let e=this.viewerCfg;this.initSpinner(),this.initCSS2DRenderer(),!0===e.enableDatGui&&this.initDatGui(),this.initOthers(),!0===e.enableAxisGizmo&&(this.axes=this.initAxes()),!0===e.enableStats&&(this.stats=this.initStats()),e.enableToolbar&&(this.toolbar=this.initToolbar()),e.enableBottomBar&&(this.bottomBar=this.initBottomBar()),e.enableNavCube&&(this.navCube=this.initNavCube()),e.enableViewCube&&(this.viewCube=this.initViewCube()),e.enableContextMenu&&(this.contextMenu=this.initContextMenu())}initScene(){this.scene=new wn,this.scene.matrixAutoUpdate=!1}initRenderer(){this.renderer=new go({antialias:!0,preserveDrawingBuffer:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.renderer.outputEncoding=yr,this.renderer.toneMappingExposure=1,this.renderer.physicallyCorrectLights=!0,this.renderer.setClearColor(11119017,1),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=Yy,Tt.printGpuInfo(this.renderer.getContext()),this.pmremGenerator=new Hp(this.renderer),this.pmremGenerator.compileEquirectangularShader(),this.enableOverlayRenderer&&(this.overlayRender=new Rr(this)),this.setEnvironmentFromDataArray()}initCSS2DRenderer(){var e;let t=new nh;t.setSize(this.width,this.height),t.domElement.style.height="0",t.domElement.style.width="0",t.domElement.style.position="absolute",t.domElement.style.top="0",t.domElement.style.left="0",t.domElement.style.overflow="visible",t.domElement.classList.add("css2d-renderer"),null==(e=this.viewerContainer)||e.appendChild(t.domElement),this.css2dRenderer=t}initCamera(){this.scene&&(this.perspectiveCamera=new Vr(45,this.width/this.height,this.settings.camera.near,this.settings.camera.far),this.perspectiveCamera.position.set(0,100,0),this.scene.add(this.perspectiveCamera),this.camera=this.perspectiveCamera)}initControls(e=!1){if(!this.renderer)return;xr.printDeviceInfo();let t,i=e?this.orthoCamera:this.perspectiveCamera;i&&this.inputManager&&((!this.perspectiveCameraControls||!this.orthoCameraConrols)&&(t=new Io(i,this.inputManager),t.dollySpeed=.1,t.dollyToCursor=!0,t.enabled=!0,t.keyTruckSpeed=10,t.restThreshold=0,t.keys={left:"KeyD",up:"KeyE",right:"KeyA",bottom:"KeyQ"},t.listenToKeyEvents(),t.update(0)),t&&(e?(this.orthoCameraConrols=t,t.minZoom=3):(this.perspectiveCameraControls=t,this.bbox&&(t.minDistance=.1,t.maxDistance=3*this.bbox.getSize(new D).length())),this.controls=t))}initRotateToCursor(){this.anchor=this.createAnchor()}initLights(){if(!this.scene)return;let e=16777215,t=new Ns(e,1.5);t.name="sun",t.castShadow=!0,t.position.set(-2,2,4),t.shadow.autoUpdate=!1,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,this.directionalLight=t,this.scene.add(t),this.scene.add(t.target),this.directionalLightHelper=new Nx(this.directionalLight),this.directionalLightHelper.visible=!1,this.scene.add(this.directionalLightHelper),this.shadowCameraHelper=new Lx(this.directionalLight.shadow.camera),this.shadowCameraHelper.visible=!1,this.scene.add(this.shadowCameraHelper),this.ambientLight=new Gl(3158064),this.hemisphereLight=new bf(e,14540253,.2),this.hemisphereLight.position.set(0,300,0),this.scene.add(this.ambientLight),this.scene.add(this.hemisphereLight)}initEvents(){if(!this.renderer)return;let e=new e0(this.renderer.domElement);this.inputManager=e;let t,i=!1,r=!1;e.addEventListener("pointerdown",(e=>{r=!1,i=!0,0===e.button&&this.onAnchorPointerDown(e)})),e.addEventListener("pointermove",(()=>{i&&(r=!0)})),e.addEventListener("pointerup",(()=>{i=!1,this.onAnchorPointerUp()})),e.addEventListener("click",(e=>{var i;r?r=!1:(t&&clearTimeout(t),t=setTimeout((()=>{0===e.button&&this.handleMouseClick(e)}),300),(!this.selectedObject||this.selectedObject&&this.selectedObject instanceof qt)&&(null==(i=this.contextMenu)||i.hide()))})),e.addEventListener("dblclick",(e=>{var i,n;!r&&null!=(i=this.sectionManager)&&i.isSectionActive()&&null!=(n=this.measurementManager)&&n.isMeasurementActive()||(t&&clearTimeout(t),this.handleMouseClick(e),this.flyToSelectedObject(),this.enableRender())})),e.addEventListener("keydown",(e=>{this.onKeyDown(e)})),e.addEventListener("contextmenu",(e=>{var t,i;r||null!=(t=this.sectionManager)&&t.isSectionActive()||null!=(i=this.measurementManager)&&i.isMeasurementActive()||this.handleRightClick(e)})),this.initRotateToCursor(),this.raycaster=new ka}initDatGui(){this.datGui=new iP(this),this.datGui.close()}initOthers(){if(!this.scene||!this.renderer||!this.camera)return;let e=this.datGui&&this.datGui.controls;e&&(e.showGroundGrid&&(this.groundGrid=aa.createGroundGrid(),this.scene.add(this.groundGrid)),e.showGrassGround&&ct(this,null,(function*(){this.grassGround=yield aa.createGrassGround(),this.scene&&this.scene.add(this.grassGround),this.enableRender()})),e.webcam&&this.enableWebCam(),this.composerEnabled=e.composerEnabled,this.composerEnabled&&(this.enableComposer(!0),this.enableRenderPass(e.renderPassEnabled),this.enableFxaaPass(e.fxaaEnabled),this.enableSaoPass(e.saoEnabled),this.enableSsaoPass(e.ssaoEnabled),this.enableOutlinePass(e.outlineEnabled),this.enableSsaaPass(e.ssaaEnabled),this.enableBloomPass(e.bloomEnabled),this.enableUnrealBloomPass(e.unrealBloomEnabled))),this.renderer.domElement.style.outlineWidth="0"}initNavCube(){var e;let t=document.createElement("div");t.id="navCube";let i=new y3;return i.renderer&&(t.appendChild(i.renderer.domElement),i.setHostViewer(this)),null==(e=this.widgetContainer)||e.appendChild(t),i}initViewCube(){var e;let t=document.createElement("div");t.id="viewCube",null==(e=this.widgetContainer)||e.appendChild(t);let i=new aP({containerId:t.id});return i.setHostViewer(this),i}initAxes(){var e,t;let i=document.createElement("div");i.classList.add("axesRenderer");let r=new Of(i,this.camera);return null==(e=this.widgetContainer)||e.append(i),this.axesInScene=new mE(!1),null==(t=this.scene)||t.add(this.axesInScene),r}initStats(){var e;let t=z3();t.setMode(0);let i=document.createElement("div");return i.classList.add("statsOutput"),i.appendChild(t.domElement),null==(e=this.widgetContainer)||e.append(i),t}initContextMenu(){let e=new Z3({items:IAe,context:{bimViewer:this,toolbar:this.toolbar,section:this.section},container:this.widgetContainer});return window.oncontextmenu=e=>e.preventDefault(),e}initToolbar(){let e=this.viewerCfg;return new Nh(this,(0,ym.merge)({},YCe,e.toolbarMenuConfig))}initBottomBar(){return new fm(this)}get has2dModel(){return this.twoDModelCount>0}showContextMenu(e){if(!this.contextMenu||!this.widgetContainer)return;this.raycaster&&this.raycaster.layers.set(10);let t=this.getAllIntersections(e);re.debug("[BimViewer] showContextMenu intersections = ",t);let i,r=(0,ym.find)(t,(e=>{let t=e.object;return t instanceof Je&&t.visible})),n=this.contextMenu.context,s=null==r?void 0:r.instanceId,a=null==r?void 0:r.faceIndex;a&&(i=Zi.getBatchIdByFaceIndex(null==r?void 0:r.object,a)),this.contextMenu.context=Ln(Mr({},n),{hit:null==r?void 0:r.object,instanceId:s,batchId:i});let{x:o,y:l}=e;this.contextMenu.show(o,l)}handleRightClick(e){this.showContextMenu(e)}sycnCameraPosition(e,t){let i=e.position;if(t.position.set(i.x,i.y,i.z),this.scene){let e=this.scene.position;t.lookAt(e)}}sycnControls(e,t){let i=e.getTarget(new D),r=e.getPosition(new D);t.setPosition(r.x,r.y,r.z),t.setTarget(i.x,i.y,i.z)}setToOrthographicCamera(e=!1){var t;if(!this.scene||!this.controls)return;let i=this.perspectiveCamera,r=this.perspectiveCameraControls,n=this.orthoCamera,s=this.orthoCameraConrols;e?(n||(n=new Ni(-this.width/2,this.width/2,this.height/2,-this.height/2,this.settings.camera.near,this.settings.camera.far),n.position.set(0,100,0),n.zoom=10,n.updateProjectionMatrix(),this.scene&&this.scene.add(n),this.orthoCamera=n),s||(this.initControls(!0),s=this.orthoCameraConrols),i&&(this.sycnCameraPosition(i,n),n.zoom=10,n.updateProjectionMatrix()),r&&s&&i&&this.sycnControls(r,s),this.camera=n,this.controls=s):(i&&n&&this.sycnCameraPosition(n,i),r&&s&&n&&this.sycnControls(s,r),this.camera=i,this.controls=r),null==(t=this.axes)||t.setHostCamera(this.camera),this.resize(this.width,this.height),this.dispatchEvent("CameraChanged")}animate(){var e,t,i,r;this.requestAnimationFrameHandle=requestAnimationFrame(this.animate.bind(this));let n=this.clock.getDelta(),s=this.controls&&this.controls.update(n);if(this.maxFps>0){if(Date.now()-this.lastFrameExecuteTime<1e3/this.maxFps)return;this.lastFrameExecuteTime=Date.now()}if(this.webcam&&this.webcam.animate(),this.scene&&this.camera){if(this.viewerContainer&&this.viewerContainer.parentElement){let{width:e,height:t}=this.viewerContainer.parentElement.getBoundingClientRect();(this.width!==e||this.height!==t)&&this.resize(e,t)}(this.renderEnabled||s)&&(this.update3dTiles(),null==(e=this.renderer)||e.render(this.scene,this.camera),this.hotpointRoot&&this.hotpointRoot.children.length>0&&(null==(t=this.css2dRenderer)||t.render(this.scene,this.camera)),this.dispatchEvent("AfterRender"))}this.composerRenderEnabled&&this.composer&&this.composerEnabled&&(this.composer.render(),this.composerRenderEnabled=!1),this.frustrumCullingByModelBBox(),null==(i=this.stats)||i.update(),null==(r=this.bottomBar)||r.update()}update3dTiles(){if(!this.camera)return;let e=Object.values(this.loaded3dTiles);0!==e.length&&(this.camera.updateMatrixWorld(),e.forEach((e=>{e.renderer.update()})))}frustrumCullingByModelBBox(){let e=new na,t=new Be;this.isFrustumInsectChecking=!0,this.camera&&(t.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),e.setFromProjectionMatrix(t),Object.values(this.loadedModels).forEach((t=>{let i=this.scene&&this.scene.getObjectById(t.id),r=t.bbox;i&&r&&this.scene&&(void 0===i.userData._visible&&(i.userData._visible=!0,Object.defineProperties(i,{visible:{set:e=>{i.userData._visible=e,this.isFrustumInsectChecking||(i.userData.userConfigVisibility=!0)},get:()=>i.userData._visible}})),void 0===i.userData.userConfigVisibility&&(i.visible=e.intersectsBox(r)))})),Object.values(this.loaded3dTiles).forEach((t=>{let i=t.renderer.group;i&&!t.bbox.isEmpty()&&this.scene&&(void 0===i.userData._visible&&(i.userData._visible=!0,Object.defineProperties(i,{visible:{set:e=>{i.userData._visible=e,this.isFrustumInsectChecking||(i.userData.userConfigVisibility=!0)},get:()=>i.userData._visible}})),void 0===i.userData.userConfigVisibility&&(i.visible=e.intersectsBox(t.bbox)))}))),this.isFrustumInsectChecking=!1}destroy(){var e,t,i,r,n;null==(e=this.inputManager)||e.removeEventListener(),this.datGui&&this.datGui.gui&&(this.datGui.beforeDestroy(),this.datGui=void 0);let s=this.webcamPlane;this.scene&&s&&(this.scene.remove(s),s.geometry.dispose(),s.material.dispose(),this.webcamPlane=void 0),this.webcam=void 0,this.composer=void 0,this.renderPass=void 0,this.effectFxaaPass=void 0,this.saoPass=void 0,this.ssaoPass=void 0,this.outlinePass=void 0,this.ambientLight=void 0,this.directionalLight=void 0,this.hemisphereLight=void 0,this.directionalLightHelper&&(this.directionalLightHelper.dispose(),this.directionalLightHelper=void 0),this.controls&&(this.disposeRotateToCursor(),this.controls.dispose(),this.controls=void 0),this.perspectiveCameraControls&&(this.perspectiveCameraControls.dispose(),this.perspectiveCameraControls=void 0),this.shadowCameraHelper&&(this.shadowCameraHelper.dispose(),this.shadowCameraHelper=void 0),this.css2dRenderer&&(null==(t=this.viewerContainer)||t.removeChild(this.css2dRenderer.domElement),this.css2dRenderer=void 0),this.stats=void 0,this.raycaster=void 0,this.selectedObject=void 0,this.groundGrid&&(this.groundGrid.geometry.dispose(),this.groundGrid.material.dispose(),this.groundGrid.clear(),this.groundGrid=void 0),this.grassGround&&(this.grassGround.geometry.dispose(),this.grassGround.material.dispose(),this.grassGround.clear(),this.grassGround=void 0),this.skyOfGradientRamp&&(this.skyOfGradientRamp.geometry.dispose(),this.skyOfGradientRamp.material.dispose(),this.skyOfGradientRamp.clear(),this.skyOfGradientRamp=void 0),this.savedMaterialsForOpacity=void 0,this.section=void 0,this.sectionType=void 0,Object.keys(this.loadedModels).forEach((e=>{delete this.loadedModels[e]})),Object.values(this.loaded3dTiles).forEach((e=>{e.renderer.dispose()})),this.loaded3dTiles={},this.perspectiveCamera=void 0,this.perspectiveCameraControls=void 0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.raf=void 0),this.contextMenu&&(this.contextMenu.destroy(),this.contextMenu=void 0),this.navCube&&(this.navCube.dispose(),this.navCube=void 0),this.viewCube&&(this.viewCube.destroy(),this.viewCube=void 0),this.axes&&(this.axes.dispose(),this.axes=void 0),this.axesInScene&&(this.axesInScene.clear(),this.axesInScene=void 0),this.toolbar&&(this.toolbar.destroy(),this.toolbar=void 0),this.font=void 0,this.pmremGenerator&&(this.pmremGenerator.dispose(),this.pmremGenerator=void 0),null==(i=this.measurementManager)||i.destroy(),this.measurementManager=void 0,null==(r=this.zoomToRectHelper)||r.destroy(),this.zoomToRectHelper=void 0,null==(n=this.sectionManager)||n.destroy(),this.sectionManager=void 0,super.destroy()}loadLocalModel(e,t,i,r){return ct(this,null,(function*(){let n;this.timer=Date.now(),this.increaseJobCount();try{let s=new pl(i);this.font&&s.setFont(this.font),n=yield s.loadLocalModel(e,t.src,r)}catch(e){let r=`Error loading ${t.src}`;return re.error(r,e),Promise.reject(r)}finally{this.decreaseJobCount()}return n?(this.applyOptionsAndAddToScene(e,n,t),Promise.resolve()):Promise.reject()}))}loadModel(e,t){return ct(this,null,(function*(){let i;this.timer=Date.now(),this.increaseJobCount();try{let r=new pl;this.font&&r.setFont(this.font),i=yield r.loadModel(e.src,e.fileFormat,t)}catch(t){let r=`Error loading ${e.src}`;return re.error(r,t),Promise.reject(r)}finally{this.decreaseJobCount()}return i?(this.applyOptionsAndAddToScene(e.src,i,e),Promise.resolve()):Promise.reject()}))}load3dTiles(e){return ct(this,null,(function*(){var t;this.timer=Date.now(),this.increaseJobCount();let i=new oS(e.src),r=new Rt,n=yield new Promise(((t,n)=>{i.onLoadTileSet=()=>{i.getBounds(r)||(i.getBoundingSphere(YAe)?YAe.getBoundingBox(r):(re.warn(`[BimViewer] Can't get the correct bounding box of 3dTiles '${e.src}'!`),n())),re.debug(r),i.onLoadTileSet=null;let s=i.group;re.debug(s),t(s)},i.onLoadModel=e=>{e.traverse((e=>{e.matrixAutoUpdate&&(e.matrixAutoUpdate=!1,e.updateMatrix()),e.isMesh&&(e.castShadow=!0,e.receiveShadow=!0),e.geometry&&e.layers.enableAll()})),e.updateWorldMatrix(!1,!0),this.updateDirectionalLightShadow(),this.enableRender()},i.setCamera(this.camera),i.setResolutionFromRenderer(this.camera,this.renderer),i.update()}));if(n){let s=Date.now(),a=e.modelId||e.src;if(this.loaded3dTiles[a]){let e=1;for(;this.loaded3dTiles[`${a}_${e}`];)e++;a=`${a}_${e}`,re.warn(`[BimViewer] 3dTiles '${a}' is loaded more than once!`)}if(this.loaded3dTiles[a]={id:n.id,bbox:r,renderer:i},e.matrix&&16===e.matrix.length){let t=new Be;t.elements=e.matrix,n.applyMatrix4(t)}else{let t=e.position||[0,0,0],i=e.rotation||[0,0,0],r=e.scale||[1,1,1];n.position.set(t[0],t[1],t[2]),n.rotation.set(i[0]*Math.PI/180,i[1]*Math.PI/180,i[2]*Math.PI/180),n.scale.set(r[0],r[1],r[2])}if(n.matrixAutoUpdate=!1,n.updateMatrix(),n.updateMatrixWorld(!0),null==(t=this.scene)||t.add(n),r.applyMatrix4(n.matrix),this.computeBoundingBox(),this.tryAdjustDirectionalLight(),0===Object.keys(this.loadedModels).length&&1===Object.keys(this.loaded3dTiles).length){let e=this.datGui&&this.datGui.controls;this.regenSkyOfGradientRamp(),e&&e.showGroundGrid&&this.regenGroundGrid(),this.tryAdjustCameraNearAndFar(),this.goToHomeView()}return re.info(`[BimViewer] Added 3dTiles '${e.src}' to scene in ${(Date.now()-s)/1e3}s`),this.enableRender(),this.decreaseJobCount(),Promise.resolve()}return this.decreaseJobCount(),Promise.reject()}))}setFont(e){return ct(this,null,(function*(){let t=Date.now();mh.isShxFile(e[0])?this.font=yield(new mh).loadAsync(e):(e.length>1&&re.warn("[BimViewer] Only support 1 typeface font file for now, others will be ignored!"),this.font=yield(new kf).loadAsync(e[0])),re.info(`[BimViewer] Font file(s) load time in ${(Date.now()-t)/1e3}s`)}))}setDracoDecoderPath(e){pl.setDracoDecoderPath(e)}addLoadedModelToScene(e,t){if(!this.scene)return;if(t.merge){let t=Date.now();gT.createMeshBvhAsync([e],{saveOriginalIndex:!0}),re.info(`[BimViewer] Creates mesh bvh cost ${(Date.now()-t)/1e3}s`)}e.traverse((e=>{e.isMesh&&(e.castShadow=!0,e.receiveShadow=!0),e.geometry&&e.layers.enableAll()})),this.scene.add(e);let i=(new Rt).setFromObject(e),r=t.modelId||t.src;if(this.loadedModels[r]){let e=1;for(;this.loadedModels[`${r}_${e}`];)e++;r=`${r}_${e}`,re.warn(`[BimViewer] Model '${r}' is loaded more than once!`)}this.loadedModels[r]={id:e.id,bbox:i},this.computeBoundingBox(),this.tryAdjustDirectionalLight();let n=Object.values(this.loadedModels).map((e=>e.id));if(Object.values(this.loaded3dTiles).forEach((e=>n.push(e.id))),!n||n.length<=1){if(this.has2dModel)this.setToOrthographicCamera(!0),this.skyOfGradientRamp&&this.scene.remove(this.skyOfGradientRamp);else{let e=this.datGui&&this.datGui.controls;this.regenSkyOfGradientRamp(),e&&e.showGroundGrid&&this.regenGroundGrid()}this.tryAdjustCameraNearAndFar(),this.goToHomeView()}t.edges&&kr.addOutlines(e),re.info(`[BimViewer] Added '${t.src}' to scene in ${(Date.now()-this.timer)/1e3}s`),this.enableRender(),this.decreaseJobCount(),this.dispatchEvent("ModelLoaded")}addOrRemoveObjectOpacity(e=!0,t=.3,i,r){if(this.savedMaterialsForOpacity||(this.savedMaterialsForOpacity=[]),!this.scene)return;let n=this.scene,s=[],a=Object.values(this.loadedModels).map((e=>e.id));Object.values(this.loaded3dTiles).forEach((e=>a.push(e.id))),a.forEach((a=>{if(e){this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0&&kr.revertObjectOpacityById(n,a,this.savedMaterialsForOpacity);let e=kr.setObjectOpacityById(n,a,t,i,r);s.push(...e)}else this.savedMaterialsForOpacity&&kr.revertObjectOpacityById(n,a,this.savedMaterialsForOpacity)})),this.savedMaterialsForOpacity=e?s:[],this.enableRender()}hasTransparentObject(){return!!(this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0)}showVertexNormals(e,t=.1){var i,r,n;e?(this.vertexNormalsHelpers||(this.vertexNormalsHelpers=new ar),null==(i=this.scene)||i.traverseVisible((e=>{var i;if(e instanceof Je&&!["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"].includes(e.name)){if(!e.geometry.attributes.normal)return;let r=new V3(e,t,16711680);null==(i=this.vertexNormalsHelpers)||i.add(r)}})),null==(r=this.scene)||r.add(this.vertexNormalsHelpers)):this.vertexNormalsHelpers&&(null==(n=this.scene)||n.remove(this.vertexNormalsHelpers),this.vertexNormalsHelpers=void 0)}resize(e,t){let i=this.camera;i&&(this.width=e||window.innerWidth,this.height=t||window.innerHeight,i instanceof Vr?i.aspect=this.width/this.height:i instanceof Ni&&(i.left=-this.width/2,i.right=this.width/2,i.top=this.height/2,i.bottom=-this.height/2),i.updateProjectionMatrix(),this.renderer&&this.renderer.setSize(this.width,this.height),this.composer&&this.composer.setSize(this.width,this.height),this.effectFxaaPass&&this.effectFxaaPass.uniforms.resolution.value.set(1/this.width,1/this.height),this.overlayRender&&this.overlayRender.setSize(this.width,this.height)),this.width=e,this.height=t,this.enableRender()}getRaycaster(){return this.raycaster}getRaycastableObjectsByMouse(e){let t=[];if(!(this.raycaster&&this.camera&&this.scene&&e&&this.viewerContainer))return t;let i=new ce(e.x,e.y),r=xi.screenPoint2NdcPoint(i,this.camera,this.viewerContainer);return this.camera.updateMatrixWorld(),this.raycaster.setFromCamera(r,this.camera),t=this.getRaycastableObjects(),t}getRaycastableObjects(){let e=[];return Object.values(this.loadedModels).forEach((t=>{let i=this.scene&&this.scene.getObjectById(t.id);i&&i.visible&&e.push(i)})),Object.values(this.loaded3dTiles).forEach((t=>{let i=this.scene&&this.scene.getObjectById(t.id);i&&i.visible&&e.push(i)})),e}getIntersections(e){let t=this.getRaycastableObjectsByMouse(e),i=this.raycaster&&this.raycaster.intersectObjects(t,!0)||[];return this.renderer&&this.renderer.clippingPlanes.length>0&&(i=i.filter((e=>{var t;return null==(t=this.renderer)?void 0:t.clippingPlanes.every((function(t){return t.distanceToPoint(e.point)>0}))}))),i}getAllIntersections(e){if(!(this.raycaster&&this.camera&&this.scene&&this.viewerContainer))return[];let t=new ce(null==e?void 0:e.x,null==e?void 0:e.y),i=xi.screenPoint2NdcPoint(t,this.camera,this.viewerContainer);this.raycaster.setFromCamera(i,this.camera);let r=this.scene.children,n=this.raycaster.intersectObjects(r,!0)||[];return this.renderer&&this.renderer.clippingPlanes.length>0&&(n=n.filter((e=>{var t;return null==(t=this.renderer)?void 0:t.clippingPlanes.every((function(t){return t.distanceToPoint(e.point)>0}))}))),n}handleMouseClick(e){var t,i,r;if(null!=(t=this.measurementManager)&&t.isMeasurementActive()||null!=(i=this.sectionManager)&&i.isSectionActive())return;let n=Date.now();this.raycaster&&this.raycaster.layers.set(12);let s=this.getIntersections(e);re.debug(`[BimViewer] getIntersections costs ${(Date.now()-n)/1e3}s`);let a,o,l=s.find((e=>{let t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof Je)})),h=l&&l.object||void 0;if(h)if(h instanceof sn)a=l.instanceId,this.selectedObject&&this.selectedObject.id===h.id&&this.selectedObject.userData.instanceId===a&&(h=void 0);else if(Zi.isMergedMesh(h)){let e=l&&l.faceIndex||-1;e>=0?(o=Zi.getBatchIdByFaceIndex(h,e),this.selectedObject&&this.selectedObject.id===h.id&&this.selectedObject.userData.batchId===o&&(h=void 0)):h=void 0}else this.selectedObject&&this.selectedObject.id===h.id&&(h=void 0);if(s.length>0&&s[0].point){let e=null==(r=this.overlayRender)?void 0:r.getDrawablesByPosition(s[0].point,this.raycaster);e&&e.length>0&&(h=e[0])}this.selectedObject&&this.clearSelection(),h?this.selectObject(h,a,o):this.clearSelection()}selectObject(e,t,i,r=void 0){if(e instanceof Ys)return this.selectedObject=e,this.selectedObject.selected=!0,void this.enableRender();if(this.selectedObject){let t=this.selectedObject.userData;if(null!=t.instanceId&&t.originalMatrix&&t.clonedMesh){this.scene&&this.scene.remove(t.clonedMesh);let i=this.selectedObject;if(i.setMatrixAt(t.instanceId,t.originalMatrix),i.instanceMatrix.needsUpdate=!0,i.updateMatrix(),delete t.instanceId,delete t.originalMatrix,e===t.clonedMesh)return t.clonedMesh.geometry.dispose(),delete t.clonedMesh,this.selectedObject=void 0,void(this.outlinePass&&(this.outlinePass.selectedObjects=[]));t.clonedMesh.geometry.dispose(),delete t.clonedMesh}else if(null!=t.batchId&&t.clonedMesh){if(this.scene&&this.scene.remove(t.clonedMesh),delete t.batchId,e===t.clonedMesh)return t.clonedMesh.geometry.dispose(),delete t.clonedMesh,this.selectedObject=void 0,void(this.outlinePass&&(this.outlinePass.selectedObjects=[]));t.clonedMesh.geometry.dispose(),delete t.clonedMesh}else if(t.originalMaterial){if(this.selectedObject.material){let e=this.selectedObject.material;Array.isArray(e)?e.forEach((e=>e.dispose())):e instanceof qr&&e.dispose()}this.selectedObject.material=t.originalMaterial,delete t.originalMaterial}this.selectedObject=void 0,this.outlinePass&&(this.outlinePass.selectedObjects=[])}if(this.scene&&e){if(e instanceof sn&&null!=t){let i=e,n=new Be,s=new Be;s.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),i.getMatrixAt(t,n),this.selectedObject=e,this.outlinePass&&(this.outlinePass.selectedObjects=[e]);let a=ss.clonedHighlightMaterials(e,{depthTest:r});if(a){let r=new Je(i.geometry.clone(),a);r.applyMatrix4(e.matrixWorld.multiply(n)),r.matrixWorldNeedsUpdate=!0,r.name="Cloned mesh for highlighting",r.layers.enableAll();let o=n.clone();o.multiplyMatrices(n,s),i.setMatrixAt(t,o),i.instanceMatrix.needsUpdate=!0,i.updateMatrix(),this.selectedObject.userData.instanceId=t,this.selectedObject.userData.originalMatrix=n,this.selectedObject.userData.clonedMesh=r,this.scene.add(r)}}else if(Zi.isMergedMesh(e)&&null!=i){let t=Zi.getBatchByBatchId(e,i),n=`[BimViewer] Clicked on merged mesh(id: ${e.id}).`;n+=` Original mesh batchId: ${i}, name: ${null==t?void 0:t.name}`,re.info(n);let s=ss.clonedHighlightMaterials(e,{depthTest:r}),a=Zi.cloneGeometryForBatch(e,t);if(s&&a){let t=new Je(a,s);t.applyMatrix4(e.matrixWorld),t.matrixWorldNeedsUpdate=!0,t.name="Cloned mesh for highlighting",t.layers.enableAll(),this.selectedObject=e,this.selectedObject.userData.batchId=i,this.selectedObject.userData.clonedMesh=t,this.scene.add(t)}}else{let t=ss.clonedHighlightMaterials(e,{depthTest:r});t&&(this.selectedObject=e,this.selectedObject.userData.originalMaterial=this.selectedObject.material,this.selectedObject.material=t,this.outlinePass&&(this.outlinePass.selectedObjects=[e]))}this.enableRender()}else this.enableRender()}clearSelection(){this.selectedObject&&this.selectedObject instanceof Ys?this.selectedObject.selected=!1:this.selectObject(),this.selectedObject=void 0}getBBox(){return this.bbox}flyToObjects(e){if(!e||0===e.length||!this.camera)return;let t=new D,i=new D,r=new Rt;e.forEach((e=>{let t=Tn.getBoundingBox(e);r.union(t)}));let n=new D;this.camera.getWorldDirection(n),Va.getCameraPositionByBboxAndDirection(r,t,i,this.camera.projectionMatrix,n);let s=(new D).subVectors(t,i).length();if(this.controls.moveTo(t.x,t.y,t.z,!0),this.camera instanceof Ni){let e=this.camera.right-this.camera.left,t=this.camera.top-this.camera.bottom,i=new D;r.getSize(i);let n=Math.min(e/i.x,t/i.y);this.controls.zoomTo(n,!0)}else this.camera instanceof Vr&&this.controls.dollyTo(s,!0);this.controls.setFocalOffset(0,0,0,!0)}flyToObject(e){this.flyToObjects([e])}flyToSelectedObject(){if(!this.selectedObject)return;let e=this.selectedObject;(e instanceof sn&&e.userData.clonedMesh||Zi.isMergedMesh(e)&&e.userData.clonedMesh)&&(e=e.userData.clonedMesh),this.flyToObject(e)}flyToRandomObject(){var e,t,i;let r=Object.values(this.loadedModels).map((e=>e.id));Object.values(this.loaded3dTiles).forEach((e=>r.push(e.id)));let n=r.length;if(n<=0)return;let s=Math.floor(Math.random()*n),a=r[s];if(!(null==(e=this.scene)?void 0:e.getObjectById(a)))return;let o=[];if(null==(t=this.scene)||t.traverseVisible((e=>{(e instanceof Je||e instanceof Sr)&&!["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"].includes(e.name)&&o.push(e.id)})),o.length<1)return;let l=Math.floor(Math.random()*o.length),h=null==(i=this.scene)?void 0:i.getObjectById(o[l]);h&&(re.info(`[BimViewer] Flying to random object: ${h.name}, type: ${h.type}`),this.selectObject(h,void 0,void 0,!0),this.flyToObject(h))}flyTo(e,t){let i=this.camera,r=this.controls;if(!i||!r)return;if(e.equals(t))return void re.error("[BimViewer] camera position and lookAt cannot be the same!");if(!Tt.isVectorValid(e)||!Tt.isVectorValid(t))return void re.error("[BimViewer] invalid position or lookAt!");let n=e.distanceTo(t);n<i.near?(e=e.clone().sub(t).normalize().multiplyScalar(1.1*i.near),re.warn("[BimViewer] camera could be too close to see the object!")):n>i.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*i.far),re.warn("[BimViewer] camera could be too far to see the object!")),r.setLookAt(e.x,e.y,e.z,t.x,t.y,t.z,!0)}viewFitAll(){var e;if(!this.scene||!this.camera)return;let t=new D,i=new D,r=Tn.getVisibleObjectBoundingBox(this.scene),n=new D;null==(e=this.camera)||e.getWorldDirection(n),Va.getCameraPositionByBboxAndDirection(r,t,i,this.camera.projectionMatrix,n),this.flyTo(t,i)}goToHomeView(){let e=this.camera,t=this.cameraCfg,i=t&&Tt.arrayToVector3(t.eye),r=t&&Tt.arrayToVector3(t.look);if(i&&r)this.controls.setLookAt(i.x,i.y,i.z,r.x,r.y,r.z,!0),this.controls.setFocalOffset(0,0,0,!0);else if(this.scene){let t=new D,i=new D,r=new D(-1,-.5,-1);if(this.has2dModel){let e=this.bbox.max.x-this.bbox.min.x,t=this.bbox.max.y-this.bbox.min.y,i=this.bbox.max.z-this.bbox.min.z,n=Math.min(e,t,i);e-n<=0?r.set(1,0,0):t-n<=0?r.set(0,-1,0):i-n<=0&&r.set(0,0,-1)}if(Va.getCameraPositionByBboxAndDirection(this.bbox,t,i,null==e?void 0:e.projectionMatrix,r),(!this.cameraCfg||this.cameraCfg&&(!this.cameraCfg.eye||!this.cameraCfg.look))&&(this.cameraCfg={eye:t.toArray(),look:i.toArray()}),e instanceof Ni){let t=this.bbox,i=t.max.x-t.min.x,r=t.max.z-t.min.z,n=e.right-e.left,s=e.top-e.bottom;e.zoom=Math.max(n,s)/Math.max(i,r),e.zoom/=2,e.updateProjectionMatrix()}t.equals(i)||this.flyTo(t,i)}}zoomToBBox(e){var t,i;let r=new D,n=new D,s=new D;if(null==(t=this.camera)||t.getWorldDirection(s),Va.getCameraPositionByBboxAndDirection(e,r,n,null==(i=this.camera)?void 0:i.projectionMatrix,s),!r.equals(n)){let t=(new D).subVectors(r,n).length();if(this.controls.moveTo(r.x,r.y,r.z,!0),this.camera instanceof Ni){let t=this.camera.right-this.camera.left,i=this.camera.top-this.camera.bottom,r=new D;e.getSize(r);let n=Math.min(t/r.x,i/r.y);this.controls.zoomTo(n,!0)}else this.camera instanceof Vr&&this.controls.dollyTo(t,!0);this.controls.setFocalOffset(0,0,0,!0)}}tryAdjustCameraNearAndFar(){let e=this.camera;if(!this.scene||!e)return;let t=this.bbox,i=e.near,r=e.far,n=t.max.x-t.min.x,s=t.max.y-t.min.y,a=t.max.z-t.min.z,o=Math.max(n,s,a),l=o/5,h=5*o;if(i>l||r<h){let t=e=>Tt.numberToString(e);re.info(`[BimViewer] BBox's longest side is: ${t(o)}`),i>l&&(re.warn(`[BimViewer] camera.near(${t(i)}) shouldn't bigger than ${t(l)}, will change it!`),e.near=l),r<h&&(re.warn(`[BimViewer] camera.far(${t(r)}) shouldn't smaller than ${t(h)}, will change it!`),e.far=h)}if(e instanceof Ni){let t=e.right-e.left,i=e.top-e.bottom;e.zoom=Math.max(t,i)/Math.max(n,a),e.zoom/=2}e.updateProjectionMatrix()}tryAdjustDirectionalLight(){if(!this.directionalLight)return;let e=this.bbox,t=new $i;e.getBoundingSphere(t);let i=t.center,r=t.radius,n=this.directionalLight.shadow.camera;n.zoom=1,n.top=r,n.bottom=-r,n.right=r,n.left=-r,n.near=.1,n.far=2*r,n.updateProjectionMatrix();let s=new D(-1,-.5,1);s.normalize().multiplyScalar(r),this.directionalLight.position.copy(i).addScaledVector(s,-1),this.directionalLight.target.position.copy(i),re.debug("[BimViewer] this.directionalLight.position",this.directionalLight.position),re.debug("[BimViewer] this.directionalLight.target.position",this.directionalLight.target.position),this.updateDirectionalLight(),this.enableRender()}updateDirectionalLight(){var e,t;if(this.directionalLight&&(this.directionalLight.updateMatrixWorld(),this.directionalLight.target.updateMatrixWorld(),this.directionalLightHelper&&(this.directionalLightHelper.update(),!(null!=(e=this.scene)&&e.matrixAutoUpdate)&&this.directionalLightHelper.updateWorldMatrix(!1,!0)),this.directionalLight.shadow.needsUpdate=!0,this.directionalLight.shadow.camera.updateProjectionMatrix(),this.shadowCameraHelper&&(this.shadowCameraHelper.update(),null==(t=this.scene)||!t.matrixAutoUpdate))){let e=this.directionalLight.shadow.camera;e.position.setFromMatrixPosition(this.directionalLight.matrixWorld),qAe.setFromMatrixPosition(this.directionalLight.target.matrixWorld),e.lookAt(qAe),e.updateMatrixWorld(),this.shadowCameraHelper.updateWorldMatrix(!1,!0)}}updateDirectionalLightShadow(){this.directionalLight&&(this.directionalLight.shadow.needsUpdate=!0)}showDirectionalLightHelper(e){this.directionalLightHelper&&(this.directionalLightHelper.visible=e),this.shadowCameraHelper&&(this.shadowCameraHelper.visible=e)}regenSkyOfGradientRamp(){if(!this.scene)return;this.skyOfGradientRamp&&(this.skyOfGradientRamp.geometry.dispose(),this.skyOfGradientRamp.material.dispose(),this.scene.remove(this.skyOfGradientRamp),this.skyOfGradientRamp.clear(),this.skyOfGradientRamp=void 0);let e=Object.values(this.loadedModels).map((e=>e.id));if(Object.values(this.loaded3dTiles).forEach((t=>e.push(t.id))),e){let t=this.cameraCfg,i=t&&Tt.arrayToVector3(t.eye),r=t&&Tt.arrayToVector3(t.look),n=new Rt;if(i&&r){let e=i,t=r;n.expandByPoint(new D(e.x,e.y,e.z)),n.expandByPoint(new D(t.x,t.y,t.z))}else n=Tn.getObjectsBoundingBox(this.scene,e);this.skyOfGradientRamp=il.createSkyOfGradientRampByBoundingBox(n),this.scene.add(this.skyOfGradientRamp)}}regenGroundGrid(){if(!this.scene)return;this.groundGrid&&(this.groundGrid.geometry.dispose(),this.groundGrid.material.dispose(),this.scene.remove(this.groundGrid));let e=Object.values(this.loadedModels).map((e=>e.id));if(Object.values(this.loaded3dTiles).forEach((t=>e.push(t.id))),e){let e=this.cameraCfg,t=e&&Tt.arrayToVector3(e.look);t&&(t.y=0),this.groundGrid=aa.createGroundGrid(void 0,void 0,t),this.scene.add(this.groundGrid)}}setOrbitPoint(e){let t=this.controls;if(this.camera&&this.renderer&&this.controls&&this.scene&&this.raycaster&&this.viewerContainer)if(this.selectedObject&&this.selectedObject instanceof qt){let e=(new Rt).setFromObject(this.selectedObject),i=new D;e.getCenter(i),null==t||t.setOrbitPoint(i.x,i.y,i.z);let r=xi.worldPosition2ScreenPoint(i,this.camera,this.viewerContainer);this.setAnchorPosition(r)}else{this.raycaster&&this.raycaster.layers.set(10);let i=this.getIntersections(e),r=new ce(e.x,e.y);if(i&&0!==i.length){let e=i[0].point;null==t||t.setOrbitPoint(e.x,e.y,e.z),this.setAnchorPosition(r)}else{let e=this.bbox.getCenter(new D);t.setOrbitPoint(e.x,e.y,e.z);let i=xi.worldPosition2ScreenPoint(e,this.camera,this.renderer.domElement);this.setAnchorPosition(i)}}}setAnchorPosition(e){this.anchor&&(this.anchor.className="anchor active",this.anchor.style.left=`${e.x}px`,this.anchor.style.top=`${e.y}px`)}createAnchor(){var e;let t=document.createElement("div");return t.className="anchor",null==(e=this.viewerContainer)||e.appendChild(t),t}disposeAnchor(){var e;this.anchor&&(null==(e=this.viewerContainer)||e.removeChild(this.anchor),this.anchor=void 0)}disposeRotateToCursor(){this.disposeAnchor()}addHotpoint(e){var t;if(this.hasHotpoint(e.hotpointId))return void re.warn(`[BimViewer] Hotpoint with id '${e.hotpointId}' already exist!`);let i=e.anchorPosition,r=sh.createHotpoint(e.html);r.position.set(i[0]||0,i[1]||0,i[2]||0),r.visible=!1!==e.visible,r.userData.hotpoint=e,this.hotpointRoot||(this.hotpointRoot=new ar,this.hotpointRoot.matrixAutoUpdate=!1,this.hotpointRoot.matrixWorldAutoUpdate=!1,this.hotpointRoot.name="HotpointRoot",null==(t=this.scene)||t.add(this.hotpointRoot)),this.hotpointRoot.add(r),r.updateWorldMatrix(!1,!1),this.enableRender()}removeHotpoint(e){var t,i;let r=(null==(t=this.hotpointRoot)?void 0:t.children)||[];for(let n=0;n<r.length;++n){let t=r[n];(null==(i=t.userData.hotpoint)?void 0:i.hotpointId)===e&&t.removeFromParent()}}clearHotpoints(){var e;null==(e=this.hotpointRoot)||e.clear()}hasHotpoint(e){var t;return-1!==((null==(t=this.hotpointRoot)?void 0:t.children)||[]).findIndex((t=>{var i;return(null==(i=t.userData.hotpoint)?void 0:i.hotpointId)===e}))}enableComposer(e){!this.scene||!this.camera||!this.renderer||(this.composerEnabled=e,e&&!this.composer&&(this.composer=new W3(this.renderer)),this.enableRender())}enableRenderPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.renderPass){let e=new q3(this.scene,this.camera);e.setSize(this.width,this.height),this.composer.addPass(e),this.renderPass=e}this.renderPass&&(this.renderPass.enabled=e),this.enableRender()}}enableFxaaPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.effectFxaaPass){let e=new PT(EAe);e.uniforms.resolution.value.set(1/this.width,1/this.height),e.setSize(this.width,this.height),e.renderToScreen=!0,this.composer.addPass(e),this.effectFxaaPass=e}this.effectFxaaPass&&(this.effectFxaaPass.enabled=e),this.enableRender()}}enableSaoPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.saoPass){let e=new fS(this.scene,this.camera,!1,!0,new ce(1/this.width,1/this.height));e.setSize(this.width,this.height),e.params.output=0,e.params.saoBias=.5,e.params.saoIntensity=5e-5,e.params.saoScale=5,e.params.saoKernelRadius=40,e.params.saoMinResolution=0,this.composer.addPass(e),this.saoPass=e}this.saoPass&&(this.saoPass.enabled=e),this.enableRender()}}enableSsaoPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.ssaoPass){let e=new fc(this.scene,this.camera,this.width,this.height);e.kernelRadius=16,e.minDistance=.005,e.maxDistance=.1,this.composer.addPass(e),this.ssaoPass=e}this.ssaoPass&&(this.ssaoPass.enabled=e),this.enableRender()}}enableOutlinePass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.outlinePass){let e=new yu(new ce(this.width,this.height),this.scene,this.camera);e.edgeStrength=3,e.edgeGlow=0,e.edgeThickness=2,e.pulsePeriod=0,e.visibleEdgeColor.set(16711680),e.hiddenEdgeColor.set(16752768),this.composer.addPass(e),this.outlinePass=e}this.outlinePass&&(this.outlinePass.enabled=e),this.enableRender()}}enableSsaaPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.ssaaRenderPass){let e=new X3(this.scene,this.camera,16777215,0);this.composer.addPass(e),this.ssaaRenderPass=e}this.ssaaRenderPass&&(this.ssaaRenderPass.enabled=e),this.enableRender()}}enableBloomPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.bloomPass){let e=new Hh(1,25,4);e.renderToScreen=!0,this.composer.addPass(e),this.bloomPass=e}this.bloomPass&&(this.bloomPass.enabled=e),this.enableRender()}}enableUnrealBloomPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.unrealBloomPass){let e=new _d(new ce(this.width,this.height),1,0,0);e.threshold=0,e.strength=.5,e.radius=0,this.composer.addPass(e),this.unrealBloomPass=e}this.unrealBloomPass&&(this.unrealBloomPass.enabled=e),this.enableRender()}}activateSection(e="ObjectsBoxSection",t){var i;!this.inputManager||null!=(i=this.sectionManager)&&i.isSectionActive()||(this.sectionType=e,this.clearSelection(),this.sectionManager||(this.sectionManager=new b3(this,this.inputManager)),this.sectionManager.activateSection(e,t),this.enableRender())}deactivateSection(){var e;null==(e=this.sectionManager)||e.deactivateSection(),this.enableRender()}setSectionClippingObjectIds(e){var t;null==(t=this.sectionManager)||t.setSectionClippingObjectIds(e),this.enableRender()}getActiveSection(){var e;return null==(e=this.sectionManager)?void 0:e.getActiveSection()}getMeasurementManager(){return this.measurementManager}getMeasurements(){return this.inputManager?(this.measurementManager||(this.measurementManager=new fu(this,this.inputManager)),this.measurementManager.getMeasurementsData()):[]}activateMeasurement(e){this.inputManager&&(this.measurementManager||(this.measurementManager=new fu(this,this.inputManager)),this.measurementManager.activateMeasurement(e),this.clearSelection())}deactivateMeasurement(){var e;null==(e=this.measurementManager)||e.deactivateMeasurement()}setMeasurementVisibility(e,t){return!!(this.inputManager&&this.measurementManager&&e)&&this.measurementManager.setMeasurementVisibility(e,t)}clearMeasurements(){var e;null==(e=this.measurementManager)||e.clearMeasurements()}zoomToRect(){this.zoomToRectHelper||(this.zoomToRectHelper=new bT(this)),this.zoomToRectHelper.activate()}deactivateZoomRect(){var e;null==(e=this.zoomToRectHelper)||e.deactivate()}enableWebCam(){this.scene&&(this.webcam||(this.webcam=new oP),this.webcamPlane||(this.webcamPlane=this.webcam.createWebCamPlane(),this.webcamPlane.position.set(10,2,0)),this.scene.add(this.webcamPlane))}disableWebCam(){this.scene&&this.webcamPlane&&(this.webcamPlane.geometry.dispose(),this.webcamPlane.material.dispose(),this.scene.remove(this.webcamPlane))}setEnvironment(e){qc.createEnvTexture(this.pmremGenerator,e).then((e=>{this.scene&&(this.scene.environment=e)}))}setEnvironmentFromDataArray(e){qc.createEnvTextureFromDataArray(this.pmremGenerator,e).then((e=>{this.scene&&(this.scene.environment=e)}))}takeObjectsScreenshot(e){return ct(this,null,(function*(){return new Promise(((t,i)=>{var r;this.renderer||i("renderer is undefined"),null==(r=this.scene)||r.traverse((t=>{t instanceof Je&&((0,ym.includes)(e,(0,ym.get)(t.userData,"UniqueId"))?t.visible=!0:t.visible=!1)})),this.enableRender(),setTimeout((()=>{var e;t(null==(e=this.renderer)?void 0:e.domElement.toDataURL("image/png"))}),1e3)}))}))}setObjectColor(e,t){this.clearSelection();let i={};e.traverse((e=>{let t=e.material;t&&(Array.isArray(t)?t.forEach((e=>{i[e.id]=e})):i[t.id]=t)}));for(let r in i)ss.setMaterialColor(i[r],new Ve(t));this.enableRender()}updateRaycasterThreshold(){let e=this.camera;if(!e||!this.raycaster)return;let t=12/e.zoom,i=this.raycaster.params;i.Line?i.Line.threshold=t:i.Line={threshold:t},i.Points?i.Points.threshold=t:i.Points={threshold:t}}instantiate(e){new iO(e).instantiate()}merge(e){this.increaseJobCount();try{let t=[];e.traverse((e=>{e.geometry&&e.material&&t.push(e)})),Zi.deepMerge(t,e)}finally{this.decreaseJobCount()}}updateProjectSettings(e){this.settings=e;let t=(e,t)=>{e&&t&&(e.near=t.near,e.far=t.far,e.updateProjectionMatrix())};t(this.perspectiveCamera,this.settings.camera),t(this.orthoCamera,this.settings.camera),this.enableRender(10)}computeBoundingBox(){let e=new Rt;return Object.values(this.loadedModels).forEach((t=>{t.bbox&&!t.bbox.isEmpty()&&e.union(t.bbox)})),Object.values(this.loaded3dTiles).forEach((t=>{t.bbox.isEmpty()||e.union(t.bbox)})),this.bbox=e,this.controls&&(this.controls.minDistance=.1,this.controls.maxDistance=3*this.bbox.getSize(new D).length()),e}},JAe=ps(Zc(),1),lP=class{constructor(e){this.viewer=e,this.itemList={},this.handleMouseWheel=e=>{e.preventDefault(),this.element&&(this.element.scrollLeft+=e.deltaY)},e.addEventListener("ModelLoaded",(()=>{this.init()}))}init(){var e;let t=document.createElement("div");t.classList.add("model-layout-switch-bar");let i=document.createElement("div");i.classList.add("model-layout-switch-bar-content"),i.addEventListener("wheel",this.handleMouseWheel),this.viewer.getLayoutNames().forEach(((e,t)=>{let r=this.createItem(e,t);this.itemList[e]=r,r.resetActivate=()=>{for(let e in this.itemList)this.itemList[e].resetActive()},null==i||i.appendChild(r.element)})),this.element=t,this.content=i,this.element.appendChild(this.content),null==(e=this.viewer.widgetContainer)||e.appendChild(this.element)}createItem(e,t){let i=new UV(this.viewer,e);return 0===t&&i.setActive(!0),i}destroy(){var e,t;for(let i in this.itemList){let t=this.itemList[i];t.destroy(),null==(e=this.content)||e.removeChild(t.element)}this.itemList={},this.element&&this.content&&(this.element.removeChild(this.content),this.element.removeEventListener("wheel",this.handleMouseWheel),null==(t=this.viewer.widgetContainer)||t.removeChild(this.element),this.element=void 0)}show(){this.element&&(this.element.style.display="block")}hide(){this.element&&(this.element.style.display="none")}},UV=class{constructor(e,t){this.viewer=e,this.eventBus=xT(),this.active=!1,this.element=this.createItem(t),this.eventBus.on("activechange",(e=>{this.resetActivate&&this.resetActivate(),e?(this.element.classList.add("activate"),this.viewer.activateLayout(t)):this.element.classList.remove("activate")}))}createItem(e){let t=document.createElement("div"),i=document.createElement("span");return t.classList.add("model-layout-switch-item"),t.onclick=()=>{this.active=!this.active,this.eventBus.emit("activechange",this.active)},i.innerText=e,t.appendChild(i),t}setActive(e){this.active!==e&&(this.active=e,this.eventBus.emit("activechange",e))}resetActive(){this.active=!1,this.element.classList.remove("activate")}destroy(){this.eventBus.off("activechange")}},cP=class{constructor(e){this.progresseItems=[],this.element=document.createElement("div"),this.element.classList.add("progress-bar"),e.appendChild(this.element)}setVisibility(e){this.element&&(e?this.element.classList.remove("hidden"):this.element.classList.add("hidden"))}addProgressItem(e,t){let i=this.progresseItems.find((t=>t.id===e));if(!i){let r=document.createElement("div");r.classList.add("progress-bar-item"),r.innerHTML=t||"",this.element.append(r),i={id:e,div:r},this.progresseItems.push(i)}this.setVisibility(!0)}updateProgress(e,t,i){let r=this.progresseItems.find((t=>t.id===e));if(!r)return;let n=t?`${t}`:"";t&&i&&(n+=": "),i&&(n+=`${i.toFixed(2)}%`),r.div.innerHTML=n}removeProgressItem(e){let t=this.progresseItems.find((t=>t.id===e));t&&t.div.remove(),0===this.progresseItems.length&&this.setVisibility(!1)}delayRemoveProgressItem(e,t=3e3){setTimeout((()=>{this.removeProgressItem(e)}),t)}},HT=new Be,$Ae=new Be,ZAe=new na,BV=new D,KAe=class extends lm{constructor(e){super(e),this.name="DxfViewer",this.CAMERA_Z_POSITION=100,this.CAMERA_MIN_ZOOM=1e-6,this.timer=Date.now(),this.loadedModels={},this.masterModelId="",this.raycaster=new ka,this.selected=!0,this.raf=new VE,this.clock=new Vl,this.renderEnabled=!1,this.enableHideVisuallySmallObjects=!0,this.sortedHidableObjects={},this.lastCameraZoom=1/0,this.activeLayoutName="",this.layoutInfos={},this.units=void 0,this.fpsUtils=new eA,this.onResize=()=>{this.viewerContainer&&this.viewerContainer.parentElement&&this.resize(this.viewerContainer.parentElement.clientWidth,this.viewerContainer.parentElement.clientHeight)},this.enableRender=(e=1e3)=>{this.renderEnabled=!0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.timeoutSymbol=this.raf.setTimeout((()=>{this.renderEnabled=!1}),e))},this.loadingDxfCount=0,this.compareMode=!1,this.viewerCfg=e,this.increaseJobCount(),this.init(),this.animate(),this.enableRender(),this.decreaseJobCount(),re.info(`[DxfViewer] Initialized in ${(Date.now()-this.timer)/1e3}s`)}init(){let e=this.viewerCfg;this.initThree(),xr.isBrowser&&!e.context&&this.initDom(),this.initInputManager(),this.initEvents(),this.initControls(),this.initOthers(),this.enableSelection=e.enableSelection}initInputManager(){this.renderer&&(this.inputManager=new e0(this.renderer.domElement))}initThree(){this.initScene(),this.initRenderer(),this.initCamera()}initDom(){let e=this.viewerCfg;this.initSpinner(),this.initCSS2DRenderer(),!0===e.enableAxisGizmo&&(this.axes=this.initAxes()),!0===e.enableStats&&(this.stats=this.initStats()),e.enableToolbar&&(this.toolbar=this.initToolbar()),e.enableBottomBar&&(this.bottomBar=this.initBottomBar()),e.enableProgressBar&&(this.loadingProgressBar=this.initLoadingProgressBar()),e.enableLayoutBar&&(this.dxfLayoutBar=new lP(this))}initScene(){let e=new wn;e.background=new Ve(2172976),e.matrixAutoUpdate=!1,e.matrixWorldAutoUpdate=!1,this.scene=e}initRenderer(){var e;let{context:t}=this.viewerCfg,i={context:t,antialias:!0,preserveDrawingBuffer:!0,alpha:!1,stencil:!1};!xr.isBrowser&&t&&Object.assign(i,{context:t,canvas:xr.creatReactNativeCanvas(t)}),t&&(this.width=t.drawingBufferWidth,this.height=t.drawingBufferHeight),this.renderer=new go(i),this.renderer.setClearColor(11119017,1),this.renderer.localClippingEnabled=!0,xr.isBrowser&&(!t&&this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.domElement.classList.add("webgl-renderer"),null==(e=this.viewerContainer)||e.appendChild(this.renderer.domElement)),this.renderer.setSize(this.width,this.height),Tt.printGpuInfo(this.renderer.getContext()),gr.maxFragmentUniforms=this.renderer.capabilities.maxFragmentUniforms-20,this.enableOverlayRenderer&&(this.overlayRender=new Rr(this))}initCSS2DRenderer(){var e;let t=new nh;t.setSize(this.width,this.height),t.domElement.style.height="0",t.domElement.style.width="0",t.domElement.style.position="absolute",t.domElement.style.top="0",t.domElement.style.left="0",t.domElement.style.overflow="visible",t.domElement.classList.add("css2d-renderer"),null==(e=this.viewerContainer)||e.appendChild(t.domElement),this.css2dRenderer=t}initCamera(){if(!this.scene)return;let e=new Ni(-this.width/2,this.width/2,this.height/2,-this.height/2,.1,1e5);e.position.set(0,0,this.CAMERA_Z_POSITION),e.zoom=10,e.updateProjectionMatrix(),this.scene.add(e),this.camera=e}initControls(){let e=this.camera;if(!this.inputManager||!e)return;let t=new Io(e,this.inputManager);t.enableRotate=!1,t.enabled=!0,t.keyTruckSpeed=10,t.dollyToCursor=!0,t.dollySpeed=.5,t.truckSpeed=1,t.mouseButtons={left:et.TRUCK,middle:et.TRUCK,wheel:et.ZOOM,right:et.TRUCK},t.touches={one:et.TOUCH_TRUCK,two:et.TOUCH_ZOOM_TRUCK,three:et.NONE},t.listenToKeyEvents(),t.update(0),this.controls=t,t.addEventListener("control",this.onControlsChange(this)),t.addEventListener("controlend",this.onControlsEnd(this))}onControlsChange(e){return()=>{e.enableRender()}}onControlsEnd(e){return()=>{e.enableRender()}}initEvents(){if(!this.inputManager||!this.renderer)return;let e=!1,t=!1;this.inputManager.addEventListener("pointerdown",(i=>{var r;t=!1,e=!0,1===i.button&&(null==(r=this.inputManager)||r.setCursor("move"))})),this.inputManager.addEventListener("pointermove",(()=>{var i;e&&(t=!0,null==(i=this.inputManager)||i.setCursor("move"))})),this.inputManager.addEventListener("pointerup",(i=>{var r;if(e=!1,null==(r=this.inputManager)||r.setCursor("default"),t)return void(t=!1);this.handleMouseClick(i);let n={evt:i};if(this.selectedObject&&this.selectedObject instanceof bn&&(n.markupData=this.selectedObject.getData()),this.selectedObject&&this.selectedObject instanceof Ii&&(n.measureData=this.selectedObject.getData()),this.selectedObject&&this.selectedObject instanceof qt){let e=t=>t.parent&&!t.parent.isScene?e(t.parent):t.name;n.entityData={modelId:e(this.selectedObject),layoutName:this.selectedObject.userData.layerName}}this.dispatchEvent("MouseClicked",n)})),this.inputManager.addEventListener("keydown",(e=>{var t,i,r,n,s;if(e.altKey&&"KeyR"===e.code)this.flyToRandomObject();else if(e.ctrlKey&&"KeyZ"===e.code){if(this.measurementManager&&this.measurementManager.isMeasurementMeasuring())return;null==(t=this.undoRedoManager)||t.undo()}else if(e.ctrlKey&&"KeyY"===e.code){if(this.measurementManager&&this.measurementManager.isMeasurementMeasuring())return;null==(i=this.undoRedoManager)||i.redo()}else"Delete"===e.code&&this.selectedObject&&(this.markupManager&&this.selectedObject instanceof bn&&(this.markupManager.removeMarkup(this.selectedObject),null==(r=this.undoRedoManager)||r.addCommand(new n0(this.markupManager,this.selectedObject.getData()))),this.measurementManager&&this.selectedObject instanceof Ii&&(null==(n=this.measurementManager)||n.removeMeasurement(this.selectedObject),null==(s=this.undoRedoManager)||s.addCommand(new DE(this.measurementManager,this.selectedObject.getData()))))})),this.inputManager.addEventListener("wheel",(()=>{this.updateHidableObjectsVisibility()}))}initOthers(){!this.scene||!this.renderer||!this.camera||(this.renderer.domElement.style.outlineWidth="0")}initAxes(){var e;let t=document.createElement("div");t.classList.add("axesRenderer");let i=new Of(t,this.camera,!0);return null==(e=this.widgetContainer)||e.append(t),i}initStats(){var e;let t=z3();t.setMode(0);let i=document.createElement("div");return i.classList.add("statsOutput"),i.appendChild(t.domElement),t.domElement.style.position="absolute",null==(e=this.widgetContainer)||e.append(i),t}showStats(){this.stats||(this.stats=this.initStats()),this.stats.showPanel(0)}hideStats(){this.stats&&this.stats.showPanel(-1)}initToolbar(){let e=this.viewerCfg;return new Nh(this,(0,JAe.merge)({},$Ce,e.toolbarMenuConfig))}initBottomBar(){return new fm(this)}initLoadingProgressBar(){return new cP(this.widgetContainer)}showLayoutBar(){var e;null==(e=this.dxfLayoutBar)||e.show()}hideLayoutBar(){var e;null==(e=this.dxfLayoutBar)||e.hide()}animate(){var e,t,i,r,n,s;this.requestAnimationFrameHandle=requestAnimationFrame(this.animate.bind(this));let a=this.clock.getDelta(),o=null==(e=this.controls)?void 0:e.update(a);if(this.scene&&this.camera){if(this.viewerContainer&&this.viewerContainer.parentElement){let{width:e,height:t}=this.viewerContainer.parentElement.getBoundingClientRect();(this.width!==e||this.height!==t)&&this.resize(e,t)}if(this.renderEnabled||o){if(this.updateRaycasterThreshold(),this.updateCameraZoomUniform(this.camera.zoom),gr.resolutionUniform.value.set(this.width,this.height),null==(t=this.renderer)||t.render(this.scene,this.camera),!xr.isBrowser){let e=null==(i=this.renderer)?void 0:i.getContext();e&&e.endFrameEXP&&(e.flush(),e.endFrameEXP())}this.hotpointRoot&&this.hotpointRoot.children.length>0&&(null==(r=this.css2dRenderer)||r.render(this.scene,this.camera)),this.dispatchEvent("AfterRender")}}null==(n=this.stats)||n.update(),this.fpsUtils.update(),null==(s=this.bottomBar)||s.update()}getFps(){return this.fpsUtils.fps}is3d(){return!1}destroy(){var e,t,i,r,n,s;gr.abortJobs=!0,this.dxfLayoutBar&&(this.dxfLayoutBar.destroy(),this.dxfLayoutBar=void 0),null==(e=this.measurementManager)||e.destroy(),this.measurementManager=void 0,null==(t=this.markupManager)||t.destroy(),this.markupManager=void 0,null==(i=this.zoomToRectHelper)||i.destroy(),this.zoomToRectHelper=void 0,null==(r=this.boxSelectHelper)||r.destroy(),this.boxSelectHelper=void 0,this.sortedHidableObjects={},this.layoutInfos={},this.raycastableObjects=void 0,this.changes={},Object.keys(this.loadedModels).forEach((e=>{delete this.loadedModels[e]})),this.loadedModels={},this.css2dRenderer&&(null==(n=this.viewerContainer)||n.removeChild(this.css2dRenderer.domElement),this.css2dRenderer=void 0),this.stats=void 0,this.raycaster=void 0,this.selectedObject=void 0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.raf=void 0),this.contextMenu&&(this.contextMenu.destroy(),this.contextMenu=void 0),this.axes&&(this.axes.dispose(),this.axes=void 0),this.toolbar&&(this.toolbar.destroy(),this.toolbar=void 0),this.bottomBar=void 0,this.font=void 0,null==(s=this.inputManager)||s.removeEventListener(),super.destroy()}loadModelAsync(e,t){return ct(this,null,(function*(){var i,r;this.loadingDxfCount++,this.timer=Date.now(),this.increaseJobCount();let n=e.modelId||e.src;this.masterModelId||(this.masterModelId=n);let s=e.ignorePaperSpace||this.masterModelId!==n;!1===e.ignorePaperSpace&&s&&re.warn(`[DxfViewer] Paper space will be ignored for '${n}' although 'ignorePaperSpace' is false!`),Tt.printMemory("Before loadModelAsync");let a=new pl(this.loadingManager);a.setFont(this.font);let o=n,l=this.translate("ProgressBar.Loading"),h=e=>{var i;null==(i=this.loadingProgressBar)||i.updateProgress(o,l,e),t&&t(new ProgressEvent("LoadProgress",{loaded:e,total:100}))},u=(e,i,r)=>{var n;let s=100*e.loaded/e.total;s=s*(r-i)/100+i,null==(n=this.loadingProgressBar)||n.updateProgress(o,l,s),t&&t(new ProgressEvent("LoadProgress",{loaded:s,total:100}))};null==(i=this.loadingProgressBar)||i.addProgressItem(o),h(0);let c=this.viewerCfg,p=yield a.loadDxfData(e.src,e.modelId,(e=>u(e,0,90)),void 0,s,c.enableLocalCache).finally((()=>{this.loadingDxfCount--,0===this.loadingDxfCount&&this.font&&this.font.releaseFontData&&this.font.releaseFontData()}));if(re.info(`[DxfViewer] Loaded '${e.src}' in ${(Date.now()-this.timer)/1e3}s, adding to scene...`),gr.abortJobs&&Promise.reject("[DxfViewer] abort load dxf"),0===p.threejsObject.children.length){let t=`[DxfViewer] Nothing was loaded from ${e.src}`;return re.warn(t),this.decreaseJobCount(),Promise.reject(t)}let d=p.threejsObject;d.name=n;let f=this.getDxfUnits(p);if(this.masterModelId===e.modelId&&(this.units=f),re.info(`[DxfViewer] Units of '${e.src}' is '${f}'`),f){let t=1;this.units&&f!==this.units&&(t=xG(f,this.units)),e.scale?e.scale=[e.scale[0]*t,e.scale[0]*t,e.scale[0]*t]:e.scale=[t,t,t]}if(e.matrix&&16===e.matrix.length){let t=new Be;t.elements=e.matrix,d.applyMatrix4(t)}else{let t=e.position||[0,0,0],i=e.rotation||[0,0,0],r=e.scale||[1,1,1];d.position.set(t[0],t[1],t[2]),d.rotation.set(i[0]*Math.PI/180,i[1]*Math.PI/180,i[2]*Math.PI/180),d.scale.set(r[0],r[1],r[2])}return yield this.addLoadedModelToScene(d,e,p,(e=>u(e,90,99))),Tt.printMemory("After addLoadedModelToScene"),re.info(`[DxfViewer] Added '${e.src}' to scene in ${(Date.now()-this.timer)/1e3}s`),this.decreaseJobCount(),h(100),null==(r=this.loadingProgressBar)||r.delayRemoveProgressItem(o),this.dispatchEvent("ModelLoaded"),Promise.resolve()}))}unloadDxf(){throw new Error("Not implemented yet!")}isCompareMode(){return this.compareMode}compare(e,t,i){return ct(this,null,(function*(){var r,n,s,a,o;let{src:l,modelId:h}=e,{src:u}=t;if(this.compareMode)return Promise.reject("[DxfViewer] It is already under comparing mode!");if(this.masterModelId||Object.keys(this.loadedModels).length>0)return Promise.reject("[DxfViewer] Shouldn't load anything else before compare!");if(this.compareMode=!0,this.timer=Date.now(),this.increaseJobCount(),!this.font)return Promise.reject("[DxfViewer] Should set font first!");let c=new gr(this.loadingManager,!0);c.setFont(this.font),this.font instanceof Jc&&this.font.getFontData&&(yield this.font.getFontData());let p=l+u,d=this.translate("ProgressBar.Comparing"),f=e=>{var t;null==(t=this.loadingProgressBar)||t.updateProgress(p,d,e),i&&i(new ProgressEvent("CompareProgress",{loaded:e,total:100}))},m=(e,t,r)=>{var n;let s=100*e.loaded/e.total;s=s*(r-t)/100+t,null==(n=this.loadingProgressBar)||n.updateProgress(p,d,s),i&&i(new ProgressEvent("CompareProgress",{loaded:s,total:100}))};Tt.printMemory("Before comparing"),this.masterModelId=h||l,this.loadingDxfCount+=2,null==(r=this.loadingProgressBar)||r.addProgressItem(p),f(0);let g=Date.now(),y=yield c.parse(l,(e=>m(e,0,15))),v=yield c.parse(u,(e=>m(e,15,30))),[T,x]=yield Promise.allSettled([y,v]);if("rejected"===T.status)return Promise.reject(`[DxfViewer] Failed to parse ${l}`);if("rejected"===x.status)return Promise.reject(`[DxfViewer] Failed to parse ${u}`);if(re.info(`[DxfViewer] loadFiles in ${(Date.now()-g)/1e3}s`),gr.abortJobs)return Promise.reject("[DxfViewer] compare loadFile aborted");let b=T.value,E=x.value;g=Date.now();let _=yield new Zn(b,E).compare((e=>m(e,30,60)));if(re.info(`[DxfViewer] Compared in ${(Date.now()-g)/1e3}s`),re.debug("Compared results:",_),gr.abortJobs)return Promise.reject("[DxfViewer] compare change aborted");Tt.printMemory("After getting the comparison results"),g=Date.now(),yield c.loadEntitiesForCompare(b,E,_,(e=>m(e,60,95))),Tt.printMemory("After Creating threejs objects based on comparison result"),null==(n=this.font)||n.releaseFontData(),this.changes=_,re.info(`[DxfViewer] Creates threejs objects based on comparison result in ${(Date.now()-g)/1e3}s`);let w=b,S=E;if(this.loadingDxfCount-=2,this.decreaseJobCount(),Object.keys(_).length||re.info("[DxfViewer] No change found"),0===(null==(s=w.threejsObject)?void 0:s.children.length)&&0===(null==(a=S.threejsObject)?void 0:a.children.length)){let e=`[DxfViewer] Nothing was loaded from ${l} and ${u}`;return re.warn(e),Promise.reject(e)}let M=w.threejsObject,I=S.threejsObject;return M.name=l,I.name=u,g=Date.now(),this.addLoadedModelToScene(M,Mr({},e),w),Tt.printMemory("After adding first loaded Model to scene"),f(95),this.addLoadedModelToScene(I,Mr({},t),S),Tt.printMemory("After adding second loaded Model to scene"),re.info(`[DxfViewer] Added compared objects to scene in ${(Date.now()-g)/1e3}s`),re.info(`[DxfViewer] The comparison between ${l}' and '${u}' is completed in ${(Date.now()-this.timer)/1e3}s !`),f(100),null==(o=this.loadingProgressBar)||o.delayRemoveProgressItem(p),Promise.resolve()}))}getEntitiesCount(){let e=0;return Object.values(this.loadedModels).forEach((t=>{var i;e+=(null==(i=t.dxfData)?void 0:i.loadedEntityCount)||0})),e}getLoadedDxfModelIds(){return Object.keys(this.loadedModels)}getLayoutNames(){let e=[];return this.getLayouts().forEach((t=>{e.push(t.layoutName)})),e}getLayouts(){let e=[],t=this.loadedModels[this.masterModelId];if(t){let i=t.dxfData,r=null==i?void 0:i.objects.LAYOUT;null==r||r.forEach((t=>{e.push(t)}))}return e}handleOverlayDxf(e){var t;let i=this.loadedModels[e];if(!i)return void re.warn(`[DxfViewer] Can't find model for modelId '${e}'!`);this.increaseJobCount(),this.switchTransformMs(gr.MODEL_LAYOUT_NAME,e);let r=null==(t=i.dxfData)?void 0:t.threejsObject,n=null==r?void 0:r.children.find((e=>e.name===gr.MODEL_LAYOUT_NAME));n&&(n.traverse((e=>{this.addSpatialFilterSection(e,i.dxfData)})),this.calcBoundingBoxOfLayoutChild(n)),this.showLayoutObjects(this.activeLayoutName),this.decreaseJobCount()}activateLayout(e){var t,i,r,n;if(this.increaseJobCount(),0==e.length)return re.warn("[DxfViewer] layout name is empty !"),void this.decreaseJobCount();if(e===this.activeLayoutName)return void this.decreaseJobCount();let s=Date.now(),a=this.camera,o=this.getLayoutByName(e);if(!o)return re.warn(`[DxfViewer] Can't find layout of ${e} !`),void this.decreaseJobCount();let l=this.loadedModels[this.masterModelId];if(!l)return re.warn(`[DxfViewer] Can't find master model for modelId '${this.masterModelId}'!`),void this.decreaseJobCount();if(this.raycastableObjects=void 0,this.activeLayoutName){let e=this.getActiveLayoutInfo();e.lastCameraPosition||(e.lastCameraPosition=new D),null==(t=this.camera)||t.getWorldPosition(e.lastCameraPosition),this.controls.update(0),e.lastCameraZoom=a.zoom}if(!(e=>{let t=this.layoutInfos[e];return!(null==t||!t.lastCameraZoom)})(e)){this.switchTransformMs(e,this.masterModelId);let t=this.getLayoutViewports(o),n=[];t.length>0&&(n=t[0].frozenLayerHandles);let s=e!==gr.MODEL_LAYOUT_NAME,a=null==(i=l.dxfData)?void 0:i.threejsObject,h=null==a?void 0:a.children.find((t=>t.name===e));if(h){let t=[],i=null==(r=l.dxfData)?void 0:r.layersAndThreejsObjects;h.traverse((r=>{this.addSpatialFilterSection(r,l.dxfData);let a=r;if(s&&a.material&&a.geometry){let r=a.userData.layerName;if(!this.isLayerFrozenForViewport(l.dxfData,r,n))return;t.push(a);let s=-1;i&&i[r]&&(s=i[r].indexOf(a),s>=0&&i[r].splice(s,1)),s<0&&re.warn(`[DxfViewer] Failed to find object for modelId '${this.masterModelId}', layer '${r}', layout '${e}'`)}})),t.forEach((e=>{e.removeFromParent()}))}let u=this.getFilteredViewports(o);re.debug("[DxfViewer] Active layout:",e,", viewports:",u);let c=Date.now(),p=this.CAMERA_Z_POSITION/10,d=0;u.forEach((t=>{var i;this.generateObjectsByViewport(e,t,l.dxfData);let r=null==(i=null==t?void 0:t.msToPsMatrix)?void 0:i.elements[14];r&&r>d&&(d=r)}));let f=this.controls,m=f.getPosition(new D);if(d>m.z+p){let e=Math.ceil(d+p);re.info(`[DxfViewer] Changing camera's z value from ${m.z} to ${e}`);let t=f.getTarget(new D);m.setZ(e),f.setLookAt(m.x,m.y,m.z,t.x,t.y,t.z)}re.info(`[DxfViewer] generateObjectsByViewport in ${(Date.now()-c)/1e3}s`),e!==gr.MODEL_LAYOUT_NAME&&this.switchTransformMs(gr.MODEL_LAYOUT_NAME,this.masterModelId),e!==gr.MODEL_LAYOUT_NAME&&h&&this.setLayoutHidableObjectArray(h),h&&this.calcBoundingBoxOfLayoutChild(h)}this.measurementManager&&this.clearMeasurements(),this.markupManager&&this.clearMarkups(),null==(n=this.undoRedoManager)||n.clear(),this.showLayoutObjects(e),this.activeLayoutName=e;let h=this.getActiveLayoutInfo();if(h.lastCameraPosition)this.goTo(h.lastCameraPosition,h.lastCameraZoom,!1);else{h.extent=this.computeBoundingBox();let e=this.getLayoutExtentEx(o);if(e){let t=e.max.x-e.min.x,i=e.max.y-e.min.y;(t<1e-16||i<1e-16||t>1e16||i>1e16)&&(re.warn(`[BimViewer] Got wired bbox, max: ${e.max.toArray()}, min: ${e.min.toArray()}, going to calculate one...`),e=this.computeBoundingBox()),h.homeViewExtent=e,this.zoomToBBox(e)}}this.updateGroundPlane(),this.dispatchEvent("LayoutChanged"),Tt.printMemory(`After activated layout '${this.activeLayoutName}'`),this.enableRender(),this.decreaseJobCount(),re.info(`[DxfViewer] Activated layout '${e}' in ${(Date.now()-s)/1e3}s`)}calcBoundingBoxOfLayoutChild(e){let t=e.children.length;for(let i=0;i<t;i++){let t=e.children[i];t.children.length>0?t.userData.boundingBox=Tn.getBoundingBox(t):t.userData.boundingBox&&delete t.userData.boundingBox}}getActiveLayoutName(){return this.activeLayoutName}getLayers(){var e,t;let i=[];if(this.masterModelId){let t=this.loadedModels[this.masterModelId],r=null==(e=null==t?void 0:t.dxfData)?void 0:e.tables.layer.layers;r&&i.push({modelId:this.masterModelId,layers:r})}for(let[r,n]of Object.entries(this.loadedModels)){if(r===this.masterModelId)continue;let e=null==(t=null==n?void 0:n.dxfData)?void 0:t.tables.layer.layers;e&&i.push({modelId:r,layers:e})}return i}setModelVisibility(e,t){let i=this.loadedModels[e];if(!i||!i.dxfData)throw new Error(`Failed to find model by modelId '${e}'!`);i.dxfData.threejsObject.visible=t,this.enableRender()}setLayerVisibility(e,t,i){let r=this.camera;i=i||this.masterModelId;let n=this.loadedModels[i];if(!n)throw new Error(`Failed to find layer by modelId '${i}'!`);let s=n.dxfData,a=null==s?void 0:s.tables.layer.layers[e];a?a.visible=t:re.warn(`[DxfViewer] Layer '${e}' not found from dxfData!`);let o=null==s?void 0:s.layersAndThreejsObjects[e];if(o){let e=r.zoom;for(let i=0;i<o.length;i++){let r=o[i];this.enableHideVisuallySmallObjects&&t&&e&&r.userData.visibleMinZoom&&e<r.userData.visibleMinZoom||(r.visible=t),(!1===t||null!=r.userData.layerVisible)&&(r.userData.layerVisible=t),r.userData.isSnapObject&&(r.visible?r.layers.set(11):r.layers.disable(11))}}else re.warn(`[DxfViewer] No object found for layer '${e}'`);this.raycastableObjects=void 0,this.enableRender()}setLayerOpacity(){throw new Error("Not implemented yet!")}setLayerColor(e,t,i){i=i||this.masterModelId;let r=this.loadedModels[i];if(!r)throw new Error(`Failed to find layer by modelId '${i}'!`);let n=r.dxfData;if(!(null==n?void 0:n.tables.layer.layers[e]))throw new Error(`Failed to find layer by layerName '${e}'!`);this.clearSelection();let s=null==n?void 0:n.layersAndThreejsObjects[e];s?s.forEach((e=>{let i=e;if(i.material){i.userData.originalMaterial||(i.userData.originalMaterial=ss.cloneMaterial(i.material));let e=ss.cloneMaterial(i.material);ss.setMaterialColor(e,new Ve(t)),gr.updateMaterialUniforms(e),i.material=e}})):re.warn(`[DxfViewer] No object found for layer '${e}'`),this.enableRender()}resetLayerColor(e,t){t=t||this.masterModelId;let i=this.loadedModels[t];if(!i)throw new Error(`Failed to find model by modelId '${t}'!`);let r=i.dxfData;if(!(null==r?void 0:r.tables.layer.layers[e]))throw new Error(`Failed to find layer by layerName '${e}'!`);this.clearSelection();let n=null==r?void 0:r.layersAndThreejsObjects[e];n?n.forEach((e=>{let t=e;t.material&&t.userData.originalMaterial&&(t.material.dispose(),t.material=t.userData.originalMaterial,delete t.userData.originalMaterial)})):re.warn(`[DxfViewer] No object found for layer '${e}'`),this.enableRender()}setFont(e){return ct(this,null,(function*(){let t=Date.now();mh.isShxFile(e[0])?this.font=yield(new mh).loadAsync(e):(e.length>1&&re.warn("[DxfViewer] Only support 1 typeface font file for now, others will be ignored!"),this.font=yield(new kf).loadAsync(e[0])),re.info(`[DxfViewer] Font file(s) load time in ${(Date.now()-t)/1e3}s`)}))}setLoadingManager(e){this.loadingManager=e}setDisplayLengthUnits(){throw new Error("Not implemented yet!")}setDisplayAreaUnits(){throw new Error("Not implemented yet!")}setDisplayPrecision(){throw new Error("Not implemented yet!")}getCurrentViewExtent(){return{min:this.getHitResultByNdcCoordinate({x:-1,y:-1}),max:this.getHitResultByNdcCoordinate({x:1,y:1})}}getScreenshot(){return ct(this,null,(function*(){var e;let t,i="image/png",r=null==(e=this.renderer)?void 0:e.domElement;if(!r||!this.viewerContainer||!this.camera)return;this.boxSelectHelper||(this.boxSelectHelper=new sm(this)),t=yield this.boxSelectHelper.select();let n=yield Tt.canvasToImage(r),s=document.createElement("canvas");s.width=r.width,s.height=r.height;let a=window.devicePixelRatio,o=s.getContext("2d");if(o.drawImage(n,0,0,n.width/a,n.height/a),this.overlayRender){let e=yield this.overlayRender.getImage((e=>e instanceof Ii||e instanceof bn));o.drawImage(e,0,0,e.width/a,e.height/a)}return{base64Image:Tt.renderingContextToImage(o,t,i,.8),viewExtent:this.getCurrentViewExtent(),imageType:i}}))}getMeasurementManager(){return this.measurementManager}activateMeasurement(e){this.inputManager&&(this.measurementManager||(this.measurementManager=new fu(this,this.inputManager)),this.measurementManager.activateMeasurement(e),this.clearSelection(),this.enableRender(),this.dispatchEvent("MeasurementActivated"))}deactivateMeasurement(){var e;null==(e=this.measurementManager)||e.deactivateMeasurement(),this.dispatchEvent("MeasurementDeactivated")}getActiveMeasurementType(){var e;return null==(e=this.measurementManager)?void 0:e.getActiveMeasurementType()}getMeasurements(){var e;return(null==(e=this.measurementManager)?void 0:e.getMeasurementsData())||[]}cancelMeasurement(){var e;null==(e=this.measurementManager)||e.cancelMeasurement()}setMeasurements(e){this.inputManager&&(this.clearMeasurements(),this.measurementManager||(this.measurementManager=new fu(this,this.inputManager)),this.measurementManager.setMeasurementsData(e))}selectMeasurement(e){this.inputManager&&(this.measurementManager||(this.measurementManager=new fu(this,this.inputManager)),this.measurementManager.selectMeasurementById(e))}unselectMeasurement(){this.inputManager&&(this.measurementManager||(this.measurementManager=new fu(this,this.inputManager)),this.measurementManager.unselectMeasurement())}removeMeasurement(e){this.inputManager&&(this.measurementManager||(this.measurementManager=new fu(this,this.inputManager)),this.measurementManager.removeMeasurementById(e))}setMeasurementVisibility(e,t){return!!(this.inputManager&&this.measurementManager&&e)&&this.measurementManager.setMeasurementVisibility(e,t)}clearMeasurements(){var e;null==(e=this.measurementManager)||e.clearMeasurements()}getMarkupManager(){return this.markupManager}activateMarkup(e){this.inputManager&&(this.markupManager||(this.markupManager=new mI(this,this.inputManager)),this.markupManager.isMarkupActive()||this.markupManager.activate(),this.markupManager.setDrawType(e),this.clearSelection(),this.dispatchEvent("MarkupActivated"))}deactivateMarkup(){this.markupManager&&this.markupManager.deactivate(),this.dispatchEvent("MarkupDeactivated")}getActiveMarkupType(){var e;return null==(e=this.markupManager)?void 0:e.getActiveMarkupType()}setMarkupLineColor(e){var t;null==(t=this.markupManager)||t.setLineColor(e)}getMarkupLineColor(){var e;return null==(e=this.markupManager)?void 0:e.getLineColor()}setMarkupFillColor(e){var t;null==(t=this.markupManager)||t.setFillColor(e)}getMarkupFillColor(){var e;return null==(e=this.markupManager)?void 0:e.getFillColor()}setMarkupLineWidth(e){var t;null==(t=this.markupManager)||t.setLineWidth(e)}getMarkupLineWidth(){var e;return null==(e=this.markupManager)?void 0:e.getLineWidth()}setMarkupFontSize(e){var t;null==(t=this.markupManager)||t.setFontSize(e)}getMarkupFontSize(){var e;return null==(e=this.markupManager)?void 0:e.getFontSize()}getMarkups(){var e;return(null==(e=this.markupManager)?void 0:e.getMarkupData())||[]}setMarkups(e){this.inputManager&&(this.clearMarkups(),this.markupManager||(this.markupManager=new mI(this,this.inputManager)),this.markupManager.setMarkupData(e),this.enableRender())}setMarkupVisibility(e,t){return!!(this.inputManager&&this.markupManager&&e)&&this.markupManager.setMarkupVisibility(e,t)}updateMarkup(e){if(!(this.inputManager&&this.markupManager&&e&&e.id))return!1;let t=!1,i=this.markupManager,r=i.getMarkupById(e.id);return r&&(i.updateMarkup(r,e),t=!0),t}removeMarkup(e){return!(!this.inputManager||!this.markupManager)&&this.markupManager.removeMarkupById(e)}clearMarkups(){var e;null==(e=this.markupManager)||e.clearAll()}addHotpoint(e){var t;if(this.hasHotpoint(e.hotpointId))return void re.warn(`[DxfViewer] Hotpoint with id '${e.hotpointId}' already exist!`);let i=e.anchorPosition,r=sh.createHotpoint(e.html);r.position.set(i[0]||0,i[1]||0,i[2]||0),r.visible=!1!==e.visible,r.userData.hotpoint=e,this.hotpointRoot||(this.hotpointRoot=new ar,this.hotpointRoot.matrixAutoUpdate=!1,this.hotpointRoot.matrixWorldAutoUpdate=!1,this.hotpointRoot.name="HotpointRoot",null==(t=this.scene)||t.add(this.hotpointRoot)),this.hotpointRoot.add(r),r.updateWorldMatrix(!1,!1),this.enableRender()}removeHotpoint(e){var t,i;let r=(null==(t=this.hotpointRoot)?void 0:t.children)||[];for(let n=0;n<r.length;++n){let t=r[n];(null==(i=t.userData.hotpoint)?void 0:i.hotpointId)===e&&t.removeFromParent()}}clearHotpoints(){var e;null==(e=this.hotpointRoot)||e.clear()}hasHotpoint(e){var t;return-1!==((null==(t=this.hotpointRoot)?void 0:t.children)||[]).findIndex((t=>{var i;return(null==(i=t.userData.hotpoint)?void 0:i.hotpointId)===e}))}getHitResult(e){let t=this.viewerContainer;if(!this.camera||!this.raycaster||!this.groundPlane)return;let i=xi.getScreenPointByEvent(e,t),r=xi.screenPoint2NdcPoint(i,this.camera,t);return this.getHitResultByNdcCoordinate(r)}getHitResultByNdcCoordinate(e){if(!this.camera||!this.raycaster||!this.groundPlane)return;this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.set(10);let t=this.raycaster.intersectObject(this.groundPlane,!0);return t&&t.length>0?t[0].point:void 0}zoomToRect(){this.zoomToRectHelper||(this.zoomToRectHelper=new bT(this)),this.zoomToRectHelper.activate()}deactivateZoomRect(){var e;null==(e=this.zoomToRectHelper)||e.deactivate()}getLayoutByName(e){let t,i=this.getLayouts();for(let r of i)if(r.layoutName===e){t=r;break}return t}getActiveLayoutInfo(){return this.getLayoutInfo(this.activeLayoutName)}getMsTransformMatrix(e){var t,i;let r=this.loadedModels[e],n=null==(t=r.dxfData)?void 0:t.header;if(!n)return;let s=n.$ANGDIR,a=this.getDxfUnits(r.dxfData),o=null==(i=r.dxfData)?void 0:i.tables.viewport.viewports.filter((e=>"*ACTIVE"===e.name.toLocaleUpperCase()));if(!o)return;let l=new Be,h=gr.getDcs2WcsMatrix(o[0],s),u=new D(o[0].center.x,o[0].center.y,0).applyMatrix4(h),c=1;this.units&&a!==this.units&&(c=xG(a,this.units)),u.multiplyScalar(c),l.makeTranslation(u.x,u.y,0),l.multiply((new Be).makeRotationZ(fr.degToRad(o[0].viewTwistAngle))),l.multiply((new Be).makeTranslation(-u.x,-u.y,0)),this.loadedModels[e].msTransformMatrix=l}switchTransformMs(e,t){var i;let r=this.loadedModels[t];if(!r)return void re.warn(`[DxfViewer] Can't find model whose modelId is ${t}`);let n=r.msTransformMatrix;if(HT.identity(),!n||n.equals(HT))return;let s=null==(i=r.dxfData)?void 0:i.threejsObject,a=null==s?void 0:s.children.find((e=>e.name===gr.MODEL_LAYOUT_NAME));a&&(e===gr.MODEL_LAYOUT_NAME?a.applyMatrix4(n):a.applyMatrix4(n.clone().invert()),a.updateMatrixWorld(!0))}getLayoutExtentEx(e){return e.layoutName===gr.MODEL_LAYOUT_NAME?this.getModelSpaceExtent():this.getLayoutExtent(e)}getModelSpaceExtent(){var e,t;let i=this.loadedModels[this.masterModelId],r=null==(e=i.dxfData)?void 0:e.header,n=new D,s=new D;if(!r)throw new Error(`Header is undefined in ${this.masterModelId}!`);let a=null==(t=i.dxfData)?void 0:t.tables.viewport.viewports,o=r.$EXTMIN,l=r.$EXTMAX,h=r.$ANGDIR;if(a&&a.length>0)for(let u=0;u<a.length;u++){let e=a[u];if("*ACTIVE"===e.name.toLocaleUpperCase()){let{center:t,viewHeight:i,aspectRatio:r}=e,n=i*r,s=gr.getDcs2WcsMatrix(e,h),a=new D(t.x,t.y,0);a.applyMatrix4(s),o={x:a.x-n/2,y:a.y-i/2,z:0},l={x:a.x+n/2,y:a.y+i/2,z:0};break}}return n.set(o.x,o.y,o.z),s.set(l.x,l.y,l.z),new Rt(n,s)}getLayoutExtent(e){var t;let i=null==(t=this.loadedModels[this.masterModelId].dxfData)?void 0:t.header,r=new D,n=new D;if(!i)throw new Error(`Header is undefined in ${this.masterModelId}!`);let s=this.getLayoutViewports(e),a=i.$PEXTMIN,o=i.$PEXTMAX,l=i.$ANGDIR;if(s&&s.length>0){let e,t=s.filter((e=>1===parseInt(e.viewportId)));e=t.length>0?t[0]:s[0];let{centerPoint:i,width_paperSpace:r,height_paperSpace:n}=e,h=gr.getDcs2WcsMatrix(e,l),u=new D(i.x,i.y,0);u.applyMatrix4(h),a={x:u.x-r/2,y:u.y-n/2,z:0},o={x:u.x+r/2,y:u.y+n/2,z:0}}return r.set(a.x,a.y,a.z),n.set(o.x,o.y,o.z),new Rt(r,n)}showLayoutObjects(e){Object.values(this.loadedModels).forEach((t=>{var i;let r=0,n=0,s=null==(i=t.dxfData)?void 0:i.threejsObject;null==s||s.children.forEach((t=>{let i=t.name===e;t.visible=i,i?r++:n++})),re.debug(`[DxfViewer] showLayoutObjects('${e}') sets ${r} layout level object(s) to visible and ${n} to hidden for model '${null==s?void 0:s.name}'`)}))}getLayoutViewports(e){var t;let i=this.loadedModels[this.masterModelId],r=e.ownerHandle;return(null==(t=i.dxfData)?void 0:t.layoutViewportsMap[r])||[]}setMaterialUniforms(e,t){e instanceof Zt&&(e.uniforms.u_cameraZoom&&(e.uniforms.u_cameraZoom=gr.cameraZoomUniform),e.uniforms.u_viewportScale&&1===(null==t?void 0:t.header.$PSLTSCALE)&&(e.uniforms.u_viewportScale=gr.viewportScaleUniform))}isLayerFrozenForViewport(e,t,i){if(!e||!t)return!1;let r=e.tables.layer.layers[t];return!!(r&&(1&r.flag)>0)||!(!i||i.length<=0)&&r&&i.indexOf(r.handle)>=0}getFilteredViewports(e){let t=this.getLayoutViewports(e),i=t.filter((e=>"1"!==e.viewportId));return i.length===t.length&&(i=t.filter(((e,t)=>0!==t))),i}generateObjectsByViewport(e,t,i,r=[]){let n=t;if("1"==t.viewportId)return;if(!n.psBBox||!n.msToPsMatrix)throw new Error("The bbox or matrix is invalid in the viewport!");gr.transformMatrixUniform={value:n.msToPsMatrix},gr.viewportScaleUniform={value:t.viewHeight/t.height_paperSpace};let s=n.psBBox.clone();s.applyMatrix4(n.msToPsMatrix.clone().invert()),s.min.setZ(-1),s.max.setZ(1);let a=this.getObjectsByBoundingBox(s);if(0===a.length)return;let o,l=n.psBBox.min,h=n.psBBox.max,u=new ns(new ce(l.x,l.y),new ce(h.x,h.y)),c=lh.generateSectionPlanesByBox(u),p=[],d=e=>(p[e.id]||(p[e.id]=e.clone(),this.setMaterialUniforms(p[e.id],i),lh.setMaterialSection(p[e.id],c)),p[e.id]),f=[...r,...t.frozenLayerHandles||[]];if(e!==gr.MODEL_LAYOUT_NAME){let e=t;e.associatedLeafObjectSet||(e.associatedLeafObjectSet=new Set),o=e.associatedLeafObjectSet}let m=new Set,g=new ar;g.name=t.viewportId;let y=null==i?void 0:i.layersAndThreejsObjects,v=[];if(a.forEach((t=>{let r=t.clone();r.traverse((t=>{if(t.material&&t.geometry){let r=t.userData.layerName;if(this.isLayerFrozenForViewport(i,r,f))return void v.push(t);!1!==t.userData.layerVisible&&(t.visible=!0),t.material=(e=>{if(Array.isArray(e)){let t=[];return e.forEach((e=>{let i=d(e);t.push(i)})),t}return d(e)})(t.material),null==o||o.add(t),y&&y[r]?y[r].push(t):re.warn(`[DxfViewer] Failed to find object for modelId '${this.masterModelId}', layer '${r}', layout '${e}'`)}t.userData.isSnapObject&&m.add(t)})),r.userData.boundingBox&&(r.visible=!0,delete r.userData.boundingBox),g.add(r)})),o&&0===o.size)return;let T=null==i?void 0:i.threejsObject,x=null==T?void 0:T.children.find((t=>t.name===e));x||(x=new ar,kr.setSharedVariablesOfObject(x),x.name=e,null==T||T.add(x)),x.add(g),g.applyMatrix4(n.msToPsMatrix),g.updateMatrixWorld(!0);let b=x.children.find((e=>e.name===gr.SNAP_GROUP_NAME));b||(b=new ar,b.visible=!1,b.name=gr.SNAP_GROUP_NAME,x.add(b)),m.forEach((e=>{let t=e.parent,i=HT.identity();for(;t&&!0!==t.userData.isLayoutLevelObject;)i.premultiply(t.matrix),t=t.parent;e.applyMatrix4(i),null==b||b.add(e)})),v.length>0?kr.removeEmptyObjectsFromRemovingObjects(v,g):kr.removeEmptyObjects(g),g.traverse((e=>{kr.setSharedVariablesOfObject(e),this.addSpatialFilterSection(e,i,!0)}))}findSpatialFilter(e,t){let i,r=t.objects.SPATIAL_FILTER;if(r){for(let t of r)if(t.handle===e){i=t;break}return i}}getAnyMaterial(e){let t,i=e;if(i.material)return Array.isArray(i.material)?i.material[0]:i.material;for(let r=0;r<e.children.length&&(t=this.getAnyMaterial(e.children[r]),!t);r++);return t}addSpatialFilterSection(e,t,i=!1){if("INSERT"!==e.userData.entityType||!e.userData.spatialFilterHandle)return;let r=this.findSpatialFilter(e.userData.spatialFilterHandle,t);if(r){let t=i,n=!1,s=this.getAnyMaterial(e);if(s&&(s.clippingPlanes&&(t=s.clippingPlanes.length>0),n=s.clipIntersection),t&&n!==r.clipPolylines[0].bReversed)return void re.warn("[DxfViewer] Material cannot set clipIntersection to different values at the same time. clipIntersection needs to be set to true here!");n=r.clipPolylines[0].bReversed;let a=this.generateSectionsBySpatialFilter(r,e.matrixWorld);if(a){let i=e=>{let t=0;return e.clippingPlanes&&(t=e.clippingPlanes.length),t+a.length>gr.maxFragmentUniforms},r=new Set,s=e=>{r.has(e.id)||(r.add(e.id),i(e)||lh.setMaterialSection(e,a,t,n))};e.traverse((e=>{let t=e.material;Array.isArray(t)?t.forEach((e=>{s(e)})):t&&s(t)}))}}}getObjectsByBoundingBox(e){var t;let i=[];if(e.isEmpty())return re.warn("[DxfViewer] bbox is empty !"),i;let r=null==(t=this.loadedModels[this.masterModelId].dxfData)?void 0:t.threejsObject,n=null==r?void 0:r.children.find((e=>e.name===gr.MODEL_LAYOUT_NAME));return n&&n.children.forEach((t=>{(t=>{let r=Tn.getBoundingBox(t,!1);e.intersectsBox(r)&&i.push(t)})(t)})),i}getDxfUnits(e){if(e||Object.keys(this.loadedModels).length>0&&(e=this.loadedModels[this.masterModelId].dxfData),!e)return"Unitless";let t=null==e?void 0:e.header;if(!t)return re.warn("DxfData or its header is undefined!"),"Unitless";let i=t.$INSUNITS;return gr.getDxfUnits(i)}generateSectionsBySpatialFilter(e,t){let i=e.clipPolylines[0];if(i.bConcave)return void re.warn("[DxfViewer] clipPolyline.bConcave = true is not supported yet in spatialFilter !");HT.copy(t),e.localMatrix&&HT.multiply(e.localMatrix);let r=i.polyline,n=[];r.forEach((e=>{let t=e.clone().applyMatrix4(HT);n.push(new ce(t.x,t.y))}));let s=Ps.isClockWise(n),a=!s&&!i.bReversed||s&&i.bReversed;return lh.generateSectionPlanesByPoints(n,a)}addLoadedModelToScene(e,t,i,r){return ct(this,null,(function*(){if(!this.scene)return;let n=t.modelId||t.src;if(this.loadedModels[n]){let e=1;for(;this.loadedModels[`${n}_${e}`];)e++;n=`${n}_${e}`,re.warn(`[DxfViewer] Model '${n}' is loaded more than once!`)}this.loadedModels[n]={dxfData:i},e.matrixAutoUpdate=!1,e.updateMatrix(),Tt.printMemory("Before merge"),t.merge&&(yield gr.merge(i,r),Tt.printMemory("After merged")),e.updateMatrixWorld(!0),gr.computeLineDistances(e),this.getMsTransformMatrix(n),this.masterModelId===n?this.activateLayout(gr.MODEL_LAYOUT_NAME):this.handleOverlayDxf(n),re.debug(i),this.scene.add(e);let s=null==i?void 0:i.threejsObject.children.find((e=>e.name===gr.MODEL_LAYOUT_NAME));s&&this.setLayoutHidableObjectArray(s),this.updateGroundPlane(),this.raycastableObjects=void 0,this.masterModelId===n||this.enableRender()}))}resize(e=window.innerWidth,t=window.innerHeight){let i=this.camera;if(i){let r=e||window.innerWidth,n=t||window.innerHeight,s=r/n;i.left=-this.height*s/2,i.right=this.height*s/2,i.top=this.height/2,i.bottom=-this.height/2,i.updateProjectionMatrix(),this.renderer&&this.renderer.setSize(r,n,!0),this.css2dRenderer&&(this.css2dRenderer.setSize(r,n),this.css2dRenderer.domElement.style.width="0",this.css2dRenderer.domElement.style.height="0"),this.overlayRender&&this.overlayRender.setSize(r,n)}this.width=e,this.height=t,this.enableRender()}getRaycaster(){return this.raycaster}getRaycastableObjects(){var e;if(this.raycastableObjects)return this.raycastableObjects;let t=Date.now(),i=[];for(let r of Object.values(this.loadedModels)){let t=null==(e=r.dxfData)?void 0:e.threejsObject,n=t&&t.children.find((e=>e.name===this.activeLayoutName));n&&n.traverse((e=>{(e.visible||e.userData.isSnapObject)&&kr.isLeafObject(e)&&i.push(e)}))}return this.groundPlane&&i.push(this.groundPlane),this.raycastableObjects=i,re.debug(`[DxfViewer] getRaycastableObjects() finds ${i.length} objects`),re.debug(`[DxfViewer] getRaycastableObjects() costs ${(Date.now()-t)/1e3} s`),i}getViewportByPoint(e){if(0===this.activeLayoutName.length||this.activeLayoutName===gr.MODEL_LAYOUT_NAME)return;let t=this.getLayoutByName(this.activeLayoutName);if(!t)return;let i=t=>e.x<t.min.x||e.x>t.max.x||e.y<t.min.y||e.y>t.max.y,r=this.getFilteredViewports(t);for(let n=0,s=r.length;n<s;n++){let e=r[n];if(!i(e.psBBox))return e}}getRaycastableObjectsByMouse(e){let t=[],i=this.viewerContainer;if(!(this.raycaster&&this.camera&&this.scene&&e))return t;let r=Date.now(),n=new ce(e.x,e.y),s=xi.screenPoint2NdcPoint(n,this.camera,i);if(this.raycaster.setFromCamera(s,this.camera),re.debug("[DxfViewer] Space coordinates corresponding to the mouse position:",this.raycaster.ray.origin),this.activeLayoutName===gr.MODEL_LAYOUT_NAME)t=this.getRaycastableObjects(),re.debug("[DxfViewer] getRaycastableObjectsByMouse() from modelSpace");else{let e=new WeakSet,i=this.getLayoutByName(this.activeLayoutName);if(i){let r=i.directAssociatedLeafObjectSet;r&&r.forEach((i=>{i.visible&&(t.push(i),e.add(i))}))}let r=this.getViewportByPoint(this.raycaster.ray.origin);r&&r.associatedLeafObjectSet?(this.getRaycastableObjects().forEach((i=>{var n;null!=(n=r.associatedLeafObjectSet)&&n.has(i)&&!e.has(i)&&(i.visible||i.userData.isSnapObject)&&(t.push(i),e.add(i))})),re.debug("[DxfViewer] getRaycastableObjectsByMouse() from inside of viewport:",r.viewportId)):re.debug("[DxfViewer] getRaycastableObjectsByMouse() from out of viewport"),this.groundPlane&&t.push(this.groundPlane)}return re.debug(`[DxfViewer] getRaycastableObjectsByMouse() costs ${(Date.now()-r)/1e3} s`),t}getIntersections(e){let t=this.getRaycastableObjectsByMouse(e);return this.raycaster&&this.raycaster.intersectObjects(t,!0)||[]}handleMouseClick(e){if(this.measurementManager&&this.measurementManager.isMeasurementActive()||this.markupManager&&this.markupManager.isMarkupActive()||(this.selectDrawableByEvent(e),this.selectedObject)||!this.enableSelection)return;this.raycaster&&this.raycaster.layers.set(12);let t=this.getIntersections(e);if(t.length>0){let e=e=>Tt.vectorToString(e);re.debug(`[DxfViewer] Clicked at: ${e(t[0].point)}`)}let i=t.find((e=>{let t=e.object;return t.visible&&!1!==t.userData.selectable})),r=i&&i.object||void 0;this.selectedObject&&this.clearSelection(),r&&this.selectedObject&&this.selectedObject.id===r.id&&(r=void 0),r?this.selectObject(r):this.clearSelection()}selectDrawableByEvent(e){var t;this.clearSelection();let i=this.getHitResult(e);if(!i)return;let r=null==(t=this.overlayRender)?void 0:t.getDrawablesByPosition(i,this.raycaster);r&&r.length>0&&(r[0].selected=!0,this.selectedObject=r[0])}selectObject(e,t){if(!this.enableSelection)return;let i=e=>{if(e.children.length>0&&e.children.forEach((e=>i(e))),e instanceof Je||e instanceof Sr){let i=ss.clonedHighlightMaterials(e,{depthTest:t});i&&(e.userData.originalMaterial=e.material,e.material=i)}},r=e=>{if(e.children.length>0&&e.children.forEach((e=>r(e))),(e instanceof Je||e instanceof Sr)&&e.userData.originalMaterial){let t=e.material;e.material=e.userData.originalMaterial,delete e.userData.originalMaterial,Array.isArray(t)?t.forEach((e=>e.dispose())):t instanceof qr&&t.dispose()}};this.selectedObject&&(r(this.selectedObject),this.selectedObject=void 0),e&&(i(e),this.selectedObject=e,e.userData.dxfEntity?re.info("[DxfViewer] Selected entity:",e.userData.dxfEntity):re.info("[DxfViewer] Selected object:",e)),this.enableRender()}clearSelection(){this.selectedObject&&this.selectedObject instanceof Ys?this.selectedObject.selected=!1:this.selectObject(),this.selectedObject=void 0}flyToObjects(e){if(!e||0===e.length||!this.camera)return;let t=new Rt;e.forEach((e=>{let i=Tn.getBoundingBox(e);i.isEmpty()||t.union(i)})),this.zoomToBBox(t)}flyToObject(e){this.flyToObjects([e])}flyToSelectedObject(){if(!this.selectedObject)return;let e=this.selectedObject;(e instanceof sn&&e.userData.clonedMesh||e instanceof Je&&Zi.isMergedMesh(e)&&e.userData.clonedMesh)&&(e=e.userData.clonedMesh),this.flyToObject(e)}flyToRandomObject(){var e;let t=this.scene,i=[];for(let u of Object.values(this.loadedModels)){let t=null==(e=u.dxfData)?void 0:e.threejsObject;t&&i.push(t.id)}let r=i.length;if(r<=0)return;let n=i[Math.floor(Math.random()*r)],s=t.getObjectById(n);if(!s)return;let a=this.getActiveLayoutName();if(!s.children.find((e=>e.name===a)))return;let o=[];if(t.traverseVisible((e=>{(e instanceof Je||e instanceof Sr)&&!["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"].includes(e.name)&&o.push(e.id)})),o.length<1)return;let l=Math.floor(Math.random()*o.length),h=t.getObjectById(o[l]);h&&(re.info(`[DxfViewer] Flying to random object: ${h.name}, type: ${h.type}`),this.selectObject(h,void 0),this.flyToObject(h))}flyTo(e,t,i,r){let n=this.camera,s=this.controls;if(!n||!s)return;if(i&&(i=this.checkAndGetLimitedCameraZoom(i)),e.equals(t))return void re.error("[DxfViewer] Camera position and lookAt cannot be the same!");if(!Tt.isVectorValid(e)||!Tt.isVectorValid(t))return void re.error("[DxfViewer] Invalid position or lookAt!",e,t);let a=e.distanceTo(t);a<n.near?(e=e.clone().sub(t).normalize().multiplyScalar(1.1*n.near),re.warn("[DxfViewer] Camera could be too close to see the object!")):a>n.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*n.far),re.warn("[DxfViewer] Camera could be too far to see the object!"));let o=(e,t,i)=>{i&&Number.isFinite(i)&&s.zoomTo(i),s.setLookAt(e.x,e.y,e.z,t.x,t.y,t.z),this.updateHidableObjectsVisibility(),this.enableRender()};if(!1===r)return this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),void o(e,t,i);let l=n.position.clone(),h=s.getTarget(new D),u=n.zoom,c=300,p=Date.now();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=setInterval((()=>{let r=Date.now()-p;r>c&&(r=c);let n,s=(e,t,i)=>{let r=e.x+(t.x-e.x)*i,n=e.y+(t.y-e.y)*i,s=e.z+(t.z-e.z)*i;return new D(r,n,s)},a=s(l,e,r/c),d=s(h,t,r/c);i&&(n=u+(i-u)*r/c),o(a,d,n),r>=c&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0)}),10)}goTo(e,t,i){let r=this.camera,n=this.controls;if(!r||!n)return;let s=new D(e.x,e.y,r.position.z),a=n.getTarget(new D),o=new D(e.x,e.y,a.z);this.flyTo(s,o,t,i)}goToHomeView(){let e=this.getActiveLayoutInfo();e.homeViewExtent?this.zoomToBBox(e.homeViewExtent):re.error(`[DxfViewer] Failed to find extent for ${this.activeLayoutName}`)}zoomToBBox(e){let t=this.camera;if(!t)return;let i=e.max.x-e.min.x,r=e.max.y-e.min.y,n=t.right-t.left,s=t.top-t.bottom,a=Math.min(n/i,s/r);a/=1.1;let o=new Rt(new D(e.min.x,e.min.y,0),new D(e.max.x,e.max.y,0)),l=new D;o.getCenter(l),l.z=0;let h=l.clone().setZ(Math.max(t.position.z,this.CAMERA_Z_POSITION));h.equals(l)||this.flyTo(h,l,a,!1)}zoomToExtent(){let e=this.getActiveLayoutInfo();e.extent?this.zoomToBBox(e.extent):(console.error("[DxfViewer] Failed to find extent of current layout! Will go to home view."),this.goToHomeView())}zoomToCompareChange(e){if(this.changes){let t=this.changes[e];if(!t)return;let i=t.box;i&&this.zoomToBBox(i.clone().expandByScalar(1.2))}}getCompareChanges(){return this.changes}setBackgroundColor(e,t,i){this.scene&&(this.scene.background=new Ve(e,t,i),this.enableRender())}getLayoutInfo(e){return this.layoutInfos[e]||(this.layoutInfos[e]={}),this.layoutInfos[e]}updateGroundPlane(){if(!this.scene)return;let e=this.getActiveLayoutInfo();if(!e.homeViewExtent)return;let t=e.homeViewExtent.clone();Tt.expandBoxByScale(t,3);let i=t.min,r=t.max,n=r.x-i.x+r.y-i.y+r.z-i.z;Tt.expandBoxByMinSize(t,n);let s=[],a=(e,t,i)=>{s.push(new D(e,t,i))},o=t.getSize(new D),l=t.getCenter(new D);if(a(-o.x/2,-o.y/2,0),a(o.x/2,-o.y/2,0),a(o.x/2,o.y/2,0),a(-o.x/2,o.y/2,0),this.groundPlane)this.groundPlane.position.copy(l),this.groundPlane.geometry.setFromPoints(s),this.groundPlane.geometry.computeBoundingSphere(),this.groundPlane.geometry.computeBoundingBox(),this.groundPlane.geometry.computeVertexNormals();else{let e=new ot;e.setFromPoints(s),e.setIndex([0,3,2,0,2,1]),e.computeVertexNormals();let t=new Xt({color:"#888",transparent:!0,opacity:0,side:bi});this.groundPlane=new Je(e,t),this.groundPlane.frustumCulled=!1,this.groundPlane.position.copy(l),this.groundPlane.scale.set(1e5,1e5,1),this.groundPlane.name="groundPlane",this.groundPlane.userData.selectable=!1,this.groundPlane.renderOrder=-1e3,this.groundPlane.layers.enableAll(),kr.disableLayerChannels(this.groundPlane,[12]),this.scene.add(this.groundPlane)}this.groundPlane.updateMatrixWorld()}computeBoundingBox(){var e;let t=new Rt;for(let i of Object.values(this.loadedModels)){let r=null==(e=i.dxfData)?void 0:e.threejsObject;for(let e=0;r&&e<r.children.length;++e){let i=r.children[e];if(i.name===this.activeLayoutName){let e=Tn.getBoundingBox(i,!1);e.isEmpty()||t.union(e)}}}return t.min.z=0,t.max.z=0,re.info(`[DxfViewer] computeBoundingBox(), BBox's max: ${t.max.toArray()}, min: ${t.min.toArray()}`),t}checkAndGetLimitedCameraZoom(e){if(!e)return 1;let t=e;return e<this.CAMERA_MIN_ZOOM&&(re.warn(`[DxfViewer] Attampting to set camera's zoom value to ${e}, will use ${this.CAMERA_MIN_ZOOM}`),t=this.CAMERA_MIN_ZOOM),t}setVisibilityByCameraFrustum(){var e;if(!this.camera)return;let t=Date.now();$Ae.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ZAe.setFromProjectionMatrix($Ae);for(let i of Object.values(this.loadedModels)){let t=null==(e=i.dxfData)?void 0:e.threejsObject;!t||!t.visible||t.children.forEach((e=>{e.visible&&e.children.forEach((e=>{e.userData.boundingBox&&(ZAe.intersectsBox(e.userData.boundingBox)?e.visible=!0:e.visible=!1)}))}))}re.debug(`[DxfViewer] setVisibilityByCameraFrustum cost: ${(Date.now()-t)/1e3}s`)}getVisiblePixelSize(e){let t=6.5*fr.smoothstep(e,1e4,3e4)+.5;return re.debug("[DxfViewer] visiblePixelSize:",t),t}setLayoutHidableObjectArray(e){let t=this.camera;if(!this.enableHideVisuallySmallObjects||!t)return;let i=Date.now(),r=e.name;this.sortedHidableObjects[r]||(this.sortedHidableObjects[r]=[]);let n=this.sortedHidableObjects[r];this.controls.update(0);let s=t.zoom;this.lastCameraZoom=s;let a=e=>{if(!this.isCompareMode()||!e.material)return!1;let t;return t=e.material instanceof Zt?e.material.uniforms.u_color.value:e.material.color,t.equals(new Ve(Zn.ENTITY_COLOR_ADDED))||t.equals(new Ve(Zn.ENTITY_COLOR_REMOVED))},o=1;e.traverse((e=>{if(this.isCompareMode()&&a(e)||e.userData.isSnapObject||!kr.isLeafObject(e))return;let t=e.geometry;t.boundingBox||t.computeBoundingBox();let i=t.boundingBox.clone();if(!i||!Tt.isBoxValid(i))return;i.applyMatrix4(e.matrixWorld),i.getSize(BV);let r=Math.max(BV.x,BV.y),s=o/r;s<1/0?n.push({visibleMinZoom:s,object:e}):e instanceof Bi?n.push({visibleMinZoom:o,object:e}):re.warn("[DxfViewer] The size of bbox is 0 ! ",e)})),o=this.getVisiblePixelSize(n.length);let l=0;n.forEach((e=>{let t=e.visibleMinZoom*o;e.visibleMinZoom=t,e.object.userData.visibleMinZoom=t,t>s&&(e.object.visible=!1,l++)})),n.sort(((e,t)=>e.visibleMinZoom-t.visibleMinZoom)),re.debug(`[DxfViewer] setLayoutHidableObjectArray cost: ${(Date.now()-i)/1e3}s, ${l} objects changed to hidden`)}statObjects(e){let t=this.sortedHidableObjects[this.activeLayoutName],i=t.length,r={},n=0;t.forEach((t=>{let i=t.object;if(i.geometry&&i.material){n++;let i=(t=>{let i=0,r=t;for(;r&&(i++,r!==e);)r=r.parent;return i})(t.object);r[i]||(r[i]=0),r[i]++}}));let s=0;e.traverse((e=>{let t=e;t.geometry&&t.material&&s++})),re.info(`[DxfViewer] hidableObjects count:${i}, real count:${n}, layout count: ${s}, level:`,r),re.info("[DxfViewer] scene:",this.scene)}updateHidableObjectsVisibility(){var e;let t=this.camera;if(!t)return;let i=Date.now();this.controls.update(0);let r=t.zoom;if(Math.abs(r-this.lastCameraZoom)<1e-5||(this.updateRaycasterThreshold(),this.updateCameraZoomUniform(r),this.raycastableObjects=void 0,!this.sortedHidableObjects[this.activeLayoutName]))return;let n=this.sortedHidableObjects[this.activeLayoutName];if(0===n.length)return;let s=r>this.lastCameraZoom,a=Math.min(r,this.lastCameraZoom),o=Math.max(r,this.lastCameraZoom),l=[],h=0;for(let u=0;u<n.length;++u)if(!1!==n[u].object.userData.layerVisible){if(n[u].visibleMinZoom<a){l.push(n[u].object);continue}if(n[u].visibleMinZoom>o)break;n[u].object.visible=s,s&&l.push(n[u].object),h++}this.lastCameraZoom=r,re.debug(`[DxfViewer] updateHidableObjectsVisibility cost: ${(Date.now()-i)/1e3}s, ${h}(out of ${n.length}) objects changed to ${s?"visible":"hidden"}`);for(let u of Object.values(this.loadedModels)){let t=null==(e=u.dxfData)?void 0:e.threejsObject,i=t&&t.children.find((e=>e.name===this.activeLayoutName));i&&i.children.forEach((e=>{e.name===gr.SNAP_GROUP_NAME&&e.traverse((e=>{kr.isLeafObject(e)&&l.push(e)}))}))}this.groundPlane&&l.push(this.groundPlane),this.raycastableObjects=l}updateRaycasterThreshold(){if(!this.camera||!this.raycaster)return;let e=3*this.getPixelSizeInWorldCoord(),t=this.raycaster.params;t.Line?t.Line.threshold=e:t.Line={threshold:e},t.Points?t.Points.threshold=e:t.Points={threshold:e}}updateCameraZoomUniform(e){gr.cameraZoomUniform.value=e}},uP=ps(Zc(),1),k6t=(e=>(e[e.Browser=0]="Browser",e[e.Browserless=1]="Browserless",e[e.Headless=2]="Headless",e))(k6t||{}),QAe=class{constructor(e,t,i){if(this.scene=this.initScene(),this.selectedObject=void 0,this.loadedModels={},this.clock=new Vl,this.viewerMode=0,this.raycaster=new ka,this.savedMaterialsForOpacity=[],this.jobCount=0,this.bbox=new Rt,this.outlineMaterial=new br({color:1118481}),this.outlineRoot=new ar,this.transparentObjectIds=[],this.applyOptionsAndAddToScene=(e,t,i)=>{if(re.info(`[SimplifiedBimViewer] '${e}' is loaded, adding to scene...`),i.matrix&&16===i.matrix.length){let e=new Be;e.elements=i.matrix,t.applyMatrix4(e)}else{let e=i.position||[0,0,0],r=i.rotation||[0,0,0],n=i.scale||[1,1,1];t.position.set(e[0],e[1],e[2]),t.rotation.set(r[0]*Math.PI/180,r[1]*Math.PI/180,r[2]*Math.PI/180),t.scale.set(n[0],n[1],n[2])}this.addLoadedModelToScene(t,i)},this.getMeshes=e=>{let t=[];return e instanceof Je?t.push(e):e.traverseVisible((e=>{e instanceof Je&&t.push(e)})),t},this.containerOrCanvas=e,t&&(this.viewerMode=t),this.glContext=i,1===this.viewerMode&&(e instanceof HTMLDivElement||!i))throw new Error("[SimplifiedBimViewer] Parameters don't match Browserless viewerMode !");this.increaseJobCount(),this.init(),this.decreaseJobCount(),re.info("[SimplifiedBimViewer] Initialized"),this.animate()}init(){this.initRenderer(),this.initCamera(),this.initControls(),this.initLights(),this.initPointerEvents(),this.scene.add(this.outlineRoot)}initScene(){let e=new wn;return e.background=new Ve(7112861),e.matrixAutoUpdate=!0,e}isBrowserlessMode(){return 1===this.viewerMode}isBrowserMode(){return 0===this.viewerMode}initRenderer(){let e={antialias:!0,preserveDrawingBuffer:!0},t=this.isBrowserlessMode();t&&Object.assign(e,{canvas:this.containerOrCanvas,context:this.glContext});let i=new go(e);if(t){let e=this.containerOrCanvas.width,t=this.containerOrCanvas.height;re.info(`[SimplifiedBimViewer] Render target size: ${e} x ${t}`),this.renderTarget=new Wr(e,t,{minFilter:hi,magFilter:Oi,format:zs,type:Xu}),i.setRenderTarget(this.renderTarget)}else{let e=this.containerOrCanvas.clientWidth,t=this.containerOrCanvas.clientHeight;this.containerOrCanvas.append(i.domElement),i.setPixelRatio(window.devicePixelRatio),i.setSize(e,t)}i.outputEncoding=yr,i.toneMappingExposure=1,i.physicallyCorrectLights=!0,i.setClearColor(11119017,1),i.shadowMap.enabled=!0,i.shadowMap.type=Yy,this.renderer=i,t||(this.pmremGenerator=new Hp(i),this.pmremGenerator.compileEquirectangularShader(),this.setEnvironmentFromDataArray())}initCamera(){if(!this.scene)return;let e=this.containerOrCanvas.clientWidth||this.containerOrCanvas.width||0,t=this.containerOrCanvas.clientHeight||this.containerOrCanvas.height||0,i=1;e&&t&&(i=e/t),this.camera=new Vr(68,i,.05,1e4),this.camera.position.set(10,10,10),this.camera.lookAt(0,0,0),this.scene.add(this.camera)}initControls(){if(!this.renderer)return;let e=this.camera;if(!e)return;let t=new Io(e,this.renderer.domElement);t.smoothTime=.5,t.enabled=!0,t.keyTruckSpeed=10,t.keys={left:"KeyD",up:"KeyE",right:"KeyA",bottom:"KeyQ"},t.update(0),this.controls=t,t.addEventListener("update",(()=>{!this.isBrowserMode()&&this.renderer&&this.renderer.render(this.scene,e)}))}initLights(){if(!this.scene)return;let e=16777215,t=new Ns(e,.3);t.position.set(-2,2,4);let i=new Gl(3158064),r=new bf(e,14540253,3);r.position.set(0,300,0),this.scene.add(t),this.scene.add(i),this.scene.add(r)}initPointerEvents(){if(!this.renderer||!this.camera||!this.controls)return;let e=!1,t=!1,i=-1,r=-1;this.renderer.domElement.addEventListener("pointerdown",(t=>{i=t.x,r=t.y,e=!1})),this.renderer.domElement.addEventListener("pointermove",(t=>{i>=0&&r>=0&&(Math.abs(t.x-i)>5||Math.abs(t.y-r)>5)&&(e=!0)})),this.renderer.domElement.addEventListener("pointerup",(()=>{t&&setTimeout((()=>{t=!1}),200),i=-1,r=-1})),this.renderer.domElement.addEventListener("dblclick",(i=>{t=!0,e||(this.handleMouseClick(i),this.flyToSelectedObject())}))}animate(){var e;this.isBrowserMode()&&requestAnimationFrame(this.animate.bind(this));let t=this.clock.getDelta();this.controls&&this.controls.update(t),this.scene&&this.camera&&(null==(e=this.renderer)||e.render(this.scene,this.camera))}destroy(){this.camera=void 0,this.scene&&this.scene.clear(),this.requestAnimationFrameHandle&&(cancelAnimationFrame(this.requestAnimationFrameHandle),this.requestAnimationFrameHandle=void 0),this.renderer&&(this.containerOrCanvas.removeChild(this.renderer.domElement),this.renderer.clear(),this.renderer.dispose(),this.renderer=void 0),this.controls&&(this.controls.dispose(),this.controls=void 0),this.renderTarget&&(this.renderTarget.dispose(),this.renderTarget=void 0),this.raycaster=void 0,this.selectedObject=void 0,this.savedMaterialsForOpacity=void 0,Object.keys(this.loadedModels).forEach((e=>{delete this.loadedModels[e]}))}loadLocalModel(e,t,i){return ct(this,null,(function*(){let r=yield(new pl).loadLocalModel(e,t.src,i);return r?(this.applyOptionsAndAddToScene(e,r,t),Promise.resolve()):Promise.reject()}))}loadModel(e,t){return ct(this,null,(function*(){this.increaseJobCount();let i=yield(new pl).loadModel(e.src,e.fileFormat,t);return i?(this.applyOptionsAndAddToScene(e.src,i,e),Promise.resolve()):Promise.reject()}))}parseGltf(e,t,i,r){this.increaseJobCount(),(new pl).parseGltf(e,t.src,(e=>{this.applyOptionsAndAddToScene(t.src,e,t),i&&i(e)}),(e=>{r&&r(e)}))}addLoadedModelToScene(e,t){if(!this.scene)return;e.updateMatrix(),e.traverse((e=>{e.geometry&&e.layers.enableAll()})),this.scene.add(e);let i=new Fx(e);i.name="BIM_VIEWER_BOX_HELPER",i.visible=!1,i.material&&(i.material=void 0,i.layers.enableAll(),i.layers.disable(12));let r=t.modelId||t.src;if(this.loadedModels[r]){let e=1;for(;this.loadedModels[`${r}_${e}`];)e++;r=`${r}_${e}`,re.warn(`[BimViewer] Model '${r}' is loaded more than once!`)}this.loadedModels[r]={id:e.id,bbox:i},this.computeBoundingBox();let n=Object.values(this.loadedModels).map((e=>e.id));(!n||n.length<=1)&&(this.tryAdjustCameraNearAndFar(),this.goToHomeView()),this.scene.add(i),t.edges&&kr.addOutlines(e),this.decreaseJobCount(),re.info(`[SimplifiedBimViewer] Added '${t.src}' to scene`)}addOrRemoveObjectOpacity(e=!0,t=.3,i,r){if(this.savedMaterialsForOpacity||(this.savedMaterialsForOpacity=[]),!this.scene)return;let n=this.scene,s=[];Object.keys(this.loadedModels).forEach((a=>{let o=this.loadedModels[a];if(e){this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0&&kr.revertObjectOpacityById(n,o.id,this.savedMaterialsForOpacity);let e=kr.setObjectOpacityById(n,o.id,t,i,r);s.push(...e)}else this.savedMaterialsForOpacity&&kr.revertObjectOpacityById(n,o.id,this.savedMaterialsForOpacity)})),this.savedMaterialsForOpacity=e?s:[]}hasTransparentObject(){return!!(this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0)}getIntersections(e){if(!this.raycaster||!this.camera||!this.scene)return[];let t=new ce;e&&(t=xi.getScreenPointByEvent(e,this.containerOrCanvas));let i=xi.screenPoint2NdcPoint(t,this.camera,this.containerOrCanvas);this.raycaster.setFromCamera(i,this.camera);let r=[];return Object.values(this.loadedModels).forEach((e=>{let t=this.scene&&this.scene.getObjectById(e.id);t&&t.visible&&r.push(t)})),this.raycaster.intersectObjects(r,!0)||[]}handleMouseClick(e){this.raycaster&&this.raycaster.layers.set(12);let t=this.getIntersections(e).find((e=>{let t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof Je)})),i=t&&t.object||void 0;i&&this.selectedObject&&this.selectedObject.id===i.id&&(i=void 0),i?this.selectObject(i):this.clearSelection()}selectObject(e){if(this.selectedObject){let e=this.selectedObject.userData;if(e.originalMaterial){if(this.selectedObject.material){let e=this.selectedObject.material;Array.isArray(e)?e.forEach((e=>e.dispose())):e instanceof qr&&e.dispose()}this.selectedObject.material=e.originalMaterial,delete e.originalMaterial}this.selectedObject=void 0}if(!this.scene||!e)return;let t=ss.clonedHighlightMaterials(e);t&&(this.selectedObject=e,this.selectedObject.userData.originalMaterial=this.selectedObject.material,this.selectedObject.material=t)}clearSelection(){this.selectObject()}flyToObjects(e){if(!e||0===e.length||!this.camera)return;let t=new D,i=new D,r=new Rt;e.forEach((e=>{let t=Tn.getBoundingBox(e);r.union(t)}));let n=new D;this.camera.getWorldDirection(n),Va.getCameraPositionByBboxAndDirection(r,t,i,this.camera.projectionMatrix,n),this.flyTo(t,i)}flyToObject(e){this.flyToObjects([e])}flyToSelectedObject(){this.selectedObject&&this.flyToObject(this.selectedObject)}flyTo(e,t,i){var r;let n=this.camera,s=this.controls;if(!n||!s)return;let a=e=Array.isArray(e)?new D(e[0],e[1],e[2]):e,o=t=Array.isArray(t)?new D(t[0],t[1],t[2]):t;re.info("[SimplifiedBimViewer] flyTo: ",Tt.vectorToString(a)),s.setPosition(a.x,a.y,a.z),s.setTarget(o.x,o.y,o.z),this.isBrowserMode()||null==(r=this.renderer)||r.render(this.scene,n),i&&i()}goToHomeView(){var e;let t=new D,i=new D,r=new D,n=new D;this.bbox.getSize(n),this.bbox.getCenter(r);let s=(n.x+n.y+n.z)/3*1.5,a=new D(r.x+s,r.y+s/1.5,r.z+s),o=r.clone().sub(a);Va.getCameraPositionByBboxAndDirection(this.bbox,t,i,null==(e=this.camera)?void 0:e.projectionMatrix,o),t.equals(i)||this.flyTo(t,i)}setEnvironmentFromDataArray(e){qc.createEnvTextureFromDataArray(this.pmremGenerator,e).then((e=>{this.scene.environment=e,this.isBrowserMode()||this.animate()}))}tryAdjustCameraNearAndFar(){let e=this.camera;if(!this.scene||!e)return;let t=this.bbox,i=e.near,r=e.far,n=t.max.x-t.min.x,s=t.max.y-t.min.y,a=t.max.z-t.min.z,o=Math.max(n,s,a),l=o/5,h=5*o;if(i>l||r<h){let t=e=>Tt.numberToString(e);re.info(`[SimplifiedBimViewer] BBox's longest side is: ${t(o)}`),i>l&&(re.warn(`[SimplifiedBimViewer] camera.near(${t(i)}) shouldn't bigger than ${t(l)}, will change it!`),e.near=l),r<h&&(re.warn(`[SimplifiedBimViewer] camera.far(${t(r)}) shouldn't smaller than ${t(h)}, will change it!`),e.far=h)}e.updateProjectionMatrix()}isolateObjects(e){let t=this.transparentObjectIds.length>0?void 0:this.transparentObjectIds,i=this.transparentObjectIds.length>0?this.transparentObjectIds:void 0,r=new Xt({color:16777215,transparent:!0,opacity:.1});Object.keys(this.loadedModels).forEach((e=>{let n=this.loadedModels[e];kr.applyMaterialToObjectById(this.scene,n.id,r,i,t)})),this.outlineRoot.clear();let n=[];if(e.forEach((e=>{let t=e.modelId,i=t?this.scene.getObjectById(this.loadedModels[t].id):this.scene;i||(re.warn(`[BimViewer] The ModelId of ${t} has no corresponding model.`),i=this.scene),i.traverse((t=>{if((0,uP.includes)(e.id,(0,uP.get)(t.userData,"UniqueId"))){let e=this.getMeshes(t);n=n.concat(e)}}))})),n.length>0){n.forEach((e=>{let t=kr.createOutline(e.geometry,this.outlineMaterial);t.applyMatrix4(e.matrixWorld),this.outlineRoot.add(t),t.updateWorldMatrix(!0,!1)}));let e=n.map((e=>e.id));Object.keys(this.loadedModels).forEach((t=>{let i=this.loadedModels[t];kr.revertAppliedMaterialToObjectById(this.scene,i.id,e)})),this.transparentObjectIds=e,this.flyToObjects(n)}else re.warn(`[BimViewer] No object found with uniqueIds: ${e.map((e=>e.id))}`);this.isBrowserMode()||this.animate()}increaseJobCount(){++this.jobCount}decreaseJobCount(){--this.jobCount}computeBoundingBox(){let e=new Rt;return Object.values(this.loadedModels).forEach((t=>{if(t.bbox){t.bbox.geometry.computeBoundingBox();let i=t.bbox.geometry.boundingBox;i&&!i.isEmpty()&&e.union(i)}})),this.bbox=e,e}getContext(){var e;return null==(e=this.renderer)?void 0:e.getContext()}getCameraDirection(){var e;let t=new D;return null==(e=this.camera)||e.getWorldDirection(t),{x:t.x,y:t.y,z:t.z}}setFov(e){this.camera&&(this.camera.fov=e,this.camera.updateProjectionMatrix())}},eOe=ps(Zc(),1),Em=class extends ar{constructor(e,t,i=10){super(),this.images=e,this.thumbnailImages=t,this.size=i,this.textureLoader=new gs,this.mesh=new Je}fadeIn(e=1e3){let t=this.getMaterials();if(!(Array.isArray(t)&&t.length>0))return void(this.visible=!0);t.forEach((e=>e.opacity=0));let i=1/(e/10);this.visible=!0,this.clearFading(),this.renderOrder+=1,this.fadingInInterval=setInterval((()=>{let e=1,r=this.getMaterials();this.materialEquals(t,r)||(t=r),t.length>0&&(e=Math.min(t[0].opacity+i,1),t.forEach((t=>t.opacity=e))),e>=1&&this.clearFading()}),10)}materialEquals(e,t){return eOe.default.isEqualWith(e,t,((e,t)=>{if(!Array.isArray(e)||!Array.isArray(t))return e.id===t.id}))}fadeOut(e=1e3){let t=this.getMaterials(),i=1/(e/10),r=1/(e/10);this.clearFading(),this.scale.set(2,2,2),this.fadingOutInterval=setInterval((()=>{let e=this.scale.x+r;this.scale.set(e,e,e);let n=0;t.length>0&&(n=Math.max(t[0].opacity-i,0),t.forEach((e=>e.opacity=n))),(n<=0||e>=3)&&this.clearFading()}),10)}clearFading(){let e=this.getMaterials();this.fadingInInterval&&(clearInterval(this.fadingInInterval),this.fadingInInterval=void 0,this.visible=!0,e.forEach((e=>e.opacity=1)),this.renderOrder-=1),this.fadingOutInterval&&(clearInterval(this.fadingOutInterval),this.fadingOutInterval=void 0,this.visible=!1,e.forEach((e=>e.opacity=1)),this.scale.set(1,1,1))}getMaterials(){let e=this.thumbnailMesh;e||(e=this.mesh);let t=[];return Array.isArray(e.material)?t.push(...e.material):e.material&&t.push(e.material),t}create(){}createThumbnailMesh(e){return ct(this,null,(function*(){if(!this.thumbnailImages||6!=this.thumbnailImages.length)return;this.thumbnailMesh=new Je(new js(e,e,e)),this.thumbnailMesh.geometry.scale(1,1,-1);let t=(yield this.loadTexturesAsync(this.thumbnailImages)).map((e=>new Xt({map:e,side:Xi,transparent:!0})));this.thumbnailMesh&&(this.thumbnailMesh.material=t,this.add(this.thumbnailMesh))}))}loadTextures(e){return e.map((e=>this.textureLoader.load(e)))}loadTexturesAsync(e){return ct(this,null,(function*(){let t=e.map((e=>this.textureLoader.loadAsync(e)));return yield Promise.all(t)}))}destroyMesh(e){var t;this.remove(e),e.clear(),e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach((e=>{var t;null==(t=e.map)||t.dispose(),e.dispose()})):(null==(t=e.material.map)||t.dispose(),e.material.dispose())}destroy(){this.clearFading(),this.images=[],this.mesh&&(this.mesh instanceof Je?this.destroyMesh(this.mesh):this.mesh.traverse((e=>{e instanceof Je&&this.destroyMesh(e)})),this.mesh=void 0)}},hP=class extends Em{constructor(e,t,i=200){if(super(e,t,i),6!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 6, got ${e.length}`)}create(){return ct(this,null,(function*(){yield this.createThumbnailMesh(this.size+.1),this.thumbnailMesh?this.createMesh():yield this.createMesh()}))}createMesh(){return ct(this,null,(function*(){let e=this.mesh;e.geometry=new js(this.size,this.size,this.size),e.geometry.scale(1,1,-1);let t=(yield this.loadTexturesAsync(this.images)).map((e=>new Xt({map:e,side:Xi,transparent:!0})));e.material=t,this.add(e),this.thumbnailMesh&&(this.destroyMesh(this.thumbnailMesh),this.thumbnailMesh=void 0,this.thumbnailImages=void 0)}))}},pP=class extends Em{constructor(e,t,i=200){if(super(e,t,i),24!==e.length)throw new Error(`[VRCube24Faces] Wrong number of images! Expected 24, got ${e.length}`);this.ratio=1,this.subPlaneWidth0=this.size*(this.ratio/(this.ratio+1)),this.subPlaneWidth1=this.size-this.subPlaneWidth0}create(){return ct(this,null,(function*(){yield this.createThumbnailMesh(this.size+.1),this.thumbnailMesh?this.createMesh():yield this.createMesh()}))}createMesh(){return ct(this,null,(function*(){var e;this.mesh=new ar,this.mesh.scale.set(1,1,-1);let t=(yield this.loadTexturesAsync(this.images)).map((e=>new Xt({map:e,side:$n,transparent:!0})));if(24!==t.length)throw new Error(`[VRCube24Faces] Wrong number of materials! Expected 24, got ${t.length}`);let i=this.createPlaneOfAFace(t.slice(0,4));i.rotateOnAxis(new D(0,1,0),-Math.PI/2),i.position.set(this.size/2,0,0);let r=this.createPlaneOfAFace(t.slice(4,8));r.rotateOnAxis(new D(0,1,0),Math.PI/2),r.position.set(-this.size/2,0,0);let n=this.createPlaneOfAFace(t.slice(8,12));n.rotateOnAxis(new D(1,0,0),-Math.PI/2),n.rotateOnAxis(new D(0,0,1),Math.PI),n.rotateOnAxis(new D(1,0,0),Math.PI),n.position.set(0,this.size/2,0);let s=this.createPlaneOfAFace(t.slice(12,16));s.rotateOnAxis(new D(1,0,0),Math.PI/2),s.rotateOnAxis(new D(0,0,1),Math.PI),s.rotateOnAxis(new D(1,0,0),Math.PI),s.position.set(0,-this.size/2,0);let a=this.createPlaneOfAFace(t.slice(16,20));a.rotateOnAxis(new D(0,1,0),Math.PI),a.position.set(0,0,this.size/2),this.createPlaneOfAFace(t.slice(20,24)).position.set(0,0,-this.size/2),this.add(this.mesh),this.thumbnailMesh&&(this.destroyMesh(this.thumbnailMesh),this.remove(this.thumbnailMesh),null==(e=this.thumbnailMesh)||e.clear(),this.thumbnailMesh=void 0)}))}createPlaneOfAFace(e){var t;let i=new ar,r=new En(this.subPlaneWidth0,this.subPlaneWidth0),n=new En(this.subPlaneWidth1,this.subPlaneWidth0),s=new En(this.subPlaneWidth0,this.subPlaneWidth1),a=new En(this.subPlaneWidth1,this.subPlaneWidth1),o=new Je(r,e[0]),l=new Je(n,e[1]),h=new Je(s,e[2]),u=new Je(a,e[3]);return o.position.set(this.subPlaneWidth1/2,this.subPlaneWidth1/2,0),l.position.set(-this.subPlaneWidth0/2,this.subPlaneWidth1/2,0),h.position.set(this.subPlaneWidth1/2,-this.subPlaneWidth0/2,0),u.position.set(-this.subPlaneWidth0/2,-this.subPlaneWidth0/2,0),o.geometry.scale(-1,1,1),l.geometry.scale(-1,1,1),h.geometry.scale(-1,1,1),u.geometry.scale(-1,1,1),i.add(o,l,h,u),null==(t=this.mesh)||t.add(i),i}},dP=class extends Em{constructor(e,t,i=100){if(super(e,t,i),1!==e.length)throw new Error(`[VRSphere] Wrong number of images! Expected 1, got ${e.length}`)}create(){return ct(this,null,(function*(){yield this.createThumbnailMesh(this.size+.1),this.thumbnailMesh?this.createMesh():yield this.createMesh()}))}createMesh(){return ct(this,null,(function*(){var e;let t=this.mesh;t.geometry=new po(this.size,100,100),t.geometry.scale(-1,1,1);let i=(yield this.loadTexturesAsync(this.images)).map((e=>new Xt({map:e,side:Xi,transparent:!0})));t.material=i[0],this.add(t),this.thumbnailMesh&&(this.destroyMesh(this.thumbnailMesh),this.remove(this.thumbnailMesh),null==(e=this.thumbnailMesh)||e.clear(),this.thumbnailMesh=void 0)}))}},tOe=class extends lm{constructor(e,t){super(e),this.name="VRViewer",this.minFov=50,this.maxFov=95,this.raycaster=new ka,this.autoRotate=!0,this.events=[],this.lastFrameExecuteTime=Date.now(),this.maxFps=60,this.isMousePressing=!1,this.settings=gE,this.viewpoints=[],this.previousViewpointId="",this.previousPanoramaId="",this.activeViewpointId="",this.activePanoramaId="",this.viewpointAssetsMap=new Map,this.loadingPanos=[],this.onResize=()=>{this.viewerContainer&&this.viewerContainer.parentElement&&this.resize(this.viewerContainer.parentElement.clientWidth,this.viewerContainer.parentElement.clientHeight)},this.onMouseWheel=e=>{let t=e.wheelDelta>0?-5:5;this.updateFov(t)},this.viewerCfg=e,this.cameraCfg=t||{eye:[0,0,0],look:[0,0,0]},this.settings=gE,this.cameraCfg.near&&(this.settings.camera.near=this.cameraCfg.near),this.cameraCfg.far&&(this.settings.camera.far=this.cameraCfg.far),this.setSpinnerVisibility(++this.jobCount>0),this.init(),this.animate(),this.setSpinnerVisibility(--this.jobCount>0)}init(){let e=this.viewerCfg;this.initSpinner(),this.initScene(),this.initRenderer(),this.initCamera(),this.initControls(),this.initLights(),this.initEvents(),this.initOthers(),!0===e.enableAxisGizmo&&(this.axes=this.initAxes()),e.enableToolbar&&(this.toolbar=this.initToolbar()),e.enableBottomBar&&(this.bottomBar=this.initBottomBar())}initScene(){let e=new wn;e.background=new Ve(16777215),e.matrixAutoUpdate=!0,this.scene=e}initRenderer(){var e,t;this.renderer=new go({antialias:!1,preserveDrawingBuffer:!1}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.css2dRenderer=new nh,this.css2dRenderer.setSize(this.width,this.height),this.css2dRenderer.domElement.style.height="0",this.css2dRenderer.domElement.style.width="0",null==(e=this.viewerContainer)||e.appendChild(this.renderer.domElement),null==(t=this.viewerContainer)||t.appendChild(this.css2dRenderer.domElement)}initCamera(){this.scene&&(this.camera=new Vr(75,this.width/this.height,this.settings.camera.near,this.settings.camera.far),this.scene.add(this.camera))}initControls(){if(!this.renderer||!this.camera)return;let e=this.camera,t=this.viewerCfg,i=new bA(e,this.renderer.domElement,!0);i.enabled=!0,i.autoRotate=this.autoRotate,i.autoRotateSpeed=t.autoRotateSpeed||-2,i.enablePan=!1,i.enableZoom=!1,i.enableRotate=!0,i.rotateSpeed=.3,i.minPolarAngle=.05*Math.PI,i.maxPolarAngle=.95*Math.PI,i.listenToKeyEvents(document.body),i.update(),this.controls=i,this.controlsHelper=new rO(e,i),this.controls.controlsHelper=this.controlsHelper,this.autoRotate&&this.controlsHelper.delayAutoRotate(),this.controlsHelper.automaticallyAdjustCameraPosition=!1,this.controls.addEventListener("end",(()=>{this.handleDragEnd&&this.handleDragEnd()}));let r=new D(0,0,0),n=new D(10,0,0);this.setCameraPositionAndDirection(r,n)}onKeyDown(e){return t=>{var i,r;let n=e.camera,s=e.controls;!n||!s||(("ArrowLeft"===t.code||"ArrowRight"===t.code||"ArrowUp"===t.code||"ArrowDown"===t.code)&&(null==(i=this.controlsHelper)||i.startToRotate(t)),null==(r=this.controlsHelper)||r.delayAutoRotate())}}initLights(){if(!this.scene)return;let e=new Ns(16777215,.3);e.position.set(-2,2,4),this.scene.add(e)}initEvents(){let e=this.renderer,t=this.camera;if(!e||!t)return;let i=!1,r=-1,n=-1;this.addEvent(window,"keydown",this.onKeyDown(this)),this.addEvent(window,"resize",this.onResize),this.addEvent(window,"mousewheel",this.onMouseWheel),this.addEvent(window,"pointerdown",(t=>{var s;r=t.x,n=t.y,i=!1,this.isMousePressing=!0,this.autoRotate&&(null==(s=this.controlsHelper)||s.delayAutoRotate()),t.button===TC.LEFT&&t.target instanceof HTMLCanvasElement&&(e.domElement.style.cursor="move")})),this.addEvent(window,"pointermove",(e=>{r>=0&&n>=0&&(Math.abs(e.x-r)>5||Math.abs(e.y-n)>5)&&(i=!0)})),this.addEvent(window,"pointerup",(r=>{var n,s;if(this.isMousePressing=!1,this.autoRotate&&(null==(n=this.controlsHelper)||n.delayAutoRotate()),e.domElement.style.cursor="auto",!i&&r.button===TC.LEFT)if(r.target&&r.target instanceof HTMLDivElement){let e=sh.tryFindObjectId(r.target);if(e){let t=null==(s=this.scene)?void 0:s.getObjectById(e);if(t){let e=t.userData.hotpoint;e&&(re.info("[VRViewer] Clicked on hotpoint: ",e.hotpointId||e),this.onHotpointClicked&&this.onHotpointClicked(e))}}}else{let e=this.getIntersection(r);if(e){let i=e=>Tt.vectorToString(e),r=e.point,n=r.clone().sub(t.position).normalize();re.info(`[VRViewer] Clicked at: ${i(r)},\n Camera position: ${i(t.position)},\n Target direction: ${i(n)}`)}}}))}initOthers(){!this.controls||!this.renderer||!this.camera||(this.renderer.domElement.style.outlineWidth="0")}initAxes(){var e;let t=document.createElement("div");t.classList.add("axesRenderer");let i=new Of(t,this.camera);return null==(e=this.widgetContainer)||e.append(t),i}initToolbar(){let e=this.viewerCfg;return new Nh(this,Mr(Mr({},XCe),e.toolbarMenuConfig),[["SceneClear"]])}initBottomBar(){return new fm(this)}animate(){var e,t,i;if(this.requestAnimationFrameHandle=requestAnimationFrame(this.animate.bind(this)),this.maxFps>0){let e=Date.now()-this.lastFrameExecuteTime;if(e<1e3/this.maxFps)return;if(this.lastFrameExecuteTime=Date.now(),this.autoRotate){let t=this.controlsHelper;t&&t.autoRotateRemainingTime>0&&!this.isMousePressing&&(t.autoRotateRemainingTime-=e,t.autoRotateRemainingTime<=0&&this.controls&&t.startAutoRotate())}}this.controls&&this.controls.update(),this.scene&&this.camera&&(null==(e=this.renderer)||e.render(this.scene,this.camera),null==(t=this.css2dRenderer)||t.render(this.scene,this.camera),null==(i=this.css3dRenderer)||i.render(this.scene,this.camera))}clearAllCachedPanoramas(){this.handleCameraUpdateInterval(),this.loadingPanos.forEach((e=>{e.creationPromise&&(e.creationPromise.cancel(),e.creationPromise=void 0)})),this.viewpointAssetsMap.forEach((e=>{var t;let i=e.panoramas;for(let r=i.length-1;r>=0;--r){let e=i[r];e.box.destroy(),null==(t=this.scene)||t.remove(e.box)}})),this.loadingPanos=[],this.viewpointAssetsMap.clear(),this.activePanoramaId="",this.activePanoramaId="",this.previousViewpointId="",this.previousPanoramaId=""}destroy(){var e,t,i;this.events.forEach((e=>e.node.removeEventListener(e.type,e.func))),this.events=[],this.clearAllCachedPanoramas(),this.css2dRenderer&&(null==(e=this.viewerContainer)||e.removeChild(this.css2dRenderer.domElement)),null==(t=this.axes)||t.dispose(),null==(i=this.toolbar)||i.destroy(),super.destroy()}updateFov(e){var t;let i=this.camera;if(!i)return;let r=this.minFov,n=this.maxFov,s=e=>{let t=i.fov+e;t=Math.min(t,n),t=Math.max(t,r),i.fov!==t&&(i.fov=t,i.updateProjectionMatrix())},a=e/20;for(let o=0;o<20;++o)setTimeout((()=>s(a)),5*o);this.autoRotate&&(null==(t=this.controlsHelper)||t.delayAutoRotate())}setMinAndMaxFov(e,t){let i=this.controls;i&&(this.minFov=e,this.maxFov=t,i.minFov=e,i.maxFov=t)}resize(e,t){var i,r,n;let s=this.camera;s&&(this.width=e||window.innerWidth,this.height=t||window.innerHeight,s.aspect=this.width/this.height,s.updateProjectionMatrix(),null==(i=this.renderer)||i.setSize(this.width,this.height),null==(r=this.css2dRenderer)||r.setSize(this.width,this.height),null==(n=this.css3dRenderer)||n.setSize(this.width,this.height)),this.width=e,this.height=t}enableAutoRotate(e){this.controls&&(this.autoRotate=e,this.controls.autoRotate=e)}setAutoRotateSpeed(e=1){this.controls&&(this.controls.autoRotateSpeed=e)}setCameraFov(e=75){let t=this.camera;t&&(t.fov=e,t.updateProjectionMatrix())}addEvent(e,t,i){e.addEventListener(t,i),this.events.push({node:e,type:t,func:i})}setCameraPositionAndDirection(e,t,i){let r,n,s=this.camera,a=this.controls;if(!s||!a)return;r=t?Array.isArray(t)?new D(t[0],t[1],t[2]):new D(t.x,t.y,t.z):a.target.clone().sub(s.position),r.normalize(),n=Array.isArray(e)?new D(e[0],e[1],e[2]):new D(e.x,e.y,e.z);let o=n.clone().addScaledVector(r,.01);this.fianlCameraPosition=n,this.finalCameraTarget=o;let l=(e,t)=>{s.position.set(e.x,e.y,e.z),a.target.set(t.x,t.y,t.z),a.update()};if(!1===i)return this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),void l(n,o);let h=s.position.clone(),u=a.target.clone(),c=500,p=Date.now();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=setInterval((()=>{let e=Date.now()-p;e>c&&(e=c);let t=(e,t,i)=>{let r=e.x+(t.x-e.x)*i,n=e.y+(t.y-e.y)*i,s=e.z+(t.z-e.z)*i;return new D(r,n,s)},i=t(h,n,e/c),r=t(u,o,e/c);l(i,r),e>=c&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0)}),10)}getCameraPositionAndDirection(){let e=this.camera;if(!e)return;let t=e.position,i=new D;return e.getWorldDirection(i),{position:{x:t.x,y:t.y,z:t.z},direction:{x:i.x,y:i.y,z:i.z}}}getCameraFov(){let e=this.camera;if(e)return e.fov}setViewpoints(e){this.handleCameraUpdateInterval(),this.viewpointAssetsMap.size>0&&(this.viewpointAssetsMap.forEach((e=>{let t=e.panoramas,i=e.css2dObjects;t.forEach((e=>{var t;e.box.destroy(),null==(t=this.scene)||t.remove(e.box)})),i.forEach((e=>{var t;null==(t=this.scene)||t.remove(e)}))})),this.viewpointAssetsMap.clear()),this.loadingPanos.forEach((e=>{e.creationPromise&&(e.creationPromise.cancel(),e.creationPromise=void 0)})),this.loadingPanos=[],this.previousViewpointId="",this.previousPanoramaId="",this.activeViewpointId="",this.activePanoramaId="",this.viewpoints=e}addPanorama(e,t){let i=this.viewpoints.find((t=>t.id===e));if(!i)throw new Error(`[VRViewer] Failed to find viewpoint by id '${e}'`);i.panoramas||(i.panoramas=[]),i.panoramas.push(t)}findPanorama(e,t){let i=this.viewpoints.find((t=>t.id===e));if(i&&i.panoramas)return i.panoramas.find((e=>e.id===t))}setHotpointsVisibility(e,t="",i=[]){if(!this.viewpoints)return;let r=t=>{var r;let n=this.viewpointAssetsMap.get(t.id),s=(null==n?void 0:n.css2dObjects)||[];null==(r=t.hotpoints)||r.forEach((r=>{if(i&&i.length>0){if(-1===i.findIndex((e=>e===r.hotpointId)))return;if(r.visible=e,this.activeViewpointId===t.id){let t=s.find((e=>e.userData.hotpoint.hotpointId===r.hotpointId));t&&(t.visible=e)}}else r.visible=e,this.activeViewpointId===t.id&&s.forEach((t=>t.visible=e))}))};if(t){let e=this.viewpoints.find((e=>e.id===t));e&&r(e)}else this.viewpoints.forEach((e=>r(e)))}addHotpoints(e){if(!this.activeViewpointId||!e)return;let t=this.viewpoints.find((e=>e.id===this.activeViewpointId)),i=this.viewpointAssetsMap.get(this.activeViewpointId);!t||!i||(t.hotpoints||(t.hotpoints=[]),e.forEach((e=>{var r,n;if(-1!==(null==(r=t.hotpoints)?void 0:r.findIndex((t=>t.hotpointId===e.hotpointId))))return void re.warn(`[VRViewer] Duplicated hotpointId: ${e.hotpointId}`);let s=t.position||[0,0,0],a=e.anchorPosition,o=sh.createHotpoint(e.html),l=new D(a[0],a[1],a[2]),h=new D(s[0],s[1],s[2]);this.relocateAnchorIfTooCloseToCamera(o,l,h),o.visible=!1!==e.visible,o.userData.hotpoint=e,i.css2dObjects.push(o),null==(n=this.scene)||n.add(o),t.hotpoints.push(e)})))}removeHotpoints(e){if(!this.activeViewpointId||!e)return;let t=this.viewpoints.find((e=>e.id===this.activeViewpointId)),i=this.viewpointAssetsMap.get(this.activeViewpointId);!t||!i||e.forEach((e=>{var r,n;if(t.hotpoints)for(let i=t.hotpoints.length-1;i>=0;--i)e===t.hotpoints[i].hotpointId&&t.hotpoints.splice(i,1);for(let t=i.css2dObjects.length-1;t>=0;--t){let s=i.css2dObjects[t];e===(null==(r=s.userData.hotpoint)?void 0:r.hotpointId)&&(i.css2dObjects.splice(t,1),null==(n=this.scene)||n.remove(s))}}))}activeViewpointById(e,t,i,r){this.activatePanoramaById(e,"",!0,t,i,r)}activatePanoramaById(e,t,i=!0,r,n,s){if(e===this.activeViewpointId&&t===this.activePanoramaId)return;let a=this.viewpoints.find((t=>t.id===e));a&&this.activatePanorama(a,t,i,r,n,s)}removeCachedPanoramas(){this.viewpointAssetsMap.forEach(((e,t)=>{var i;let r=e.panoramas;for(let n=r.length-1;n>=0;--n){let e=r[n];if(t===this.activeViewpointId&&e.id===this.activePanoramaId||t===this.previousViewpointId&&e.id===this.previousPanoramaId)return;e.box.destroy(),null==(i=this.scene)||i.remove(e.box),r.splice(n,1)}}))}unlimitControlsAndShowAssets(e=!1){if(this.controls){let e=this.controls;e.enablePan=!0,e.enableZoom=!0}this.viewpointAssetsMap.forEach((t=>{t.panoramas.forEach((e=>{e.box.visible=!0})),e&&t.css2dObjects.forEach((e=>{e.visible=!0}))}))}relocateAnchorIfTooCloseToCamera(e,t,i){let r=this.camera;if(!r)return re.error("[VRViewer] Camera is not initialized"),void e.position.set(t.x,t.y,t.z);let n,s=Math.abs(t.distanceTo(i));if(s<r.near){let e=t.clone().sub(i).normalize();n=i.clone().add(e.multiplyScalar(s+1))}else n=t;e.position.set(n.x,n.y,n.z)}activatePanorama(e,t,i=!0,r,n,s){return ct(this,null,(function*(){var a,o,l;let h=(e,t,i)=>{let r=e.panoramas.find((e=>e.id===t)),n=null==r?void 0:r.box;n&&(i?this.fadeIn(n):this.fadeOut(n))},u=(e,t)=>{e.css2dObjects.forEach((e=>{t?!1!==e.userData.hotpoint.visible&&(e.visible=t):e.visible=t}))},c=()=>{var t;let n=new D(0,0,0),s=new D(1,0,0),a=null==(t=this.getCameraPositionAndDirection())?void 0:t.direction;a&&s.set(a.x,a.y,a.z);let o=e.position;if(o&&3===o.length&&n.set(o[0],o[1],o[2]),i){let t=e.initialDirection;t&&3===t.length&&s.set(t[0],t[1],t[2])}this.setCameraPositionAndDirection(n,s,r)};!t&&(null==(a=e.panoramas)?void 0:a.length)>0&&(t=e.panoramas[0].id||""),this.handleCameraUpdateInterval();let p=this.viewpointAssetsMap.get(this.activeViewpointId),d=this.viewpointAssetsMap.get(e.id);if(this.activeViewpointId&&p&&(this.activeViewpointId!==e.id&&u(p,!1),h(p,this.activePanoramaId,!1)),d&&d.panoramas.find((e=>e.id===t)))return h(d,t,!0),this.activeViewpointId!==e.id&&u(d,!0),this.activeViewpointId!==e.id&&c(),this.activeViewpointId=e.id,this.activePanoramaId=t,void(n&&n(e));this.previousViewpointId=this.activeViewpointId,this.previousPanoramaId=this.activePanoramaId,this.activeViewpointId=e.id,this.activePanoramaId=t;try{if(this.loadingPanos.some((i=>i.viewpointId===e.id&&i.panoramaId===t)))return void re.warn(`[VRViewer] Panorama with viewpointId=${e.id} and panoramaId=${t} is being created`);let i=new ZC(this.createBoxByImageOrImages(e,t));this.loadingPanos.push({viewpointId:e.id,panoramaId:t,creationPromise:i});let r=yield i.promise;this.loadingPanos=this.loadingPanos.filter((i=>i.viewpointId!==e.id||i.panoramaId!==t));let s=e.position;s&&3===s.length&&r.position.set(s[0],s[1],s[2]),this.activeViewpointId===e.id&&this.activePanoramaId===t?(this.fadeIn(r),null==(o=this.scene)||o.add(r),c()):(r.visible=!1,null==(l=this.scene)||l.add(r));let a={id:t,box:r},h=this.viewpointAssetsMap.get(e.id);if(h)h.panoramas.push(a),u(h,!0);else{let i=[];e.hotpoints&&e.hotpoints.forEach((n=>{let s=n.anchorPosition,a=sh.createHotpoint(n.html);a.visible=!1!==n.visible,a.userData.hotpoint=n;let o=new D(s[0],s[1],s[2]);this.relocateAnchorIfTooCloseToCamera(a,o,r.position),(this.activeViewpointId!==e.id||this.activePanoramaId!==t)&&(a.visible=!1),i.push(a)}));let n={panoramas:[a],css2dObjects:i};this.viewpointAssetsMap.set(e.id,n),i.forEach((e=>{var t;return null==(t=this.scene)?void 0:t.add(e)}))}n&&n(e)}catch(e){"cancel"!==e.type&&s&&s(e)}}))}createBoxByImageOrImages(e,t){var i;let r=e.imageOrImages,n=e.thumbnailImages;if((null==(i=e.panoramas)?void 0:i.length)>0){let i=this.findPanorama(e.id,t);i||(i=e.panoramas[0],re.warn(`[VRViewer] Failed to find panorama by id '${t}', will use the first one`)),r=i.images,n=i.thumbnails}if(!r)throw new Error("[VRViewer] Invalid images!");if(Array.isArray(r)||(r=[r]),1===r.length)return this.createBoxByImage(r,n);if(6===r.length)return this.createBoxBy6Images(r,n);if(24===r.length)return this.createBoxBy24Images(r,n);throw new Error(`[VRViewer] Wrong number of images! Expected 1/6/24, got ${r.length}`)}createBoxByImage(e,t){return ct(this,null,(function*(){let i=new dP(e,t);return yield i.create(),i}))}createBoxBy6Images(e,t){return ct(this,null,(function*(){if(6!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 6, got ${e.length}`);let i=new hP(e,t);return yield i.create(),i}))}createBoxBy24Images(e,t){return ct(this,null,(function*(){if(24!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 24, got ${e.length}`);let i=new pP(e,t);return yield i.create(),i}))}getIntersection(e){if(!this.camera||!this.scene)return;let t=this.viewpointAssetsMap.get(this.activeViewpointId);if(!t)return;let i=t.panoramas.find((e=>e.id===this.activePanoramaId));if(!i)return;let r=i.box,n=this.viewerContainer,s=new ce;e&&(s=xi.getScreenPointByEvent(e,n));let a=xi.screenPoint2NdcPoint(s,this.camera,n);this.raycaster.setFromCamera(a,this.camera);let o=[r],l=this.raycaster.intersectObjects(o,!0)||[];return l.length>0?l.find((e=>{let t=e.object;return t.visible&&t instanceof Je})):void 0}fadeIn(e,t=500){e.fadeIn(t)}fadeOut(e,t=1e3){e.fadeOut(t)}handleCameraUpdateInterval(){if(this.cameraUpdateInterval){clearInterval(this.cameraUpdateInterval);let e=this.fianlCameraPosition,t=this.finalCameraTarget;if(e&&t&&this.controls&&this.camera){this.camera.position.set(e.x,e.y,e.z);let i=this.controls;i.target.set(t.x,t.y,t.z),i.update()}this.cameraUpdateInterval=void 0}this.fianlCameraPosition=void 0,this.finalCameraTarget=void 0}getHitResult(e){let t={location:null};if(!this.camera)return t;let i=this.getIntersection(e);return t.location=i?{x:i.point.x,y:i.point.y,z:i.point.z}:null,t}lookToPosition(e){var t;if(!this.camera)return;this.handleCameraUpdateInterval();let i=new D(e[0],e[1],e[2]).clone().sub(this.camera.position);null==(t=this.controlsHelper)||t.lookTo(i)}};export{cZt as AXIS_SECTION_PLANE_CONTROL_ID,lZt as AXIS_SECTION_PLANE_ID,h3 as AngleMeasurement,IG as AnnotationTable,p3 as AreaMeasurement,Pk as ArrowMarkup,l3 as AxisPlaneSection,qCe as AxisType,$k as BYBLOCK,AA as BYLAYER,Lh as BaseMeasurement,hm as BaseSection,dh as BaseTable,Em as BaseVRMesh,lm as BaseViewer,XAe as BimViewer,Bf as BinaryReader,F0 as BitView,sm as BoxSelectHelper,sh as CSS2DObjectUtils,Io as CameraControlsEx,ZC as CancelablePromise,Rr as CanvasRender,Nk as CircleMarkup,Zp as CloudLineMarkup,Lk as CloudRectMarkup,Tt as CommonUtils,s0 as CompareDrawable,rO as ControlsHelper,mE as CoordinateAxes,Of as CoordinateAxesViewport,xi as CoordinateConversionUtils,d3 as CoordinateMeasurement,tI as CreateEdgesGeometryWorker,YCe as DEFAULT_BIMVIEWER_TOOLBAR_CONFIG,ZCe as DEFAULT_BIM_VIEWER_CONFIG,$Ce as DEFAULT_DXFVIEWER_TOOLBAR_CONFIG,GCe as DEFAULT_MARKUP_TOOLBAR_CONFIG,ZA as DEFAULT_SIZE,XCe as DEFAULT_VRVIEWER_TOOLBAR_CONFIG,xr as DeviceUtils,f3 as DistanceMeasurement,Fk as DotMarkup,Ys as Drawable,Xc as DrawableList,nG as DxfChangeType,Zn as DxfCompare,pge as DxfCompareMarkupManager,kE as DxfDataTable,gr as DxfLoader,c0 as DxfParser,Ffe as DxfRenderOrder,KAe as DxfViewer,oZt as ENTER_KEY,aZt as ESC_KEY,Hk as EllipseMarkup,Ls as Event,cI as Exploder,Xg as ExportUtils,fh as FontDataTable,eA as FpsUtils,Vde as GROUND_PLANE_RENDER_ORDER,kCe as GROUP_CONFIG,sA as GenerateMeshBvhWorker,kt as GeometryUtils,aa as GroundUtils,EE as ICON_FONT_CLASS,rS as IUploader,as as IndexedDbManager,e0 as InputManager,iO as InstantiateHelper,nZt as KEYDOWN_EVENT,sZt as KEYUP_EVENT,Abt as Keys,YA as LinePatternShaders,pl as LoadingHelper,KCe as LocalDxfUploader,JCe as LocalImageUploader,m3 as LocalModelUploader,gk as MOUSEDOWN_EVENT,Nf as MOUSEMOVE_EVENT,mk as MOUSEUP_EVENT,mI as MarkupManager,a3 as MarkupToolbar,nl as MarkupType,ss as MaterialUtils,$t as MathUtils,fu as MeasurementManager,hc as MeasurementType,s3 as MenuTypeEnums,Zi as MergeUtils,gT as MeshBvhHelper,n3 as MobileTouchHelperDrawable,v3 as NavCube,y3 as NavCubeViewport,a0 as NestCompareTypes,ZO as OSnapHelper,_fe as OSnapMarkerType,QFt as OSnapType,ECe as ObjectPixelSizeHelper,kr as ObjectUtils,E3 as ObjectsBoxSection,mge as Offset,ege as Orientation,T3 as PickPlaneSection,Ff as PolygonUtils,Uk as PolylineMarkup,VE as RafHelper,Bk as RectMarkup,pZt as SECTION_BOX_ID,hZt as SECTION_PLANE_CONTROL_ID,uZt as SECTION_PLANE_ID,vk as SECTION_PLANE_NAME,yCe as SHP,XO as SHPLoader,qO as SHPParser,O2r as SIMPLE_BIM_VIEWER_CONFIG,_Kt as SNAP_ICON_SIZE,Cbt as STATE,pde as SVGObject,Ife as SVGObjectUtils,dde as SVGRenderer,Tn as SceneUtils,b3 as SectionManager,TE as SectionType,lh as SectionUtils,YO as ShpThree,Jc as ShxFont,mh as ShxFontLoader,p0 as ShxFontType,QAe as SimplifiedBimViewer,xfe as SimplifyUtils,il as SkyboxUtils,pa as SnapDrawable,kk as TextMarkup,qc as TextureUtils,Nh as Toolbar,eV as ToolbarMenu,K_ as ToolbarMenuId,bG as Units,bA as VRControls,hP as VRCube,pP as VRCube24Faces,dP as VRSphere,tOe as VRViewer,Va as Viewer3DUtils,Yc as ViewerEvent,k6t as ViewerMode,TT as ViewerName,_G as ViewpointTable,Ok as Views,oP as WebCam,Gk as XMarkup,bT as ZoomToRectHelper,TG as bspline,Qme as checkIsNewVersion,jde as cn,Zme as createHatchPatternShaderMaterial,Fxt as decodeDxfTextCharacterCodes,Uxt as decodeDxfTextMbcsCharacterCodes,Hxt as decodeDxfTextUnicodeCodePoints,zde as en,OKt as getLengthValueByUnit,uI as getUnitStr,Bxt as getVersionFromLocalStorage,oh as layerForHitableObjects,On as layerForSelectableObjects,ql as layerForSnapableObjects,re as log,on as matrixAutoUpdate,XA as parseDxfMTextContent,$A as parseDxfTextContent,yG as round10,iZt as sceneAutoUpdate,JC as setIcon,Tde as setLogLevel,kxt as setVersionToLocalStorage,ah as showPrecisionValue,Sfe as unitConversionByMeter,Rbt as unitLabel,xG as unitScaleConversion,Kme as unitScaleToMeter}; |